用于Elasticsearch集群的Model Context Protocol服务器。使LLMs能够管理索引并执行查询。
重要提示:此文档主要通过向Claude提供来自Postgres MCP服务器的例子来构建。
search
index (字符串):目标索引名称query (对象):Elasticsearch查询DSLcreate_index
index (字符串):索引名称mappings (对象,可选):索引映射配置settings (对象,可选):索引设置配置list_indices
index_document
index (字符串):目标索引名称id (字符串,可选):文档IDdocument (对象):文档内容该服务器为每个索引提供了映射信息:
elasticsearch://<host>/<index>/schema)
在您的claude_desktop_config.json文件中的“mcpServers”部分添加以下内容:
{
"mcpServers": {
"elasticsearch": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-elasticsearch",
"http://localhost:9200"
]
}
}
}
docker run -d --name elasticsearch -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" -e "xpack.security.enabled=false" docker.elastic.co/elasticsearch/elasticsearch:8.11.3
用您的Elasticsearch端点替换URL。
根据MIT许可证授权。免费使用、修改和分发。详情见LICENSE文件。 </中文翻译>