Skip to content
← All MCP servers

Is the Elasticsearch MCP server safe? What it can reach

What the Elasticsearch MCP server can read, write and delete, how it signs in, and how to limit it in Claude Code and Codex.

Official serverChecked

Elastic’s own Elasticsearch MCP server is now deprecated and gets only critical security fixes. Elastic points users to the Agent Builder MCP endpoint in Kibana instead. The older server runs locally in Docker and signs in with an API key or a username and password. Its five tools only read, so the key’s privileges set the real limit.

Who maintains it

ImplementationKindStatus
elastic/mcp-server-elasticsearchOfficialdeprecated
Elastic Agent Builder MCP endpoint (Kibana 9.2+ and Serverless)Officialactive

It runs as a local process on your machine or as a hosted remote server.

How it signs in

An Elasticsearch API key, or a username and password pair, passed as environment variables. The server searches with whatever that credential can see. The Agent Builder endpoint takes an API key too, or OAuth 2.1 on Serverless only.

What its tools can do

KindTools
Readlist_indices, get_mappings, search, esql, get_shards
Writenone documented
Can’t be undonenone documented

These five tools belong to the deprecated server. None of them writes to an index. The Agent Builder endpoint uses platform.core.* tools instead, and some of those, such as execute_workflow and generate_workflow, can change data or run workflow steps.

Built-in limits

OptionWhat it does
Scoped API keyElastic’s own guidance is to use an API key with minimal permissions, such as read access to specific indices only, and to rotate it every 30 to 90 days.
ES_SSL_SKIP_VERIFYLeave it unset. Setting it to true skips certificate checks, and Elastic says to use it only for development or testing.
Agent Builder OAuthOn Serverless, OAuth 2.1 lets each person act with their own permissions. A shared API key means every caller acts as one identity.

The risks

  • The search and esql tools can read every index the key can see, so a prompt-injected agent can pull logs, user records or other sensitive documents into the conversation.
  • A shared admin-level key gives the agent the cluster’s full read reach even though the tools never write, because the server does not narrow the key.
  • Document text that comes back from an index is untrusted input, and an instruction planted in a record can steer the agent’s next tool call.
  • The deprecated server now receives only critical security fixes, so new problems may stay unfixed.

Limit it in Claude Code

Add it from the documented launch settings, at local or user scope so a token never lands in a shared .mcp.json:

claude mcp add --env ES_URL=... --env ES_API_KEY=... elasticsearch -- docker run -i --rm -e ES_URL -e ES_API_KEY docker.elastic.co/mcp/elasticsearch stdio

Claude Code names MCP tools mcp__elasticsearch__<tool>. Once you know the tool names, deny the ones you won’t use and set the rest to ask in .claude/settings.json.

Limit it in Codex

Codex reads MCP servers from ~/.codex/config.toml. disabled_tools removes tools, and enabled_tools keeps only the ones you list:

[mcp_servers.elasticsearch]
command = "docker"
args = ["run", "-i", "--rm", "-e", "ES_URL", "-e", "ES_API_KEY", "docker.elastic.co/mcp/elasticsearch", "stdio"]
env_vars = ["ES_URL", "ES_API_KEY"]

Checklist

  • Create an API key limited to read access on the indices the agent needs.
  • Keep ES_SSL_SKIP_VERIFY unset outside of tests.
  • Plan a move to the Agent Builder endpoint, since the Docker server is deprecated.
  • Rotate the key on a schedule and never commit it.
  • Treat returned documents as untrusted text.

Checked against the vendor documentation on November 25, 2026. elastic/mcp-server-elasticsearch README · README (raw) · Elastic Agent Builder MCP server · Agent Builder built-in tools reference

What Excellent covers

Excellent doesn’t inspect MCP servers themselves. Its free scan reads supported logs on the Mac (Claude Code, Codex, Grok Build, GitHub Copilot CLI, Gemini CLI and Qwen Code) and reports findings for review, so you can see what an agent did after a session. Run the free scan · See a sample report · How to vet any MCP server

Excellent Pro adds checks before supported actions. Claude Code can display an ask prompt. With Codex, an Excellent “ask” refuses the action and tells the agent to ask you. Pro is US-only for now. Agent coverage · Pricing