Skip to content

MCP server

Elasticsearch MCP server

Elastic's Agent Builder MCP endpoint lets AI search indices, run ES|QL queries and read mappings and documents in Elasticsearch.

At a glance

Maintained by
Elastic
Tools exposed
8 listed below
Reviewed
September 24, 2026

Why it matters

What it does and why it matters

Elasticsearch powers search and log analytics for many companies. Elastic now provides MCP access through its Agent Builder, with an endpoint in Kibana. An assistant can search indices, generate and run ES|QL queries, list indices, read mappings and fetch documents.

For support and operations teams, that means asking questions of logs and search data in plain English, such as "how many checkout errors did we see yesterday, by region".

The older standalone Elasticsearch MCP server is deprecated and receives only critical security fixes. The Agent Builder endpoint requires Elastic 9.2 or later. Core tools read and query data. Custom and workflow tools can take actions, depending on how you set them up, so review what you publish.

Use cases

Best business use cases

Log questions

Ask about errors and events in logs.

Search tuning

Inspect mappings and test queries.

Document lookup

Fetch a document by ID during an investigation.

Operational reports

Summarize events by service or region.

Product docs

Search Elastic product documentation.

Tools

Available tools

Tool names as published by the maintainer at review time. Versions change, so check the repository for the current list.

Read and write: Core built-in tools read and query data; custom and workflow tools can take actions depending on setup.

  • platform.core.search

    Searches Elasticsearch data using natural language.

  • platform.core.execute_esql

    Runs an ES|QL query and returns a table.

  • platform.core.generate_esql

    Writes an ES|QL query from a plain-language question.

  • platform.core.list_indices

    Lists indices, aliases and data streams.

  • platform.core.get_index_mapping

    Gets mappings for one or more indices.

  • platform.core.get_document_by_id

    Gets a full document by its ID.

  • platform.core.index_explorer

    Finds relevant indices for a plain-language query.

  • platform.core.product_documentation

    Searches Elastic product documentation.

Workflows

Example workflows

Investigate an error spike

  1. 1

    An alert shows more checkout errors.

  2. 2

    Ask the assistant to count errors by service for the last day.

  3. 3

    It generates and runs an ES|QL query.

  4. 4

    It highlights the service with the jump.

  5. 5

    An engineer investigates with that lead.

Check an index before a change

  1. 1

    Ask for the mapping of the products index.

  2. 2

    The assistant reads and explains it.

  3. 3

    It samples documents.

  4. 4

    It flags fields that may not be indexed as expected.

  5. 5

    The team updates the mapping plan.

Prompts

Example prompts

  • “How many checkout errors did we log yesterday, by region?”

  • “Show the mapping for the products index and explain each field type.”

  • “Find the log entries for request ID abc-123.”

Setup

Installation and configuration

Examples for Claude Desktop and Claude Code. Replace the placeholder values with your own keys, and store secrets outside version control.

Claude Desktop: claude_desktop_config.json

{
    "mcpServers": {
        "elastic-agent-builder": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "${KIBANA_URL}/api/agent_builder/mcp",
                "--header",
                "Authorization:${AUTH_HEADER}"
            ],
            "env": {
                "KIBANA_URL": "${KIBANA_URL}",
                "AUTH_HEADER": "ApiKey ${API_KEY}"
            }
        }
    }
}

Claude Code: terminal

claude mcp add --transport http elastic-agent-builder https://YOUR_KIBANA_URL/api/agent_builder/mcp --header "Authorization: ApiKey YOUR_API_KEY"
  • Hosted server: {KIBANA_URL}/api/agent_builder/mcp (or {KIBANA_URL}/s/{SPACE_NAME}/api/agent_builder/mcp).
  • Local server: Via npx mcp-remote bridge to the Kibana endpoint.
  • Needs: Kibana URL; Elastic API key with Kibana privilege feature_agentBuilder.read (or OAuth 2.1).

Security

Security considerations

  • Scoped API key

    Use an API key with only the Agent Builder read privilege.

  • Index permissions

    Limit which indices the key can read.

  • Custom tools

    Review any custom or workflow tools before publishing them.

  • Logs hold personal data

    Mask personal data in logs where possible.

Related servers

Servers that pair well with it

Sentry

Sentry's official MCP server lets AI search errors, events and traces, read issue details, get AI analysis and update issues.

Snowflake

Snowflake's managed MCP server exposes admin-defined tools, such as Cortex agents, Cortex Analyst, Cortex Search and SQL, to AI assistants.

BigQuery

Google's remote BigQuery MCP server lets AI list datasets and tables and run SQL, with a read-only query tool and IAM controls.

Keep exploring

FAQ

Questions people ask us

Have a question that is not here? Ask us directly.

Start a project

Want this connected to your own systems? We build AI workflows with MCP.

Send a short brief. We reply with questions, a suggested plan and an estimate you can compare with other offers.

Your privacy choices

We use necessary storage to run this site. With your permission we also use Google Analytics to see which pages help people, and load maps from Google. You can change this at any time. Read the cookie policy.