Elasticsearch MCP server with available features including mappings management, search and indexing, and index management etc.
What is awesimon elasticsearch mcp
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
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
- An Elasticsearch instance
- Elasticsearch authentication credentials (API key or username/password)
- MCP Client (e.g. Claude Desktop, Cursor)
Installation & Setup
Using the Published NPM Package
[!TIP] 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 Config
and 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:
[!NOTE] You must provide either an API key or both username and password for authentication.
Environment Variable | Description | Required |
---|---|---|
ES_HOST |
Your Elasticsearch instance URL (also supports legacy HOST ) |
Yes |
ES_API_KEY |
Elasticsearch API key for authentication (also supports legacy API_KEY ) |
No |
ES_USERNAME |
Elasticsearch username for basic authentication (also supports legacy USERNAME ) |
No |
ES_PASSWORD |
Elasticsearch password for basic authentication (also supports legacy PASSWORD ) |
No |
ES_CA_CERT |
Path to custom CA certificate for Elasticsearch SSL/TLS (also supports legacy CA_CERT ) |
No |
Local Development
[!NOTE] If you want to modify or extend the MCP Server, follow these local development steps.
-
Use the correct Node.js version
nvm use
-
Install Dependencies
npm install
-
Build the Project
npm run build
-
Run locally in Claude Desktop App
- Open Claude Desktop App
- Go to Settings > Developer > MCP Servers
- Click
Edit Config
and 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 Server
and 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 inspector
This 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
[!TIP] 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.
Leave a Comment
Frequently Asked Questions
What is MCP?
MCP (Model Context Protocol) is an open protocol that standardizes how applications provide context to LLMs. Think of MCP like a USB-C port for AI applications, providing a standardized way to connect AI models to different data sources and tools.
What are MCP Servers?
MCP Servers are lightweight programs that expose specific capabilities through the standardized Model Context Protocol. They act as bridges between LLMs like Claude and various data sources or services, allowing secure access to files, databases, APIs, and other resources.
How do MCP Servers work?
MCP Servers follow a client-server architecture where a host application (like Claude Desktop) connects to multiple servers. Each server provides specific functionality through standardized endpoints and protocols, enabling Claude to access data and perform actions through the standardized protocol.
Are MCP Servers secure?
Yes, MCP Servers are designed with security in mind. They run locally with explicit configuration and permissions, require user approval for actions, and include built-in security features to prevent unauthorized access and ensure data privacy.
Related MCP Servers
Brave Search MCP
Integrate Brave Search capabilities into Claude through MCP. Enables real-time web searches with privacy-focused results and comprehensive web coverage.
chrisdoc hevy mcp
sylphlab pdf reader mcp
An MCP server built with Node.js/TypeScript that allows AI agents to securely read PDF files (local or URL) and extract text, metadata, or page counts. Uses pdf-parse.
aashari mcp server atlassian bitbucket
Node.js/TypeScript MCP server for Atlassian Bitbucket. Enables AI systems (LLMs) to interact with workspaces, repositories, and pull requests via tools (list, get, comment, search). Connects AI directly to version control workflows through the standard MCP interface.
aashari mcp server atlassian confluence
Node.js/TypeScript MCP server for Atlassian Confluence. Provides tools enabling AI systems (LLMs) to list/get spaces & pages (content formatted as Markdown) and search via CQL. Connects AI seamlessly to Confluence knowledge bases using the standard MCP interface.
prisma prisma
Next-generation ORM for Node.js & TypeScript | PostgreSQL, MySQL, MariaDB, SQL Server, SQLite, MongoDB and CockroachDB
Zzzccs123 mcp sentry
mcp sentry for typescript sdk
zhuzhoulin dify mcp server
zhongmingyuan mcp my mac
zhixiaoqiang desktop image manager mcp
MCP 服务器,用于管理桌面图片、查看详情、压缩、移动等(完全让Trae实现)
Submit Your MCP Server
Share your MCP server with the community
Submit Now