list_indicesLABSCO SUMMARY
The harness stops doomed queries and returns the nearest real fields instead.
A spurious .keyword suffix is corrected silently and the correction reported; an unknown field blocks the query and comes back with live suggestions rather than a provider error. That is the difference between an agent that iterates productively and one that retries the same broken DSL. The gate to clear first is licensing — a basic cluster will not run this at all, so activate a trial before troubleshooting anything else.
What it is
An Elasticsearch server aimed at security analysis, threat hunting and incident investigation. Its distinguishing piece is a query harness sitting between the model and the cluster: intent comes from the model, correctness comes from the harness, which validates field names against the cluster's real capabilities before anything executes.
What you get
es_searchruns full Query DSL with auto-highlighting, plus harness validation and auto-fixesql_queryruns pipe-based ES|QL with the same validation and tabular output, on ES 8.11+ clusterslookup_fieldsfinds the right field names by intersecting the bundled ECS vocabulary with the index's actual fields — so the full dictionary stays out of the context windowlist_indicesandget_mappingswith pattern, health and field filters, flat, tree or raw modes and multi-index compareget_shardsreports shard health with problem detection, andlist_data_streamscovers ILM and backing indices on ES 7.9+execute_es_apicalls any REST endpoint directly when the typed tools do not cover it- Version detection is automatic across ES 5.x to 9.x — unsupported tools are simply not registered, and
skip_lint: truebypasses validation for edge cases such as externally defined runtime fields
Requirements
An Elasticsearch instance with a valid licence — trial, platinum or enterprise; the server will not start without one, and a 30-day trial can be activated through the cluster's _license/start_trial endpoint. ES_URL is required; authenticate with ES_API_KEY or with ES_USERNAME and ES_PASSWORD. ES_CA_CERT points at a custom CA and NODE_TLS_REJECT_UNAUTHORIZED set to 0 disables certificate validation for development only. MAX_TOKEN_CALL defaults to 20000. The npm package is @tocharianou/elasticsearch-mcp, version 0.9.0, needing Node 18+; MCP_TRANSPORT=http switches to a standalone HTTP server on MCP_HTTP_PORT, defaulting to 3000.
Setup effort
One command — npm install -g @tocharianou/elasticsearch-mcp
USE CASES
Investigating a suspected brute-force attempt
Ask about failed logins over a window and let the harness resolve the real field names.
Not knowing what your fields are called
Look up candidate fields against the index's actual mapping instead of guessing at ECS names.
Aggregating without writing JSON DSL
Use a pipe-based ES|QL query for counts and averages by service or host.
Working out which index to query
List indices by pattern and health, then read the mapping for the one that matters.
Checking cluster health mid-investigation
Read shard status with the problem detection rather than interpreting raw shard output.
8 tools
Listed in project docs. Your client may show a different list.
get_mappingses_searchlookup_fieldsexecute_es_apiget_shardslist_data_streamsesql_queryBEFORE YOU INSTALL
What to know first
Tools you get
8 tools named in the project's documentation.
Requires
- Node version — requires Node 18+
- ES_URL in your environment
Optional
- ES_API_KEY in your environment
- ES_PASSWORD in your environment
- ES_USERNAME in your environment
INSTALLATION
Connect your client
Server setup
npm install -g @tocharianou/elasticsearch-mcpMCP Clients
Claude Desktop
{
"mcpServers": {
"elasticsearch-mcp-server": {
"command": "npx",
"args": [
"@tocharianou/elasticsearch-mcp"
],
"env": {
"ES_URL": "<YOUR_ES_URL>",
"ES_USERNAME": "elastic",
"ES_PASSWORD": "<YOUR_ES_PASSWORD>",
"NODE_TLS_REJECT_UNAUTHORIZED": "0"
}
}
}
}Claude Code
claude mcp add elasticsearch -e ES_URL=https://<YOUR_ELASTICSEARCH_HOST>:9200 -e ES_API_KEY=<YOUR_ES_API_KEY> -- npx @tocharianou/elasticsearch-mcpPlatforms — HTTP mode
MCP_TRANSPORT=http ES_URL=<YOUR_ES_URL> ES_USERNAME=elastic ES_PASSWORD=<YOUR_ES_PASSWORD> npx @tocharianou/elasticsearch-mcp