
How to add Elasticsearch MCP Server to Claude Desktop
Official Elastic server: list indices, read mappings, and search with Query DSL. Paste the config into ~/Library/Application Support/Claude/claude_desktop_config.json and restart Claude Desktop.
Last updated June 15, 2026 ยท 700โ ยท stdio ยท apikey ยท official
Claude Desktop config for Elasticsearch MCP Server
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": "<your-elasticsearch-cluster-url>",
"ES_API_KEY": "<your-elasticsearch-api-key>"
}
}
}
}Requires Docker to be installed and running.
Setup steps
- 1Open Claude Desktop โ Settings โ Developer โ Edit Config (this opens ~/Library/Application Support/Claude/claude_desktop_config.json).
- 2Paste the Elasticsearch MCP Server config below under the top-level "mcpServers" key.
- 3Fill in any placeholder secrets (API keys, paths) in the snippet.
- 4Save the file, then fully quit and reopen Claude Desktop.
- 5Open a chat and confirm Elasticsearch MCP Server's tools appear under the ๐ tools menu.
Before you start
- An Elasticsearch cluster, version 8.x or 9.x (self-managed, Elastic Cloud, or serverless)
- An Elasticsearch endpoint URL set as ES_URL
- An API key (create one in Kibana under Stack Management > Security > API keys, or via the _security/api_key API) set as ES_API_KEY โ or ES_USERNAME / ES_PASSWORD basic-auth credentials
- Node.js (the npm package @elastic/mcp-server-elasticsearch) or Docker installed and running to launch the container
What Elasticsearch MCP Server can do in Claude Desktop
list_indicesList the available indices in the Elasticsearch cluster.
get_mappingsRetrieve the field mappings for a specific index.
searchRun a search using Elasticsearch Query DSL.
esqlExecute an ES|QL query against the cluster.
get_shardsGet shard allocation and status information for indices.
Security
Use an Elasticsearch API key scoped to read-only on only the indices the agent needs rather than cluster-admin credentials. The project is deprecated to security-only maintenance, so plan to migrate to Elastic Agent Builder for new work.
Elasticsearch MCP Server + Claude Desktop FAQ
Where is the Claude Desktop config file?
Claude Desktop reads MCP servers from ~/Library/Application Support/Claude/claude_desktop_config.json. Paste the Elasticsearch MCP Server config there under the "mcpServers" key and restart the client.
Is Elasticsearch MCP Server safe to use with Claude Desktop?
Use an Elasticsearch API key scoped to read-only on only the indices the agent needs rather than cluster-admin credentials. The project is deprecated to security-only maintenance, so plan to migrate to Elastic Agent Builder for new work.
Is this server still maintained?
It is deprecated and receives only critical security updates. Elastic recommends the Agent Builder MCP endpoint (Elastic 9.2.0+ and serverless) for new work, but the server still functions for existing and older clusters.
How do I authenticate?
Use an Elasticsearch API key set as ES_API_KEY, or basic auth with ES_USERNAME and ES_PASSWORD, alongside your ES_URL endpoint.
Which Elasticsearch versions are supported?
Elasticsearch 8.x and 9.x clusters, whether self-managed, on Elastic Cloud, or serverless.