
Ndjson Local Log Triage Mcp
io.github.vola-trebla由 GitHub 账号 vola-trebla 发布v0.2.0更新于 Oct 24, 2026
Streams NDJSON log triage: query patterns, detect anomalies, summarize timelines without full load.
概览
一个本地 MCP 服务器,以流式方式读取 NDJSON 日志文件,让助手无需整体加载即可筛选条目、检测错误尖峰并汇总时间线。
- 可以做什么
- 按字段/值匹配筛选日志条目,可选按行首模式重建多行堆栈,并限制返回条数。按时间窗口分桶统计错误,用 Z 分数标出异常偏高的窗口。按时间窗口汇总各级别日志数量,可选自动调整桶大小并放大峰值窗口。按 trace ID 跨多个日志文件重建分布式调用链,列出涉及的服务和总耗时。推断日志文件格式与字段结构,识别时间戳和严重级别字段。用 Drain 算法把消息聚类成模板并展示参数分布。启动后台实时跟踪并推送异常告警,或查询外部日志平台。
- 适用场景
- 当助手需要排查大型 NDJSON 日志时使用,例如查明某时间点错误激增的原因、跨服务重建一次请求,或在故障期间快速获得严重级别时间线。
- 运行要求
- 通过 npm 包以 npx 在用户机器上作为本地进程运行,需要 Node.js。未声明认证、环境变量或请求头。助手需要对磁盘上的日志文件有读取权限。
安装
在 SourceWeft 中
- 打开 控制台中的 Ndjson Local Log Triage Mcp,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
🪵 ndjson-local-log-triage-mcp
Your service just crashed. The log file is 2GB. Your AI agent can't help.
MCP server that stream-parses NDJSON log files without loading them into memory — filter by pattern, detect error spikes via Z-score analysis, summarize severity timelines by time window.
🤔 The problem
A service crashes at 3am. The log file is app.log.ndjson and it's 2GB. You ask your agent to find what caused the spike in errors around 03:17. The agent can't read 2GB. It can't even try.
ndjson-local-log-triage-mcp streams the file line by line — never loading it into memory — and gives the agent exactly the slice it needs.
🛠️ Tools
query_log_pattern
Filter log entries by a field/value match. Returns up to N matching entries, streaming the file without loading it entirely. Pass lineStartPattern (e.g. "^{") to reconstruct multiline stack traces silently dropped by the default parser.
detect_error_anomalies
Z-score frequency analysis. Buckets errors by time window, computes mean + stddev, flags windows where the error rate is anomalously high.
summarize_log_timeline
Chronological aggregation of errors, warnings, and info counts per time window. Quick visual of where the incident is.
Pass adaptive: true to auto-scale bucket size to actual event density and zoom in on the peak error window at 10× finer resolution.
correlate_request
Reconstructs a distributed trace from multiple NDJSON log files. Given a trace_id, collects all correlated events in chronological order across all files and surfaces the services involved and total duration.
discover_log_schema
Analyze a log file to infer its wrapper format (NDJSON, Syslog, Kubernetes container logs) and extract type schemas, identifying polymorphic keys, timestamp patterns, and severity fields.
group_semantic_patterns
Cluster log messages dynamically using the fixed-depth tree-based Drain parsing algorithm to isolate distinct log templates and analyze their parameter distributions (wildcard variations).
start_live_triage
Start background log tailing with real-time Z-score anomaly alerting on error frequency spikes and heap memory protection limits. Dispatches notifications directly over standard JSON-RPC channels.
query_external_logs
A unified gateway to query central log providers (Datadog, Splunk, Elasticsearch), converting search patterns to vendor-specific dialects and mapping the output into the standardized OpenTelemetry Log Data Model structure.
⚡ Setup
🚀 Usage
"Analyze /var/log/app.log.ndjson — summarize the error timeline in 5-minute windows, detect any anomalous spikes, and show me the error entries around the spike."
Works great alongside:
- release-readiness-triage-mcp — CI failure triage before release
- env-secret-exposure-analyzer-mcp — secret exposure scanning
📦 Links
- npm: npmjs.com/package/ndjson-local-log-triage-mcp
- GitHub: github.com/vola-trebla/ndjson-local-log-triage-mcp
License
MIT
来源:README.md,提交 76f7060
工具
0版本历史
1- v0.2.0最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分