Elasticsearch MCP Server

Databasestdiohttp-streamingv0.4.0
Repository

Official Elastic MCP server that connects AI agents to Elasticsearch data using the Model Context Protocol. Enables natural language interactions with Elasticsearch indices — querying, analyzing, and retrieving data without custom APIs. Supports both stdio and streamable-HTTP transports, and works with Elasticsearch 8.x/9.x clusters including Elasticsearch Serverless. Distributed as a Docker container image from the Elastic registry.

Connect

Add this configuration to .claude/mcp.json

Transport:
{
  "mcpServers": {
    "elasticsearch": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "ES_URL",
        "-e",
        "ES_API_KEY",
        "docker.elastic.co/mcp/elasticsearch",
        "stdio"
      ],
      "env": {
        "ES_URL": "<YOUR_ES_URL>",
        "ES_API_KEY": "<YOUR_ES_API_KEY>",
        "ES_USERNAME": "<YOUR_ES_USERNAME>",
        "ES_PASSWORD": "<YOUR_ES_PASSWORD>"
      }
    }
  }
}

Tools (5)

search

Execute a search query against one or more Elasticsearch indices using Query DSL or natural language. Returns matching documents with scores.

{
  "type": "object",
  "required": [
    "index",
    "query"
  ],
  "properties": {
    "size": {
      "type": "integer",
      "description": "Maximum number of results to return (default 10)"
    },
    "index": {
      "type": "string",
      "description": "Index name or pattern to search (e.g. \"logs-*\")"
    },
    "query": {
      "type": "object",
      "description": "Elasticsearch Query DSL object"
    }
  }
}

get_mappings

Retrieve the field mappings for one or more Elasticsearch indices, showing field names, types, and analyzer configurations.

{
  "type": "object",
  "required": [
    "index"
  ],
  "properties": {
    "index": {
      "type": "string",
      "description": "Index name or pattern"
    }
  }
}

list_indices

List all available Elasticsearch indices with their health status, document count, and storage size.

{
  "type": "object",
  "properties": {
    "pattern": {
      "type": "string",
      "description": "Optional index name pattern filter (e.g. \"logs-*\")"
    }
  }
}

get_cluster_info

Retrieve Elasticsearch cluster health, node count, and version information.

{
  "type": "object",
  "properties": {}
}

index_document

Index a new document or update an existing document in an Elasticsearch index.

{
  "type": "object",
  "required": [
    "index",
    "document"
  ],
  "properties": {
    "id": {
      "type": "string",
      "description": "Optional document ID (auto-generated if omitted)"
    },
    "index": {
      "type": "string",
      "description": "Target index name"
    },
    "document": {
      "type": "object",
      "description": "Document body to index"
    }
  }
}

Resources

This server does not expose any resources.

Prompts

This server does not expose any prompts.

Server Information

Author
Elastic (@elastic)
Repository
https://github.com/elastic/mcp-server-elasticsearch
License
Apache-2.0
Version
0.4.0
Stars
320
Last Updated
May 31, 2026