Elasticsearch is a Databases MCP server that lets Claude Code, Cursor, Windsurf and any MCP-compatible AI agent full-text search and analytics engine. Install in 1 minute with mcpizy install elasticsearch.
Databases
Full-text search and analytics engine
mcpizy install elasticsearchnpx -y elasticsearch-mcpElasticsearch MCP exposes the ES REST API as agent tools: `search`, `get_index_mapping`, `list_indices`, `index_document`, `delete_document`, `aggregate`. Authentication is HTTP basic auth or API keys; modern setups use API keys with role-based scoping. The MCP works against Elastic Cloud, self-hosted Elasticsearch, and OpenSearch (with minor caveats).
We use Elasticsearch MCP for three workflows. First, log analysis: production logs ship to ES, the agent runs `search` with a date range and a query string, finds the relevant errors, and explains them. Second, search-relevance debugging: a product-search team complains about ranking — the agent runs the same query with `explain: true` to surface BM25 scores per field. Third, mapping audits: `get_index_mapping` reveals the inferred schema, the agent identifies type mismatches (a field that should be `keyword` but is `text`). Token cost on raw log queries is heavy — 100 hit results with full `_source` are ~10-15k tokens; use `_source` filtering aggressively.
Compared to Splunk MCP (when it exists) or Datadog Logs MCP, Elasticsearch wins on flexibility and self-host options; managed alternatives win on zero-ops. Compared to ClickHouse MCP for analytics, ES wins on full-text search and loses on aggregation speed over large datasets. The honest trade-off: ES's query DSL is hard for LLMs to write correctly; the agent will produce subtly wrong queries (missing `bool` wrapper, wrong field-suffix) until you few-shot it.
Query DSL is unforgiving. Mixing `match`, `term`, and `query_string` in a single bool clause without correct nesting will return zero results or syntax errors. Have the agent call `get_index_mapping` first to know which fields are `keyword` vs `text`.
`_source` filtering is critical for token economy. Without it, every hit returns the full document — easily 5-10 kB per hit. Pin `_source: ["field1", "field2"]` for every search.
ES indices have per-shard, per-index, and cluster-level rate limits. The default is generous but `scroll` queries (used for paginating > 10k hits) lock shards open until they expire — long-running agent loops with unclosed scrolls can exhaust the scroll budget.
Version differences matter. ES 7, 8, and OpenSearch 2 have small but breaking changes in field-mapping APIs. The MCP server is usually pinned to one version; mismatches surface as cryptic 400s. Pin the MCP version to your cluster.
Honest pros/cons against the closest databases MCP servers.
| Server | Strengths | Trade-offs |
|---|---|---|
| OpenSearch MCP (community) | OSS fork, drop-in compatible mostly, no licensing risk | Slightly slower for vector search, smaller ecosystem |
| Algolia MCP | Managed search-as-a-service, faster to set up | Closed source, pricier at scale, narrower to product-search |
| Typesense MCP (community) | Open source, simpler than ES, fast | Smaller community, fewer enterprise features |
If Elasticsearch doesn't fit your stack, these Databases MCP servers solve similar problems.
The Elasticsearch MCP server is an Databases Model Context Protocol server that lets Claude Code, Cursor, Windsurf, VS Code with Copilot, and other MCP-compatible AI agents full-text search and analytics engine. It exposes Elasticsearch's capabilities as tools the AI can call directly from your editor or CLI.
The fastest way is the MCPizy CLI: run `mcpizy install elasticsearch` and MCPizy will add the server to your `.claude.json` automatically. You can also install it manually by adding an entry under `mcpServers` in `.claude.json` with the command `npx -y elasticsearch-mcp` and restarting Claude Code.
Yes. The Elasticsearch MCP server is free and open source. You may still need a Elasticsearch account or API key to connect the server to the underlying service, but the MCP layer itself has no MCPizy subscription cost.
Yes. Any MCP-compatible client works — including Claude Code, Claude Desktop, Cursor (via `.cursor/mcp.json`), Windsurf, VS Code with Copilot Chat, and custom agents built on the MCP SDK. The same install command targets all of them; only the config file path differs.
Once installed, your AI agent can full-text search and analytics engine directly inside your conversation. Typical use cases include asking Claude Code or Cursor to run Elasticsearch operations, inspect results, chain Elasticsearch with other MCP servers (see our Workflow Recipes), and automate repetitive databases tasks without leaving your editor.