Elasticsearch
About
Enables natural language interaction with Elasticsearch clusters for listing indices, inspecting field mappings, and executing Query DSL searches with automatic text highlighting
Details
- Author
- elastic
- Repository
- elastic/mcp-server-elasticsearch
- GitHub stars
- 500
- Downloads
- 2,828
- License
- Apache License 2.0
- Categories
- Database, Other, Search, AI, Design, Developer Tools, Security, Infrastructure, Frontend
Jump to
- list_indices: List all available Elasticsearch indices
- get_mappings: Get field mappings for a specific index
- search: Execute a query DSL search
- esql: Run an ES|QL query
- get_shards: Obtain shard information for indices
- Supports stdio and streamable-HTTP transports
Setting up with Highlight
This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:
- Download and install Highlight from highlightai.com/download
- Navigate to the plugins tab and select "Add Custom Plugin"
-
Configure the plugin with the settings below
Plugin Name
ElasticsearchCommand (node, npx, python, etc.)dockerArguments-
Argument 1
run -
Argument 2
-i -
Argument 3
--rm -
Argument 4
-e -
Argument 5
ES_URL -
Argument 6
-e -
Argument 7
ES_API_KEY -
Argument 8
docker.elastic.co/mcp/elasticsearch -
Argument 9
stdio
Environment-
ES_URL
<elasticsearch-cluster-url> -
ES_API_KEY
<elasticsearch-API-key>
Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.
-
Argument 1
- Enable "Start Automatically" if you want the plugin to start when Highlight launches
From the repository
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).
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)
- For authentication, use one of these options:
- API key: Set ES_API_KEY to your Elasticsearch API key
- Basic authentication: Set ES_USERNAME and ES_PASSWORD to your Elasticsearch credentials
- (Optional) ES_SSL_SKIP_VERIFY: Set to true to skip SSL/TLS certificate verification when connecting to Elasticsearch. Only use this for development or testing environments.
Add 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 cluster
- For authentication, use one of these options:
- API key: Set ES_API_KEY to your Elasticsearch API key
- Basic authentication: Set ES_USERNAME and ES_PASSWORD to your Elasticsearch credentials
- (Optional) ES_SSL_SKIP_VERIFY: Set to true to skip SSL/TLS certificate verification
If you're using Claude Desktop (free edition) which only supports the stdio protocol, use mcp-proxy to bridge stdio to streamable-HTTP:
1. Install mcp-proxy:
uv tool install mcp-proxy
For alternative installation options, refer to mcp-proxy/README.md.
2. 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.
list_indices
List all available Elasticsearch indices.
get_mappings
Get field mappings for a specific Elasticsearch index.
search
Perform an Elasticsearch search using query DSL.
esql
Execute an ES|QL query.
get_shards
Get shard information for all or specific indices.
Once connected, the MCP server provides these tools to your agent:
- list_indices: List all available Elasticsearch indices
- get_mappings: Get field mappings for a specific Elasticsearch index
- search: Perform an Elasticsearch search using query DSL
- esql: Execute an ES|QL query
- get_shards: Get shard information for all or specific indices
Your agent can use these tools to interact with your Elasticsearch data through natural language conversations.
Claude Desktop / Cursor
Paste into your MCP client config file to install this server.
{
"mcpServers": {
"elasticsearch": {
"env": {
"ES_URL": "<elasticsearch-cluster-url>",
"ES_API_KEY": "<elasticsearch-API-key>"
},
"args": [
"run",
"-i",
"--rm",
"-e",
"ES_URL",
"-e",
"ES_API_KEY",
"docker.elastic.co/mcp/elasticsearch",
"stdio"
],
"command": "docker"
}
}
}
Linux
{
"env": {
"ES_URL": "<elasticsearch-cluster-url>",
"ES_API_KEY": "<elasticsearch-API-key>"
},
"args": [
"run",
"-i",
"--rm",
"-e",
"ES_URL",
"-e",
"ES_API_KEY",
"docker.elastic.co/mcp/elasticsearch",
"stdio"
],
"command": "docker"
}
Macos
{
"env": {
"ES_URL": "<elasticsearch-cluster-url>",
"ES_API_KEY": "<elasticsearch-API-key>"
},
"args": [
"run",
"-i",
"--rm",
"-e",
"ES_URL",
"-e",
"ES_API_KEY",
"docker.elastic.co/mcp/elasticsearch",
"stdio"
],
"command": "docker"
}
Windows
{
"env": {
"ES_URL": "<elasticsearch-cluster-url>",
"ES_API_KEY": "<elasticsearch-API-key>"
},
"args": [
"/c",
"docker",
"run",
"-i",
"--rm",
"-e",
"ES_URL",
"-e",
"ES_API_KEY",
"docker.elastic.co/mcp/elasticsearch",
"stdio"
],
"command": "cmd"
}
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.




