Elasticsearch
Search and analyze Elasticsearch data with Elastic's Agent Builder tools
About
Use built-in and custom Elastic Agent Builder tools from Elastic Cloud Serverless and self-managed Elastic Stack deployments through Elastic’s official MCP server.
See Elastic’s official Agent Builder MCP server documentation for endpoint details, authentication options, permissions, and current capabilities.
This entry is the recommended replacement for the legacy containerized Elasticsearch entry. Agent Builder provides broader vendor-managed search and analysis capabilities, but it does not expose a shard-inspection tool or the legacy server’s direct raw Query DSL interface.
Features
- Index Discovery: List accessible indices, aliases, and data streams
- Mapping Inspection: Retrieve mappings for an index or index pattern
- Natural Language Search: Search, count, aggregate, and summarize Elasticsearch data
- ES|QL: Generate and execute ES|QL queries
- Extensible Tools: Use built-in tools and custom tools configured in Agent Builder
- Scoped API Key: Run tools with an Elasticsearch or Serverless project API key restricted to the data the server needs
Requirements
- Elastic Cloud Serverless, or Elastic Stack 9.3 or later with Kibana and Agent Builder
- Access to Elastic Agent Builder and the data the tools will query
- An Elasticsearch API key or Serverless project API key with Agent Builder and index privileges
- The Kibana URL for the project, without a trailing slash
Create an API key with feature_agentBuilder.read and feature_actions.read Kibana application privileges for the target space, and restrict it to the indices the MCP server needs. read and view_index_metadata are required for query and index exploration; monitor_inference is required when the configured tools use the Elasticsearch Inference API.
For the default Kibana space, enter a URL such as https://my-project.kb.us-central1.gcp.elastic.cloud. For a custom space, include /s/<space-name>, for example https://my-project.kb.us-central1.gcp.elastic.cloud/s/production. Set an expiration date and rotate API keys regularly.
⚠️ Upgrade notice
If you’re upgrading this server, note that this replaces the direct, Obot-hosted Elasticsearch MCP server with Elastic Agent Builder’s MCP server.
- Reconnect required: Provide a Kibana URL and scoped Elastic API key. The previous Elasticsearch URL, username/password, and direct API-key settings are no longer used.
- New requirement: Agent Builder requires Elastic Cloud Serverless or Elastic Stack 9.3 or later.
- Tool changes: All tool names and parameters change. Direct raw Query DSL and shard inspection are no longer available.
Configuration
Environment variables
| Variable | Description | Required |
|---|---|---|
KIBANA_URL | Kibana URL without a trailing slash. Include /s/<space-name> when using a custom Kibana space. | Yes |
Request headers
| Header | Description | Required |
|---|---|---|
Authorization | Elasticsearch or Serverless project API key with Agent Builder and scoped index privileges | Yes |
Remote runtime
- Url Template
${KIBANA_URL}/api/agent_builder/mcp