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.2.tar.gz (63.3 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.2-py3-none-any.whl (17.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for plumelog_search-0.1.2.tar.gz
Algorithm Hash digest
SHA256 a0a7091fb48a3e5a9aa57d96a1fdfaac36fddedfd97553a5c531e94f0cb45e7f
MD5 5b5d90583652a06fd05bfa3653a2a687
BLAKE2b-256 fa500f1b12f94e91cfa408e03ae601a8a8b7a90d0aa2f06a4059ad9fc96393a4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for plumelog_search-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 90e28b7ad18db980a50736f986dae93b2a36c54c6603ad31178b845f00a3f6a9
MD5 f32fa46dc12beeb8d5726d8e5e03de94
BLAKE2b-256 752b17d710b85d98a690a61675a6a6e540b4d07a0e23a60906eceaa806e93718

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