MCP Directory

Elasticsearch/OpenSearch MCP Server

Search, analyze, and manage Elasticsearch & OpenSearch clusters through MCP tools.

Unverified
stdio (local)
API key
Python

Add to your client

Copy the config for your MCP client and paste it into its config file.

Install / run
uvx elasticsearch-mcp-server

Paste into ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "elasticsearch-opensearch-mcp-server": {
      "command": "uvx",
      "args": [
        "elasticsearch-mcp-server"
      ],
      "env": {
        "ELASTICSEARCH_HOSTS": "https://localhost:9200",
        "ELASTICSEARCH_USERNAME": "elastic",
        "ELASTICSEARCH_PASSWORD": "test123"
      }
    }
  }
}

Requires `uv` (the Python package runner). Install it from https://docs.astral.sh/uv/ if `uvx` is not found.

Step-by-step guides: Add to Claude Desktop · Add to Cursor · Add to Windsurf

Before you start

  • uv / uvx (or Docker) to run the server
  • A reachable Elasticsearch or OpenSearch cluster (e.g. via the provided docker-compose files)
  • Credentials: basic auth (username/password) or an Elasticsearch API key

About Elasticsearch/OpenSearch MCP Server

A Model Context Protocol server implementation that lets AI clients interact with Elasticsearch and OpenSearch clusters. It enables searching documents, analyzing indices, managing data streams/aliases/analyzers, and monitoring cluster health through a dedicated set of MCP tools, with support for multiple named clusters and configurable safety controls.

Tools & capabilities (20)

general_api_request

Perform a general HTTP API request for any Elasticsearch/OpenSearch API that does not have a dedicated tool.

list_indices

List all indices.

get_index

Return information (mappings, settings, aliases) about one or more indices.

create_index

Create a new index.

delete_index

Delete an index.

create_data_stream

Create a new data stream (requires a matching index template).

get_data_stream

Get information about one or more data streams.

delete_data_stream

Delete one or more data streams and their backing indices.

search_documents

Search for documents.

index_document

Create or update a document in an index.

get_document

Get a document by ID.

delete_document

Delete a document by ID.

delete_by_query

Delete documents matching the provided query.

get_cluster_health

Return basic information about the health of the cluster.

get_cluster_stats

Return a high-level overview of cluster statistics.

list_aliases

List all aliases.

get_alias

Get alias information for a specific index.

put_alias

Create or update an alias for a specific index.

delete_alias

Delete an alias for a specific index.

analyze_text

Analyze text using a specified analyzer or custom analysis chain; useful for debugging search queries and understanding tokenization.

What this server can do

Elasticsearch/OpenSearch MCP Server provides tools for these capabilities — tap one to see every MCP server that does the same:

When to use it

  • Let an AI assistant run full-text and structured searches over Elasticsearch/OpenSearch indices
  • Inspect and manage indices, data streams, and aliases conversationally
  • Monitor cluster health and statistics during operations
  • Debug search relevance by analyzing how text is tokenized
  • Operate across multiple named clusters (e.g. prod/staging) from one MCP client

Security notes

For HTTP transports (SSE/Streamable HTTP) set MCP_API_KEY to require a Bearer token; if unset, the server is accessible without authentication, which is a network security risk. The stdio transport uses local process communication and needs no auth. VERIFY_CERTS defaults to false. Use DISABLE_HIGH_RISK_OPERATIONS=true (or DISABLE_OPERATIONS) to hide write/delete tools for read-only deployments. Credentials (passwords / API keys) are passed via environment variables.

Elasticsearch/OpenSearch MCP Server FAQ

Which Elasticsearch/OpenSearch versions are supported?

Elasticsearch 7.x, 8.x, and 9.x via package variants (elasticsearch-mcp-server-es7, elasticsearch-mcp-server for 8.x, elasticsearch-mcp-server-es9), and OpenSearch 1.x/2.x/3.x via opensearch-mcp-server.

What transports are supported?

stdio (default), SSE, and Streamable HTTP. Use the --transport flag (sse or streamable-http) with optional --host, --port, and --path.

How do I make a deployment read-only?

Set DISABLE_HIGH_RISK_OPERATIONS=true to completely hide all write/delete tools from the client, or set DISABLE_OPERATIONS to a comma-separated list of specific operations to disable.

How is the HTTP server secured?

Set MCP_API_KEY and clients must send an Authorization: Bearer <MCP_API_KEY> header. Authentication applies only to HTTP transports; if MCP_API_KEY is unset the server is accessible without authentication.

Can I connect to more than one cluster?

Yes. Set ELASTICSEARCH_CLUSTERS (or OPENSEARCH_CLUSTERS) to a JSON object of named clusters, or point ELASTICSEARCH_CLUSTERS_FILE at a JSON file. Each tool accepts an optional cluster parameter, falling back to DEFAULT_CLUSTER.

Alternatives to Elasticsearch/OpenSearch MCP Server

Compare all alternatives →

Official MCP reference server that fetches a URL and returns its content as clean Markdown, with chunking.

Verified
stdio (local)
No auth
Python
2 tools
Updated 20 days agoRepo

Official Firecrawl MCP server — scrape, crawl, map, search, and structured extraction for any LLM client.

Verified
stdio (local)
API key
TypeScript
8 tools
Updated 18 days agoRepo

Exa's neural web search and crawling MCP server — runs locally via npx or as a hosted remote endpoint.

Verified
stdio (local)
API key
TypeScript
6 tools
Updated 19 days agoRepo

Compare Elasticsearch/OpenSearch MCP Server with: