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 分