home / mcp / elasticsearch mcp server

Elasticsearch MCP Server

Elasticsearch MCP server with available features including mappings management, search and indexing, and index management etc.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "awesimon-elasticsearch-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@awesome-ai/elasticsearch-mcp"
      ],
      "env": {
        "ES_HOST": "your-elasticsearch-host",
        "ES_API_KEY": "your-api-key",
        "ES_CA_CERT": "/path/to/ca.crt",
        "ES_PASSWORD": "elastic_password",
        "ES_USERNAME": "elastic_user"
      }
    }
  }
}

You connect your MCP Client to your Elasticsearch data using a dedicated MCP Server. It translates natural language requests into Elasticsearch operations so you can interact with indices, mappings, searches, and cluster health through conversations.

How to use

You interact with Elasticsearch through natural language in your MCP Client. The Elasticsearch MCP Server analyzes what you ask, runs the corresponding Elasticsearch operations (such as listing indices, fetching mappings, or performing a search), and returns results in a user-friendly format for you to review.

Typical workflows include: asking for cluster health, listing indices, creating or updating mappings, performing searches, and bulk data operations. You can also manage index templates and reindex data between indices. Use your MCP Client to start a conversation and simply ask questions like health checks, index lists, or data queries. The server handles the rest and presents results clearly.

How to install

{
  "mcpServers": {
    "elasticsearch_mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@awesome-ai/elasticsearch-mcp"
      ],
      "env": {
        "ES_HOST": "your-elasticsearch-host",
        "ES_API_KEY": "your-api-key"
      }
    }
  }
}

Open your MCP Client and configure a new MCP Server with the above settings. This uses the published package to run the MCP server.

Additional sections

Configuration and startup notes help you tailor the server to your Elasticsearch deployment. You can connect to a single Elasticsearch node or configure multiple nodes for high availability.

Security: provide authentication to Elasticsearch using either an API key or a username/password pair. You must supply one of these methods to establish a trusted connection.

Examples and environments shown below illustrate common setups and local development workflows so you can run and test the MCP Server with your own Elasticsearch instance.

Troubleshooting

If you run into connection or authentication issues, verify the ES_HOST and credentials you configured match your Elasticsearch deployment. Check that the MCP Client is connected to the MCP Server and that the server process is running. Use the MCP Inspector to observe requests and responses during development.

Available tools

elasticsearch_health

Get cluster health status, with optional index-level details.

list_indices

List available indices, with optional regex support.

create_index

Create an Elasticsearch index with optional settings and mappings.

reindex

Reindex data from a source index to a target index with optional query and script.

get_mappings

Retrieve field mappings for a specific index.

create_mapping

Create or update a mapping for an index.

search

Execute a search using the provided query DSL.

bulk

Bulk insert data into an index.

create_index_template

Create or update an index template.

get_index_template

Retrieve information about index templates.

delete_index_template

Delete an index template.