MCP server
Let your coding agent start Interleave runs, wait for the verdict and fix what broke.
The Interleave MCP server lets an agent test its own pull request: start QA on the branch it just pushed, wait for the verdict and fix what broke, without leaving the editor. It works with Claude Code, Cursor, Windsurf, VS Code, Claude Desktop and any other client that runs stdio MCP servers.
The agent skill can add this server for you as part of setting up a repo.
Tools
| Tool | What it does |
|---|---|
run_tests | Starts a run on a pushed branch or a PR. Takes repo, branch or prNumber, and optional instructions. Returns the run id and dashboard link. With wait: true it blocks until the verdict, sends progress as cases finish, and returns the report. |
get_report | The run's verdict and, for each failing case, the judge's call, the failing step and a link. Without runId it reports the latest run for the repo, branch or PR. Takes wait: true too. |
list_runs | Recent runs for a repo, newest first. Filter by branch or prNumber. |
get_case | One case result in depth, for debugging: the judge's rationale and evidence, every step with its status and error, the test source and links to the recording. Takes the caseResultId that get_report prints under each failing case. |
repo and branch default to the git repo and branch the server was started in. Most clients start it
in your project folder. Interleave tests what's on GitHub, so push first.
The report's verdict is one of passed, failed, needs_review, run_failed, cancelled or
in_progress. failed cases marked as a regression are bugs in the change; needs_review means a
person should look (see what fails a PR). The tools also return the same
data as JSON (structuredContent) for clients that use it.
Runs started over MCP count toward your plan's limits like any other run.
Setup
Get an API key
In the dashboard, open API keys and click Create key.
The key (il_…) is shown once. It acts as you and works in the org you created it in.
See API keys.
Already ran interleave login on this machine? Skip this step: the server uses the key the CLI saved.
Add the server
You need Node 20 or later.
claude mcp add interleave --env INTERLEAVE_API_KEY=il_your_key -- npx -y @interleaveqa/mcpThe dashboard shows this exact command, with your key filled in, when you create a key.
To share the server with your team, add --scope project. That writes .mcp.json. Leave the key out
of that file and have each person set INTERLEAVE_API_KEY in their shell.
Use it
Ask your agent something like:
Push this branch, run the Interleave tests and wait for the result. Fix any regressions.
The agent calls run_tests with wait: true and gets a report like:
FAILED · run #8 · feat/cart @ abcdef0
2 passed · 1 failed · 6.0 min · $0.42
Checkout total is wrong after a coupon
Needs attention:
1. ✗ Coupon applies to total — failed
judge: regression: the change broke this
why: total ignores the coupon
step 3: expected $90.00, saw $100.00
https://…/runs/…/cases/…
Passed: Add to cart; Remove from cart
Report: https://…/runs/…Debug a case with your agent
On a failing case's page, Debug with agent (next to View details) copies a prompt for Claude Code, Cursor or
Codex. It names the case and tells the agent to call get_case, installing this server first if it
isn't set up. The prompt never contains an API key; the agent asks you for one.
Long runs
Runs usually take several minutes. If your client times out long tool calls, call run_tests without
wait, then get_report with wait: true. A wait gives up after timeoutMinutes (default 20); the
run itself keeps going, and another get_report picks it up.
Configuration
Everything comes from environment variables.
| Variable | Default |
|---|---|
INTERLEAVE_API_KEY | The key saved by interleave login. |
INTERLEAVE_ORG | The org the key was created in. Set an org slug or id to work in another org you belong to. |
INTERLEAVE_API_URL | The production API, or the URL saved at login. |