
本页由 AI 翻译,技术细节请以原文为准。 查看原文
该MCP服务器已被弃用,今后仅会接收关键安全更新。它已被Elastic Agent Builder MCP端点取代,该端点支持Elastic 9.2版本。
概览
该 MCP 服务器已被弃用,今后只会接收关键的安全更新。它已被 Elastic Agent Builder MCP 端点取代,后者可在 Elastic 9.2.0+ 和 Elasticsearch Serverless 项目中使用。 Elasticsearch MCP 服务器通过模型上下文协议(MCP)将您的 AI 代理连接到 Elasticsearch 数据。它支持与 Elasticsearch 索引的自然语言交互,使代理无需自定义 API 即可查询、分析和检索数据。 请按照以下步骤部署并配置 AWS Marketplace 中的 Elasticsearch MCP 服务器容器镜像。 - 一个Elasticsearch簇(版本8.x或9。
概述(AI 翻译)
[!注意] 该MCP服务器已被弃用,今后只会收到关键的安全更新。 它已被 Elastic Agent Builder MCP 端点取代,后者可在 Elastic 9.2.0+ 和 Elasticsearch 无服务器项目中使用。
使用Elasticsearch MCP服务器用于AI代理
Elasticsearch MCP 服务器通过模型上下文协议(MCP)将您的 AI 代理连接到 Elasticsearch 数据。 它支持与Elasticsearch索引的自然语言交互,使代理无需自定义API即可查询、分析和检索数据。
请按照以下步骤部署并配置 AWS Marketplace 中的 Elasticsearch MCP 服务器容器镜像。
在你开始之前
开始之前,请确保你具备:
- 一个从您的 AWS 环境访问的 Elasticsearch 集群(版本 8.x 或 9.x)
- Elasticsearch 认证凭证:
- API 密钥,或
- 用户名和密码对
- 在你的AWS环境中安装并运行的Docker(例如,在EC2实例或容器服务中)
- 配置好的MCP客户端(如Claude Desktop、Cursor、VS Code或其他兼容MCP的工具)
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
Elasticsearch MCP Server
[!CAUTION] This MCP server is deprecated and will only receive critical security updates going forward. It has been superseded by the Elastic Agent Builder MCP endpoint, which is available in Elastic 9.2.0+ and Elasticsearch Serverless projects.
Use the Elasticsearch MCP Server for AI Agents
The Elasticsearch MCP Server connects your AI agents to Elasticsearch data using the Model Context Protocol (MCP). It enables natural language interactions with your Elasticsearch indices, allowing agents to query, analyze, and retrieve data without custom APIs.
Follow these steps to deploy and configure the Elasticsearch MCP Server container image from AWS Marketplace.
Before you begin
Before you start, ensure you have:
- An Elasticsearch cluster (version 8.x or 9.x) accessible from your AWS environment
- Elasticsearch authentication credentials:
- Docker installed and running in your AWS environment (for example, on an EC2 instance or in a container service)
- An MCP client configured (such as Claude Desktop, Cursor, VS Code, or another MCP-compatible tool)
- Network connectivity between your deployment environment and your Elasticsearch cluster
[!NOTE]
These instructions apply to Elasticsearch MCP Server 0.4.0 and later. For versions 0.3.1 and earlier, refer to the README for v0.3.1.
Deploy the Elasticsearch MCP Server
The Elasticsearch MCP Server is provided as a Docker container image available from AWS Marketplace. You can run it using either the stdio protocol (for direct client connections) or the streamable-HTTP protocol (for web-based integrations).
Choose a protocol
The server supports two protocols:
- stdio: Direct communication between the MCP client and server. Use this when your client supports stdio and runs in the same environment.
- streamable-HTTP: HTTP-based protocol recommended for web integrations, stateful sessions, and concurrent clients.
Note: Server-Sent Events (SSE) is deprecated. Use streamable-HTTP instead.
Configure the stdio protocol
Use the stdio protocol when your MCP client connects directly to the server process.
Set environment variables for stdio mode
Set the following environment variables:
ES_URL: The URL of your Elasticsearch cluster (for example,https://your-cluster.es.amazonaws.com:9200)- For authentication, use one of these options:
- API key: Set
ES_API_KEYto your Elasticsearch API key
- API key: Set
安装
docker run -i --rm -e ES_URL -e ES_API_KEY docker.elastic.co/mcp/elasticsearch stdio配置
{
"mcpServers": {
"elasticsearch-mcp-server": {
"command": "docker",
"args": [
"run", "-i", "--rm",
"-e", "ES_URL",
"-e", "ES_API_KEY",
"docker.elastic.co/mcp/elasticsearch",
"stdio"
],
"env": {
"ES_URL": "<elasticsearch-cluster-url>",
"ES_API_KEY": "<elasticsearch-API-key>"
}
}
}
}