Log

io.github.rog0x由 GitHub 账号 rog0x 发布v1.0.2更新于 Oct 25, 2026

Log parse, filter, analyze for AI agents

已验证STDIO仅桌面开发者工具数据与分析

概览

AI 生成的概览

本地 MCP 服务器,让 AI 助手解析、过滤、分析、格式化并汇总 JSON、Apache/Nginx、syslog 等常见格式的日志

可以做什么
解析 JSON、Apache/Nginx、syslog 和结构化格式的日志,或用带命名捕获组的自定义正则解析,提取时间戳、级别、消息和来源字段。按级别、ISO 8601 日期范围、关键词、正则或来源过滤条目,并返回各级别计数。分析日志模式,给出高频错误、按时间的错误率、请求量、最慢端点和异常检测。在 JSON、纯文本、CSV 和表格之间转换,按级别着色并生成汇总报告。统计级别分布、日期覆盖范围、唯一 IP、常见 User-Agent、HTTP 状态码和吞吐量。
适用场景
当你手上有日志文件或粘贴的日志文本,希望助手排查错误、按时间或级别筛选、发现尖峰和最慢端点,或把原始日志整理成可读报告,而不想自己写解析脚本时适用。
运行要求
以 stdio 本地进程运行;需安装 npm 包并构建,然后用 Node.js 在客户端配置中指向构建后的入口文件。未声明账号、API 密钥、环境变量或请求头。
安装前请注意
日志内容会传给助手及其模型提供商,含凭据、令牌、个人数据或内部主机名的日志会因此外泄。这些工具读取并转换传入的文本;README 未说明会写入或删除文件。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Log,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

@rog0x/mcp-log-tools

Log analysis and processing tools for AI agents, exposed via the Model Context Protocol (MCP).

Tools

parse_logs

Parse log content in common formats: JSON logs, Apache/Nginx access logs, syslog, and structured logs. Supports custom regex patterns with named capture groups. Extracts timestamp, level, message, source, and additional structured fields.

filter_logs

Filter parsed log entries by:

  • Log level (ERROR, WARN, INFO, DEBUG)
  • Date range (ISO 8601)
  • Keyword search (case-insensitive)
  • Regex pattern matching
  • Source/logger name

Returns matched entries along with level occurrence counts.

analyze_logs

Analyze log patterns to surface operational insights:

  • Top 10 most frequent errors (normalized)
  • Error rate over time (hourly buckets)
  • Request volume per hour
  • Slowest endpoints (from HTTP access logs)
  • Anomaly detection (sudden spikes or drops using standard deviation)

format_logs

Convert between log formats and produce reports:

  • JSON to plain text, plain to JSON, CSV, or table
  • ANSI colorization by log level
  • Structured field extraction
  • Summary report generation

log_stats

Compute comprehensive log statistics:

  • Total and non-empty line counts
  • Level distribution with percentages
  • Date range coverage
  • Unique IP addresses and request counts
  • Top user agents
  • HTTP status code distribution
  • Throughput (entries per second)

Setup

bash
npm installnpm run build

Usage with Claude Desktop

Add to your claude_desktop_config.json:

json
{  "mcpServers": {    "log-tools": {      "command": "node",      "args": ["path/to/mcp-log-tools/dist/index.js"]    }  }}

Supported Log Formats

FormatExample
JSON{"timestamp":"2024-01-15T10:30:00Z","level":"ERROR","message":"Connection failed"}
Apache/Nginx127.0.0.1 - frank [10/Oct/2000:13:55:36 -0700] "GET /index.html HTTP/1.1" 200 2326
SyslogJan 1 00:00:00 hostname process[1234]: Something happened
Structured2024-01-15T10:30:00.000Z [ERROR] [ModuleName] Something failed
CustomAny format using a regex with named capture groups

License

MIT

来源:README.md,提交 8a042e8

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v1.0.2最新Sep 16, 2026

评分

已满足适用检查项的 40%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

    请在仓库或注册中心条目中声明许可证。