Elastic MCP server: Agent Builder setup, tools and limits
Elastic serves MCP from Kibana through Agent Builder. The standalone server is deprecated, and its npm package ships fewer tools than its README lists.
Checked 7 October 2026 · from Elastic's Agent Builder documentation, the standalone repository and npm registry, and that server's own tools/list response
One of 91 guides to monitoring and developer tools. Each covers what an AI coding agent can get out of the tool through MCP, the protocol that lets the agent query the tool directly.
Summary
Elastic's official MCP server is the Agent Builder MCP endpoint, built into Kibana. It is generally available from Elastic 9.3, in preview on 9.2, and on Elasticsearch Serverless.
It serves the full Agent Builder tool catalog. That covers search and ES|QL on every deployment, Observability and Security tools in those solutions, and any custom tools you define.
The standalone server it replaced, elastic/mcp-server-elasticsearch, is deprecated. Since v0.4.6 on 24 October 2025 it receives critical security updates only. Its setup is documented below for clusters older than 9.2.
What is the Elastic MCP server?
It is Elastic's server for the Model Context Protocol, served by Kibana. An external client such as Claude Code or Cursor calls Agent Builder tools without opening Kibana.
ES|QL is Elastic's piped query language. platform.core.generate_esql writes a query from a plain question, and platform.core.execute_esql runs it.
There are two surfaces and only one is developed. The Agent Builder MCP endpoint is current. The standalone server, @elastic/mcp-server-elasticsearch, is deprecated, and its npm package stops at 0.3.1 with four tools.
Elastic has two MCP servers, and one is current:
| Server | Tools | State |
|---|---|---|
Agent Builder MCP endpoint · <kibana-url>/api/agent_builder/mcp | The full Agent Builder catalog | Current. Generally available since 9.3, preview in 9.2, and on Serverless |
elastic/mcp-server-elasticsearch · npm and Docker | 4 on npm 0.3.1 · 5 in the 0.4.x image | Deprecated since v0.4.6, 24 October 2025. Security fixes only |
The standalone server's README and its npm entry both carry the deprecation notice, and the README points to Agent Builder.
Elastic's Agent Builder endpoint reaches indices and ES|QL everywhere, and logs, traces and alerts in Observability. It concerns queried operational data, so development workflow, model traces and billing sit outside it.
| Part of the work | What Elastic has here | Can an agent reach it |
|---|---|---|
| Code, tests & review | None | No code-review product |
| CI & release | None | No CI product, and no build or test pipeline |
| Production observability | Indices, logs, APM traces and alerts | Yes. Search and ES|QL on every deployment. Observability tools add logs, traces, alerts and change points |
| Agent observability & evals | None | No traces, evaluations or prompt versioning for your own agents |
| AI cost management | None | No token or model spend data |
For an agent, Elastic answers questions about data already in Elasticsearch. An agent connected here can search logs, run ES|QL, and read traces and alerts. It cannot see the code change behind an incident, so it pairs with a source-control connector.
What can an AI agent do with Elastic?
| Task | Tools | Works | Watch out for |
|---|---|---|---|
| Find out what data exists | platform.core.list_indices platform.core.get_index_mapping platform.core.index_explorer | Yes | Lists only the indices, aliases and data streams the key or user can access |
| Search logs for an error | platform.core.search observability.get_logs | Yes | get_logs is an Observability tool, available from 9.4 |
| Run an ES|QL query | platform.core.generate_esql platform.core.execute_esql | Yes | Preview in 9.2 and generally available from 9.3 |
| Read an APM trace | observability.get_traces observability.get_trace_metrics | Yes | get_traces needs 9.4 or later. Both appear in Observability only |
| Read active alerts | observability.get_alerts security.alerts | Yes | Each tool belongs to its own solution, Observability or Security |
| Find what changed in a service | observability.get_trace_change_points observability.get_metric_change_points | Yes | Trace change points need 9.4 or later |
Tool IDs follow Elastic's built-in tools reference, read 7 October 2026. The deprecated standalone server covered only the first two rows, with four tools.
26 core and Observability tools generally available in Elastic 9.4, before Security, case, workflow and custom tools
- Platform core10
platform.core.searchplatform.core.execute_esqlplatform.core.generate_esqlplatform.core.list_indicesplatform.core.get_index_mappingplatform.core.index_explorerplatform.core.get_document_by_idplatform.core.product_documentationplatform.core.integration_knowledgeplatform.core.create_visualization- Observability: logs and alerts6
observability.get_logsobservability.get_log_groupsobservability.get_log_change_pointsobservability.run_log_rate_analysisobservability.get_alertsobservability.get_anomaly_detection_jobs- Observability: services and traces10
observability.get_servicesobservability.get_hostsobservability.get_tracesobservability.get_trace_metricsobservability.get_trace_change_pointsobservability.get_service_topologyobservability.get_apm_correlationsobservability.get_runtime_metricsobservability.get_metric_change_pointsobservability.get_index_info
IDs and versions from Elastic's built-in tools reference, read 7 October 2026. With an API key, the endpoint serves the full catalog, including custom tools. Some later tools write, such as security.create_detection_rule from 9.4. The deprecated standalone server's npm package registered four: list_indices, get_mappings, search and get_shards.
What the tool definitions cost in context
A client that loads every tool definition at the start of a session spends this much context before the first question. Claude Code defers definitions by default through tool search, and loads a tool's definition when the agent needs it. The method below gives the version and date measured.
A context window is the amount of text a model can hold at once. A client that loads every tool definition upfront sends each tool's name, description and input schema to the model when the session starts. That list is charged whether or not a single tool is called.
The figures below were measured on the deprecated standalone server's npm package on 19 August 2026. Its four tools cost about 374 tokens. Agent Builder serves its catalog only to an authenticated deployment, and the catalog changes by version, so it is unmeasured.
| Tool set | Tools | Tokens (GPT-5.6, GPT-5.5) | Tokens (GPT-4, GPT-3.5) | Tokens (Claude Haiku 4.5 to Opus 5) | Share of a 200,000-token window |
|---|---|---|---|---|---|
| Deprecated standalone server, npm 0.3.1, 19 August 2026 | 4 | 374 to 582 | 367 to 580 | 987 to 1,015 | 0.2% to 0.5% |
Encodings: GPT-5.6, GPT-5.5 o200k_base; GPT-4, GPT-3.5 cl100k_base; Claude Haiku 4.5 to Opus 5 count_tokens. Counted 19 August 2026 from tools/list on the deprecated @elastic/mcp-server-elasticsearch 0.3.1, the npm latest. It was run locally with a placeholder URL and key.
Registration is static, so no Elasticsearch instance was involved. Figures cover name, description and input schema. The two models in column one share the o200k_base encoding, so they get one count. The spread is formatting, about 56%. Reasoning tokens are output, spent per request. This count is billed as input whenever the client loads it.
The Claude figures are measured rather than encoded. Anthropic publishes no local tokenizer. The definitions were sent to the API's count_tokens endpoint, and a no-tools baseline was subtracted. The range covers two tokenizer generations rather than two serializations. Haiku 4.5 and Opus 4.6 sit at the low end. Opus 5 and Sonnet 5 sit at the high end. The gap between them is a small fraction.
Elastic MCP server limits: where answers come back incomplete
The first two limits below return answers that look complete. The third applies to setups still running the deprecated standalone server.
The agent says: “There is no data for that service.” The API key cannot read that index.
Agent Builder tools run with the API key's permissions. platform.core.list_indices lists only the indices, aliases and data streams the caller can access. A search outside the key's scope comes back empty and reads like an answer.
Guard: Have the agent list its indices first, and name the indices it searched in every answer.
The agent says: “There is no tool for that.” The tool arrived in a later Elastic version.
The built-in catalog changes by version. observability.get_traces and observability.get_logs arrived in 9.4, and three Observability tools were removed in 9.4. Observability and Security tools also appear only in their own solutions.
Guard: Have the agent list its own tools before you rely on one from the documentation, and check your version against Elastic's tools reference.
The agent says: “Elasticsearch is connected.” It is connected to the deprecated standalone server.
Deprecation does not break a connector. Elastic states the standalone server will only receive critical security updates going forward, and names the Agent Builder MCP endpoint as its replacement.
Its npm package also lags its README. npm's latest is 0.3.1, published 1 July 2025, with four tools. The README describes 0.4.0 and later, which add esql and ship as a Docker image.
Guard: On 9.2 or later, connect Agent Builder instead. Keep the standalone server only as a bridge for older clusters.
How to configure Elastic MCP for agents
- 1
Check your version and license
The Agent Builder MCP endpoint is generally available from Elastic 9.3 and in preview on 9.2. Outside Serverless, Elastic's subscription table lists MCP access under Enterprise.
- 2
Pick an API key or OAuth
An API key works on every deployment and suits unattended agents. OAuth 2.1 works on Serverless only, and gives each person their own revocable connection.
- 3
Scope the API key
Tools run with the key's permissions. Restrict it to the indices the agent should read, and include the
feature_agentBuilder.readKibana privilege, which the endpoint requires. - 4
Include the space in the URL
A custom Kibana Space needs
/s/<space-name>before/api/agent_builder/mcp. On 9.2, the copy button in the Tools UI leaves the space out. - 5
Keep the standalone server for clusters older than 9.2 only
It receives critical security fixes and nothing else, and its npm package stops at 0.3.1.
Paste this into your agent’s instructions
Agent Builder returns what the key may read, so its silent failure is scope. An agent that searched one index sounds the same as one that searched everything.
When you answer using Elastic MCP tools, state: - Which indices or data streams you searched, and the time range in the query. - The tool you used, and the ES|QL or query it ran. - Whether the result hit a size limit. A full page of hits is not evidence there are no more. Report an empty result as "none returned under the constraints above". Write your answer in ASD-STE100 Simplified Technical English. Use short sentences with one idea in each.
Do you need the MCP server at all?
Partly. Elasticsearch's REST API and ES|QL are fully documented, and a coding agent can call them directly with the same API key.
Agent Builder adds tools above the raw API: ES|QL generation, index exploration from a plain question, and the Observability analysis tools. Custom tools you define in Kibana reach the agent through the same endpoint.
For a cluster older than 9.2, the deprecated standalone server still wraps _cat/indices, _mapping, _search and _cat/shards in four tools. It receives security fixes only.
On Elastic 9.2 or later, use the Agent Builder endpoint. On older clusters, use the REST API or the standalone server, and plan the upgrade.
Elastic MCP server setup
The MCP endpoint is built into Kibana, so there is nothing to install. It is <kibana-url>/api/agent_builder/mcp, or <kibana-url>/s/<space-name>/api/agent_builder/mcp in a custom space.
Authenticate with an API key that carries the feature_agentBuilder.read Kibana privilege, sent as Authorization: ApiKey <key>. Serverless projects also accept OAuth 2.1.
Claude Code
Claude Code speaks streamable HTTP, so it connects to the endpoint directly. The API key goes in a header.
claude mcp add --transport http elastic \ https://<kibana-url>/api/agent_builder/mcp \ --header "Authorization: ApiKey <your-api-key>"
Cursor
In ~/.cursor/mcp.json. Elastic documents this mcp-remote shape for Cursor, Claude Desktop and VS Code.
{"mcpServers":{"elastic-agent-builder":{"command":"npx",
"args":["mcp-remote","https://<kibana-url>/api/agent_builder/mcp",
"--header","Authorization:${AUTH_HEADER}"],
"env":{"AUTH_HEADER":"ApiKey <your-api-key>"}}}}Codex CLI
Codex reads TOML, so the JSON blocks above will not transfer. env_http_headers reads the header value from a variable. Set ELASTIC_AUTH_HEADER to ApiKey <your-api-key>.
[mcp_servers.elastic]
url = "https://<kibana-url>/api/agent_builder/mcp"
env_http_headers = { Authorization = "ELASTIC_AUTH_HEADER" }Every other client
Each block below is the configuration for one client, with the file path and the key that client expects.
Claude Desktop
macOS ~/Library/Application Support/Claude/claude_desktop_config.json. Windows %APPDATA%\Claude\claude_desktop_config.json. There is no CLI. Edit through Settings, Developer, Edit Config.
Quit and restart fully for changes to load. On Serverless, Elastic also documents adding the endpoint as a connector with OAuth. Logs at ~/Library/Logs/Claude/mcp.log.
{"mcpServers":{"elastic-agent-builder":{"command":"npx",
"args":["mcp-remote","https://<kibana-url>/api/agent_builder/mcp",
"--header","Authorization:${AUTH_HEADER}"],
"env":{"AUTH_HEADER":"ApiKey <your-api-key>"}}}}Gemini CLI
~/.gemini/settings.json globally, or .gemini/settings.json per project. Key mcpServers, using httpUrl. CLI: gemini mcp add.
{"mcpServers":{"elastic":{
"httpUrl":"https://<kibana-url>/api/agent_builder/mcp",
"headers":{"Authorization":"ApiKey <your-api-key>"}}}}VS Code Copilot
.vscode/mcp.json per workspace, or your user profile. CLI: code --add-mcp.
{"servers":{"elastic":{"type":"http",
"url":"https://<kibana-url>/api/agent_builder/mcp",
"headers":{"Authorization":"ApiKey <your-api-key>"}}}}`.vscode/mcp.json` uses the key `servers`. VS Code's portable files, .mcp.json at the project root and ~/.copilot/mcp-config.json, use mcpServers. VS Code recommends them for new servers.
Windsurf
~/.codeium/windsurf/mcp_config.json, which is the path Windsurf documents. Key mcpServers, the same JSON shape as Cursor, carrying the same API key header.
Zed
~/.config/zed/settings.json, carrying the same API key header as the blocks above.
The key is `context_servers`. Zed does not call them MCP servers in config, so searching its settings for mcp finds nothing.
Google Antigravity
~/.gemini/config/mcp_config.json globally, or .agents/mcp_config.json per project. Key mcpServers. There is no CLI. Use the /mcp overlay in the editor. Supports stdio, streamable HTTP, SSE and websocket.
{"mcpServers":{"elastic":{"type":"http",
"url":"https://<kibana-url>/api/agent_builder/mcp",
"headers":{"Authorization":"ApiKey <your-api-key>"}}}}Amp (Sourcegraph)
~/.config/amp/settings.json or .amp/settings.json, carrying the same API key header. The amp mcp CLI covers approve, doctor and oauth.
The key is `amp.mcpServers`, namespaced. A bare mcpServers block is ignored.
Cline
~/.cline/mcp.json per the docs. The source also reads ~/.cline/data/settings/cline_mcp_settings.json. Key mcpServers, standard JSON shape, carrying the same API key header. Supports stdio, streamable HTTP and SSE.
Goose (Block)
~/.config/goose/config.yaml, carrying the same API key header.
YAML, and servers are called `extensions`. Goose does not use the MCP vocabulary in config at all. Add one interactively with goose configure, or per session with goose session --with-extension.
Kiro (AWS)
.kiro/settings/mcp.json per workspace, or ~/.kiro/settings/mcp.json globally. Key mcpServers, standard JSON shape, carrying the same API key header.
Warp
~/.warp/.mcp.json or .warp/.mcp.json. Key mcpServers, standard shape, carrying the same API key header. Also addable through the /agent-add-mcp skill.
JetBrains Junie
.junie/mcp/mcp.json per project, or ~/.junie/mcp/mcp.json. Key mcpServers, carrying the same API key header. Use /mcp in the CLI to manage.
Roo Code
.roo/mcp.json per project. The global file is mcp_settings.json, opened from the Roo Code MCP settings view with Edit Global MCP. Key mcpServers, carrying the same API key header.
Continue
.continue/mcpServers/*.yaml, one file per server, carrying the same API key header.
YAML, and `mcpServers` is a list. Every JSON client keys servers by name. Continue takes an array, so a converted config will not parse.
Trae
.trae/mcp.json per project, or paste into the UI under Raw Config (JSON). Key mcpServers, standard shape, carrying the same API key header.
Devin
Devin has no config file to edit. Servers are added through a web form in the settings UI, and Devin's documentation states you do not need to write or paste JSON. Enter the endpoint URL and the same API key header there.
Deprecated standalone server, npm 0.3.1
Deprecated. Elastic deprecated elastic/mcp-server-elasticsearch with v0.4.6 on 24 October 2025, and it receives critical security updates only. npm also marks the package deprecated. Its latest npm version is 0.3.1, with four tools.
For a cluster older than 9.2: it needs ES_URL plus ES_API_KEY, or ES_USERNAME and ES_PASSWORD. ES_SSL_SKIP_VERIFY disables certificate checks, so use it only against a cluster you control.
claude mcp add-json "elasticsearch" '{"command":"npx",
"args":["-y","@elastic/mcp-server-elasticsearch"],
"env":{"ES_URL":"https://your-cluster:9200",
"ES_API_KEY":"<your-api-key>"}}'npm installs 0.3.1, which lacks `esql`. The repository README describes 0.4.0 and later, which ship as a Docker image with a fifth tool.
Deprecated standalone server, Docker image 0.4.0 and later
The route to the five-tool standalone server, including esql. Elastic's README deploys it from AWS Marketplace and runs it in stdio or streamable HTTP mode. The same ES_URL and credential variables apply.
docker run -i --rm -e ES_URL -e ES_API_KEY \ docker.elastic.co/mcp/elasticsearch stdio
Read-only access, permissions and security
Tools run with the API key's permissions
Elastic's guidance is to restrict the key to the indices the tools need, and to set an expiry date on it.
Some built-in tools write
From 9.4 the catalog includes
security.create_detection_rule, and 9.5 adds watchlist and case management tools. A key with read privileges only keeps writes out of reach.One key is one identity
Every caller that shares an API key acts with the same permissions. On Serverless, OAuth gives each person their own connection, revocable one at a time.
The standalone server gets security fixes only
Elastic deprecated it with v0.4.6 on 24 October 2025. Move to Agent Builder on 9.2 or later.
Troubleshooting
- 403 Forbidden on connect
- The API key lacks the
feature_agentBuilder.readKibana application privilege. Create a key that includes it. - Tools from a custom space are missing
- The URL needs
/s/<space-name>before/api/agent_builder/mcp. On 9.2, the copy button in the Tools UI leaves the space name out. - An OAuth connection stops working
- OAuth tokens refresh automatically, but a connection unused for 30 days or more needs a new authorization. OAuth applies to Serverless projects only.
- There is no tool for ES|QL
- That is the deprecated standalone server's npm package, 0.3.1, which registers four tools. Agent Builder provides
platform.core.execute_esql. The standalone 0.4.x Docker image also hasesql. - The SSE transport fails
- SSE is deprecated on the standalone server. Configure streamable HTTP, or stdio for a local process.
Elastic MCP server: Reference
| Item | Value |
|---|---|
| Status | Agent Builder MCP endpoint generally available since 9.3, preview in 9.2, and on Serverless · standalone server deprecated since v0.4.6, 24 October 2025 |
| Endpoint | <kibana-url>/api/agent_builder/mcp · <kibana-url>/s/<space-name>/api/agent_builder/mcp in a custom space |
| Auth | API key with feature_agentBuilder.read · OAuth 2.1 on Serverless |
| License | Enterprise subscription outside Serverless, per Elastic's subscription table |
| Tools | The full Agent Builder catalog: built-in tools by version and solution, plus custom tools |
| Read-only | Set by the API key's privileges. Some built-in tools write from 9.4 |
| Standalone server | @elastic/mcp-server-elasticsearch on npm, 0.3.1, deprecated · Docker image docker.elastic.co/mcp/elasticsearch, 0.4.0 and later · repository tag v0.4.6 |
| Adoption | 717 stars on the standalone repository as of 7 October 2026 · Apache 2.0 license |
What engineers report
Agent Builder ships inside Kibana, so its record is Elastic's documentation. The public repository belongs to the deprecated standalone server, with 717 stars as of 7 October 2026.
| What was checked | What it shows |
|---|---|
| Agent Builder MCP endpoint | Generally available since 9.3, preview in 9.2 |
| Standalone repository stars | 717 |
| Standalone repository latest tag | v0.4.6, 24 October 2025 |
| Standalone npm latest | 0.3.1, published 1 July 2025, deprecated |
| Tools in the standalone npm package | 4 |
“The
get_mappingstool throws error decoding response body if a nested property is defined without explicitly specifying nested, even though the mapping is valid according to Elasticsearch specifications.”
“I deployed the MCP Server using docker and entered the container to confirm that the environment variables ES_USERNAME, ES_PASSWORD, and even ES_lOGIN configuration were all correct. However, it still said that my identity authentication failed.”
Repository facts from the GitHub API and package facts from the npm registry, retrieved 7 October 2026. Agent Builder facts from Elastic's documentation, read 7 October 2026. The standalone tool count comes from that server's own tools/list response on 19 August 2026.
Should you connect an agent to Elastic?
Yes. Best for elastic 9.3+ and Serverless teams, with a read-only API key scoped to the indices the agent needs.
- Strongest fit
- Teams on Elastic 9.3 or later, or Serverless, who want an agent searching indices, running ES|QL and reading Observability data.
- Main advantage
- Built into Kibana, with ES|QL generation, Observability analysis tools and your own custom tools on one endpoint.
- Main weakness
- Outside Serverless it needs an Enterprise subscription, and the tool catalog changes from version to version.
- Operational risk
- Tools run with the API key's privileges, and some built-in tools write. A broadly scoped key gives the agent that reach.
From Oodle
One platform for agent traces and infrastructure
Agent traces usually sit in a different product from the rest of your telemetry, so when a slow database makes an agent slow the symptom is in one tool and the cause is in another. Oodle keeps both in one query surface.
See agent observabilityFrequently asked questions
Does Elastic have an official MCP server?
Yes. The Elastic Agent Builder MCP endpoint is built into Kibana at /api/agent_builder/mcp. It is generally available from Elastic 9.3, in preview on 9.2, and on Serverless.
Is the Elastic MCP server deprecated?
The standalone one is. Elastic deprecated elastic/mcp-server-elasticsearch with v0.4.6 on 24 October 2025, and it receives critical security updates only. Agent Builder replaces it.
Which tools does it expose?
The full Agent Builder catalog. That includes built-in tools such as platform.core.search and platform.core.execute_esql, Observability and Security tools in those solutions, and any custom tools you create.
Can an agent read APM traces through it?
Yes, in Observability. observability.get_traces reads trace documents from 9.4, and observability.get_trace_metrics returns latency, throughput and failure rates.
Does it need a paid license?
Outside Serverless, Elastic's subscription table lists MCP access to Agent Builder under Enterprise. Serverless projects need the matching project feature tier.
How many tools did the standalone server have?
Four on its npm package, 0.3.1: list_indices, get_mappings, search and get_shards. Its 0.4.x Docker image adds esql. The npm count comes from the server's own tools/list response on 19 August 2026.