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-DD 或 YYYY-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
Release history Release notifications | RSS feed
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.1.tar.gz
(39.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file plumelog_search-0.1.1.tar.gz.
File metadata
- Download URL: plumelog_search-0.1.1.tar.gz
- Upload date:
- Size: 39.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9fdec7c093e3463c1231a2e91c914db27425a065073c5439e2fd421041be3e37
|
|
| MD5 |
bac21e3fceedb1a4b72790ef4a2af621
|
|
| BLAKE2b-256 |
24787d86c46b15f5e48914bfc825dc64ce42bda5abd0a0e1a7453185858c3ff5
|
File details
Details for the file plumelog_search-0.1.1-py3-none-any.whl.
File metadata
- Download URL: plumelog_search-0.1.1-py3-none-any.whl
- Upload date:
- Size: 17.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a97ab5d0a9b224da68a1f77d61e94131accebc40ad325357893919671bdda5ee
|
|
| MD5 |
1a9db88c83423e0ab66fbbce959e71c6
|
|
| BLAKE2b-256 |
a30ee68e99a41f51383b84293462814ef97a785f0cf8e8ce92417fa562c39599
|