Elasticsearch MCP Server logo

Elasticsearch MCP Server

by cr7258

Connects MCP clients to Elasticsearch or OpenSearch for search, index, document, alias, analyzer, and cluster operations.

Install Elasticsearch MCP Server

Pick your client, then add it in one click or paste the config.

STDIOPython
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "cr7258-elasticsearch-mcp-server": {
      "command": "uvx",
      "args": [
        "elasticsearch-mcp-server"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Automated check passed— started and listed 20 tools correctly (23d ago).

Overview

cr7258/elasticsearch-mcp-server MCP server exposes Elasticsearch and OpenSearch operations through MCP tools. It supports document search and mutation, index and data-stream administration, aliases, text analysis, cluster inspection, and a general API request tool. Configure one or more clusters through environment variables, then target a named cluster per tool call when needed. Reach for it when an agent needs to inspect or operate an Elasticsearch-compatible datastore.

Use cases

  • Search documents in Elasticsearch or OpenSearch
  • Inspect index mappings, settings, and aliases
  • Manage indices and data streams through MCP tools
  • Check cluster health and statistics
  • Analyze text tokenization for search debugging

Key features

  • Elasticsearch and OpenSearch connectivity
  • Document search and CRUD operations
  • Index, data-stream, and alias management
  • Cluster health and statistics inspection
  • Text analyzer inspection
  • Configurable multi-cluster routing

Tools20

What Elasticsearch MCP Server lets your agent do. Expand a tool for its parameters.

Verified live~2.5k tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked 1d ago

Recent health check succeeded.

19/19 checks healthy over the last 78d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 16d ago via OSV.dev · elasticsearch-mcp-server (PyPI)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars313Stargazers on the source repository.
Last commit7d agoMost recent push to the default branch.
Availability100%Our rolling endpoint + install checks that succeeded.
Install checkPassedOur sandbox started it and listed its tools.
Tools exposed20Callable tools this server registers over MCP.
Directory activity3 viewsConfig copies, upvotes, and views on AllMCPs.

How Elasticsearch MCP Server works

What cr7258/elasticsearch-mcp-server does

cr7258/elasticsearch-mcp-server connects MCP clients to Elasticsearch and OpenSearch. Its tools cover common datastore administration and data-access tasks without requiring a separate tool for every supported API endpoint.

The server can list, inspect, create, and delete indices; create, inspect, and remove data streams; and list, inspect, create, update, or delete aliases. Document tools support searches, reads by ID, writes, deletes by ID, and deletion by query. Cluster health and cluster statistics tools provide operational information. The text analyzer tool helps inspect how a configured analyzer or custom analysis chain tokenizes input.

A general HTTP API tool provides a route for Elasticsearch or OpenSearch operations that do not have a dedicated MCP tool. Write operations can be disabled globally or individually through environment variables.

How it works

The server communicates with the configured Elasticsearch or OpenSearch endpoint and presents the available operations as MCP tools. A single-cluster setup uses host and authentication variables. The server also supports multiple named clusters defined as inline JSON or in a separate JSON file. Tool calls accept an optional cluster value; if it is omitted, the configured default cluster is used, or the first configured cluster when no default is set.

Authentication can use Elasticsearch API keys, Elasticsearch basic authentication, or OpenSearch basic authentication, depending on the target system. For HTTP-based MCP transports, the server can require a bearer token through MCP_API_KEY. Local stdio communication does not use that MCP API-key check.

Setup and configuration

Run cr7258/elasticsearch-mcp-server with the MCP client configuration for the chosen transport. The default endpoint is https://localhost:9200 when no host setting is supplied. Set ELASTICSEARCH_HOSTS or OPENSEARCH_HOSTS for the connection targets, then provide the matching credentials or Elasticsearch API key as needed.

For multiple clusters, use ELASTICSEARCH_CLUSTERS or OPENSEARCH_CLUSTERS with a JSON object, or point ELASTICSEARCH_CLUSTERS_FILE or OPENSEARCH_CLUSTERS_FILE to a JSON file. DEFAULT_CLUSTER selects the cluster used when a tool call does not specify one. VERIFY_CERTS controls certificate verification, and REQUEST_TIMEOUT can set the request timeout in seconds.

HTTP deployments should set MCP_API_KEY; without it, HTTP access has no MCP-level authentication. RESPONSE_FORMAT=gcf optionally encodes model-facing tool results in Graph Compact Format while preserving structured content.

Tools and capabilities

  • general_api_request for API calls without a dedicated tool.
  • Index and data-stream creation, inspection, and deletion.
  • Document search, retrieval, indexing, deletion, and delete-by-query.
  • Cluster health and statistics inspection.
  • Alias listing, inspection, creation, updating, and deletion.
  • Text analysis with a selected analyzer or custom analysis chain.

Limitations and notes

The server can affect datastore state: index deletion, document deletion, delete-by-query, alias changes, data-stream deletion, and other write operations are available unless disabled. Set DISABLE_HIGH_RISK_OPERATIONS=true to hide the default write-operation set from the MCP client, or use DISABLE_OPERATIONS to disable selected operations.

HTTP authentication is not enabled automatically. Exposing the server over a network without MCP_API_KEY leaves it accessible without MCP-level authentication. Certificate verification defaults to false, so deployments that require certificate validation should configure VERIFY_CERTS explicitly.

The general API tool is available for endpoints not represented by the dedicated tools, subject to the target system's API behavior and permissions.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Elasticsearch MCP Server

cr7258/elasticsearch-mcp-server is an MCP server that connects AI clients to Elasticsearch and OpenSearch. Its main tools search, retrieve, index, and delete documents; manage indices, data streams, and aliases; inspect cluster health and statistics; analyze text; and send general API requests.

Configure the server in your MCP client and run it with the repository's supported command or package setup.

Set `OPENSEARCH_HOSTS` and, when needed, `OPENSEARCH_USERNAME` and `OPENSEARCH_PASSWORD`. For multiple OpenSearch clusters, use `OPENSEARCH_CLUSTERS` or `OPENSEARCH_CLUSTERS_FILE`, and optionally set `DEFAULT_CLUSTER`.

Set `DISABLE_HIGH_RISK_OPERATIONS=true` to hide the default write tools. To disable only selected operations, set `DISABLE_OPERATIONS` to a comma-separated list such as `delete_index,delete_document,delete_by_query`.

It documents MCP configuration using stdio and HTTP-based transports, so compatibility depends on whether the client supports the configured MCP transport and authentication setup.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewElasticsearch MCP Server AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/cr7258-elasticsearch-mcp-server?style=directory)](https://allmcps.com/mcp/cr7258-elasticsearch-mcp-server)
HTML Embed
<a href="https://allmcps.com/mcp/cr7258-elasticsearch-mcp-server"><img src="https://allmcps.com/api/badge/cr7258-elasticsearch-mcp-server?style=directory" alt="Elasticsearch MCP Server on AllMCPs" /></a>