连接器指南阅读约 4 分钟16 个 MCP 工具7 种语言

如何通过 MCP 将 Elasticsearch 连接到 Meta Muse

让你的 AI 浏览和查询你在 Elastic Cloud、Serverless 或自有服务器上的 Elasticsearch 集群:列出索引和数据流,读取映射,搜索、聚合、计数,运行 ES|QL,并在你确认后写入文档。

HC作者:HelpCode 团队更新于 4 分钟阅读 在 GitHub 开源

无需信用卡 · 7 天试用 · 提供自托管方案

Elasticsearch

Elasticsearch

Let your AI explore and query your Elasticsearch cluster on Elastic Cloud, Serverless or your own servers: list indices and data streams, read mappings, search, aggregate, count, run ES|QL and, with your confirmation, write documents.

个工具

16

区域

INTL

类别

数据库

身份验证

API Key

所需环境变量

ELASTICSEARCH_URLELASTICSEARCH_API_KEY
在 Cloud 上一键安装

7 天免费试用 · 无需信用卡

  • 7 天免费试用
    无需信用卡
  • 符合 GDPR,SOC 2 就绪
    数据驻留欧盟,审计日志
  • 在 GitHub 开源
    开源 · AGPL-3.0
  • 支持 ChatGPT、Claude、Gemini
    任何兼容 MCP 的客户端

跳过安装。2 分钟内即可运行。

在 cloud.anythingmcp.com 开始免费试用,一键添加 Elasticsearch,然后将你的 AI 客户端(Claude、ChatGPT、Copilot 或 Cursor)指向生成的 MCP 端点。无需 Docker,无需 git clone,无需任何工程经验。

开始免费试用

摘要

让你的 AI 浏览和查询你在 Elastic Cloud、Serverless 或自有服务器上的 Elasticsearch 集群:列出索引和数据流,读取映射,搜索、聚合、计数,运行 ES|QL,并在你确认后写入文档。

试试这样问

Elasticsearch 的示例提示

点击任意提示即可复制,然后粘贴到 Claude、ChatGPT、Cursor、Gemini、Copilot 或 OpenClaw 中,在该连接器上运行。

Elasticsearch · 通过 MCP 实时
分享
Opus 4.7

Claude 是 AI,可能会出错。请核对回答。

💡 无需安装? 直接使用 cloud.anythingmcp.com。 登录、点击 Connectors → Elasticsearch、粘贴凭证、生成 MCP API key,即可完成。无 Docker、无 git clone、无本地服务器。

Elasticsearch + Meta Muse

让你的 AI 浏览和查询你在 Elastic Cloud、Serverless 或自有服务器上的 Elasticsearch 集群:列出索引和数据流,读取映射,搜索、聚合、计数,运行 ES|QL,并在你确认后写入文档。

前提条件

完整的设置说明已内置在连接器中 (在 store 中选择连接器时可见)。所需环境变量:

ELASTICSEARCH_URL, ELASTICSEARCH_API_KEY

步骤 1 — 获取凭证

  1. 找到 Elasticsearch 端点。Elastic Cloud Hosted:在 https://cloud.elastic.co 打开部署,复制 Elasticsearch endpoint,例如 https://my-deployment.es.europe-west3.gcp.cloud.es.io。Serverless:打开项目,复制它的 Elasticsearch 端点。自管集群:集群响应的 HTTPS 地址和端口,例如 https://search.example.com:9200。把它粘贴到 ELASTICSEARCH_URL,末尾不要带斜杠。请使用 Elasticsearch 端点,而不是 Kibana 地址。
  2. 在 Kibana 的 Stack Management → API keys → Create API key 中创建 API 密钥(Serverless:项目设置 → API keys)。为它命名,例如 anythingmcp,设置过期时间,并打开 Control security privileges 来限制权限(见下文)。
  3. 复制 Encoded 值(base64):Elastic 只显示一次。把它粘贴到 ELASTICSEARCH_API_KEY,然后安装连接器。单独的 id 或 api_key 值无法使用,也不支持用户名和密码登录。
  4. 用 elasticsearch_whoami 检查设置:它不需要任何权限,会显示密钥属于谁。

集群部署位置:Elastic Cloud Hosted、Elastic Cloud Serverless 以及版本 8 及以上的自管集群。AnythingMCP Cloud 需要能通过互联网访问的集群;自托管的 AnythingMCP 在管理员允许该主机后,也可以访问你内网中的集群。

只读密钥(推荐):在 Kibana 表单中使用以下角色描述符,或在 Kibana 的 Dev Tools 中运行该请求,并从响应中复制 encoded:

POST /_security/api_key
{
  "name": "anythingmcp-read",
  "expiration": "365d",
  "role_descriptors": {
    "anythingmcp_read": {
      "cluster": ["monitor"],
      "indices": [
        { "names": ["*"], "privileges": ["read", "view_index_metadata", "monitor"] }
      ]
    }
  }
}

把 "*" 换成允许 AI 查看的索引模式,例如 ["products", "logs-*"]。read 涵盖搜索、计数、聚合、ES|QL 和单个文档;view_index_metadata 涵盖映射、别名和数据流;monitor 涵盖索引列表和集群健康状态。密钥的权限永远不会超过创建它的用户。

AI 能做什么:列出索引、别名和数据流;在查询前读取索引的字段映射;用 Query DSL 搜索(默认 10 条结果,每次最多 100 条);运行聚合,例如按值计数、求和、平均值和日期直方图;统计匹配数量;运行 ES|QL 查询获取表格结果(最多 500 行);读取单个文档。常见的向量字段不会出现在搜索结果中。在由 Elastic 托管集群的 Serverless 上无法查看集群健康状态。

写入前会先问你:elasticsearch_index_document 创建或整体替换文档,elasticsearch_update_document 修改文档的部分字段。每次调用前,AI 都会给你看索引、_id 和内容,并等你同意。两者都需要 write 权限,所以使用上面的只读密钥时会返回 403,这正是预期的安全保障。

安装时默认关闭:elasticsearch_delete_document 和 elasticsearch_delete_by_query。删除无法撤销,delete by query 可能删除数百万个文档。需要管理员有意识地开启;开启后,AI 会先统计匹配的文档数,并在删除前征求你的确认。

常见错误:401:密钥错误、过期或已失效,或者粘贴的是 id 而不是 Encoded 值。403 security_exception:密钥缺少消息中指出的权限。404 index_not_found_exception:索引名称不存在。400 parsing_exception 或 verification_exception:查询有错误;消息会指出字段或位置。429:集群过载;请稍候重试。

该连接器只与 Elasticsearch 通信,不连接 Kibana。它不会创建或删除索引,不会修改映射或设置,也不涉及快照、摄取管道、安全管理和 Bulk API。

步骤 2 — 安装 adapter

curl -fsSL https://raw.githubusercontent.com/HelpCode-ai/anythingmcp/main/docker-compose.quickstart.yml -o docker-compose.yml
printf 'JWT_SECRET=%s\nENCRYPTION_KEY=%s\n' "$(openssl rand -hex 32)" "$(openssl rand -hex 32)" > .env
docker compose up -d

步骤 3 — 在 Muse 中添加连接器

你的服务器 URL: 在 AnythingMCP 中打开 MCP Servers → 此连接器所在的服务器,复制它的 URL(https://cloud.anythingmcp.com/mcp/…)。本指南中出现 YOUR_SERVER_ID 的地方都用它替换。

Muse 以自定义连接器的形式添加远程 MCP 服务器,并通过 OAuth 登录。

  1. 在 Muse 中打开 Settings → Connectors,选择 Add custom connector。
  2. 粘贴 MCP 服务器 URL https://cloud.anythingmcp.com/mcp/YOUR_SERVER_ID。
  3. Muse 会打开 AnythingMCP 的登录页面:登录并批准访问。
  4. 在聊天中,向 Muse 提出需要用到 Elasticsearch 的工具的请求。

你也可以在聊天中完成设置,适用于网页版、iOS 和 Android 应用以及 WhatsApp。给 Muse 发送这条消息:

Create a Custom Connector for a new remote MCP server, then connect to it:
Name: AnythingMCP
Transport: remote streamable HTTP
URL: https://cloud.anythingmcp.com/mcp/YOUR_SERVER_ID
Auth: OAuth

自托管?请用你实例的公网 HTTPS 地址替换 https://cloud.anythingmcp.com。Muse 从 Meta 的云端连接,因此 localhost 无法使用。

可用工具

ToolWhat it does
elasticsearch_whoamiShow who the connector is signed in as: the user behind the API key, the key's name and id and the authentication type
elasticsearch_cluster_infoGet basic information about the cluster: name, uuid, Elasticsearch version and build flavor (serverless on Elastic Cloud Serverless)
elasticsearch_cluster_healthGet the cluster health: status (green, yellow or red), node counts, active, relocating, initializing and unassigned shards and pending tasks
elasticsearch_list_indicesList indices with their health, status, document count, store size, primary and replica shard counts and creation date, sorted by name (at…
elasticsearch_get_mappingGet the field mapping of an index or data stream: every field with its type (text, keyword, date, long, dense_vector...)
elasticsearch_searchSearch an index, data stream or alias with the Query DSL and get the matching documents (total, and per hit _index, _id, _score, _source…
elasticsearch_aggregateRun aggregations over an index or data stream without returning documents: counts per value (terms), sums and averages, date histograms…
elasticsearch_countCount the documents in an index, data stream or alias that match a query (all documents without a query)
elasticsearch_esql_queryRun an ES|QL query, a piped language for filtering, aggregating and joining (Elasticsearch 8.11 or later, and Serverless)
elasticsearch_get_documentGet one document by its _id from an index: found, _version and the _source, optionally only some fields
elasticsearch_list_aliasesList index aliases: alias name, the index it points to, whether it has a filter and whether it is the write index
elasticsearch_list_data_streamsList data streams (time series such as logs and metrics): name, health status, index template, generation, number of backing indices…
elasticsearch_index_documentCreate or replace a whole document under a given _id in an index
elasticsearch_update_documentChange some fields of an existing document by _id, leaving the others as they are (a partial update with doc)
elasticsearch_delete_documentDelete one document by _id
elasticsearch_delete_by_queryDelete every document that matches a query

示例提示

  • “我们有哪些索引?每个索引有多少文档、占多大空间?”
  • “在 products 索引中搜索 100 欧元以下的无线耳机,显示名称、品牌和价格。”
  • “用 ES|QL 统计 logs- 过去 24 小时内每台主机的错误数,显示前 10 名。”*
  • “9 月份我们每天有多少订单?在 orders 索引上用日期直方图统计。”
  • “把 products 索引中商品 4711 的 stock 字段设为 0。修改前先给我看要改的内容。”

FAQ

Muse 在哪些地区可用? Meta 目前在美国和加拿大提供 Muse,可在网页版、iOS 和 Android 应用以及 WhatsApp 中使用。

Meta 会审核这个连接器吗? 不会。Meta 不审核自定义连接器。Muse 只能看到你在 AnythingMCP 中为此 MCP 服务器启用的工具,你也可以随时在 Settings → Connectors 中断开它。

下一步

这份指南对你有帮助吗?

你的 Elasticsearch 智能体只差一次点击。

安装连接器,粘贴密钥,向 Meta Muse 提问。免费试用 7 天,无需信用卡。

相关指南

连接器

如何通过 MCP 将 Elasticsearch 连接到 ChatGPT

让你的 AI 浏览和查询你在 Elastic Cloud、Serverless 或自有服务器上的 Elasticsearch 集群:列出索引和数据流,读取映射,搜索、聚合、计数,运行 ES|QL,并在你确认后写入文档。

连接器

如何通过 MCP 将 Elasticsearch 连接到 Claude

让你的 AI 浏览和查询你在 Elastic Cloud、Serverless 或自有服务器上的 Elasticsearch 集群:列出索引和数据流,读取映射,搜索、聚合、计数,运行 ES|QL,并在你确认后写入文档。

连接器

如何通过 MCP 将 Elasticsearch 连接到 Cursor

让你的 AI 浏览和查询你在 Elastic Cloud、Serverless 或自有服务器上的 Elasticsearch 集群:列出索引和数据流,读取映射,搜索、聚合、计数,运行 ES|QL,并在你确认后写入文档。

连接器

如何通过 MCP 将 Elasticsearch 连接到 Gemini

让你的 AI 浏览和查询你在 Elastic Cloud、Serverless 或自有服务器上的 Elasticsearch 集群:列出索引和数据流,读取映射,搜索、聚合、计数,运行 ES|QL,并在你确认后写入文档。

连接器

Elasticsearch 接入 MCP:在任意 AI 代理中使用搜索、聚合和 ES|QL

让你的 AI 浏览和查询你在 Elastic Cloud、Serverless 或自有服务器上的 Elasticsearch 集群:列出索引和数据流,读取映射,搜索、聚合、计数,运行 ES|QL,并在你确认后写入文档。

连接器

如何通过 MCP 将 Avito 连接到 Meta Muse

让你的 AI 使用你的 Avito 企业账户:列出广告并修改价格,读取浏览、联系和来电统计,检查自动上传 (autoload) 的上传记录及其错误、Feed 格式和钱包,并读取 Avito Messenger 聊天。发送消息和修改自动上传设置为可选功能,默认关闭。