Skip to main content

MCP server for reading Kibana pages with DingTalk scan login

Project description

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 页面的结构化数据

认证流程

  1. 首次使用时,MCP 会打开浏览器显示钉钉扫码页面
  2. 用户扫码登录后,MCP 自动保存 Cookie
  3. 后续调用直接使用保存的 Cookie
  4. Cookie 过期时自动提示重新扫码

URL 类型支持

类型 示例 处理方式
短 URL /goto/abc123 Playwright 重定向
Discover /app/kibana#/discover API 调用
Dashboard /app/kibana#/dashboard API 调用

开发

# 安装开发依赖
pip install -e ".[dev]"

# 运行测试
pytest

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kibana_reader_mcp-0.1.0.tar.gz (12.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kibana_reader_mcp-0.1.0-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

File details

Details for the file kibana_reader_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: kibana_reader_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 12.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for kibana_reader_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d77f3222cd2efc70ecaabd47f1b27c992a2599103ae32072ea5767454650c1d8
MD5 384972ee0af73aac44b8c11b51421398
BLAKE2b-256 e58d760cab252652d88ae8e6167e83273e3b6053b2eae8bfe4d722839ddd76bb

See more details on using hashes here.

File details

Details for the file kibana_reader_mcp-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for kibana_reader_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d7296a133b4012ef772cee2dd18a71756951635475fe68379a6a57f9af41fde0
MD5 543b99f87458ab061de5911819c65abd
BLAKE2b-256 a60d78fcc957bf310caf76970c6ef9b1915d858995b179f782e9d191fcc59039

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page