MCP/Elasticsearch MCP Server
Elasticsearch MCP Server logo

Elasticsearch MCP Server

Verified Blue (500+ GitHub stars)

Connects AI agents to Elasticsearch data using Model Context Protocol for index search, ES|QL queries, and schema mappings.

rag-data•Databases & Storage
GitHub725
License:Apache-2.0
VERIFIED

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.

Real-time Interaction

Direct low-latency RPC protocol communication with structured JSON schemas.

Scoped Sandboxing

Restricted capability bounds to prevent accidental modifications or leakage.

Security & Best Practices

API Key Scoping: Generate restricted Elasticsearch API keys with read-only cluster and index privileges.
Network Isolation: Run mcp-proxy over HTTPS or secure internal VPC endpoints to safeguard cluster data.
Credential Privacy: Avoid embedding plaintext API keys in shared configuration files; use environment variables.

When to Use (and When Not To)

Best For
  • •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
Not For / Limitations
  • •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

terminal command
$claude mcp add elasticsearch -- mcp-proxy --transport=streamablehttp --header Authorization "ApiKey $ELASTIC_API_KEY" $ELASTIC_MCP_URL

Exposed Tools & Endpoints

5 tools

Functions your AI agent can invoke via this Model Context Protocol server

list_indices

Lists all available Elasticsearch indices across the connected cluster.

get_mappings

Retrieves field mappings, data types, and properties for a specific Elasticsearch index.

search

Performs full-text, vector, or filtered Elasticsearch search operations using standard Query DSL.

esql

Executes an ES|QL (Elasticsearch Query Language) piped analytical query.

get_shards

Retrieves shard routing, status, and node allocation details for all or specific indices.