by elastic
Enables natural‑language interaction with Elasticsearch indices via the Model Context Protocol, exposing tools for listing indices, fetching mappings, performing searches, running ES|QL queries, and retrieving shard information.
Provides an experimental MCP server that connects agents to an Elasticsearch cluster, allowing conversational access to index data and metadata.
ES_URL
– URL of the Elasticsearch clusterES_API_KEY
ES_USERNAME
and ES_PASSWORD
ES_SSL_SKIP_VERIFY=true
to ignore TLS verification.docker run -i --rm -e ES_URL -e ES_API_KEY docker.elastic.co/mcp/elasticsearch stdio
docker run --rm -e ES_URL -e ES_API_KEY -p 8080:8080 docker.elastic.co/mcp/elasticsearch http
CLI_ARGS=http
.list_indices
: enumerate all available indices.get_mappings
: retrieve field mappings for a chosen index.search
: execute a standard Elasticsearch DSL query.esql
: run ES|QL queries.get_shards
: obtain shard information for one or many indices.Is this production‑ready? No, the server is marked experimental and should be used for testing or development.
Which Elasticsearch versions are supported? Versions 8.x and 9.x.
How is authentication handled?
Either an API key (ES_API_KEY
) or basic username/password (ES_USERNAME
/ES_PASSWORD
).
What transport should I choose? Streamable‑HTTP is recommended; SSE is deprecated.
Can I run the server without Docker? Earlier versions (≤0.3.1) were npm‑based, but they are deprecated. Current releases are Docker‑only.
[!CAUTION]
WARNING: this MCP server is EXPERIMENTAL.
Connect to your Elasticsearch data directly from any MCP Client using the Model Context Protocol (MCP).
This server connects agents to your Elasticsearch data using the Model Context Protocol. It allows you to interact with your Elasticsearch indices through natural language conversations.
list_indices
: List all available Elasticsearch indicesget_mappings
: Get field mappings for a specific Elasticsearch indexsearch
: Perform an Elasticsearch search with the provided query DSLesql
: Perform an ES|QL queryget_shards
: Get shard information for all or specific indicesSupported Elasticsearch versions
This works with Elasticsearch versions 8.x
and 9.x
.
[!NOTE]
Versions 0.3.1 and earlier were installed via
npm
. These versions are deprecated and no longer supported. The following instructions only apply to 0.4.0 and later.To view instructions for versions 0.3.1 and earlier, see the README for v0.3.1.
This MCP server is provided as a Docker image at docker.elastic.co/mcp/elasticsearch
that supports MCP's stdio, SSE and streamable-HTTP protocols.
Running this container without any argument will output a usage message:
docker run docker.elastic.co/mcp/elasticsearch
Usage: elasticsearch-mcp-server <COMMAND>
Commands:
stdio Start a stdio server
http Start a streamable-HTTP server with optional SSE support
help Print this message or the help of the given subcommand(s)
Options:
-h, --help Print help
-V, --version Print version
The MCP server needs environment variables to be set:
ES_URL
: the URL of your Elasticsearch clusterES_API_KEY
ES_USERNAME
and ES_PASSWORD
ES_SSL_SKIP_VERIFY
set to true
skips SSL/TLS certificate verification when connecting
to Elasticsearch. The ability to provide a custom certificate will be added in a later version.The MCP server is started in stdio mode with this command:
docker run -i --rm -e ES_URL -e ES_API_KEY docker.elastic.co/mcp/elasticsearch stdio
The configuration for Claude Desktop is as follows:
{
"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>"
}
}
}
}
Note: streamable-HTTP is recommended, as SSE is deprecated.
The MCP server needs environment variables to be set:
ES_URL
, the URL of your Elasticsearch clusterES_API_KEY
ES_USERNAME
and ES_PASSWORD
ES_SSL_SKIP_VERIFY
set to true
skips SSL/TLS certificate verification when connecting
to Elasticsearch. The ability to provide a custom certificate will be added in a later version.The MCP server is started in http mode with this command:
docker run --rm -e ES_URL -e ES_API_KEY -p 8080:8080 docker.elastic.co/mcp/elasticsearch http
If for some reason your execution environment doesn't allow passing parameters to the container, they can be passed
using the CLI_ARGS
environment variable: docker run --rm -e ES_URL -e ES_API_KEY -e CLI_ARGS=http -p 8080:8080...
The streamable-HTTP endpoint is at http:<host>:8080/mcp
. There's also a health check at http:<host>:8080/ping
Configuration for Claude Desktop (free edition that only supports the stdio protocol).
Install mcp-proxy
(or an equivalent), that will bridge stdio to streamable-http. The executable
will be installed in ~/.local/bin
:
uv tool install mcp-proxy
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"
]
}
}
}
Please log in to share your review and rating for this MCP.
Explore related MCPs that share similar capabilities and solve comparable challenges
by exa-labs
Provides real-time web search capabilities to AI assistants via a Model Context Protocol server, enabling safe and controlled access to the Exa AI Search API.
by graphlit
Enables integration between MCP clients and the Graphlit platform, providing ingestion, extraction, retrieval, and RAG capabilities across a wide range of data sources and connectors.
by mamertofabian
Fast cross‑platform file searching leveraging the Everything SDK on Windows, Spotlight on macOS, and locate/plocate on Linux.
by cr7258
Provides Elasticsearch and OpenSearch interaction via Model Context Protocol, enabling document search, index management, cluster monitoring, and alias operations.
by liuyoshio
Provides natural‑language search and recommendation for Model Context Protocol servers, delivering rich metadata and real‑time updates.
by ihor-sokoliuk
Provides web search capabilities via the SearXNG API, exposing them through an MCP server for seamless integration with AI agents and tools.
by fatwang2
Provides web and news search, URL crawling, sitemap extraction, deep‑reasoning, and trending topic retrieval via Search1API, exposed as an MCP server for integration with AI clients.
by cnych
Provides SEO data retrieval via Ahrefs, exposing MCP tools for backlink analysis, keyword generation, traffic estimation, and keyword difficulty, with automated CAPTCHA solving and response caching.
by nacos-group
Provides search, installation, and proxy functionalities for MCP servers, combining Nacos service discovery with optional Compass API support and offering both router and proxy operating modes.