Skip to content
MCP server

Elasticsearch

Elasticsearch MCP Server for ES 5.x-9.x with a query harness, field validation and full…

Install
Pricing
Open source
Runs
Locally or Remotely
Version
0.9.1
Listing updated
4 days ago

About Elasticsearch

Elasticsearch is an open-source MCP server for databases. It can run locally on your machine or as a hosted remote server.

Elasticsearch MCP Server for ES 5.x-9.x with a query harness, field validation and full API access

Install

Run in a terminal

claude mcp add elasticsearch --env ES_URL='<ES_URL>' --env ES_API_KEY='<ES_API_KEY>' --env ES_PASSWORD='<ES_PASSWORD>' -- npx -y @tocharianou/elasticsearch-mcp

Add to claude_desktop_config.json

{
  "mcpServers": {
    "elasticsearch": {
      "command": "npx",
      "args": [
        "-y",
        "@tocharianou/elasticsearch-mcp"
      ],
      "env": {
        "ES_URL": "<ES_URL>",
        "ES_API_KEY": "<ES_API_KEY>",
        "ES_PASSWORD": "<ES_PASSWORD>"
      }
    }
  }
}

Add to ~/.cursor/mcp.json

{
  "mcpServers": {
    "elasticsearch": {
      "command": "npx",
      "args": [
        "-y",
        "@tocharianou/elasticsearch-mcp"
      ],
      "env": {
        "ES_URL": "<ES_URL>",
        "ES_API_KEY": "<ES_API_KEY>",
        "ES_PASSWORD": "<ES_PASSWORD>"
      }
    }
  }
}

Add to .vscode/mcp.json

{
  "servers": {
    "elasticsearch": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@tocharianou/elasticsearch-mcp"
      ],
      "env": {
        "ES_URL": "<ES_URL>",
        "ES_API_KEY": "<ES_API_KEY>",
        "ES_PASSWORD": "<ES_PASSWORD>"
      }
    }
  }
}

Add to ~/.codeium/windsurf/mcp_config.json

{
  "mcpServers": {
    "elasticsearch": {
      "command": "npx",
      "args": [
        "-y",
        "@tocharianou/elasticsearch-mcp"
      ],
      "env": {
        "ES_URL": "<ES_URL>",
        "ES_API_KEY": "<ES_API_KEY>",
        "ES_PASSWORD": "<ES_PASSWORD>"
      }
    }
  }
}

Add to your client's MCP settings (most use this shape)

{
  "mcpServers": {
    "elasticsearch": {
      "command": "npx",
      "args": [
        "-y",
        "@tocharianou/elasticsearch-mcp"
      ],
      "env": {
        "ES_URL": "<ES_URL>",
        "ES_API_KEY": "<ES_API_KEY>",
        "ES_PASSWORD": "<ES_PASSWORD>"
      }
    }
  }
}

Configuration

  • ES_URLYour Elasticsearch instance URL (e.g., https://localhost:9200)Required
  • ES_API_KEYElasticsearch API key for authentication
  • ES_USERNAMEElasticsearch username for basic authentication
  • ES_PASSWORDElasticsearch password for basic authentication
  • ES_CA_CERTPath to custom CA certificate for Elasticsearch SSL/TLS
  • NODE_TLS_REJECT_UNAUTHORIZEDSet to '0' to disable SSL certificate validation (development only)
  • MAX_TOKEN_CALLMaximum tokens per API call
  • MCP_TRANSPORTTransport mode selectionRequired
  • MCP_HTTP_PORTHTTP server port (when using HTTP transport)
  • MCP_HTTP_HOSTHTTP server host (when using HTTP transport)
  • ES_URLYour Elasticsearch instance URL (e.g., https://localhost:9200)Required
  • ES_API_KEYElasticsearch API key for authentication
  • ES_USERNAMEElasticsearch username for basic authentication
  • ES_PASSWORDElasticsearch password for basic authentication
  • ES_CA_CERTPath to custom CA certificate for Elasticsearch SSL/TLS
  • NODE_TLS_REJECT_UNAUTHORIZEDSet to '0' to disable SSL certificate validation (development only)
  • MAX_TOKEN_CALLMaximum tokens per API call

Pricing

Open source

Elasticsearch FAQ

Is Elasticsearch free?

Yes. Elasticsearch is open source, so you can use and self-host it for free.

How do I add Elasticsearch to Claude Code?

Run this command in your terminal: claude mcp add elasticsearch --env ES_URL='<ES_URL>' --env ES_API_KEY='<ES_API_KEY>' --env ES_PASSWORD='<ES_PASSWORD>' -- npx -y @tocharianou/elasticsearch-mcp

What are the best alternatives to Elasticsearch?

The closest alternatives to Elasticsearch are Midplane, PlatypusDB, Lorebase, Sovaria and model2data studio.

Alternatives to Elasticsearch

  1. Midplane

    MCP server

    Postgres gateway for AI agents with table grants, column masking and approval for writes

    Runs locally
    • Open source
    • 5 GitHub stars
    • Databases
  2. PlatypusDB

    MCP server

    Gives MCP clients access to your PlatypusDB database connections, scoped per agent

    Runs locally
    • Open source
    • Databases
  3. Lorebase

    MCP server

    Lets agents read and change a governed, versioned Postgres knowledge graph

    Runs locally
    • Open source
    • Knowledge and memory
  4. Sovaria

    MCP server

    Manage a Sovaria backend (Postgres, auth, storage, functions) from an AI assistant

    Not checked yet
    • 4 tools
    • Remote
    • Freemium
    • Databases
  5. Generate realistic connected test data, dbt projects and dashboards from a schema

    • Remote
    • Freemium
    • Databases
  6. semlayer

    MCP server

    Infers a semantic layer from your data warehouse and serves it to agents

    Runs locally
    • Free
    • Databases