Kibana Mcp

io.github.mshegolev由 GitHub 帳號 mshegolev 發布v0.1.1更新於 Oct 25, 2026

Kibana/Elasticsearch MCP — log search, aggregations, index discovery, dashboards.

已驗證STDIO僅桌面安全與監控資料與分析

概覽

AI 產生的概覽

針對 Kibana 與 Elasticsearch 的唯讀 MCP 伺服器,讓助理搜尋日誌、執行聚合、列出索引並瀏覽儀表板。

可以做什麼
列出索引及其健康狀態、文件數與大小,可依模式篩選。在指定索引中依全文查詢、時間範圍、排序與結果數量搜尋日誌。依欄位對日誌聚合,支援計數、平均值、加總、最小值與最大值指標。列出已儲存的儀表板,支援搜尋與分頁,並取得單一儀表板及其面板明細。結果同時以結構化 JSON 與 markdown 文字回傳。
適用情境
適合助理在排查問題或回顧事故時檢索日誌、依等級或服務統計錯誤、確認有哪些索引,或查找 Kibana 儀表板,不必開啟 Kibana 介面。
執行需求
以本機 Python 套件執行(pip install kibana-mcp 或 uvx kibana-mcp),也可使用 Docker 映像。必須設定 KIBANA_URL;可選 ELASTICSEARCH_URL 直連 Elasticsearch,否則請求會經 Kibana Console 代理轉送。驗證使用 KIBANA_API_KEY,或 KIBANA_USERNAME 搭配 KIBANA_PASSWORD,也可匿名存取。自簽憑證可將 KIBANA_SSL_VERIFY 設為 false。需要能連線至 Kibana 或 Elasticsearch 主機的網路。
安裝前請注意
需要 Kibana 或 Elasticsearch 執行個體的憑證:KIBANA_API_KEY 與 KIBANA_PASSWORD 屬於機密,應透過環境變數提供,不要寫入程式碼庫。將 KIBANA_SSL_VERIFY 設為 false 會關閉憑證驗證。伺服器自稱唯讀,但所用憑證的權限可能大於工具實際使用範圍,建議依需求限縮 API key 權限。日誌資料會作為工具結果傳送給助理所用的模型供應商。

安裝

在 SourceWeft 中

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

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

其他 MCP 客戶端

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

README

kibana-mcp

[PyPI version] [Python 3.10+] [License: MIT] [Tests]

MCP server for Kibana / Elasticsearch — log search, aggregations, index discovery, and dashboard browsing via Claude and any MCP-compatible agent.

Why another Kibana MCP?

Existing integrations require a running Kibana instance with browser-level credentials and often wrap the Kibana UI rather than the stable REST APIs. This server:

  • Hits Elasticsearch REST API directly for log queries (faster, stable across Kibana UI changes)
  • Falls back to the Kibana Console proxy when no direct ES URL is configured (zero extra firewall rules)
  • Supports ApiKey auth (best for agents) as well as Basic auth and anonymous access
  • Returns both structured JSON (outputSchema) and markdown text so it works with any MCP client
  • Is read-only — all tools carry readOnlyHint: true, no data is modified

Tools

ToolAPIDescription
kibana_list_indicesGET ES/_cat/indicesDiscover available indices with health, docs, size
kibana_search_logsPOST ES/{index}/_searchFull-text log search with time range, sort, size
kibana_aggregate_logsPOST ES/{index}/_searchTerms grouping with count/avg/sum/min/max metric
kibana_list_dashboardsGET Kibana/api/saved_objects/_findList saved dashboards with search + pagination
kibana_get_dashboardGET Kibana/api/saved_objects/dashboard/{id}Fetch one dashboard with panel breakdown

Installation

bash
pip install kibana-mcp

Or run directly with uvx:

bash
uvx kibana-mcp

Configuration

Environment Variables

VariableRequiredDescription
KIBANA_URLYesKibana base URL (e.g. https://kibana.example.com)
ELASTICSEARCH_URLNoDirect ES endpoint. If unset, ES requests go through Kibana Console proxy
KIBANA_API_KEYNoES API key (ApiKey base64(id:api_key) format). Recommended for agents
KIBANA_USERNAMENoHTTP Basic auth username (used if API key not set)
KIBANA_PASSWORDNoHTTP Basic auth password
KIBANA_SSL_VERIFYNotrue (default) or false for self-signed certificates

Auth priority: ApiKey > Basic > anonymous.

Copy .env.example to .env and fill in your values.

MCP Client Configuration (Claude Desktop / claude.app)

json
{  "mcpServers": {    "kibana": {      "command": "uvx",      "args": ["kibana-mcp"],      "env": {        "KIBANA_URL": "https://kibana.example.com",        "KIBANA_API_KEY": "your-api-key-here"      }    }  }}

Or with direct ES access for better performance:

json
{  "mcpServers": {    "kibana": {      "command": "uvx",      "args": ["kibana-mcp"],      "env": {        "KIBANA_URL": "https://kibana.example.com",        "ELASTICSEARCH_URL": "https://es.example.com:9200",        "KIBANA_API_KEY": "your-api-key-here"      }    }  }}

Docker

bash
docker run --rm -i \  -e KIBANA_URL=https://kibana.example.com \  -e KIBANA_API_KEY=your-key \  ghcr.io/mshegolev/kibana-mcp

Usage Examples

Log Search

Find the last 50 ERROR logs from the API service in the last hour

→ kibana_search_logs(index="logs-*", query="level:ERROR AND service:api", size=50, time_from="2026-04-18T09:00:00Z")

Show 500 HTTP errors sorted oldest first for incident replay

→ kibana_search_logs(index="nginx-*", query="status:500", sort_order="asc", size=100)

Aggregations

How many logs per log level in the last hour?

→ kibana_aggregate_logs(index="logs-*", group_by="level", time_from="2026-04-18T09:00:00Z")

What is the average response time per service?

→ kibana_aggregate_logs(index="logs-*", group_by="service.keyword", metric="avg", metric_field="response_time_ms")

Index Discovery

What log indices are available?

→ kibana_list_indices()

Show me all filebeat indices

→ kibana_list_indices(pattern="filebeat-*")

Dashboards

Find the infrastructure dashboard

→ kibana_list_dashboards(search="infrastructure")

What panels does dashboard X have?

→ kibana_get_dashboard(dashboard_id="<id from list_dashboards>")

Performance Characteristics

  • Log search (kibana_search_logs): typically 50-500ms with direct ES URL; add 100-200ms when routing through Kibana Console proxy
  • Aggregations (kibana_aggregate_logs): size:0 queries — no hits transferred, usually 10-100ms
  • Index listing: single _cat/indices call, O(index_count) response, typically <100ms
  • Dashboard APIs: Kibana Saved Objects API, typically 50-200ms; latency is Kibana-side, not network
  • Set ELASTICSEARCH_URL directly if your agent does frequent log searches — eliminates the proxy overhead

Development

bash
git clone https://github.com/mshegolev/kibana-mcpcd kibana-mcppip install -e '.[dev]'pytest tests/ -vruff check src testsruff format src tests

License

MIT — see LICENSE.

來源:README.md,提交 b1c596c

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.1.1最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

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

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

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

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分