Elasticsearch MCP Server

by da1y

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Integrations

  • Provides a one-liner to run Elasticsearch in a Docker container for easy setup and deployment of the required backend.

  • Enables management of Elasticsearch clusters, allowing for creating indices, indexing documents, listing available indices, and executing search queries using Elasticsearch query DSL.

Elasticsearch

用于 Elasticsearch 集群的模型上下文协议 (LLM) 服务器。使 LLM 能够管理索引并执行查询。

重要提示:这主要是通过从 postgres mcp 服务器向 claude 提供示例来构建的。

成分

工具

  • 搜索
    • 针对索引执行搜索查询
    • 输入:
      • index (字符串):目标索引名称
      • query (对象):Elasticsearch 查询 DSL
    • 返回搜索结果
  • 创建索引
    • 创建新的 Elasticsearch 索引
    • 输入:
      • index (字符串):索引名称
      • mappings (对象,可选):索引映射配置
      • settings (对象,可选):索引设置配置
  • 列表索引
    • 列出所有可用索引
    • 无需输入
    • 返回索引信息数组
  • 索引文档
    • 索引文档
    • 输入:
      • index (字符串):目标索引名称
      • id (字符串,可选):文档 ID
      • document (对象):文档内容
    • 返回索引操作结果

资源

服务器提供每个索引的映射信息:

  • 索引映射elasticsearch://<host>/<index>/schema
    • JSON 映射信息
    • 字段名称、类型和配置
    • 从元数据中自动发现

与 Claude Desktop 一起使用

添加到claude_desktop_config.json的“mcpServers”部分:

{ "mcpServers": { "elasticsearch": { "command": "npx", "args": [ "-y", "@modelcontextprotocol/server-elasticsearch", "http://localhost:9200" ] } } }

Docker 一个运行容器的内衬:

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

将 URL 替换为您的 Elasticsearch 端点。

执照

采用 MIT 许可证。可免费使用、修改和分发。详情请参阅许可证文件。

-
security - not tested
F
license - not found
-
quality - not tested

模型上下文协议服务器使 LLM 能够与 Elasticsearch 集群交互,从而允许它们管理索引并使用自然语言执行搜索查询。

  1. Components
    1. Tools
    2. Resources
  2. Usage with Claude Desktop
    1. Docker one liner to run container :
      1. License
        ID: ffpxy5j3n3