About this Server
The official Elasticsearch Model Context Protocol (MCP) server connects AI coding agents and assistants directly to Elasticsearch clusters. It enables natural language queries against Elasticsearch indices without writing custom APIs. Agents can list indices, inspect field mappings, execute search queries using Elasticsearch Query DSL, run ES|QL queries, and inspect shard allocation across clusters.
Direct low-latency RPC protocol communication with structured JSON schemas.
Restricted capability bounds to prevent accidental modifications or leakage.
Security & Best Practices
When to Use (and When Not To)
- •Querying enterprise search indices, application log archives, and analytics indices with natural language
- •Executing high-performance ES|QL queries to summarize log trends or metrics
- •Inspecting index field data types and shard distribution during system debugging
- •Pure relational database operations with ACID foreign key constraints (use DBHub or PostgreSQL MCP instead)
- •Lightweight local file and vector prototyping without Elasticsearch clusters (use Chroma MCP instead)
- •Direct browser DOM automation and web scraping (use Chrome DevTools or Firecrawl MCP instead)
Install & Setup
claude mcp add elasticsearch -- mcp-proxy --transport=streamablehttp --header Authorization "ApiKey $ELASTIC_API_KEY" $ELASTIC_MCP_URLExposed Tools & Endpoints
5 toolsFunctions your AI agent can invoke via this Model Context Protocol server
Lists all available Elasticsearch indices across the connected cluster.
Retrieves field mappings, data types, and properties for a specific Elasticsearch index.
Performs full-text, vector, or filtered Elasticsearch search operations using standard Query DSL.
Executes an ES|QL (Elasticsearch Query Language) piped analytical query.
Retrieves shard routing, status, and node allocation details for all or specific indices.