Elasticsearch

Provides a dedicated MCP server to query Elasticsearch: list indices, search, get mappings, and view shards.
  • python

0

GitHub Stars

python

Language

5 months ago

First Indexed

2 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "m0-ar-custom-elasticsearch-mcp-server": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "--add-host=host.docker.internal:host-gateway",
        "-e",
        "ES_URL=http://host.docker.internal:9400",
        "elasticsearch-mcp:latest"
      ],
      "env": {
        "ES_URL": "http://host.docker.internal:9400",
        "MAX_CONNECTIONS": "100",
        "REQUEST_TIMEOUT": "30",
        "CONNECTION_TIMEOUT": "30",
        "MAX_KEEPALIVE_CONNECTIONS": "20"
      }
    }
  }
}

You have a custom MCP server that connects to Elasticsearch, exposing four practical tools to list indices, run queries, retrieve mappings, and inspect shard information. It’s designed for cloud environments where your public key is already trusted, and it emphasizes ease of use, high concurrency, and flexible tuning for traffic-heavy workloads.

How to use

You will connect your MCP client to the Elasticsearch MCP server by adding the server configuration to your client’s MCP setup and then use the four supplied tools to interact with your Elasticsearch cluster. The server supports asynchronous, high-concurrency operation, so you can run multiple requests in parallel from different applications without blocking each other. Use the tools to discover indices, search data with Elasticsearch Query DSL, fetch index mappings, and check shard status of your cluster.

How to install

Prerequisites: you need Docker installed on the host that will run the MCP server image, and you should have an MCP client (Cursor) ready to load MCP servers.

Build and run the MCP server image, then configure Cursor to load it as an MCP server. The following steps show a practical flow based on the available configuration examples.

# Build the MCP server image from source
git clone https://github.com/M0-AR/Custom-Elasticsearch-MCP-Server.git
cd Custom-Elasticsearch-MCP-Server
docker build -t elasticsearch-mcp:latest .

Add the MCP server to your Cursor configuration. You will run the MCP server via Docker and pass the Elasticsearch endpoint as an environment variable. You will create or edit your Cursor MCP configuration to include the following entry.

{
  "mcpServers": {
    "elasticsearch-custom": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "--add-host=host.docker.internal:host-gateway",
        "-e",
        "ES_URL=http://host.docker.internal:9400",
        "elasticsearch-mcp:latest"
      ]
    }
  }
}

Restart Cursor after adding the MCP server configuration so Cursor can detect and load the new server with its four tools.

If you need higher throughput, you can use an enhanced configuration with additional environment variables to tune concurrency before starting Cursor.

Additional sections

Configuration details show how to tune the server for different environments. The base environment variable is ES_URL, which points to your Elasticsearch instance. Other tuning options control concurrency and timeouts to fit high-traffic workloads.

Security and access: this version relies on a pre-authorized public key on the host system, so you do not supply an API key. Ensure your deployment environment maintains proper key management and network security around the MCP server and Elasticsearch.

Troubleshooting tips cover common networking issues, Docker connectivity checks, and the proper initialization sequence for MCP clients. If you encounter connection issues, verify SSH tunnels, Docker networking, and the exact MCP run configuration used in your environment.

Notes

If you plan to scale for very high concurrency, you can adjust the following example to use more aggressive limits: increase MAX_CONNECTIONS, MAX_KEEPALIVE_CONNECTIONS, and timeouts. Always verify stability under load with representative traffic patterns.

Available tools

list_indices

List all Elasticsearch indices with an optional pattern filter

search

Execute a full Elasticsearch Query DSL search against a specific index or indices

get_mappings

Retrieve field mappings for a specific index or indices

get_shards

Show shard information for the cluster

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational