ndjson-local-log-triage-mcp
Streams NDJSON log triage without loading gigabyte files into context
🪵 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.
Log Query Results
File: /var/log/app.log.ndjson
Filter: service contains "auth"
Lines read: 847,293
Matches: 50 (limit 50 reached)
{"timestamp":"2025-01-15T03:17:02Z","level":"error","service":"auth","msg":"token validation failed","userId":"u_abc123"}
...
detect_error_anomalies
Z-score frequency analysis. Buckets errors by time window, computes mean + stddev, flags windows where the error rate is anomalously high.
Error Anomaly Detection
File: /var/log/app.log.ndjson
Window: 5min
Z-score cutoff: 2.0
Baseline: mean=3.2 errors/window, stdDev=1.8
Anomalies found: 2
[z=4.71] 2025-01-15T03:15:00.000Z 23 errors
[z=2.33] 2025-01-15T03:20:00.000Z 9 errors
summarize_log_timeline
Chronological aggregation of errors, warnings, and info counts per time window. Quick visual of where the incident is.
Log Timeline Summary
File: /var/log/app.log.ndjson
Window: 5min
Buckets: 48
Time (UTC) Errors Warnings Info Other
─────────────────────────────────────────────────────────
2025-01-15 03:00:00Z 2 8 142 0
2025-01-15 03:05:00Z 1 5 138 0
2025-01-15 03:10:00Z 3 9 141 0
! 2025-01-15 03:15:00Z 23 14 119 0
2025-01-15 03:20:00Z 9 11 133 0
⚡ Setup
{
"mcpServers": {
"log-triage": {
"command": "npx",
"args": ["-y", "ndjson-local-log-triage-mcp"]
}
}
}
🚀 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
Related Servers
Alpha Vantage MCP Server
sponsorAccess financial market data: realtime & historical stock, ETF, options, forex, crypto, commodities, fundamentals, technical indicators, & more
GodotIQ
The intelligent MCP server for AI-assisted Godot 4 development. 35 tools for spatial intelligence, code understanding, flow tracing, and visual debugging. 22 free, full suite $19.
Remote MCP Server (Authless)
An example of a remote MCP server deployable on Cloudflare Workers without authentication.
Laravel Docs
Search and access Laravel documentation from version 6.x onwards, with automatic daily updates.
AST2LLM for Go
An AST-powered tool that enhances LLM context by automatically injecting relevant Go code structures into prompts.
MCP Playground
A demonstration MCP server implementation in Go featuring real-time bidirectional file communication.
MCP Streamable HTTP Python Server
A Python template for creating a streamable HTTP MCP server. Requires an external 'mcp-config.json' file for client setup.
Grafana
Access and manage Grafana resources, including dashboards, datasources, Prometheus, Loki, and alerting.
open-context
A high-performance MCP server providing up-to-date documentation for Go, npm, Python, Rust, Docker, Kubernetes, Terraform, and more — fetched from official sources, not training data.
MCP Reticle
Reticle intercepts, visualizes, and profiles JSON-RPC traffic between your LLM and MCP servers in real-time, with zero latency overhead. Stop debugging blind. Start seeing everything.
ChuckNorris
A specialized MCP gateway for LLM enhancement prompts and jailbreaks with dynamic schema adaptation. Provides prompts for different LLMs using an enum-based approach.