Elasticsearch Semantic Search MCP Server
MCP 服务器:Elasticsearch 语义搜索工具
演示 repo: https://j.blaszyk.me/tech-blog/mcp-server-elasticsearch-semantic-search/
目录
Related MCP server: ElasticMind-MCP
概述
该存储库提供了一个 MCP 服务器的 Python 实现,用于通过Elasticsearch中索引的Search Labs 博客文章进行语义搜索。
它假设您已经使用Elastic Open Crawler抓取了博客文章并将其存储在search-labs-posts索引中。
运行 MCP 服务器
将ES_URL和ES_AP_KEY添加到.env文件中,(查看此处了解如何生成具有最低权限的 api 密钥)
在MCP Inspector中启动服务器:
make dev运行后,访问 MCP Inspector: http://localhost:5173
与 Claude Desktop 集成
要将 MCP 服务器添加到Claude Desktop :
make install-claude-config这会更新你主目录中的claude_desktop_config.json 。下次重启后,Claude 应用将检测服务器并加载声明的工具。
抓取搜索实验室博客文章
1. 验证爬虫设置
要检查Elastic Open Crawler是否工作,请运行:
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"这应该从单个页面打印抓取的内容。
2.配置Elasticsearch
设置Elasticsearch URL 和 API Key 。
生成具有最低爬虫权限的 API 密钥:
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"
}
}从响应中复制encoded值并将其设置为API_KEY 。
3. 更新语义搜索的索引映射
确保search-labs-posts索引存在。如果不存在,请创建它:
PUT search-labs-posts更新映射以启用语义搜索:
PUT search-labs-posts/_mappings
{
"properties": {
"body": {
"type": "text",
"copy_to": "semantic_body"
},
"semantic_body": {
"type": "semantic_text",
"inference_id": ".elser-2-elasticsearch"
}
}
}使用Elasticsearch 的 ELSER 模型将body字段索引为语义文本。
4.开始爬行
运行爬虫来填充索引:
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]如果使用新的 Elasticsearch 集群,请等待ELSER 模型启动后再进行索引。
5.验证索引文档
检查文档是否已被索引:
GET search-labs-posts/_count这将返回索引中的文档总数。您也可以在Kibana中验证。
完成!您现在可以对Search Labs 博客文章进行语义搜索了
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn unofficial MCP server that provides semantic search capabilities for Hugging Face models and datasets, enabling Claude and other MCP-compatible clients to search, discover, and explore the Hugging Face ecosystem using natural language queries.20MIT
- FlicenseAqualityDmaintenanceAn MCP server that indexes PDF documentation and text into Elasticsearch for semantic search and retrieval. It enables users to query knowledge bases, ingest new files, and dynamically update content through MCP-compatible clients like Claude Desktop and Cursor.41
- FlicenseNot gradedqualityDmaintenanceA semantic search system for Claude Code transcript history, exposed as an MCP server so Claude Code can query its own past sessions.
- AlicenseNot gradedqualityDmaintenanceAn MCP server that enables semantic and keyword search over Claude Code conversation history stored locally, using hybrid search, local embeddings, and time-decay scoring.23MIT
Related MCP Connectors
Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer
MCP server giving Claude AI access to 22+ NYC public-record databases for real estate due diligence
Search your AI chat history (ChatGPT, Claude, Codex) from any MCP client. Remote, private, read-only
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/jedrazb/elastic-semantic-search-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server