Test Reporter MCP Server
Enables Claude Code to analyze flaky tests, find failure patterns, suggest fixes, and query test history, failure patterns, and correlated failures from Test Ledger.
README
Test Reporter MCP Server
MCP (Model Context Protocol) server for Test Ledger that enables Claude Code to analyze flaky tests, find failure patterns, suggest fixes and more.
Installation
No installation required! Just add the configuration to Claude Code.
Quick Start
1. Get your API key
Log into testledger.dev and go to Settings → API Keys to generate a key.
2. Configure Claude Code
Add this to your Claude Code MCP config:
Location: ~/.claude.json (global) or .mcp.json (project)
{
"mcpServers": {
"test-reporter": {
"command": "npx",
"args": ["-y", "@testledger/mcp@latest"],
"env": {
"TEST_LEDGER_API_KEY": "your-api-key-here"
}
}
}
}
Tip: Using
@latestensures you always get the newest version with bug fixes.
3. Restart Claude Code
That's it! Claude Code now has access to your test results.
Usage
Once configured, you can ask Claude Code things like:
- "Why is
checkout.spec.jsflaky?" - "What tests have been failing the most this week?"
- "Show me recent test failures"
- "Are there any tests that always fail together?"
With the /fix-flaky-test command
For the best experience, add the fix-flaky-test slash command to your project:
mkdir -p .claude/commands
curl -o .claude/commands/fix-flaky-test.md https://raw.githubusercontent.com/your-company/test-reporter-mcp/main/commands/fix-flaky-test.md
Then use it:
/fix-flaky-test
Test: LoginPage.should allow user to login with valid credentials
Error: element ("#submit-btn") still not clickable after 3000ms
at login.spec.js:42:24
Available Tools
The MCP server provides these tools to Claude:
| Tool | Description |
|---|---|
get_test_history |
Pass/fail/flaky statistics for a test |
get_failure_patterns |
Time-of-day, browser, and version patterns |
get_correlated_failures |
Tests that fail together (shared setup issues) |
get_flaky_tests |
Project-wide flaky test leaderboard |
get_recent_failures |
Recent failures for quick triage |
get_test_trend |
Failure rate over time |
Configuration Options
| Environment Variable | Required | Description |
|---|---|---|
TEST_LEDGER_API_KEY |
Yes | Your API key from the dashboard |
TEST_LEDGER_API_URL |
No | Custom API URL (default: https://app-api.testledger.dev) |
TEST_LEDGER_PROJECT_ID |
No | Default project ID to use for queries |
Example with all options
{
"mcpServers": {
"test-reporter": {
"command": "npx",
"args": ["-y", "@testledger/mcp"],
"env": {
"TEST_LEDGER_API_KEY": "tr_live_abc123",
"TEST_LEDGER_PROJECT_ID": "42"
}
}
}
}
Troubleshooting
"Tool not found" errors
- Restart Claude Code after updating config
- Check for JSON syntax errors in your config file
- Verify your API key is valid
"API error 401"
Your API key is invalid or expired. Generate a new one from the dashboard.
"API error 403"
Your API key doesn't have access to the requested project. Check project permissions.
Support
- Documentation: testledger.dev
- Issues: GitHub Issues
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.