io.github.CloudCorpRecords/indexsearch

السجل الرسمي البحث والويب

Elasticsearch tools: indices, mappings, query DSL search, ES|QL, and shards.

التثبيت

أضف هذا إلى إعدادات MCP في عميلك (Claude Desktop: claude_desktop_config.json، وCursor: ‏.cursor/mcp.json، ويستخدم VS Code وغيره الصيغة نفسها «mcpServers»).

NPM package @reneturcios/indexsearch
Claude Code
claude mcp add indexsearch -- npx -y @reneturcios/indexsearch@0.1.0 mcp
إعداد JSON (Claude Desktop وCursor وVS Code)
{
    "mcpServers": {
        "indexsearch": {
            "command": "npx",
            "args": [
                "-y",
                "@reneturcios/indexsearch@0.1.0",
                "mcp"
            ]
        }
    }
}
OCI package ghcr.io/cloudcorprecords/indexsearch:0.1.0
Claude Code
claude mcp add indexsearch -- docker run -i --rm ghcr.io/cloudcorprecords/indexsearch:0.1.0 mcp
إعداد JSON (Claude Desktop وCursor وVS Code)
{
    "mcpServers": {
        "indexsearch": {
            "command": "docker",
            "args": [
                "run",
                "-i",
                "--rm",
                "ghcr.io/cloudcorprecords/indexsearch:0.1.0",
                "mcp"
            ]
        }
    }
}

التوثيق

مأخوذ من ملف README للمشروع على GitHub ويُحدَّث أسبوعيًا. تفتح الروابط على GitHub.

المحتويات
  1. indexsearch
  2. Install
  3. Configuration
  4. CLI
  5. MCP server
  6. Development
  7. License

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-indices

Or run the container image:

docker run -i ghcr.io/cloudcorprecords/indexsearch

The 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=...).

Configuration

VariableMeaningDefault
ES_URLCluster base URLhttp://localhost:9200
INDEXSEARCH_URLFallback cluster base URL when ES_URL is unset—
ES_API_KEYAPI key, sent as Authorization: ApiKey <key>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 --version

Exit 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 mcp

MCP client configuration:

{
  "mcpServers": {
    "indexsearch": {
      "command": "npx",
      "args": ["-y", "@reneturcios/indexsearch", "mcp"],
      "env": { "ES_URL": "http://localhost:9200" }
    }
  }
}
Tools
ToolRequiredOptionalHTTP requestWhat it does
list_indices——GET /_cat/indices?format=jsonList all available indices
get_mappingsindex—GET /{index}/_mappingGet field mappings for an index
searchindex, query (object)—POST /{index}/_search with { "query": ... }Search using query DSL
esqlquery (string)—POST /_query with { "query": ... }Run an ESQL query
get_shards—indexGET /_cat/shards[/{index}]?format=jsonGet 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 tsx

Request 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.

الأسئلة الشائعة

ما هو io.github.CloudCorpRecords/indexsearch؟

Elasticsearch tools: indices, mappings, query DSL search, ES|QL, and shards.

كيف أثبّت io.github.CloudCorpRecords/indexsearch؟

يعمل على جهازك. في Claude Code: claude mcp add indexsearch -- npx -y @reneturcios/indexsearch@0.1.0 mcp. وفي العملاء الآخرين، الصق إعداد JSON من هذه الصفحة في إعدادات MCP الخاصة بهم.

هل يحتاج io.github.CloudCorpRecords/indexsearch إلى مفتاح API؟

لا يذكر إدراجه في السجل أي مفتاح أو سر إلزامي. قد تتطلب بعض الميزات حسابًا لدى الخدمة التي يتصل بها.

هل io.github.CloudCorpRecords/indexsearch مفتوح المصدر؟

نعم. شيفرته متاحة على GitHub بترخيص MIT.

من يصون io.github.CloudCorpRecords/indexsearch؟

ينشره CloudCorpRecords. يدرجه AI.tn لكنه لا يصونه ولا يوصي به.

من سجل MCP الرسمي. الإدراج ليس توصية: راجع شيفرة الخادم وصلاحياته قبل منحه الوصول إلى بياناتك.