
The Elasticsearch MCP Server connects your AI agents to Elasticsearch data using the Model Context P
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.
·
[!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.
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 start, ensure you have:
[!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.
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).
The server supports two protocols:
Note: Server-Sent Events (SSE) is deprecated. Use streamable-HTTP instead.
Use the stdio protocol when your MCP client connects directly to the server process.
Set the following environment variables:
ES_URL: The URL of your Elasticsearch cluster (for example, https://your-cluster.es.amazonaws.com:9200)ES_API_KEY to your Elasticsearch API keyES_USERNAME and ES_PASSWORD to your Elasticsearch credentialsES_SSL_SKIP_VERIFY: Set to true to skip SSL/TLS certificate verification when connecting to Elasticsearch. Only use this for development or testing environments.Start the MCP server in stdio mode:
docker run -i --rm \
-e ES_URL \
-e ES_API_KEY \
docker.elastic.co/mcp/elasticsearch \
stdioAdd this configuration to your Claude Desktop configuration file:
{
"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>"
}
}
}
}Replace <elasticsearch-cluster-url> with your Elasticsearch cluster URL and <elasticsearch-API-key> with your API key.
Use the streamable-HTTP protocol for web-based integrations or when you need to support multiple concurrent clients.
Set the same environment variables as the stdio protocol:
ES_URL: The URL of your Elasticsearch clusterES_API_KEY to your Elasticsearch API keyES_USERNAME and ES_PASSWORD to your Elasticsearch credentialsES_SSL_SKIP_VERIFY: Set to true to skip SSL/TLS certificate verificationStart the MCP server in HTTP mode:
docker run --rm \
-e ES_URL \
-e ES_API_KEY \
-p 8080:8080 \
docker.elastic.co/mcp/elasticsearch \
httpThe streamable-HTTP endpoint is available at http://<host>:8080/mcp. A health check endpoint is available at http://<host>:8080/ping.
If you're using Claude Desktop (free edition) which only supports the stdio protocol, use mcp-proxy to bridge stdio to streamable-HTTP:
Install mcp-proxy:
uv tool install mcp-proxyFor alternative installation options, refer to mcp-proxy/README.md.
Add this configuration to Claude Desktop:
{
"mcpServers": {
"elasticsearch-mcp-server": {
"command": "/<home-directory>/.local/bin/mcp-proxy",
"args": [
"--transport=streamablehttp",
"--header", "Authorization", "ApiKey <elasticsearch-API-key>",
"http://<mcp-server-host>:<mcp-server-port>/mcp"
]
}
}
}Replace <home-directory>, <elasticsearch-API-key>, <mcp-server-host>, and <mcp-server-port> with your values.
After configuring your MCP client, verify the connection works:
If the connection fails, verify:
docker logs <container-id>)Monitor the health and proper function of the Elasticsearch MCP Server using these methods:
Verify the container is running:
docker ps | grep elasticsearch-mcp-serverThe container should appear in the list with a status of Up.
If you're using the streamable-HTTP protocol, test the health check endpoint:
curl http://<host>:8080/pingA successful response returns pong, indicating the server is running and healthy.
View container logs to identify any issues:
docker logs <container-id>Look for error messages related to:
Test connectivity to your Elasticsearch cluster from the container:
docker exec <container-id> curl -k -u <username>:<password> <ES_URL>Or with an API key:
docker exec <container-id> curl -k -H "Authorization: ApiKey <api-key>" <ES_URL>A successful response indicates the container can reach your Elasticsearch cluster.
The Elasticsearch MCP Server handles authentication credentials securely:
ES_URL uses the https:// protocol. Ensure your Elasticsearch cluster has SSL/TLS enabled.The Elasticsearch MCP Server runs as a container in your AWS environment. Consider these AWS service quotas:
To request quota increases, use the AWS Service Quotas console or refer to the AWS General Reference Guide.
Once connected, the MCP server provides these tools to your agent:
list_indices: List all available Elasticsearch indicesget_mappings: Get field mappings for a specific Elasticsearch indexsearch: Perform an Elasticsearch search using query DSLesql: Execute an ES|QL queryget_shards: Get shard information for all or specific indicesYour agent can use these tools to interact with your Elasticsearch data through natural language conversations.
Pick your client and paste the snippet. Each one is the same server, written the way that client expects it.
claude mcp add elasticsearch-mcp-server -- docker run -i --rm -e ES_URL -e ES_API_KEY docker.elastic.co/mcp/elasticsearch stdio{
"mcpServers": {
"elasticsearch-mcp-server": {
"env": {
"ES_URL": "",
"ES_API_KEY": ""
},
"args": [
"run",
"-i",
"--rm",
"-e",
"ES_URL",
"-e",
"ES_API_KEY",
"docker.elastic.co/mcp/elasticsearch",
"stdio"
],
"command": "docker"
}
}
}code --add-mcp '{"name":"elasticsearch-mcp-server","env":{"ES_URL":"","ES_API_KEY":""},"args":["run","-i","--rm","-e","ES_URL","-e","ES_API_KEY","docker.elastic.co/mcp/elasticsearch","stdio"],"command":"docker"}'[mcp_servers.elasticsearch-mcp-server]
command = "docker"
args = ["run", "-i", "--rm", "-e", "ES_URL", "-e", "ES_API_KEY", "docker.elastic.co/mcp/elasticsearch", "stdio"]Runs locally on your device. Your client starts the server itself, so nothing has to be hosted.
Paste this prompt into your agent. It reads this page and does the setup for you.
Read https://aiagentslisting.com/mcp/elasticsearch-mcp-server to learn what the "Elasticsearch MCP Server" MCP server does and how to install it. Add it to my coding agent's MCP configuration as documented on that page, then confirm the server connects and list the tools it exposes.Agents can also browse this directory over MCP at https://aiagentslisting.com/api/mcp
docker run -i --rm
docker run --rmThis server runs locally, so we can't read its tool list over the web yet.
v0.4.6Release notesv0.4.5Release notesv0.4.4Release notesv0.4.3Release notesv0.4.2Release notesv0.4.1Release notesv0.4.0Release notesv0.3.1Release notesv0.3.0Release notesv0.2.0Release notesv0.1.1Release notesv0.1.0Release notesConnect to the AI Agents Listing MCP server at https://aiagentslisting.com/api/mcp using the HTTP transport and complete the sign-in when it asks. Then call the submit_review tool for the listing "elasticsearch-mcp-server" with a rating from 1 to 5 and a short note on what worked and what did not.No reviews yet
Be the first to share your experience with this tool.
One email a week. New agents, MCP servers and skills, and what is actually getting traction.