indexsearch
Provides tools for interacting with an Elasticsearch cluster's HTTP API, including listing indices, reading field mappings, running query DSL searches, executing ES|QL queries, and inspecting shard placement.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@indexsearchsearch the products index for shoes with a match query on name"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
indexsearch
indexsearch gives an agent — or you, at a terminal — the five core Elasticsearch tools: see which indices exist, read an index's field mappings, run a search in query DSL, run an ES|QL query, and inspect shard placement. Everything goes through the cluster's own HTTP API; there is no bundled client library and no second query language to learn.
Each tool call is first mapped to a plain HTTP request — method, path,
and JSON body — and that mapping is the whole contract:
GET /_cat/indices?format=json, GET /{index}/_mapping,
POST /{index}/_search, POST /_query, GET /_cat/shards. Transport
is an injectable fetch function, which is what the test suite drives;
no live cluster is needed to verify behaviour, and no result is ever
invented when a cluster is unreachable or answers with an error.
Install
npx @reneturcios/indexsearch list-indicesOr run the container image:
docker run -i ghcr.io/cloudcorprecords/indexsearchThe container defaults to the MCP server (see below). Pass CLI
arguments to use it as a CLI instead, and pass the cluster settings as
environment variables (-e ES_URL=...).
Related MCP server: Elastic MCP
Configuration
Variable | Meaning | Default |
| Cluster base URL |
|
| Fallback cluster base URL when | — |
| API key, sent as | unset (no auth) |
CLI
# List indices
indexsearch list-indices
# Read one index's field mappings
indexsearch mappings products
# Search with query DSL (a bare clause, or a full {"query": ...} body)
indexsearch search products '{"match":{"name":"shoes"}}'
# Run an ES|QL query
indexsearch esql 'FROM products | SORT price DESC | LIMIT 5'
# Shard information for every index, or for one
indexsearch shards
indexsearch shards products
# Start the MCP server
indexsearch mcp
indexsearch --versionExit codes: 0 on success, 1 when the request or the cluster
fails (the error names the HTTP status or the unreachable URL),
2 for usage errors.
Index names are validated before any request is made: names carrying
characters Elasticsearch forbids in index names (whitespace, /, *,
?, ", <, >, |, ,, #, :, \) are rejected locally.
MCP server
One bin serves both faces. The mcp subcommand starts a stdio MCP
server:
npx -y @reneturcios/indexsearch mcpMCP client configuration:
{
"mcpServers": {
"indexsearch": {
"command": "npx",
"args": ["-y", "@reneturcios/indexsearch", "mcp"],
"env": { "ES_URL": "http://localhost:9200" }
}
}
}Tools
Tool | Required | Optional | HTTP request | What it does |
| — | — |
| List all available indices |
|
| — |
| Get field mappings for an index |
|
| — |
| Search using query DSL |
|
| — |
| Run an ES |
| — |
|
| Get shard information for all or specific indices |
Replies are returned as the cluster's parsed JSON. A non-JSON reply is
returned under a raw key rather than being dropped, and an empty
reply reads as an empty object.
Development
npm install
npm run build # tsc -> dist/
npm test # node test runner over test/*.test.ts, no network, no live cluster
npm run dev # run the CLI from source via tsxRequest construction, validation, header and body assembly, error surfacing, and settings resolution are all covered by tests that drive the core through a fake fetch and assert the exact paths and bodies.
License
MIT — see LICENSE.
This server cannot be deployed
Maintenance
Related MCP Connectors
Call third-party APIs from agents without leaking secrets. SSRF blocked, per-key quotas.
Provides capabilities that let LLM agents perform a range of infrastructure management tasks.
Read-only AgentiScript concept search, catalog, authenticity, license, and approved asset discovery.
Query Klaaro datasets, documents, and extracted records from any agent.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceConnects agents to Elasticsearch data using the Model Context Protocol, allowing natural language interaction with Elasticsearch indices through tools for listing indices, getting field mappings, performing searches, and viewing shard information.2,169 npmApache 2.0
- FlicenseBqualityDmaintenanceConnects to Elasticsearch clusters through the Model Context Protocol, enabling natural language querying and management of Elasticsearch data. Provides tools to search indices, list available indices, and retrieve index mappings.3-
- FlicenseBqualityNot gradedmaintenanceProvides comprehensive tools for managing Elasticsearch clusters, including security management, search operations, and index administration. It enables users to monitor cluster health, handle InfoSec tasks, and execute complex queries using Elasticsearch Query DSL and ES|QL.37-
- AlicenseBqualityDmaintenanceEnables interaction with Elasticsearch clusters for health checks, index management, document CRUD operations, and search via natural language.103 npmMIT