MCP Elasticsearch Server π
About
MCP server connecting AI systems to Elasticsearch clusters
Details
- Author
- sonirico
- Downloads
- 369
- Categories
- Database
Jump to
- Multiple authentication methods (API key or username/password)
- List indices with health status and document counts
- Retrieve field mappings to understand index structure
- Execute complex Elasticsearch queries with aggregations and sorting
- JSON-formatted output with search metadata
- Query execution time tracking
Install by cloning the repository, building with Go, and installing the binary. Configure with the ES_URL environment variable and either an ES_API_KEY or ES_USERNAME/ES_PASSWORD. Run directly or integrate with clients like Claude Desktop or ApMentor by adding a mcpServers entry.
MCP Elasticsearch Server π
A Model Context Protocol (MCP) server that provides Elasticsearch integration capabilities to AI assistants and other MCP clients. This server enables querying Elasticsearch clusters through a standardized interface.
Features
- π Multiple Authentication Methods: Supports both API key and username/password authentication
- π Index Management: List indices with health status and document counts
- πΊοΈ Schema Discovery: Retrieve field mappings to understand index structure
- π Advanced Search: Execute complex Elasticsearch queries with aggregations and sorting
- π Structured Responses: JSON-formatted output with search metadata
- β‘ Performance Monitoring: Query execution time tracking
- π― Context Aware: Supports search execution with proper context cancellation
Tools
list_indices
List all Elasticsearch indices with optional pattern filtering.Parameters:
- pattern (string, optional): Index pattern filter (default: "*")
Returns:
- Total index count
- Index details (name, health, status, document count, size)
get_index_mappings
Get field mappings for one or more Elasticsearch indices.Parameters:
- index (string, required): Index name or pattern
Returns:
- Complete field mappings for the specified indices
search
Execute Elasticsearch search queries with full DSL support.Parameters:
- index (string, required): Index name or pattern to search
- query (string, optional): Elasticsearch query DSL as JSON (default: "{}")
- size (number, optional): Maximum documents to return (default: 10, max: 10000)
- sort (string, optional): Sort specification as JSON
- track_total_hits (boolean, optional): Track total hit count (default: true)
Returns:
- Search results with hits, aggregations, and metadata
Configuration
Environment Variables
Elasticsearch Configuration
-ES_URL: Elasticsearch cluster URL (required)
- ES_API_KEY: API key for authentication (optional)
- ES_USERNAME: Username for basic authentication (optional)
- ES_PASSWORD: Password for basic authentication (optional)
Server Configuration
-MCP_ES_SERVER_NAME: Server name (default: "mcp-elasticsearch π")
Logging Configuration
-MCP_ES_LOG_LEVEL: Log level (debug, info, warn, error, fatal)
- MCP_ES_LOG_FORMAT: Log format (json, console)
- MCP_ES_LOG_OUTPUT: Log output (stdout, stderr)
Authentication
You must provide either:
1. API Key authentication: Set ES_API_KEY
2. Basic authentication: Set both ES_USERNAME and ES_PASSWORD
Installation
```bash
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.



