The Elasticsearch MCP server, maintained by Elastic, connects AI models directly to your Elasticsearch cluster through the Model Context Protocol. List indices, read field mappings and run full query DSL searches — all from plain English. Point it at a cluster URL and API key and start asking questions.
Bring your own
Claude Sonnet 4.5
MCP Playground runs 40+ models on the same workflow: switch anytime, or use Compare mode to run several in parallel and balance quality vs. cost.
Elasticsearch cluster URL plus an API key (or username/password). Use a role scoped to read-only on only the indices the agent needs. Or deploy a sandboxed hosted instance from the MCP Playground catalog.
How models use it and what it is built for.
The Elasticsearch MCP server wraps the Elasticsearch REST API as a small set of MCP tools. Models can enumerate every index, read the field mappings for any index, run a full Elasticsearch query DSL search (with highlighting, profiling and explain), and inspect shard allocation. It runs as a local stdio process — Node.js or the Docker image — configured with your cluster URL and an API key. The reference implementation is open source at elastic/mcp-server-elasticsearch. Elastic now recommends the newer Agent Builder MCP endpoint (Elastic 9.2.0+ and Elasticsearch Serverless) for new projects; the classic server still works and receives critical security fixes.
Typical tools an AI model can call. Exact names vary by version.
Copy any of these into MCP Agent Studio after connecting.
List every index in the cluster and tell me which ones look like application logs.
Show me the field mappings for the "products" index and flag any text fields missing a keyword sub-field.
Search the "orders" index for documents where status is "failed" in the last 24 hours and summarise the top error messages.
Run a match query on the "articles" index for "model context protocol" and return the 5 highest-scoring titles.
This is not a single-model product: you get the same MCP connection with 40+ models (Claude, GPT, Gemini, DeepSeek, open-weight, and more), you can switch mid-conversation, and you can open Compare mode to run the same prompt against multiple models at once. The card above is a suggested starting point for this server — not the only choice.
Default pick for Elasticsearch
Claude Sonnet 4.5
Claude Sonnet 4.5 writes correct Elasticsearch query DSL and reasons over mappings reliably. Use Haiku 4.5 for simple list/search calls to keep costs low.
Open MCP Agent Studio with the connection pre-filled. Add your token, pick any of 40+ models, and start chatting — no install required.
Open Agent StudioCommon questions about connecting, scoping and using it safely.
It is an official open-source MCP server from Elastic that lets AI models query an Elasticsearch cluster through natural language. You give it a cluster URL and API key, and it exposes list_indices, get_mappings, search and get_shards tools to any MCP-compatible AI client.
Four core tools: list_indices to enumerate indices, get_mappings to read field mappings, search to run a full Elasticsearch query DSL search (with highlighting, profiling and explain), and get_shards to inspect shard allocation.
Elastic now recommends its newer Agent Builder MCP endpoint (available in Elastic 9.2.0+ and Elasticsearch Serverless) for new projects. The classic elastic/mcp-server-elasticsearch still works and receives critical security updates, so it remains a solid choice for existing clusters.
Create an API key with a role scoped to read-only access on only the indices the agent needs, and never share a superuser key. For exploration, point the agent at a read replica or a staging cluster during setup.
Open MCP Agent Studio, connect the running Elasticsearch MCP server (or deploy a hosted sandboxed instance from the catalog), pick a model and start chatting. You can watch every list_indices and search tool call live without any local setup.