mcp server · elasticsearch

Elasticsearch MCP server with dynamic mapping discovery.

Point Claude, Cursor, or any MCP client at Elasticsearch through wmcp.sh. The agent doesn't need to know your index schema up front — discover_mapping returns a flattened, agent-readable schema on demand. wmcp.sh is not affiliated with Elastic NV.

Connect at https://wmcp.sh/mcp/elasticsearch · works with Elasticsearch 7.x / 8.x / 9.x and OpenSearch

Why route through wmcp.sh instead of running the official server.

Elastic ships an official MCP server at elastic/mcp-server-elasticsearch. As of 2026 that project's README marks it deprecated — it will only receive critical security patches. Elastic now recommends the Agent Builder MCP endpoint that ships with Elasticsearch 9.2.0+ and Elasticsearch Serverless. If you're on 8.x or older, you're between two stories.

Both approaches have the same agent UX gap: the agent needs to know index names and field names before it can write a query. That's fine for one-off "search my docs" demos. It breaks when an agent is exploring an unfamiliar cluster — every interaction starts with "what indices exist? what fields?".

wmcp.sh adds dynamic mapping discovery: list_indices + discover_mapping return a flattened, prompt-friendly schema (field name, type, analyzer, aggregatable?) so the agent can plan a search in one shot. Plus per-user encrypted API-key vault, query timeout caps, and audit logging.

Elasticsearch tools, MCP-shaped.

Nine read-focused tools that work across ES 7.x, 8.x, 9.x, and OpenSearch.

Python — agent discovers schema then queries.

# pip install anthropic mcp
import os, asyncio
from anthropic import Anthropic
from mcp import ClientSession
from mcp.client.streamable_http import streamablehttp_client

WMCP = "https://wmcp.sh/mcp/elasticsearch"
TOKEN = os.environ["WMCP_TOKEN"]

async def run():
    async with streamablehttp_client(WMCP, headers={"Authorization": f"Bearer {TOKEN}"}) as (r, w, _):
        async with ClientSession(r, w) as session:
            await session.initialize()
            tools = (await session.list_tools()).tools
            anthropic = Anthropic()
            # Claude will call discover_mapping then search, two-step.
            msg = anthropic.messages.create(
                model="claude-opus-4-5",
                max_tokens=2048,
                tools=[{"name": t.name, "description": t.description, "input_schema": t.inputSchema} for t in tools],
                messages=[{"role": "user", "content": "Find the top 5 error_codes from the 'logs-app' index in the last 24h"}],
            )
            return msg

asyncio.run(run())

Self-hosted Elasticsearch MCP server vs wmcp.sh-routed.

CapabilitySelf-hosted / official deprecated serverwmcp.sh-routed
Maintenance statusOfficial server marked deprecated, security-onlyActively developed, free + paid tiers
Dynamic mapping discoveryBasic get_mappingsFlattened, prompt-friendly schema in one call
ES|QL supportYesYes + auto-detects cluster version
Credential storagePlaintext env varEncrypted per-user vault, rotatable
OpenSearch compatibilityPartial / unofficialDetected + incompatible tools hidden
Audit logNonePer-call: who, when, query, latency, hit count
Works with Claude.ai connectorsStdio onlyStreamable HTTP + OAuth 2.1

Common questions.

Is there an official Elasticsearch MCP server?
Yes — Elastic ships elastic/mcp-server-elasticsearch. The project README marks it deprecated as of 2026 with critical-security-only updates; Elastic recommends migrating to the Agent Builder MCP endpoint in Elasticsearch 9.2.0+ and Elasticsearch Serverless. wmcp.sh is not affiliated with Elastic and provides a hosted alternative.
What's "dynamic mapping discovery"?
A tool that returns a flattened, prompt-readable schema for an index — field name, type, analyzer, aggregatable — so the agent can plan a search without prior knowledge of your indices. Helpful for exploration and cross-cluster work.
Can the agent write to my cluster?
Default is read-only. Index, update, delete, and mapping-change operations are blocked at the wmcp.sh layer. Write tools are opt-in per connection.
OpenSearch?
Yes. wmcp.sh detects the cluster type at connect time and hides Elastic-specific tools (ELSER, semantic_text) when talking to OpenSearch.
Pricing?
Free 100 reads/day anonymous. Managed Starter $499 one-time, Managed Retainer $999/mo, Enterprise $4,999+/mo. See /managed.

Need this in production?

Production setup includes a read-only Elasticsearch API key with index-pattern restrictions, audit retention, multi-cluster routing, and SSO. Starter $499 one-time, Managed Retainer $999/mo, Enterprise $4,999+/mo.

→ Managed setup ($499) Submit your MCP server (free)