Server facts
mcp-server-elasticsearch
GitHub stars
737
Last commit
Nov 25, 2026
Runtime
rust
License
Apache-2.0
Project
- Author
- elastic
- Website
- www.elastic.co/elasticsearch
- License
- Apache-2.0
- Category
- Databases
Tech
- Runtime
- rust
- Transports
- stdiostreamable-http
- Remote access
- No
- Authentication
- Elasticsearch API Key or Basic Auth (ES_API_KEY / ES_USERNAME+ES_PASSWORD)
Activity
- GitHub stars
- 737
- Last commit
- Data as of
Tags
- elasticsearch
- mcp
- mcp server
- vector database
Overview
Anyone evaluating elasticsearch mcp should note Elastic's prominent deprecation banner first: `elastic/mcp-server-elasticsearch` now receives critical security fixes only and is superseded by the built-in Elastic Agent Builder MCP endpoint on Elastic 9.2.0+ and Elasticsearch Serverless. For teams still operating Elasticsearch 8.x or self-managed 9.x clusters that need a standalone Apache-2.0 container bridge, version 0.4.0+ ships as the `docker.elastic.co/mcp/elasticsearch` image and runs in either direct `stdio` mode or multi-client `streamable-HTTP` mode (SSE is deprecated).
Agents interact with cluster data through 5 focused tools—`list_indices`, `get_mappings`, `search` (Query DSL), `esql`, and `get_shards`—working cleanly in Claude Desktop, Cursor, VS Code, or containerized AWS EC2/ECS/EKS deployments. Authentication passes strictly through runtime environment variables (`ES_URL` paired with `ES_API_KEY`, or `ES_USERNAME` and `ES_PASSWORD`, plus optional dev-only `ES_SSL_SKIP_VERIFY=true`) so credentials are never written to disk or logged. Start the Elastic container image in `stdio` mode with those credentials passed through Docker flags for local desktop clients, or launch `http` mode on port `8080` to serve `/mcp` alongside the `/ping` health probe (`pong`).
Install & configure
Requirements
- Docker runtime capable of pulling `docker.elastic.co/mcp/elasticsearch` (or AWS Marketplace container image)
- Reachable Elasticsearch 8.x or 9.x cluster URL (`ES_URL`)
- Elasticsearch `ES_API_KEY` (recommended with minimal read-only index permissions) or `ES_USERNAME` + `ES_PASSWORD`
docker pull docker.elastic.co/mcp/elasticsearchLaunch in stdio mode with `docker run -i --rm -e ES_URL -e ES_API_KEY docker.elastic.co/mcp/elasticsearch stdio`, or swap `stdio` for `http` and expose `-p 8080:8080` to serve Streamable HTTP at `/mcp` and health checks at `/ping`. Free-tier Claude Desktop users bridging to HTTP mode can pair it with `mcp-proxy`.
Examples are translated from the published configuration. Supply your own credentials and verify requirements in the upstream README. Remote connectors are shown only where a supported configuration format is known.
Config file · macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Use Settings → Developer → Edit Config when available. Do not assume a Linux configuration path; check the client documentation for your platform. Remote servers use the app’s connector flow when supported, not the local stdio file shown here. Merge this example with existing settings; do not overwrite unrelated servers.
{
"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>"
}
}
}
}Config file · Project: .cursor/mcp.json
User: ~/.cursor/mcp.json
The project path is relative to the workspace root. The tilde denotes your user home directory. Use Cursor’s MCP settings to confirm which configuration and scope your installed version is reading. Merge this example with existing settings; do not overwrite unrelated servers.
{
"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>"
}
}
}
}Config file · Workspace: .vscode/mcp.json
For user scope, use the “MCP: Open User Configuration” command if available. Do not guess a user configuration path across operating systems, profiles, containers, or remote workspaces; check the client documentation. Merge this example with existing settings; do not overwrite unrelated servers.
{
"servers": {
"elasticsearch-mcp-server": {
"type": "stdio",
"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>"
}
}
}
}Config file · macOS/Linux: ~/.codeium/windsurf/mcp_config.json
Windows: %USERPROFILE%\.codeium\windsurf\mcp_config.json
Open the MCP configuration through Windsurf’s settings when possible to confirm the active file. Paths can differ in managed or future releases; check the client documentation if this location is not present. Merge this example with existing settings; do not overwrite unrelated servers.
{
"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>"
}
}
}
}Config file · Project scope: .mcp.json at the repository root
The project file uses mcpServers. For user scope, use claude mcp add --scope user rather than assuming .mcp.json in your home directory is the user configuration. Check the client documentation for managed settings and storage details. Merge this example with existing settings; do not overwrite unrelated servers.
{
"mcpServers": {
"elasticsearch-mcp-server": {
"type": "stdio",
"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>"
}
}
}
}Examples are translated from the published configuration. Supply your own credentials and verify requirements in the upstream README. Remote connectors are shown only where a supported configuration format is known.
Tools
Source: repository README. Tool descriptions are a documented snapshot, not a live capability check.
| Tool | What it does |
|---|---|
| list_indices | Lists all Elasticsearch indices visible to the configured API key or basic-auth user. |
| get_mappings | Returns the field mapping schema for a specified Elasticsearch index before constructing queries. |
| search | Executes an Elasticsearch search query using standard Query DSL against cluster indices. |
| esql | Runs an Elasticsearch Query Language (ES|QL) analytical query against indexed data. |
| get_shards | Retrieves shard status and allocation metadata for all indices or targeted indices. |
Use cases
- Inspect index schemas (`get_mappings`) and run ad-hoc ES|QL or Query DSL investigations against Elasticsearch 8.x/9.x logs from Claude Desktop, Cursor, or VS Code.
- Check cluster health and shard placement across indices using `list_indices` and `get_shards` during incident triage.
- Deploy a shared Streamable HTTP MCP container on AWS EC2, ECS, or EKS backed by AWS Secrets Manager for `ES_API_KEY` injection.
Strengths
- Official Elastic Docker image (`docker.elastic.co/mcp/elasticsearch`) supporting both local stdio and concurrent Streamable HTTP (`/mcp` + `/ping`).
- Supports both Elasticsearch Query DSL (`search`) and modern `esql` queries alongside schema and shard inspection.
- Stores no data on disk and reads `ES_API_KEY` or username/password strictly from runtime environment variables.
Limitations
- Officially deprecated by Elastic—only critical security updates are planned, with Elastic Agent Builder MCP replacing it on Elastic 9.2.0+ and Serverless.
- Requires Elasticsearch 8.x or 9.x; older major Elasticsearch clusters are not listed as supported.
- Containerized delivery requires Docker rather than a lightweight `npx` or `uvx` binary.
mcp-server-elasticsearch setup notes
- Check ES_API_KEY, ES_URL in the mcp-server-elasticsearch configuration if startup or authentication fails.
- mcp-server-elasticsearch's example uses stdio, while its catalog transports are stdio / streamable-http; use the example's connection type.