Query indices, manage mappings, run aggregations, and debug search relevance in Elasticsearch directly from Claude Code.
The Elasticsearch MCP connects Claude Code to your Elasticsearch or OpenSearch cluster. It enables Claude to run queries, manage indices and mappings, execute aggregations for analytics, and debug search relevance — making it a powerful companion for log analysis, full-text search, and observability pipelines.
mcpizy install elasticsearch
Provide your Elasticsearch host URL, and credentials (API key or username/password) during setup. Cloud deployments on Elastic Cloud are fully supported.
_explain to understand why a document scored the way it did.Analyze error log patterns from the last hour:
{
"query": { "range": { "@timestamp": { "gte": "now-1h" } } },
"aggs": {
"errors_by_service": {
"terms": { "field": "service.name", "size": 10 }
}
}
}
Claude runs this against your logs index and summarizes which services are generating the most errors.