Skip to main content
Glama
Test Logs MCP Server

Test Logs MCP Server

by sarahggs1

Test Log MCP Agent

AI assistance for a system validation team: an MCP server that gives an AI agent read-only access to nightly test campaigns, a Claude agent that triages the failures through it, and an automatic validation of the agent's triage, because an AI that qualifies a product has to be qualified itself.

The test campaigns are synthetic: a fictitious set-top box with a voice assistant, 16 tests (boot, wake word, voice intents, audio, 4K video, HDMI-CEC, Wi-Fi, OTA), 14 nights on 4 benches in four countries, 4 firmware versions. Four problems are injected and their ground truth is kept.

The problems to find

Kind

What was injected

Who should act

Product regression

the volume voice intents fail on every bench from firmware 3.2.0

product (NLU)

Flaky test

wake-word detection in a noisy room fails at random

test framework

Bench-specific issue

HDMI-CEC tests time out on one bench only (bench-BR-04)

test bench

Infrastructure

the bench controller is unreachable during one run (R038)

infrastructure

The difficulty is the one validation teams face every morning: the same red dashboard mixes product bugs, unreliable tests, faulty benches and broken infrastructure, and each goes to a different team.

Related MCP server: Log Analyzer MCP

Architecture

test logs (JSONL per run) ──► MCP server (stdio, read-only tools) ──► Claude agent ──► submit_triage (strict schema)
                                                                                     └─► validation vs ground truth

MCP server (testlogs/server.py), every tool annotated read-only:

Tool

Returns

list_runs

runs with date, bench, firmware and pass / fail / error counts, filterable

run_failures

failed tests of a run with message and log excerpt

error_signatures

failures grouped by normalised message (numbers and quoted values removed)

test_history

counts of one test per firmware and bench

flaky_tests

tests that both pass and fail in the same configuration

regressions

tests that passed on earlier firmwares and fail on every run from a given firmware

bench_breakdown

pass rate and errors per bench, tests failing on one bench only

search_logs

regular-expression search in messages and logs

Agent (testlogs/agent.py): an MCP client starts the server, turns its tools into Claude tool definitions and runs the tool loop on the Messages API (claude-opus-5-5, adaptive thinking, server-side refusal fallback). It runs next to the logs, typically in the CI job that produced them. Parallel tool calls are executed and returned in one message, MCP errors are passed back as tool errors, and the final answer must go through a local submit_triage tool with a strict JSON schema (category, tests, scope, evidence, owning team). A malformed triage is rejected and the model is asked to fix it.

Validation (testlogs/triage.py): the submitted triage is scored against the ground truth: which of the four problems were found with the right category and the right scope (firmware, bench or run), and how many findings match nothing (noise sent to the teams). A rule-based baseline gives the reference:

4/4 problems found, 0 finding matching no injected problem

(baseline triage). The agent's value over this baseline is on messy cases the rules do not cover: reading log excerpts, explaining the likely cause, writing the summary for the teams.

Run

pip install -r requirements.txt
python -m testlogs generate                 # writes data/logs
python -m testlogs baseline                 # rule-based triage and its score
python -m testlogs.agent                    # Claude agent over MCP (needs ANTHROPIC_API_KEY)
python -m pytest -q

Use the same server from Claude Code or Claude Desktop with an MCP configuration such as:

{"mcpServers": {"test-logs": {"command": "python", "args": ["-m", "testlogs.server", "--logs", "data/logs"]}}}

Tests

The tests run the real MCP server over stdio. The agent loop is tested with a scripted model (no API key needed): parallel tool calls answered in a single message with the real MCP output, an invalid triage rejected then corrected, refusal handled. No live model run is included in this repository.

Limits

  • Synthetic logs; real campaigns add video captures, audio recordings and device logs, which would be new MCP tools (for example frame extraction or log parsing per component).

  • The validation covers four known problem types; an evaluation set built from past campaigns with the validation team's own triage would be the next step.

License

MIT

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      B
      quality
      C
      maintenance
      Enables AI-assisted analysis of log files through advanced searching, filtering, and test execution capabilities. Supports time-based queries, pattern matching, test summarization, and code coverage reporting directly within compatible MCP clients.
      12
      -
    • A
      license
      A
      quality
      C
      maintenance
      Enables log analysis through MCP tools for searching logs, retrieving error contexts, and summarizing incidents with self-verified root-cause hypotheses.
      3
      ISC