LogLens
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., "@LogLens What regressions are in nightly-1042 compared to nightly-1041?"
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.
LogLens
An MCP server that lets AI agents troubleshoot from service logs: search them, group errors, compare a test run against a known-good baseline, and see which problems of other services show up around an error.
Performance labs run the same benchmarks every night across game builds, drivers and GPUs. When a run breaks, someone has to read the logs of the test runner, the driver, the game build and the telemetry side by side. LogLens gives an agent the tools to do that first pass, while keeping it honest: every number comes from code, never from the language model. The agent can only explain findings that the tools computed.
Tools
Tool | What it answers |
| Which runs are there, with how many lines, warnings and errors? |
| Lines filtered by run, service, minimum level, text and time range |
| The most frequent problems in a run, grouped by message signature |
| What is new, more frequent or gone in a candidate run compared with a baseline? |
| Which problems of other services appear around a given error, and do they come before or after it? |
All tools are marked read-only and idempotent, and only read .jsonl files
below LOGLENS_LOG_DIR; paths that leave that directory are rejected.
Related MCP server: mcp-incident-triage-agent
Example
The repository ships a generator for synthetic performance-lab logs
(loglens-synth): two nightly runs on four benchmark scenes and three GPUs.
Run nightly-1042 uses a newer driver, and in two scenes something goes wrong.
These are the real tool results on that data.
find_regressions(baseline_run="nightly-1041", candidate_run="nightly-1042"):
Finding | Signature | Count |
new |
| 13 |
new |
| 13 |
new |
| 8 |
new |
| 5 |
resolved |
| 10 in baseline |
correlate_errors(anchor="TDR timeout", run="nightly-1042"), 13 occurrences:
Service | Signature | share | before_share |
game-build |
| 1.00 | 1.00 |
test-runner |
| 0.62 | 0.00 |
test-runner |
| 0.38 | 0.00 |
game-build |
| 0.15 | 1.00 |
Read: every GPU timeout was preceded by a slow shader compilation
(before_share 1.0, a candidate cause), and the aborted benchmarks always come
afterwards (a consequence). The asset retries show up near 15 % of the
timeouts only, so they are probably unrelated.
How it works
Signatures. Variable parts of a message (numbers, hex addresses, ids, quoted strings) are replaced by placeholders, so
timeout after 2031 msandtimeout after 1987 mscount as the same problem. Digits inside a word stay (RTX4090).Fair comparisons.
find_regressionsnormalizes counts per 1,000 log lines of each run, so a longer run does not look worse just because it logged more. A problem counts as increased when its rate grows byratio(default 2×) and it occurs at leastmin_counttimes.Cause or consequence.
correlate_errorslooks at a time window around every occurrence of the anchor.shareis the fraction of occurrences a problem appears near;before_sharehow often it came first. Correlation is not causation: the tool points to candidates, the engineer decides.Robust input. Logs are JSON Lines (
ts,service,level,message, optionalrunand any extra fields). Malformed lines are counted and skipped, not fatal. Timestamps without a zone are read as UTC.Caching. Parsed logs are kept in memory and re-read only when a file's size or modification time changes.
Quick start
Requires Python 3.11 or newer.
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
loglens-synth logs # write the synthetic sample logs
LOGLENS_LOG_DIR=logs loglens-server # MCP server on stdioMost MCP clients accept a server entry like this:
{
"mcpServers": {
"loglens": {
"command": "/path/to/LogLens/.venv/bin/loglens-server",
"env": { "LOGLENS_LOG_DIR": "/path/to/your/logs" }
}
}
}Docker
docker build -t loglens .
docker run -i --rm -v "$PWD/logs:/data/logs" loglensThe image contains the sample logs, so it also works without a mount.
Tests
pytest -q
ruff check . && ruff format --check .20 tests cover parsing and malformed input, signatures, every analysis function on the synthetic data with known expected findings, the path restriction, the cache, and an end-to-end round trip in which an MCP client starts the server as a subprocess and calls a tool over stdio. GitHub Actions runs them on Python 3.11 to 3.13 and builds the Docker image.
Limitations and next steps
Input is JSON Lines only; plain-text formats would need a parser per format.
Everything is held in memory, which suits nightly runs, not weeks of production logs.
Grouping is by exact signature. Embedding-based grouping would also merge differently worded messages about the same problem.
Next: link findings to known issues and historical runs, and ingest OpenTelemetry logs directly.
License
MIT
Available Tools
5 toolscorrelate_errorsBRead-onlyIdempotent
Show which warnings and errors of other services appear around an error.
before_share close to 1 means the problem usually comes first: a candidate cause. Close to 0 means it follows: more likely a consequence.
Inputs: anchor (required), run, top, path, +1 more. Returns: object
error_summaryBRead-onlyIdempotent
Group errors by message signature (numbers and ids removed), most frequent first.
Inputs: run, top, path, service, +1 more. Returns: object
find_regressionsCRead-onlyIdempotent
Compare a candidate run with a baseline: new, more frequent and resolved problems.
Inputs: baseline_run (required), candidate_run (required), path, ratio, +2 more. Returns: object
list_runsBRead-onlyIdempotent
List the test runs in the logs with line, warning and error counts.
Inputs: path. Returns: object
search_logsBRead-onlyIdempotent
Find log lines by run, service, minimum level, text and time range (ISO 8601).
Inputs: run, path, limit, since, +4 more. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool targets a distinct log-analysis action: listing runs, searching lines, grouping errors, comparing runs, and correlating errors across services. The boundaries are clear, and even the potential overlap between search_logs and error_summary is resolved by their different aggregation levels.
Four of the five tools follow a clear verb_noun pattern (list_runs, search_logs, find_regressions, correlate_errors). error_summary is a noun phrase rather than verb_noun, but it remains readable and predictable.
Five tools is well-scoped for a log diagnostics server, covering discovery, search, aggregation, regression comparison, and correlation. Each tool earns its place without redundancy.
The surface covers the main log-analysis workflows: run listing, filtered search, error grouping, regression comparison, and cross-service correlation. Minor gaps like a dedicated service inventory or run-detail endpoint exist, but agents can work around them with the provided filters.
Maintenance
Related MCP Connectors
Production errors and incidents for your agent: stack traces, breadcrumbs, likely causes, triage.
Lets AI agents analyze API metrics, request logs, and traces, and manage apps and alerts.
Errors, traces, replays and logs from Talaria for coding agents.
Query your AI agent traces, root-cause verdicts and issues, and run investigations, from your agent.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables LLM agents to search and analyze Elasticsearch logs for errors, detect recurring patterns, analyze error-rate trends, and retrieve full trace context through MCP tools.6MIT
- AlicenseNot gradedqualityDmaintenanceExposes service health and log search tools for incident triage, enabling AI agents to investigate and summarize operational issues.MIT
- AlicenseNot gradedqualityDmaintenanceEnables log analysis through MCP tools for searching logs, retrieving error contexts, and summarizing incidents with self-verified root-cause hypotheses.ISC
- AlicenseNot gradedqualityCmaintenanceEnables coding agents to access live runtime observability data such as logs, deploys, and health metrics for evidence-based incident triage.1MIT