An Elasticsearch server focused on security and threat analysis. Requires a valid Elasticsearch license (trial, platinum, or enterprise) for connection.
Enhanced Elasticsearch MCP Server Solution - Security & Threat Analysis Focused
This is a professional security-focused solution maintained by TocharianOU. It enables comprehensive interaction with all Elasticsearch APIs, specifically optimized for security analysis, threat detection, and incident investigation. Features include advanced security monitoring, anomaly detection, threat hunting, root cause analysis, and comprehensive audit capabilities.
Key Security Features:
Note: This solution requires a valid Elasticsearch license (trial, platinum, or enterprise) and is designed for security professionals, SOC teams, and threat analysts.
Connect to your Elasticsearch data directly from any MCP Client (such as Claude Desktop) using the Model Context Protocol (MCP). Interact with your Elasticsearch security data through natural language queries for advanced threat analysis and incident response.
⚠️ This project requires your Elasticsearch cluster to have a valid license. If you do not have a license, you can activate a trial license as shown below.
To connect to Elasticsearch with a self-signed certificate or in a test environment, you can set the following environment variable:
NODE_TLS_REJECT_UNAUTHORIZED=0
⚠️ This disables Node.js SSL certificate validation. Use only in development or testing environments. For production, always use a trusted CA certificate.
The Elasticsearch MCP Server supports the following configuration options:
Environment Variable | Description | Required |
---|---|---|
ES_URL | Your Elasticsearch instance URL | Yes |
ES_API_KEY | Elasticsearch API key for authentication | No |
ES_USERNAME | Elasticsearch username for basic authentication | No |
ES_PASSWORD | Elasticsearch password for basic authentication | No |
ES_CA_CERT | Path to custom CA certificate for Elasticsearch SSL/TLS | No |
NODE_TLS_REJECT_UNAUTHORIZED | Set to 0 to disable SSL certificate validation | No |
Install globally via NPM
npm install -g @tocharian/mcp-server-elasticsearch-sl
Run directly
npx @tocharian/mcp-server-elasticsearch-sl
Clone the repository
git clone https://github.com/TocharianOU/mcp-server-elasticsearch-sl.git
cd mcp-server-elasticsearch-sl
Install Dependencies
npm install
Build the Project
npm run build
Configure Claude Desktop App
Edit Config
and add a new MCP Server with the following configuration:For NPM Installation:
{
"mcpServers": {
"elasticsearch-mcp-server": {
"command": "npx",
"args": [
"@tocharian/mcp-server-elasticsearch-sl"
],
"env": {
"ES_URL": "your-elasticsearch-url",
"ES_USERNAME": "elastic",
"ES_PASSWORD": "your_pass",
"NODE_TLS_REJECT_UNAUTHORIZED": "0"
}
}
}
}
For Source Installation:
{
"mcpServers": {
"elasticsearch-mcp-server-local": {
"command": "node",
"args": [
"/path/to/your/mcp-server-elasticsearch-sl/dist/index.js"
],
"env": {
"ES_URL": "your-elasticsearch-url",
"ES_USERNAME": "elastic",
"ES_PASSWORD": "your_pass",
"NODE_TLS_REJECT_UNAUTHORIZED": "0"
}
}
}
}
Debugging with MCP Inspector
ES_URL=your-elasticsearch-url ES_USERNAME=elastic ES_PASSWORD=your_pass 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 3000
🔍 MCP Inspector is up and running at http://localhost:5173 🚀
We welcome contributions from the community! For details on how to contribute, please see Contributing Guidelines.
[!TIP] Here are security-focused queries you can try with your MCP Client.
Threat Detection:
Root Cause Analysis:
Threat Intelligence:
Real-time Monitoring:
[!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.
You can create a dedicated Elasticsearch API key with minimal permissions to control access to your data:
{
"name": "es-mcp-server-access",
"role_descriptors": {
"mcp_server_role": {
"cluster": [
"monitor"
],
"indices": [
{
"names": [
"index-1",
"index-2",
"index-pattern-*"
],
"privileges": [
"read",
"view_index_metadata"
]
}
]
}
}
}
This project is licensed under the Apache License 2.0.
If you encounter issues, feel free to open an issue on the GitHub repository.
If your Elasticsearch cluster does not have a valid license, you can activate a 30-day trial license with the following command:
curl -X POST -u elastic:your_password \
-k "https://your-es-host:9200/_license/start_trial?acknowledge=true"
your_password
and your-es-host
with your actual credentials and host.Note: This project will not start if your cluster does not have a valid license (trial, platinum, enterprice etc.).
Hydrolix time-series datalake integration providing schema exploration and query capabilities to LLM-based workflows.
MCP server for autonomous data exploration on .csv-based datasets, providing intelligent insights with minimal effort.
Interact with Supabase databases, storage, and edge functions.
Full Featured MCP Server for MongoDB Database.
Interact with Neon Postgres databases using natural language to manage projects, branches, queries, and migrations via the Neon API.
Connects to Supabase platform for database, auth, edge functions and more.
Interact with the Stellar blockchain to manage wallets, list tokens, query balances, and transfer funds.
Connect to any relational database, and be able to get valid SQL, and ask questions like what does a certain column prefix mean.
Vector search using the LanceDB vector database and Ollama embedding models.
An MCP server for integrating with SAP OData services, configured via environment variables.