elasticsearch-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| ES_HOST | Yes | Elasticsearch host URL | |
| ES_API_KEY | No | API key authentication | |
| ES_CLOUD_ID | No | Elastic Cloud ID | |
| ES_PASSWORD | No | Password for basic authentication | |
| ES_USERNAME | No | Username for basic authentication | |
| ES_READ_ONLY | No | Block all write operations | false |
| ES_MAX_RESULTS | No | Maximum results per query | 1000 |
| ES_BLOCKED_INDICES | No | Indices to hide | .security*,... |
Capabilities
Features and capabilities supported by this server
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| connectA | Connect to the Elasticsearch cluster. Uses configuration from environment variables (ES_HOST, ES_API_KEY, etc.). Returns: Connection status and cluster information. |
| disconnectA | Disconnect from the Elasticsearch cluster. Returns: Disconnection status. |
| cluster_healthA | Get the health status of the Elasticsearch cluster. Returns: Cluster health including status (green/yellow/red), nodes, and shards. |
| cluster_infoA | Get cluster version and information. Returns: Cluster name, version, build info, and compatibility versions. |
| list_nodesA | List all nodes in the cluster. Returns: Node names, IPs, roles, and resource usage (CPU, memory, disk). |
| cluster_statsA | Get cluster-wide statistics. Returns: Aggregated statistics for indices and nodes across the cluster. |
| list_indicesA | List all indices in the cluster. Args: pattern: Index pattern to filter (supports wildcards like "logs-*"). include_hidden: Include hidden indices starting with "." (default: False). Returns: List of indices with health, status, doc count, and size. |
| describe_indexA | Get detailed information about an index. Args: index: Name of the index to describe. Returns: Index mappings (fields and types), settings, and statistics. |
| get_index_statsB | Get statistics for an index. Args: index: Name of the index. Returns: Document counts, store size, indexing and search statistics. |
| get_mappingsB | Get field mappings for an index. Args: index: Name of the index. Returns: Field definitions including types, analyzers, and options. |
| get_aliasesA | Get index aliases. Args: index: Optional index name to filter aliases. Returns: List of aliases with their target indices. |
| es_searchA | Execute a search query using Elasticsearch Query DSL. Args: index: Index to search (supports wildcards like "logs-*"). query: Elasticsearch query DSL (e.g., {"match": {"message": "error"}}). size: Maximum results to return (default: 10, max: from config). from_: Starting offset for pagination. sort: Sort specification (e.g., [{"@timestamp": "desc"}]). Returns: Search hits with _id, _score, and _source fields. |
| search_simpleA | Execute a simple query string search. Args: index: Index to search. q: Query string (supports Lucene syntax like "status:error AND level:critical"). size: Maximum results to return. Returns: Search hits matching the query string. |
| count_docsA | Count documents matching a query. Args: index: Index to count. query: Optional query to filter documents. Returns: Document count. |
| get_documentB | Get a document by ID. Args: index: Index containing the document. doc_id: Document ID. Returns: Document source data or not found error. |
| aggregateB | Execute an aggregation query. Args: index: Index to aggregate. aggs: Aggregation definition (e.g., {"status_count": {"terms": {"field": "status"}}}). query: Optional query to filter documents before aggregating. Returns: Aggregation results with buckets and metrics. |
| terms_aggregationB | Get top values for a field (terms aggregation). Args: index: Index to aggregate. field: Field to get top values for (must be keyword or numeric). size: Number of top terms to return (default: 10). query: Optional query to filter documents. Returns: Top field values with document counts. |
| date_histogramA | Get document counts over time (date histogram). Args: index: Index to aggregate. field: Date field to aggregate on (e.g., "@timestamp"). interval: Time interval (minute, hour, day, week, month, year). query: Optional query to filter documents. Returns: Time buckets with document counts. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/bpamiri/elasticsearch-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server