Indexsearch

io.github.CloudCorpRecords由 GitHub 帳號 CloudCorpRecords 發布v0.1.0更新於 Nov 7, 2026

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

已驗證STDIO僅桌面資料庫資料與分析

概覽

AI 產生的概覽

Elasticsearch MCP 伺服器,讓助理列出索引、讀取欄位對應、執行 query DSL 搜尋與 ES|QL 查詢,並檢視分片資訊。

可以做什麼
  • 列出索引並檢視叢集的分片分布
  • 讀取指定索引的欄位對應
  • 使用 Elasticsearch query DSL 對索引執行搜尋
  • 透過叢集查詢端點執行 ES|QL 查詢
  • 回傳叢集解析後的 JSON 結果,非 JSON 回覆保留在 raw 欄位中
適用情境
適合需要探查或查詢既有 Elasticsearch 叢集的情況:確認有哪些索引、在撰寫查詢前了解資料結構、執行臨時搜尋或 ES|QL 查詢,或排查分片配置。
執行需求
透過 npx 或 Docker 映像以 stdio 在本機執行,mcp 子命令會啟動伺服器。需要可連線的 Elasticsearch 叢集,以 ES_URL(預設 INDEXSEARCH_URL 指定,可選用 ES_API_KEY 進行驗證。未宣告其他帳號或憑證。
安裝前請注意
ES_API_KEY 會以 Authorization 標頭送出,權限取決於叢集授予的範圍,建議使用唯讀金鑰。搜尋與 ES|QL 查詢會送往叢集,可能耗費資源或回傳敏感索引資料。索引名稱僅在本機驗證,伺服器不限制助理可存取的索引或可執行的查詢。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Indexsearch,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

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

bash
npx @reneturcios/indexsearch list-indices

Or run the container image:

bash
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

bash
# List indicesindexsearch list-indices
# Read one index's field mappingsindexsearch mappings products
# Search with query DSL (a bare clause, or a full {"query": ...} body)indexsearch search products '{"match":{"name":"shoes"}}'
# Run an ES|QL queryindexsearch esql 'FROM products | SORT price DESC | LIMIT 5'
# Shard information for every index, or for oneindexsearch shardsindexsearch shards products
# Start the MCP serverindexsearch 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:

bash
npx -y @reneturcios/indexsearch mcp

MCP client configuration:

json
{  "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 ES
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

bash
npm installnpm run build   # tsc -> dist/npm test        # node test runner over test/*.test.ts, no network, no live clusternpm 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.

來源:README.md,提交 0798c6b

工具

5

list_indices

List all available Elasticsearch indices

無需輸入參數。

get_mappings

Get field mappings for a specific Elasticsearch index

輸入參數index必填

esql

Perform an Elasticsearch ES|QL query

輸入參數query必填

get_shards

Get shard information for all or specific indices

輸入參數index

版本歷史

1
  1. v0.1.0最新Oct 31, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分