Elasticsearch MCP Server
Available Tools
list_indices: List all available Elasticsearch indices
get_mappings: Get field mappings for a specific Elasticsearch index
search: Perform an Elasticsearch search with the provided query DSL
get_shards: Get shard information for all or specific indices
Prerequisites
- An Elasticsearch instance
- Elasticsearch authentication credentials (API key or username/password)
- MCP Client (e.g. Claude Desktop)
Demo
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
- Start a Conversation
Configuration Options
[!NOTE] You must provide either an API key or both username and password for authentication.
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
Developing Locally
[!NOTE] If you want to modify or extend the MCP Server, follow these local development steps.
- Use the correct Node.js version
- Install Dependencies
- Build the Project
- Run locally in Claude Desktop App
- Debugging with MCP InspectorThis will start the MCP Inspector, allowing you to debug and analyze requests. You should see:
Contributing
Example Questions
[!TIP] Here are some natural language queries you can try with your MCP Client.
- "What indices do I have in my Elasticsearch cluster?"
- "Show me the field mappings for the 'products' index."
- "Find all orders over $500 from last month."
- "Which products received the most 5-star reviews?"
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.
Security Best Practices
[!WARNING] Avoid using cluster-admin privileges. Create dedicated API keys with limited scope and apply fine-grained access control at the index level to prevent unauthorized data access.
License
Troubleshooting
- Ensure your MCP configuration is correct.
- Verify that your Elasticsearch URL is accessible from your machine.
- Check that your authentication credentials (API key or username/password) have the necessary permissions.
- If using SSL/TLS with a custom CA, verify that the certificate path is correct and the file is readable.
- Look at the terminal output for error messages.
Elasticsearch MCP Server
Available Tools
list_indices: List all available Elasticsearch indices
get_mappings: Get field mappings for a specific Elasticsearch index
search: Perform an Elasticsearch search with the provided query DSL
get_shards: Get shard information for all or specific indices
Prerequisites
- An Elasticsearch instance
- Elasticsearch authentication credentials (API key or username/password)
- MCP Client (e.g. Claude Desktop)
Demo
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
- Start a Conversation
Configuration Options
[!NOTE] You must provide either an API key or both username and password for authentication.
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
Developing Locally
[!NOTE] If you want to modify or extend the MCP Server, follow these local development steps.
- Use the correct Node.js version
- Install Dependencies
- Build the Project
- Run locally in Claude Desktop App
- Debugging with MCP InspectorThis will start the MCP Inspector, allowing you to debug and analyze requests. You should see:
Contributing
Example Questions
[!TIP] Here are some natural language queries you can try with your MCP Client.
- "What indices do I have in my Elasticsearch cluster?"
- "Show me the field mappings for the 'products' index."
- "Find all orders over $500 from last month."
- "Which products received the most 5-star reviews?"
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.
Security Best Practices
[!WARNING] Avoid using cluster-admin privileges. Create dedicated API keys with limited scope and apply fine-grained access control at the index level to prevent unauthorized data access.
License
Troubleshooting
- Ensure your MCP configuration is correct.
- Verify that your Elasticsearch URL is accessible from your machine.
- Check that your authentication credentials (API key or username/password) have the necessary permissions.
- If using SSL/TLS with a custom CA, verify that the certificate path is correct and the file is readable.
- Look at the terminal output for error messages.