- Home
- MCP servers
- Elastic
Elastic
- python
0
GitHub Stars
python
Language
7 months ago
First Indexed
3 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"akhilvis-elastic-mcp": {
"command": "uv",
"args": [
"run",
"--with-requirements",
"<absolute path to requirements.txt>",
"fastmcp",
"run",
"<absolute path to elastic_tool.py>"
],
"env": {
"ELASTIC_URL": "http://localhost:9200",
"ELASTIC_PASSWORD": "your_password",
"ELASTIC_USERNAME": "your_username"
}
}
}
}You can connect to your Elasticsearch data and operations from MCP-compatible clients using the Elastic MCP Server. It exposes Elasticsearch functionality through the MCP interface, enabling natural-language style querying, management, and analysis across tools and agents.
How to use
You interact with the Elastic MCP Server through an MCP client by starting an MCP runner configured to execute the server tool. You can run the server locally in stdio mode or use an MCP client UI to connect and issue natural-language requests to search, list indices, or inspect mappings.
How to install
Prerequisites you need before installing and running the server are clearly defined and must be installed on your machine.
# Prerequisites
# - Python 3.8+
# - Elasticsearch running and accessible
# - uv or pip for dependency management
# Install dependencies using uv package manager
uv pip install -r requirements.txt
Additional setup and configuration
You can run the MCP server in multiple ways. The following options show sample commands and environment configurations you can adapt to your environment.
{
"mcpServers": {
"Elastic MCP Server": {
"type": "stdio",
"name": "elastic",
"command": "uv",
"args": [
"run",
"--with-requirements",
"<absolute path to requirements.txt>",
"fastmcp",
"run",
"<absolute path to elastic_tool.py>"
],
"env": {
"ELASTIC_URL": "http://localhost:9200",
"ELASTIC_USERNAME": "your_username",
"ELASTIC_PASSWORD": "your_password"
}
}
}
}
Working with the server in stdio mode
Option 1: Run via the uv-based workflow shown below. This starts the MCP runner with the fastmcp tool and the Elasticsearch tool script.
ELASTIC_URL="http://localhost:9200" ELASTIC_USERNAME="your_username" ELASTIC_PASSWORD="your_password" fastmcp dev tools/elastic_tool.py
Option 2: Run the MCP server directly with Python and then connect a client. This starts the tool using Python 3 and the elastic_tool.py script.
ELASTIC_URL="http://localhost:9200" ELASTIC_USERNAME="elastic" ELASTIC_PASSWORD="hKsXqDsd" python3 tools/elastic_tool.py
Then, in another terminal, start a client such as the MCP client you use (e.g., Python MCP client) with its own start command as appropriate for your setup.
## Examples of how to connect from an MCP client (Claude Desktop)
If you configure an MCP client, you can add a server entry that runs the Elastic MCP Server through an MCP runner as shown in the configuration example.
## Notes on deployment and credentials
For production deployments, avoid hardcoding credentials. Use secure environment management and rotate credentials regularly. Ensure Elasticsearch is accessible from the MCP runner and that network permissions allow the MCP client to communicate with the server.
## Available tools
### search\_index
Search an index with a query string.
### list\_indices
List all indices (excluding system indices).
### get\_index\_mappings
Get mappings for a specific index.