ndjson-local-log-triage-mcp
Allows querying Datadog logs by converting search patterns to Datadog's query language via the query_external_logs tool.
Allows querying Elasticsearch logs by converting search patterns to Elasticsearch's query language via the query_external_logs tool.
Maps log output from various providers into the standardized OpenTelemetry Log Data Model structure.
Allows querying Splunk logs by converting search patterns to Splunk's query language via the query_external_logs tool.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ndjson-local-log-triage-mcpdetect error anomalies in /var/log/app.log.ndjson with 5min windows"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
🪵 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.
Related MCP server: Log Analyzer MCP Server
🛠️ 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.
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 errorssummarize_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.
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 0correlate_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.
Request Correlation
Trace ID: trace-8f7a9b2c
Files scanned: 2
Events found: 10
Services involved: api, worker
Duration: 890ms
[2025-01-15T14:00:00.001Z] api {"level":"info","msg":"incoming request",...}
[2025-01-15T14:00:00.045Z] api {"level":"info","msg":"auth token validated",...}
[2025-01-15T14:00:00.112Z] worker {"level":"info","msg":"job queued",...}
...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.
{
"fileFormat": "NDJSON",
"detectedKeys": {
"timestamp": { "type": "string", "format": "date-time", "isChronologicalIndex": true },
"level": { "type": "string", "isSeverityField": true, "possibleValues": ["info", "error"] }
}
}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).
Processed Logs: 1500
Unique Patterns: 2
- Template: "connection failed from * port *"
Occurrences: 1200
Parameters:
- param_0 (client_ip): 192.168.1.1 (80%), 10.0.0.5 (20%)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.
{
"method": "notifications/triage",
"params": {
"type": "anomaly",
"message": "Live Anomaly Detected: 45 errors in current window (Z-score: 3.52)",
"z_score": 3.52,
"error_count": 45
}
}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
{
"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
License
MIT
Available Tools
8 toolscorrelate_requestA
Reconstruct a distributed trace by collecting all log events matching a trace/request ID across multiple NDJSON files, sorted chronologically.
| Name | Required | Description | Default |
|---|---|---|---|
| idField | No | Field name containing the trace/request ID | trace_id |
| traceId | Yes | Trace/request ID value to search for | |
| logFiles | Yes | Array of absolute paths to NDJSON log files | |
| serviceField | No | Field name for service/component name | service |
| timestampField | No | Field name for ISO timestamp | timestamp |
| lineStartPattern | No | Regex that marks new log line start — enables multiline stack trace buffering |
detect_error_anomaliesB
Z-score frequency analysis to find sudden error spikes by time window.
| Name | Required | Description | Default |
|---|---|---|---|
| logFile | Yes | Absolute path to the NDJSON log file | |
| levelField | No | Field containing log level | level |
| errorValues | No | Level values to treat as errors | |
| windowMinutes | No | Aggregation window size in minutes | |
| timestampField | No | Field containing ISO timestamp | timestamp |
| zScoreThreshold | No | Z-score threshold above which a window is flagged as anomalous | |
| lineStartPattern | No | Regex that marks new log line start — enables multiline stack trace buffering |
discover_log_schemaB
Analyze a log file to infer format and type schemas, including key type polymorphism and regex patterns for timestamps.
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | Absolute path to the log file | |
| sample_size | No | Number of lines to sample for schema detection |
group_semantic_patternsA
Cluster similar log messages using Drain algorithm to isolate core events and parameter distributions.
| Name | Required | Description | Default |
|---|---|---|---|
| depth | No | Depth of the Drain parse tree | |
| file_path | Yes | Absolute path to the log file | |
| time_window_start | No | ISO timestamp to filter logs generated after this time | |
| similarity_threshold | No | Similarity threshold for clustering (0.1 to 1.0) |
query_external_logsA
Query external log providers (Datadog, Splunk, Elasticsearch) translating search patterns and mapping to OpenTelemetry format.
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Max entries to return | |
| query | Yes | Search query string | |
| provider | Yes | Vendor log service to search | |
| start_time | No | ISO timestamp for search window start |
query_log_patternA
Filter NDJSON log file by field/value pattern, return top N matching entries.
| Name | Required | Description | Default |
|---|---|---|---|
| field | Yes | JSON field name to filter on (e.g. 'level', 'service') | |
| limit | No | Max entries to return | |
| value | Yes | Value to match (case-insensitive substring) | |
| logFile | Yes | Absolute path to the NDJSON log file | |
| lineStartPattern | No | Regex that marks new log line start (e.g. "^{") — enables multiline stack trace reconstruction |
start_live_triageA
Start background log tailing with real-time Z-score anomaly alerting and heap memory safety limits.
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | Absolute path to the log file | |
| high_water_mark | No | Heap memory safety threshold in bytes (automatically shuts down tailing loop if exceeded) | |
| anomaly_threshold_z | No | Z-score threshold above which log volume spikes trigger notifications |
summarize_log_timelineA
Chronological severity aggregation — errors, warnings, and info counts per time window.
| Name | Required | Description | Default |
|---|---|---|---|
| logFile | Yes | Absolute path to the NDJSON log file | |
| adaptive | No | Auto-scale bucket size to actual event density — samples first 1000 events to choose ms/s/min granularity and zooms in on the peak error window | |
| levelField | No | Field containing log level | level |
| windowMinutes | No | Aggregation window size in minutes | |
| timestampField | No | Field containing ISO timestamp | timestamp |
| lineStartPattern | No | Regex that marks new log line start — enables multiline stack trace buffering |
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
8 tool updates
v0.3.0- First observed
correlate_request - First observed
detect_error_anomalies - First observed
discover_log_schema - First observed
group_semantic_patterns - First observed
query_external_logs - First observed
query_log_pattern - First observed
start_live_triage - First observed
summarize_log_timeline
TDQS
Scored across 8 tools
Tools target distinct operations: schema exploration, pattern querying, anomaly detection, timeline summary, request correlation, semantic clustering, live monitoring, and external integration. Some minor overlap exists between static anomaly detection and live triage, but descriptions clarify the static vs. real-time contexts.
All tool names follow a consistent verb_noun pattern using snake_case, with clear action verbs (discover, query, detect, summarize, correlate, group, start). Even the two query tools are distinguished by their target (local pattern vs. external providers).
8 tools is well within the optimal range for a log triage server, covering analysis, querying, aggregation, correlation, clustering, live monitoring, and external access without being excessive or sparse.
The tool set covers the core triage lifecycle: schema discovery, querying, anomaly detection, timeline summary, trace correlation, semantic grouping, live monitoring, and external log retrieval. Notable gaps include the absence of a stop/control tool for live triage and a dedicated raw context retrieval by log ID, but these are minor and workable.
Maintenance
Related MCP Connectors
Syslog receiver and MCP server for homelab log intelligence.
Syslog receiver and MCP server for homelab log intelligence.
Structured analysis API and remote MCP tool for text, JSON records and numeric series.
Analytics and debugging for your MCP server — explore usage and sessions, then root-cause errors.
Related MCP Servers
- MIT No Attribution
- AlicenseNot gradedqualityDmaintenanceAn MCP server for intelligent log analysis providing semantic search, error pattern clustering, and smart error detection. It enables users to process, vectorize, and query local logs to efficiently identify issues and generate AI-powered summaries.MIT
- AlicenseAqualityDmaintenanceMCP server for log file analysis. Gives LLMs the ability to efficiently analyze large log files without loading them into context.7101MIT
- FlicenseBqualityDmaintenanceA log analysis MCP server that enables tailing, searching, filtering, and summarizing logs from local files and Docker containers.7-