Elasticsearch MCP Server for Claude
Connect Claude to your Elasticsearch cluster — search indices, inspect mappings, run ES|QL, and check shard health — with Elastic's official Model Context Protocol server.
Open the source and read safety notes before installing.
Safety notes
- Search, ES|QL, and shard tools run live read queries against the configured cluster; a broad or expensive query can add load.
- Scope the Elasticsearch API key to least privilege (read-only on the indices Claude should see) before connecting.
Privacy notes
- Index data, field mappings, and query results enter the MCP client context and the model's prompt.
- ES_URL and ES_API_KEY are secrets — store them in the client config or environment, never in shared repositories.
Prerequisites
- Docker installed (the server is distributed as the docker.elastic.co/mcp/elasticsearch image).
- An Elasticsearch cluster URL (ES_URL) you can reach.
- An Elasticsearch API key (ES_API_KEY) or username/password (ES_USERNAME + ES_PASSWORD).
- An MCP client such as Claude Code or Claude Desktop.
Schema details
- Install type
- cli
- Troubleshooting
- No
- Scope
- Source repo
- Estimated setup
- 10 minutes
- Difficulty
- intermediate
- Website
- https://www.elastic.co
Full copyable content
{
"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>"
}
}
}
}About this resource
Overview
The Elasticsearch MCP Server is Elastic's official Model Context Protocol server. It connects
Claude (and other MCP clients) directly to an Elasticsearch cluster, so you can search indices,
inspect mappings, run ES|QL, and check shard health in natural language — without writing a custom
API layer. It is distributed as the docker.elastic.co/mcp/elasticsearch container image and
licensed under Apache-2.0.
Key capabilities
The server exposes five tools, each mapping to a real Elasticsearch operation:
list_indices— list the indices available on the cluster.get_mappings— return the field mappings for a specific index.search— run a search using Elasticsearch Query DSL.esql— run an ES|QL query for tabular, pipe-style analytics.get_shards— report shard allocation and health.
How it compares
Several data-store MCP servers let Claude query a backing store; they differ by data model and query language:
| MCP server | Data model | Query interface | Transports |
|---|---|---|---|
| Elasticsearch MCP | Search & analytics indices | Query DSL + ES|QL | stdio, streamable-HTTP |
| PostgreSQL MCP | Relational tables | SQL | stdio |
| MongoDB MCP | Document collections | MongoDB query / aggregation | stdio |
Choose the Elasticsearch server when your data lives in Elasticsearch and you want full-text search, relevance ranking, or ES|QL analytics; the PostgreSQL and MongoDB servers cover their own relational and document workloads.
Installation
Claude Code
claude mcp add elasticsearch -- docker run -i --rm \
-e ES_URL=<your-cluster-url> \
-e ES_API_KEY=<your-api-key> \
docker.elastic.co/mcp/elasticsearch stdio
Claude Desktop
Add the server to your 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>"
}
}
}
}
To run it as a remote, streamable-HTTP endpoint instead of stdio, start the image with the http
argument and publish port 8080:
docker run --rm -e ES_URL -e ES_API_KEY -p 8080:8080 docker.elastic.co/mcp/elasticsearch http
Configuration
| Variable | Required | Purpose |
|---|---|---|
ES_URL |
Yes | Elasticsearch cluster URL. |
ES_API_KEY |
One of | API-key authentication. |
ES_USERNAME + ES_PASSWORD |
One of | Basic authentication (alternative to the API key). |
ES_SSL_SKIP_VERIFY |
No | Skip TLS verification — development only. |
Requirements
- Docker, to pull and run the
docker.elastic.co/mcp/elasticsearchimage. - A reachable Elasticsearch cluster URL.
- An API key or username/password with access to the indices you want Claude to query.
- An MCP client (Claude Code or Claude Desktop).
Security
- Authenticate with an API key (
ES_API_KEY) or basic credentials; scope it to read-only on only the indices Claude should reach. - Treat
ES_URLand credentials as secrets — keep them in the MCP client config or environment. ES_SSL_SKIP_VERIFYdisables TLS verification and is intended for development only.- The
searchandesqltools execute live read queries, so a broad query can add cluster load.
Source Verification Notes
Verified on 2026-06-17:
- The official repository
github.com/elastic/mcp-server-elasticsearchdocuments thedocker.elastic.co/mcp/elasticsearchimage, the stdio and streamable-HTTP modes, theES_URL/ES_API_KEYconfiguration, and the five tools listed above (Apache-2.0). - Elastic's Search Labs write-up describes the server's purpose and capabilities.
- Claude Code's MCP documentation describes the connector setup pattern used here.
Source citations
Add this badge to your README
How it compares
Elasticsearch MCP Server for Claude side by side with 3 alternatives on trust, install, platform support, and disclosed safety notes — all from reviewed registry metadata.
| Field | Elasticsearch MCP Server for Claude Connect Claude to your Elasticsearch cluster — search indices, inspect mappings, run ES|QL, and check shard health — with Elastic's official Model Context Protocol server. Open dossier | Elastic Agent Builder MCP Server for Claude Official Elastic Agent Builder MCP server endpoint for connecting Claude, Cursor, VS Code, and other MCP clients to Elastic Agent Builder tools through Kibana with API-key scoped access to Elasticsearch indices and Agent Builder privileges. Open dossier | Meilisearch MCP Server for Claude Connect Claude to Meilisearch — manage indexes, add and search documents, tune settings, and monitor tasks — with Meilisearch's official Model Context Protocol server. Open dossier | Weaviate MCP Server for Claude Connect Claude to a Weaviate vector database — run hybrid search, inspect collection config, list tenants, and upsert objects — using Weaviate's built-in Model Context Protocol server. Open dossier |
|---|---|---|---|---|
| Trust | ||||
| Install risk | Review first | Review first | Review first | Review first |
| Notes | Safety ✓ Privacy ✓ | Safety ✓ Privacy ✓ | Safety ✓ Privacy ✓ | Safety ✓ Privacy ✓ |
| Category | mcp | mcp | mcp | mcp |
| Source | source-backed | source-backed | source-backed | source-backed |
| Author | Elastic | Elastic | Meilisearch | Weaviate |
| Added | 2026-06-17 | 2026-06-04 | 2026-06-17 | 2026-06-17 |
| Platforms | Claude CodeCodexCursorClaude Desktop | Claude CodeClaude Desktop | Claude CodeClaude Desktop | Claude CodeClaude Desktop |
| Source repo | — | — | — | — |
| Safety notes | ✓Search, ES|QL, and shard tools run live read queries against the configured cluster; a broad or expensive query can add load. Scope the Elasticsearch API key to least privilege (read-only on the indices Claude should see) before connecting. | ✓Elastic Agent Builder MCP executes with the scope assigned to the API key. Treat the API key as the effective permission boundary for every index, space, inference endpoint, and Agent Builder tool exposed to Claude. Do not use a broad administrator API key for exploratory chats. Elastic's docs recommend setting API key expiration dates and limiting access to only the indices the tools need to query. The example API key privileges include `read` and `view_index_metadata` for selected indices plus Kibana application privileges such as `feature_agentBuilder.read` and `feature_actions.read`. Keep those permissions as narrow as the workflow allows. Agent Builder tools can route AI clients into Elastic data exploration workflows. Require human review before using assistant-generated findings to change detections, alerts, response processes, dashboards, workflows, or production investigation decisions. If your Kibana deployment uses multiple spaces, verify the MCP URL includes the intended space path before connecting the client. A wrong space can expose the wrong tools, saved objects, or index access assumptions. `npx mcp-remote` is a local bridge process. Pin or review runtime dependencies when reproducibility or endpoint trust is required, and avoid running the bridge from untrusted project directories. | ✓Tools create and delete indexes and documents and rotate API keys — scope the key and confirm destructive actions. Settings and index deletes change live search behavior; review before running them through Claude. | ✓The MCP server runs inside your Weaviate instance and respects its existing RBAC; scope the API key to least privilege. The object-upsert tool writes data — restrict write access to the collections Claude should modify. |
| Privacy notes | ✓Index data, field mappings, and query results enter the MCP client context and the model's prompt. ES_URL and ES_API_KEY are secrets — store them in the client config or environment, never in shared repositories. | ✓Elastic Agent Builder MCP can expose log events, metrics, traces, security alerts, documents, index mappings, inference context, saved tool behavior, and Agent Builder outputs to the connected AI client. Index names, field names, mappings, document samples, query results, and investigation prompts can reveal internal service names, user identifiers, customer data, infrastructure details, secrets accidentally present in logs, or security investigation context. Store Elastic API keys outside prompts, shell history, committed MCP config, screenshots, tickets, and shared chat transcripts. Rotate keys after exposure and prefer short-lived keys for development. Claude transcripts, IDE logs, MCP client logs, terminal history, support bundles, and generated investigation notes may retain Elastic-derived data outside Elastic's normal access controls and retention policies. The MCP endpoint runs through Kibana. Review Elastic deployment access, Kibana space membership, API key scopes, and any external AI-client data retention policy before connecting regulated or customer-sensitive indices. | ✓Indexed documents and search results enter the MCP client context and the model's prompt. MEILI_HTTP_ADDR and MEILI_MASTER_KEY are secrets — keep them in the client config or environment. | ✓Query text, retrieved objects, and collection metadata enter the MCP client context and the model's prompt. The Weaviate endpoint URL and API key are secrets — keep them in the client config or environment, not in shared repositories. |
| Prerequisites |
|
|
|
|
| Install | | | | |
| Config | | | | |
| Citations | ||||
| Claim | Unclaimed | Unclaimed | Unclaimed | Unclaimed |
Featured in
Signals
Loading live community signals…
A short, calm digest of reviewed Claude resources. Unsubscribe any time.