elastic-semantic-search-mcp-server
MCP server to search up-to-date elasticsearch docs
Documentation
MCP Server: Elasticsearch semantic search tool
Demo repo for: https://j.blaszyk.me/tech-blog/mcp-server-elasticsearch-semantic-search/
Table of Contents
Overview
This repository provides a Python implementation of an MCP server for semantic search through Search Labs blog posts indexed in Elasticsearch.
It assumes you've crawled the blog posts and stored them in the `search-labs-posts` index using Elastic Open Crawler.
Running the MCP Server
Add `ES_URL` and `ES_AP_KEY` into `.env` file, (take a look here for generating api key with minimum permissions)
Start the server in MCP Inspector:
make devOnce running, access the MCP Inspector at: http://localhost:5173
Integrating with Claude Desktop
To add the MCP server to Claude Desktop:
make install-claude-configThis updates `claude_desktop_config.json` in your home directory. On the next restart, the Claude app will detect the server and load the declared tool.
Crawling Search Labs Blog Posts
1. Verify Crawler Setup
To check if the Elastic Open Crawler works, run:
docker run --rm \
--entrypoint /bin/bash \
-v "$(pwd)/crawler-config:/app/config" \
--network host \
docker.elastic.co/integrations/crawler:latest \
-c "bin/crawler crawl config/test-crawler.yml"This should print crawled content from a single page.
2. Configure Elasticsearch
Set up Elasticsearch URL and API Key.
Generate an API key with minimum crawler permissions:
POST /_security/api_key
{
"name": "crawler-search-labs",
"role_descriptors": {
"crawler-search-labs-role": {
"cluster": ["monitor"],
"indices": [
{
"names": ["search-labs-posts"],
"privileges": ["all"]
}
]
}
},
"metadata": {
"application": "crawler"
}
}Copy the `encoded` value from the response and set it as `API_KEY`.
3. Update Index Mapping for Semantic Search
Ensure the `search-labs-posts` index exists. If not, create it:
PUT search-labs-postsUpdate the mapping to enable semantic search:
PUT search-labs-posts/_mappings
{
"properties": {
"body": {
"type": "text",
"copy_to": "semantic_body"
},
"semantic_body": {
"type": "semantic_text",
"inference_id": ".elser-2-elasticsearch"
}
}
}The `body` field is indexed as semantic text using Elasticsearch’s ELSER model.
4. Start Crawling
Run the crawler to populate the index:
docker run --rm \
--entrypoint /bin/bash \
-v "$(pwd)/crawler-config:/app/config" \
--network host \
docker.elastic.co/integrations/crawler:latest \
-c "bin/crawler crawl config/elastic-search-labs-crawler.yml"> [!TIP]
> If using a fresh Elasticsearch cluster, wait for the ELSER model to start before indexing.
5. Verify Indexed Documents
Check if the documents were indexed:
GET search-labs-posts/_countThis will return the total document count in the index. You can also verify in Kibana.
Done! You can now perform semantic searches on Search Labs blog posts
Frequently asked questions
What is elastic-semantic-search-mcp-server?
elastic-semantic-search-mcp-server is MCP server to search up-to-date elasticsearch docs
How do I install elastic-semantic-search-mcp-server?
Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.
Is elastic-semantic-search-mcp-server open source?
Yes — it is hosted on GitHub at https://github.com/jedrazb/elastic-semantic-search-mcp-server and has 3 stars.
Related MCP tools
🙌 OpenHands: Code Less, Make More for the Model Context Protocol. Enhance AI assistants with powerful integrations. Python-based implementation.
Universal memory layer for AI Agents; Announcing OpenMemory MCP - local and secure memory management. Python-based implementation.
基于大模型搭建的聊天机器人,同时支持 微信公众号、企业微信应用、飞书、钉钉 等接入,可选择ChatGPT/Claude/DeepSeek/文心一言/讯飞星火/通义千问/ Gemini/GLM-4/Kimi/LinkAI,能处理文本、语音和图片,访问操作系统和互联网,支持基于自有知识库进行定制企业智能客服。
An LLM agent that conducts deep research (local and web) on any given topic and generates a long report with citations. Built for the Model Context Protocol to
🚀 The fast, Pythonic way to build MCP servers and clients Trusted by 19900+ developers. Trusted by 19900+ developers. Trusted by 19900+ developers.
🔥 MaxKB is an open-source platform for building enterprise-grade agents. MaxKB 是强大易用的开源企业级智能体平台。 for the Model Context Protocol. Enhance AI assistants with po
Run your own MCP server? See who uses it and what to fix.
Measure it with TrackMCP