Elasticsearch MCP Server

v1.0.7Search & Data Extractionstable

Enables Claude Desktop to connect directly to Elasticsearch clusters for intelligent log analysis through natural language queries. Users can ask questions about their logs in plain English and get actionable insights without writing complex Elastics

elasticsearchmcpmcp-servervector-databasesearch
Share:
662
Stars
0
Downloads
0
Weekly
0/5

What is Elasticsearch MCP Server?

Elasticsearch MCP Server is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to enables claude desktop to connect directly to elasticsearch clusters for intelligent log analysis through natural language queries. users can ask questions about their logs in plain english and get ac...

Enables Claude Desktop to connect directly to Elasticsearch clusters for intelligent log analysis through natural language queries. Users can ask questions about their logs in plain English and get actionable insights without writing complex Elastics

This server falls under the Search & Data Extraction category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • Enables Claude Desktop to connect directly to Elasticsearch

Use Cases

Natural language log analysis
Direct Elasticsearch cluster access
Query insights without writing DSL
elastic

Maintainer

LicenseApache-2.0
Languagerust
Versionv1.0.7
UpdatedMay 21, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

NPM

npx -y @awesome-ai/elasticsearch-mcp

PIP

pip install elasticsearch-mcp-server

Manual Installation

npx -y @awesome-ai/elasticsearch-mcp

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use Elasticsearch MCP Server

The Elasticsearch MCP Server connects Claude Desktop and other MCP clients directly to Elasticsearch clusters, enabling natural language queries against indices, log analysis, and cluster inspection without writing Elasticsearch DSL by hand. It exposes five tools — list_indices, get_mappings, search, esql, and get_shards — and runs as a Docker container supporting both stdio and Streamable HTTP transport modes. Operations teams use it to ask plain-English questions about their log data and receive actionable insights without needing Elasticsearch expertise.

Prerequisites

  • Docker installed and running on your machine
  • A running Elasticsearch cluster (self-hosted or Elastic Cloud) with a known endpoint URL
  • ES_URL: the full URL of your Elasticsearch cluster (e.g. https://my-cluster.es.io:9243)
  • Authentication: either ES_API_KEY for API key auth, or ES_USERNAME and ES_PASSWORD for basic auth
  • An MCP client such as Claude Desktop
1

Pull the Elasticsearch MCP Docker image

The official MCP server is distributed as a Docker image from Elastic's registry. Pull it before running.

docker pull docker.elastic.co/mcp/elasticsearch
2

Test the server in stdio mode

Run the container in interactive stdio mode to verify it can connect to your Elasticsearch cluster. Pass your cluster URL and API key as environment variables.

docker run -i --rm \
  -e ES_URL="https://your-cluster.es.io:9243" \
  -e ES_API_KEY="your-api-key" \
  docker.elastic.co/mcp/elasticsearch \
  stdio
3

Configure Claude Desktop to use the MCP server

Add the Elasticsearch MCP server to your Claude Desktop configuration file. The stdio mode is recommended for local use.

{
  "mcpServers": {
    "elasticsearch": {
      "command": "docker",
      "args": [
        "run", "-i", "--rm",
        "-e", "ES_URL",
        "-e", "ES_API_KEY",
        "docker.elastic.co/mcp/elasticsearch",
        "stdio"
      ],
      "env": {
        "ES_URL": "https://your-cluster.es.io:9243",
        "ES_API_KEY": "your-api-key-here"
      }
    }
  }
}
4

Optional: run in HTTP mode for concurrent access

For web integrations or multiple concurrent MCP clients, run the container in HTTP mode on port 8080.

docker run --rm \
  -e ES_URL="https://your-cluster.es.io:9243" \
  -e ES_API_KEY="your-api-key" \
  -p 8080:8080 \
  docker.elastic.co/mcp/elasticsearch \
  http
5

Optional: disable TLS verification for development

When connecting to a local Elasticsearch instance with a self-signed certificate, set ES_SSL_SKIP_VERIFY to true. Do not use this in production.

docker run -i --rm \
  -e ES_URL="https://localhost:9200" \
  -e ES_USERNAME="elastic" \
  -e ES_PASSWORD="changeme" \
  -e ES_SSL_SKIP_VERIFY="true" \
  docker.elastic.co/mcp/elasticsearch \
  stdio

Elasticsearch MCP Server Examples

Client configuration

Complete Claude Desktop configuration for the official Elasticsearch MCP server in stdio mode with API key authentication.

{
  "mcpServers": {
    "elasticsearch": {
      "command": "docker",
      "args": [
        "run", "-i", "--rm",
        "-e", "ES_URL",
        "-e", "ES_API_KEY",
        "docker.elastic.co/mcp/elasticsearch",
        "stdio"
      ],
      "env": {
        "ES_URL": "https://your-cluster.es.io:9243",
        "ES_API_KEY": "ApiKey your-base64-encoded-key"
      }
    }
  }
}

Prompts to try

Natural language prompts that use the five exposed Elasticsearch tools.

- "List all indices in my Elasticsearch cluster"
- "Show me the field mappings for the logs-nginx-* index"
- "Search the application-logs index for error messages in the last 24 hours"
- "Run an ES|QL query to count events by log level in the past hour"
- "Show me the shard distribution across my cluster nodes"

Troubleshooting Elasticsearch MCP Server

Docker container exits immediately with 'connection refused' or 'authentication failed'

Verify ES_URL is reachable from inside the Docker container (not localhost — use the host's IP or a Docker network alias). Confirm ES_API_KEY or the username/password pair is correct and has read permissions on your indices.

Claude Desktop shows the server as disconnected after adding the config

Ensure Docker is running before launching Claude Desktop. The docker run command must be executable — test it manually in your terminal first. Check that the ES_URL and ES_API_KEY env values are correctly set in the env block, not just in the args.

TLS certificate verification fails for self-hosted Elasticsearch

Set ES_SSL_SKIP_VERIFY=true in the env block for local development with self-signed certs. For production, mount your CA certificate into the container and configure the ELASTIC_TLS_CA_CERT path.

Frequently Asked Questions about Elasticsearch MCP Server

What is Elasticsearch MCP Server?

Elasticsearch MCP Server is a Model Context Protocol (MCP) server that enables claude desktop to connect directly to elasticsearch clusters for intelligent log analysis through natural language queries. users can ask questions about their logs in plain english and get actionable insights without writing complex elastics It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Elasticsearch MCP Server?

Install via npm with the command: npx -y @awesome-ai/elasticsearch-mcp. Then add the server configuration to your AI client's JSON config file (e.g., claude_desktop_config.json or .cursor/mcp.json).

Which AI clients work with Elasticsearch MCP Server?

Elasticsearch MCP Server works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Elasticsearch MCP Server free to use?

Yes, Elasticsearch MCP Server is open source and available under the Apache-2.0 license. You can use it freely in both personal and commercial projects.

Browse More Search & Data Extraction MCP Servers

Explore all search & data extraction servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "elasticsearch-mcp-server": { "command": "npx", "args": ["-y", "@awesome-ai/elasticsearch-mcp"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use Elasticsearch MCP Server?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides