testforge-mcp
v1.0.0
Published
**Test coverage, quality analysis, and generation for AI coding agents.**
Maintainers
Readme
TestForge MCP
Test coverage, quality analysis, and generation for AI coding agents.
TestForge MCP gives AI coding agents (Claude, Cursor, Copilot) a structured view of your test suite — coverage gaps, quality anti-patterns, and config issues — through the Model Context Protocol. It works with any JavaScript or TypeScript project using Vitest or Jest, requires no configuration, and ships 4 free analysis tools and 3 free generation tools today with 6 pro tools for advanced mutation testing, flaky detection, and aggregated reporting.
Quick Start
npx testforge-mcpClaude Desktop configuration
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"testforge": {
"command": "npx",
"args": ["testforge-mcp"]
}
}
}Restart Claude Desktop. TestForge tools will appear automatically.
Tools
Free tools (7 total)
| Tool | Description |
|---|---|
| coverage_report | Analyze line, branch, function, and statement coverage per file. Filter by threshold. Supports Vitest and Jest JSON output. |
| missing_tests | Find source files with untested exports. Ranks by priority (high / medium / low) based on export count and import frequency. |
| test_quality | Detect anti-patterns: assertion-free tests, snapshot-heavy suites, over-mocking, hardcoded timeouts, missing error-path tests, console pollution, and broad mocks. |
| test_config | Validate your Vitest or Jest configuration — coverage provider, thresholds, module resolution, and common misconfigurations. |
| generate_unit_tests | Generate template-based unit tests for exported functions, classes, and constants in a source file. Supports Vitest and Jest. |
| generate_integration_tests | Generate integration tests for Express, Fastify, and Next.js App Router route files with auth, validation, and 404 scenarios. |
| generate_e2e_tests | Generate a Playwright or Cypress E2E test scaffold for a described user flow with beforeEach setup and common assertions. |
Pro tools (6 total)
| Tool | Description |
|---|---|
| mutation_testing | Run mutation testing — flip operators, remove conditions, change returns, negate booleans, remove calls. Reports killed/survived/errored counts and mutation score. |
| flaky_detection | Detect flaky test indicators via static analysis — order-dependency, shared-state, timing-sensitive, unmocked-network, async-race. |
| test_impact | Analyze import graph to determine which test files are impacted by source file changes. Returns impacted tests, reasons, and savings percentage. |
| snapshot_audit | Audit .snap files for oversized snapshots, implementation details leaking in, and missing companion assertions. |
| mock_analysis | Analyze test files for mock anti-patterns — over-mocked files, broad mocks without factory, outdated mocks, and signature-mismatch heuristics. |
| test_report | Aggregate report combining coverage, missing tests, quality score, and config issues into a single prioritized action plan. Supports JSON and Markdown output. |
Free vs Pro
| Feature | Free | Pro | |---|---|---| | Coverage analysis | Yes | Yes | | Missing test detection | Yes | Yes | | Quality anti-pattern detection | Yes | Yes | | Config validation | Yes | Yes | | Unit test generation | Yes | Yes | | Integration test generation | Yes | Yes | | E2E test generation | Yes | Yes | | Mutation testing | — | Yes | | Flaky test detection | — | Yes | | Test impact analysis | — | Yes | | Snapshot audit | — | Yes | | Mock analysis | — | Yes | | Aggregated test report | — | Yes |
Pro tools require a PRO_LICENSE environment variable. Set it in your MCP server config:
{
"mcpServers": {
"testforge": {
"command": "npx",
"args": ["testforge-mcp"],
"env": { "PRO_LICENSE": "your-license-key" }
}
}
}License
MIT — see LICENSE.
Built with AI by Craftpipe
