Kibana Reader MCP
一个用于读取 Kibana 页面内容的 MCP Server,支持钉钉扫码登录。
功能
- 读取 Kibana Discover 页面数据
- 读取 Kibana Dashboard 页面数据
- 支持短 URL 自动重定向
- 自动管理 Cookie/Session
- 支持钉钉扫码认证
安装
pip install kibana-reader-mcp
playwright install chromium
配置
方式一:配置文件
创建配置文件 ~/.kibana-reader-mcp/config.json:
{
"kibana_base_url": "https://your-kibana.example.com",
"session_file": "~/.kibana-reader-mcp/session.json",
"playwright_headless": false,
"scan_timeout_seconds": 120,
"default_max_rows": 100
}
方式二:环境变量
export KIBANA_BASE_URL="https://your-kibana.example.com"
export PLAYWRIGHT_HEADLESS=false
export SCAN_TIMEOUT_SECONDS=120
客户端配置
Claude Desktop
编辑 ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"kibana-reader": {
"command": "uvx",
"args": ["kibana-reader-mcp"],
"env": {
"KIBANA_BASE_URL": "https://your-kibana.example.com"
}
}
}
}
Claude Code
编辑 ~/.claude/settings.json:
{
"mcpServers": {
"kibana-reader": {
"command": "uvx",
"args": ["kibana-reader-mcp"],
"env": {
"KIBANA_BASE_URL": "https://your-kibana.example.com"
}
}
}
}
Cursor / Windsurf / Codex
在 MCP 设置中添加服务器配置,格式同上。
使用示例
AI: 调用 read_kibana_url
参数:
- url: "https://your-kibana/goto/abc123"
- max_rows: 100
返回: Kibana 页面的结构化数据
认证流程
- 首次使用时,MCP 会打开浏览器显示钉钉扫码页面
- 用户扫码登录后,MCP 自动保存 Cookie
- 后续调用直接使用保存的 Cookie
- Cookie 过期时自动提示重新扫码
URL 类型支持
| 类型 | 示例 | 处理方式 |
|---|---|---|
| 短 URL | /goto/abc123 |
Playwright 重定向 |
| Discover | /app/kibana#/discover |
API 调用 |
| Dashboard | /app/kibana#/dashboard |
API 调用 |
开发
# 安装开发依赖
pip install -e ".[dev]"
# 运行测试
pytest
License
MIT
Metadata
Release files for kibana-reader-mcp 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| kibana_reader_mcp-0.1.0.tar.gz | 12.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| kibana_reader_mcp-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 28.3 kB
Release files / kibana_reader_mcp-0.1.0.tar.gz
| Download URL | kibana_reader_mcp-0.1.0.tar.gz |
|---|---|
| Size | 12.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d77f3222cd2efc70ecaabd47f1b27c992a2599103ae32072ea5767454650c1d8
|
|
BLAKE2b-256 checksum How to use checksums |
e58d760cab252652d88ae8e6167e83273e3b6053b2eae8bfe4d722839ddd76bb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|
Release files / kibana_reader_mcp-0.1.0-py3-none-any.whl
| Download URL | kibana_reader_mcp-0.1.0-py3-none-any.whl |
|---|---|
| Size | 15.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d7296a133b4012ef772cee2dd18a71756951635475fe68379a6a57f9af41fde0
|
|
BLAKE2b-256 checksum How to use checksums |
a60d78fcc957bf310caf76970c6ef9b1915d858995b179f782e9d191fcc59039
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|