About TestLens
TestLens checks Python `unittest` suites with mutation testing by changing code and reporting which changes the tests catch or miss. It is for developers and agents evaluating whether tests cover relevant behavior, and is available as an API and stdio MCP server.
Key features
- 01Generate code mutants automatically
- 02Run Python `unittest` cases against mutants
- 03Report mutation score and survivors
- 04Show survivor line numbers and hangs
- 05Provide an API health check
Use cases
- 01Check whether tests catch boundary-condition changes
- 02Find behavior changes missed by a test suite
- 03Review tests generated by humans or AI
MCP support
The stdio MCP server exposes `testlens_mutate` for running tests against generated mutants and `testlens_health` for checking API availability. It sends code and tests to the TestLens API and returns the verdict and report.
Configuration
Remote servers need no local install. Pick your client, then copy the config or install in one click.
https://testlens.bigfloppy.net/mcpclaude mcp add --transport http net-bigfloppy-testlens-testlens https://testlens.bigfloppy.net/mcp{"mcpServers":{"net-bigfloppy-testlens-testlens":{"type":"http","url":"https://testlens.bigfloppy.net/mcp"}}}Open in Cursor{"servers":{"net-bigfloppy-testlens-testlens":{"type":"http","url":"https://testlens.bigfloppy.net/mcp"}}}Open in VS Code{"mcpServers":{"net-bigfloppy-testlens-testlens":{"type":"http","url":"https://testlens.bigfloppy.net/mcp"}}}{"mcpServers":{"net-bigfloppy-testlens-testlens":{"serverUrl":"https://testlens.bigfloppy.net/mcp"}}}Run commands in a terminal; paste JSON into the client’s MCP config and restart. Servers that need sign-in will prompt on first connect.
Tools
Details
From the project READMETestLens — does your test suite actually test?
Mutation-testing verifier for Python unittest suites, built by lead-builder-2 (autonomous agent).
The problem: tests written (by humans or AI) against an implementation often share its blind spots. They pass while missing boundaries, edge cases, and inverted conditions.
The method: TestLens generates small mutants of your code — flips a comparison, swaps an operator, bumps a constant — runs your tests against each, and reports every survivor: a behaviour change your tests did not catch.
POST /api/mutate {"code": "...", "tests": "..."} -> JSON report
GET /api/health -> {"ok": true}
GET / -> landing page
codeis saved assolution.py;testsareunittestcases importingsolution.- Response:
mutation_score(killed/total), survivors with line numbers, hangs. - Sandbox: each run executes with an audit hook blocking sockets/subprocess/exec; temp dir is disposable; 1 concurrent run; ≤24 mutants; 2.5s per run; per-IP rate limit.
Stdlib only. Run: PORT=8312 python3 app.py.
Use TestLens from your AI agent (MCP)
mcp_server.py is a stdio MCP server that exposes TestLens as agent tools:
testlens_mutate— run your tests against auto-generated mutantstestlens_health— check the API is up
Configure it like any MCP server (Claude Desktop / Cursor / any MCP client):
{"mcpServers": {"testlens": {"command": "python3", "args": ["/path/to/mcp_server.py"]}}}
Then ask your agent: "mutation-test this function with TestLens". It POSTs the code
and tests to the free TestLens API (no key, fair use) and reads back the verdict,
mutation score and survivors. Protocol-level e2e test: python3 mcp_e2e_test.py.
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.