Elasticsearch MCP Server
Connect an MCP client to Elasticsearch to manage and query cluster, index, mapping, data, and template operations.
Check cluster health, optionally with index-level details.
List indices with optional regex filtering.
Get field mappings for an index.
Search an index using Elasticsearch query DSL.
Create indices with optional settings and mappings.
Create or update index mappings.
Bulk import documents, optionally using a field as document ID.
Reindex data between indices with optional query and script.
Create/update, get, and delete index templates.
Connects to Elasticsearch clusters allowing interaction with indices through natural language, including listing indices, retrieving mappings, performing searches, managing index templates, bulk operations, reindexing data, and monitoring cluster health.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Elasticsearch MCP Server show me the health status of my Elasticsearch cluster"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Elasticsearch MCP Server
MCP Server for connecting to your Elasticsearch cluster directly from any MCP Client (like Claude Desktop, Cursor).
This server connects agents to your Elasticsearch data using the Model Context Protocol. It allows you to interact with your Elasticsearch indices through natural language conversations.
Demo

Related MCP server: Elasticsearch MCP Server
Feature Overview
Available Features
Cluster Management
elasticsearch_health: Get Elasticsearch cluster health status, optionally including index-level details
Index Operations
list_indices: List available Elasticsearch indices, support regexcreate_index: Create Elasticsearch index with optional settings and mappingsreindex: Reindex data from a source index to a target index with optional query and script
Mapping Management
get_mappings: Get field mappings for a specific Elasticsearch indexcreate_mapping: Create or update mapping structure for an Elasticsearch index
Search & Data Operations
search: Perform an Elasticsearch search with the provided query DSLbulk: Bulk data into an Elasticsearch index
Template Management
create_index_template: Create or update an index templateget_index_template: Get information about index templatesdelete_index_template: Delete an index template
How It Works
The MCP Client analyzes your request and determines which Elasticsearch operations are needed.
The MCP server carries out these operations (listing indices, fetching mappings, performing searches).
The MCP Client processes the results and presents them in a user-friendly format.
Getting Started
Prerequisites
Elasticsearch 8.x (recommended; this is the current primary compatibility target)
An Elasticsearch instance
Elasticsearch authentication credentials (API key or username/password)
MCP Client (e.g. Claude Desktop, Cursor)
This project depends on the Node.js client@elastic/elasticsearch@^8.17.1. That client dependency is not a minimum Elasticsearch server version.
Elastic's official compatibility matrix aligns client and server major versions and describes forward compatibility with higher minor versions within the same major version.
This repository does not claim that every Elasticsearch 8.x minor or patch release has been validated; npm test currently runs TypeScript compilation only and does not establish Elasticsearch server compatibility.
Elasticsearch 7.x, 9.x, and other major versions have not been validated.
Installation & Setup
Using the Published NPM Package
The easiest way to use Elasticsearch MCP Server is through the published npm package.
Configure MCP Client
Open your MCP Client. See the list of MCP Clients, here we are configuring Claude Desktop.
Go to Settings > Developer > MCP Servers
Click
Edit Configand add a new MCP Server with the following configuration:
{ "mcpServers": { "elasticsearch-mcp": { "command": "npx", "args": [ "-y", "@awesome-ai/elasticsearch-mcp" ], "env": { "ES_HOST": "your-elasticsearch-host", "ES_API_KEY": "your-api-key" } } } }Start a Conversation
Open a new conversation in your MCP Client.
The MCP server should connect automatically.
You can now ask questions about your Elasticsearch data.
Configuration Options
The Elasticsearch MCP Server supports configuration options to connect to your Elasticsearch:
You must provide either an API key or both username and password for authentication.
Environment Variable | Description | Required |
| Your Elasticsearch instance URL(s) - supports single URL or comma-separated multiple URLs (also supports legacy | Yes |
| Elasticsearch API key for authentication (also supports legacy | No |
| Elasticsearch username for basic authentication (also supports legacy | No |
| Elasticsearch password for basic authentication (also supports legacy | No |
| Path to custom CA certificate for Elasticsearch SSL/TLS (also supports legacy | No |
Multiple URLs Configuration
You can configure multiple Elasticsearch nodes for high availability and load balancing:
{
"mcpServers": {
"elasticsearch-mcp": {
"command": "npx",
"args": [
"-y",
"@awesome-ai/elasticsearch-mcp"
],
"env": {
"ES_HOST": "https://es-node1:9200,https://es-node2:9200,https://es-node3:9200",
"ES_API_KEY": "your-api-key"
}
}
}
}The client will automatically handle failover and load balancing between the configured nodes.
Local Development
If you want to modify or extend the MCP Server, follow these local development steps.
Use the correct Node.js version
nvm useInstall Dependencies
npm installBuild the Project
npm run buildRun locally in Claude Desktop App
Open Claude Desktop App
Go to Settings > Developer > MCP Servers
Click
Edit Configand add a new MCP Server with the following configuration:
{ "mcpServers": { "elasticsearch-mcp": { "command": "node", "args": [ "/path/to/your/project/dist/index.js" ], "env": { "ES_HOST": "your-elasticsearch-host", "ES_API_KEY": "your-api-key" } } } }Run locally in Cursor Editor
Open Cursor Editor
Go to Cursor Settings > MCP
Click
Add new global MCP Serverand add a new MCP Server with the following configuration:
{ "mcpServers": { "elasticsearch-mcp": { "command": "node", "args": [ "/path/to/your/project/dist/index.js" ], "env": { "ES_HOST": "your-elasticsearch-host", "ES_API_KEY": "your-api-key" } } } }Debugging with MCP Inspector
ES_HOST=your-elasticsearch-url ES_API_KEY=your-api-key npm run inspectorThis will start the MCP Inspector, allowing you to debug and analyze requests. You should see:
Starting MCP inspector... ⚙️ Proxy server listening on port 6277 🔍 MCP Inspector is up and running at http://127.0.0.1:6274 🚀
Example Queries
Here are some natural language queries you can try with your MCP Client.
Cluster Management
"What is the health status of my Elasticsearch cluster?"
"How many active nodes are in my cluster?"
Index Operations
"What indices do I have in my Elasticsearch cluster?"
"Create a new index called 'users' with 3 shards and 1 replica."
"Reindex data from 'old_index' to 'new_index'."
Mapping Management
"Show me the field mappings for the 'products' index."
"Add a keyword type field called 'tags' to the 'products' index."
Search & Data Operations
"Find all orders over $500 from last month."
"Which products received the most 5-star reviews?"
"Bulk import these customer records into the 'customers' index."
Template Management
"Create an index template for logs with pattern 'logs-*'."
"Show me all my index templates."
"Delete the 'outdated_template' index template."
If you encounter issues, feel free to open an issue on the GitHub repository.
Available Tools
11 toolsbulkD
Bulk data into an Elasticsearch index
Inputs: index (required), documents (required), idField.
create_indexB
Create an Elasticsearch index, optionally configure settings and mappings
Inputs: index (required), settings, mappings.
create_index_templateB
Create or update an Elasticsearch index template
Inputs: name (required), indexPatterns (required), template (required), priority, +1 more.
create_mappingB
Create or update the mapping structure of an Elasticsearch index
Inputs: index (required), mappings (required).
delete_index_templateC
Delete an Elasticsearch index template
Inputs: name (required).
elasticsearch_healthB
Get the health status of the Elasticsearch cluster, optionally include index-level details
Inputs: includeIndices.
get_index_templateB
Get information about Elasticsearch index templates
Inputs: name.
get_mappingsB
Get field mappings for a specific Elasticsearch index
Inputs: index (required).
list_indicesA
List all available Elasticsearch indices, support regex
Inputs: pattern.
reindexB
Reindex data from a source index to a target index
Inputs: sourceIndex (required), destIndex (required), query, script.
searchB
Perform an Elasticsearch search with the provided query DSL. Highlights are always enabled.
Inputs: index (required), queryBody (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 11 tools
Each tool targets a distinct Elasticsearch resource and action (e.g., create_index, create_mapping, search, bulk). There is no overlap or ambiguity; tools are clearly differentiated by their purpose.
Most tools follow a verb_noun pattern with underscores (e.g., create_index, get_mappings). However, 'elasticsearch_health' deviates by starting with a noun instead of a verb, causing a minor inconsistency.
With 11 tools, the server covers a reasonable breadth of Elasticsearch operations (index management, search, mapping, templates) without being excessive. The count fits well within the typical 3-15 range for a focused server.
The tool set lacks essential operations like deleting an index and document-level CRUD (get, delete by ID). While bulk and search are present, agents cannot perform complete lifecycle management, leading to significant gaps.
Maintenance
Related MCP Connectors
Make your knowledge agent-ready. One MCP endpoint, 5 connectors, 3 search modes.
Connect AI clients to your Dactic work context through a hosted MCP service.
Agent-driven search: build, import, tune, search, and score result quality — all over MCP.
Enable secure connectivity between Sentry issues and debugging data, and LLM clients, using a Model Context Protocol (MCP) server.
Related MCP Servers
- AlicenseBqualityAmaintenanceFacilitates interaction with Elasticsearch clusters by allowing users to perform index operations, document searches, and cluster management via a Model Context Protocol server and natural language commands.20320Apache 2.0
- FlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that enables LLMs to interact with Elasticsearch clusters, allowing them to manage indices and execute search queries using natural language.2-

Elasticsearch MCP Serverofficial
AlicenseBqualityDmaintenanceConnects Claude and other MCP clients to Elasticsearch data, allowing users to interact with their Elasticsearch indices through natural language conversations.3735Apache 2.0- AlicenseBqualityDmaintenanceConnects to Elasticsearch databases using the Model Context Protocol, allowing users to query and interact with their Elasticsearch indices through natural language conversations.4Apache 2.0
Appeared in Searches
- Using an AI Agent for Structured Search and Traversal in a Neo4j Database
- Tools and Components for Visual AI Code Editing and Chat Interfaces
- Servers for Cloud Architecture (AWS) and Platform Engineering with Oauth Integration for Documentation Access
- Natural Language to SQL Conversion and Executing MySQL Queries to Retrieve Data
- How to query a MySQL database