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.0.tar.gz
(39.2 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.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bf360bb6dd7706cbc300064c1b992425c6402d52f05372907a52071f3fb540be
|
|
| MD5 |
7f2d9105eb0139d6eab6b27fbc946ece
|
|
| BLAKE2b-256 |
64e32dd663fc2629137f39cd4fccc969b7a69de2313de7e915d933b9525ee00c
|
File details
Details for the file plumelog_search-0.1.0-py3-none-any.whl.
File metadata
- Download URL: plumelog_search-0.1.0-py3-none-any.whl
- Upload date:
- Size: 17.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
41f7ffa5830dfff821d8050a0b321745116281c26f62768953c2979a2b461540
|
|
| MD5 |
833cd8ff94bd260e1692866fd140588d
|
|
| BLAKE2b-256 |
77f19660a6879c5153957eca52dc05cb5150bca60526c4486a69659c971ff1df
|