Skip to main content

MCP server for querying LogBook logs

Project description

plumelog-search

基于 Plume Log 的 MCP Server,提供日志查询工具,可集成到 Cursor 等支持 MCP 协议的编辑器中。

功能

  • 通过 MCP 协议暴露 search_logs 工具
  • 自动管理登录会话(cookie),401 时自动重登录
  • 支持按时间范围、追踪码、服务器、应用名、日志内容等条件查询
  • 内容查询支持两种模式:精确查询和布尔条件查询
  • 自动格式化响应,只返回关键字段

环境要求

  • Python >= 3.14
  • uv

配置

在 Cursor 的 MCP 配置文件(.cursor/mcp.json)中添加:

{
  "mcpServers": {
    "plumelog-search": {
      "command": "uvx",
      "args": ["--from", "/path/to/plumelog-search", "plumelog-search"],
      "env": {
        "LOGBOOK_USERNAME": "your_username",
        "LOGBOOK_PASSWORD": "your_password",
        "LOGBOOK_BASE_URL": "https://your-logbook-server.com"
      }
    }
  }
}
环境变量 必填 说明
LOGBOOK_USERNAME 登录账号
LOGBOOK_PASSWORD 登录密码
LOGBOOK_BASE_URL LogBook 服务地址

工具参数

search_logs

参数 类型 必填 默认值 说明
start_time string - 开始时间,YYYY-MM-DDYYYY-MM-DD HH:mm:ss
end_time string - 结束时间,同上
content string - 查询内容(见下方说明)
content_mode string "query" "query""condition"
trace_id string - 追踪码
server_name string - 服务器名称或 IP
app_name string - 应用名称
size int 100 返回条数上限,最大 500

内容查询模式

query 模式(默认):传入带引号的字符串进行精确匹配

"关键词"

condition 模式:支持布尔语法

"关键词1" AND "关键词2" NOT "排除词" OR "备选词"

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

plumelog_search-0.1.0.tar.gz (39.2 kB view details)

Uploaded Source

Built Distribution

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

plumelog_search-0.1.0-py3-none-any.whl (17.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: plumelog_search-0.1.0.tar.gz
  • Upload date:
  • Size: 39.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.3

File hashes

Hashes for plumelog_search-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bf360bb6dd7706cbc300064c1b992425c6402d52f05372907a52071f3fb540be
MD5 7f2d9105eb0139d6eab6b27fbc946ece
BLAKE2b-256 64e32dd663fc2629137f39cd4fccc969b7a69de2313de7e915d933b9525ee00c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for plumelog_search-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 41f7ffa5830dfff821d8050a0b321745116281c26f62768953c2979a2b461540
MD5 833cd8ff94bd260e1692866fd140588d
BLAKE2b-256 77f19660a6879c5153957eca52dc05cb5150bca60526c4486a69659c971ff1df

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