Borrowing it
Nothing to install: this file belongs to csimi/elastic-mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/csimi/elastic-mcp/master/CLAUDE.mdgit clone --depth 1 https://github.com/csimi/elastic-mcpWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/instructions/csimi/elastic-mcp/claude-md)<a href="https://agentmods.dev/instructions/csimi/elastic-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/csimi/elastic-mcp/claude-md/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/instructions/csimi/elastic-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/csimi/elastic-mcp/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.01210 | $0.01210 |
| Opus 5.5 | $0.00484 | $0.00484 |
| Sonnet 5.5 | $0.00242 | $0.00242 |
| Haiku 4.5 | $0.00121 | $0.00121 |
Grade A, and why
elastic-mcp CLAUDE.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 86 lines — stays where its author put it; the contents beside it link to each section on GitHub.
CLAUDE.md
Guidance for AI assistants (and humans) working in this repository.
This project was vibe coded. It is typechecked and unit-tested; keep both green on every change.
What this is
A Model Context Protocol (MCP) server for Elasticsearch, over the stdio transport. Read-only by default,
with optional write tools. Written in JavaScript with JSDoc types checked by TypeScript (@ts-check /
checkJs) — there is no build step; the .js files in src/ are what runs.
Commands
npm run typecheck # tsc --noEmit (must pass)
npm test # node --test (must pass)
npm start # node src/index.js (needs ELASTICSEARCH_URL)
Project layout
src/
index.js entry point; resolves version, builds client + server, wires stdio
server.js builds the MCP server and registers tool groups
es-client.js config parsing, version probe/selection, client construction
connection.js base-path-aware UndiciConnection subclass (factory)
util.js tool-result + error helpers (jsonResult, errorResult, toToolResult, isAuthorizationError)
tools/
search.js search, count, esql, get_document
indices.js list_indices, get_mapping, get_settings, get_aliases, list_shards
cluster.js cluster_health, cluster_stats, cluster_info, list_nodes
kibana.js get_kibana_object
write.js index_document, update_document, delete_document, create_index, delete_index
test/
config.test.js readConfig / splitOriginAndPrefix
util.test.js tool-result helpers
server.test.js end-to-end tool routing against a fake Elasticsearch HTTP server
Architecture notes
- Base path support (
connection.js): the official client routes requests against the node origin only and drops any URL path.createPrefixedConnection(UndiciConnectionBase, prefix)returns a subclass that re-prepends the prefix to every request. The base class is passed in so each client major subclasses its own bundledUndiciConnection. - Dual 8.x / 9.x support (
es-client.js): the v9 client sendscompatible-with=9, which 8.x clusters reject. Both client majors are installed (@elastic/elasticsearchfor v9, theelasticsearch8alias for v8).resolveMajor()honorsELASTICSEARCH_API_VERSION, else probes the root endpoint with a plainapplication/jsonrequest. The probe needscluster:monitor/main; on any failure it falls back to the v8 client, which both 8.x and 9.x accept. Cross-major type incompatibilities are bridged with casts confined to the v8 branch ofcreateClient. - Privilege fallbacks (
tools/indices.js):list_indicesfalls back from_cat/indices(needs clustermonitor) to_resolve/index, andget_mappingfromgetMapping(needsview_index_metadata) to_field_caps(needs onlyread). Each remembers the authorization failure in a closure flag for the process lifetime so it stops retrying the rejected endpoint. - Kibana saved objects (
tools/kibana.js):get_kibana_objectreads.kibana_analytics+.kibanadirectly (user content vs. system content), decodes the JSON-as-string fields Kibana stores inline (visState,searchSourceJSON, ...) viadecodeInlineJson, and resolves eachreferences[]entry to its title. Those are restricted system indices, so the API key needs anallow_restricted_indicesread entry on.kibana*. - Results & errors (
util.js): every tool returns throughtoToolResult, which serializes success withjsonResultand converts throws witherrorResult.errorResultsurfaces ElasticsearchResponseErrorstatus + reason and never emits"[object Object]". UseisAuthorizationErrorto detect 403 /security_exception. - Write tools are off by default; registered only when
ELASTICSEARCH_ENABLE_WRITES=true(server.js). Mutating tools carrydestructiveHintannotations.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2mo ago First seen · 86 lines · 1,210 tokens per session scan A 2662df5ee46b
elastic-mcp CLAUDE.md is an instructions file published in the GitHub repository csimi/elastic-mcp (1 stars, last pushed 2mo ago), licensed ISC. It adds 1,210 tokens to every session, about $0.0048 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
elastic-mcp CLAUDE.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| elastic-mcp CLAUDE.mdcsimi/elastic-mcp | Instructions file | 1 | 2mo ago | ISC | A | 1,210 | Claude Code |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 9,719 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 143k | yesterday | MIT | A | 7,461 | Codex, OpenCode |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 149k | yesterday | MIT | A | 4,680 | Codex, OpenCode |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 5,516 | GitHub Copilot |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 3,093 | GitHub Copilot |
| deepseek-harness AGENTS.mddeepseek-ai/deepseek-harness | Instructions file | 274k | 2d ago | MIT | A | 4,313 | Codex, OpenCode |