Featured
Y
Your brand here
Get featured
MCP ServerSTDIO

Elasticsearch MCP Server

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.

Hosted URL

Bring your own

Suggested model

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.

Auth

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.

What the Elasticsearch MCP server does

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.

Tools the Elasticsearch MCP server exposes

Typical tools an AI model can call. Exact names vary by version.

  • list_indices — enumerate all indices in the cluster
  • get_mappings — return the field mappings for a specific index
  • search — run an Elasticsearch query DSL search with highlighting, profiling and explain
  • get_shards — inspect shard allocation for all or specific indices

Example prompts to try

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.

Models on MCP Playground

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.

Try the Elasticsearch MCP server in your browser

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 Studio

Elasticsearch MCP server — FAQ

Common questions about connecting, scoping and using it safely.

What is the Elasticsearch MCP server?

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.

Which tools does the Elasticsearch MCP server expose?

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.

Is the classic Elasticsearch MCP server deprecated?

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.

Is it safe to connect a production Elasticsearch cluster?

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.

How do I test an Elasticsearch MCP server in the browser?

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.

Other MCP servers

More on MCP Playground

Elasticsearch MCP Server — AI Agent for Search & Indices