Connect Understudy to your tools
You can use Understudy from a coding agent, from pull requests, or over plain HTTP. Every route goes through the same engine, policy, evidence records and restore as the web screen.
From your coding agent (MCP): nothing to install
Add the hosted MCP server. Then ask your agent something like “Use Understudy to check whether denying payment's egress to 10.0.0.0/8 on port 5432 is safe, and tell me what to fix.” It composes the change, starts a real rehearsal, waits, and reports back the verdict, the cited evidence, the verified correction and a link to the screen.
Claude Code
claude mcp add --transport http understudy https://understudy-b4ifn2ibuq-el.a.run.app/mcp
Cursor: .cursor/mcp.json
{
"mcpServers": {
"understudy": { "url": "https://understudy-b4ifn2ibuq-el.a.run.app/mcp" }
}
}
VS Code: .vscode/mcp.json
{
"servers": {
"understudy": { "type": "http", "url": "https://understudy-b4ifn2ibuq-el.a.run.app/mcp" }
}
}
Tools
- list_changes and playground_options: what you can rehearse.
- rehearse_change and rehearse_playground: start a real rehearsal.
- get_rehearsal: the outcome. It can wait up to 45 s per call.
Local (stdio), for clients without remote MCP
From a clone of the repository, with uv:
claude mcp add understudy -e UNDERSTUDY_URL=https://understudy-b4ifn2ibuq-el.a.run.app -- \ uv run --directory /path/to/Understudy python -m understudy_mcp
On every pull request (GitHub Action)
A pull request that adds or edits changes/<dir>/ is rehearsed automatically. The Action authenticates with Workload Identity Federation, so there are no keys. It waits for the verdict, comments the outcome on the PR, and fails the check when the change is not verified. Your own Terraform is checked by an overlay content policy before anything is applied: allowlisted resource types only, no provisioners, no foreign modules.
Today the federation is pinned to one repository and an allowlist of GitHub actors, so adding a repository is a manual step. Ask through the contact in security.txt.
Over HTTP
curl -s https://understudy-b4ifn2ibuq-el.a.run.app/api/changes
curl -s -X POST https://understudy-b4ifn2ibuq-el.a.run.app/api/playground -H 'content-type: application/json' \
-d '{"egress_deny_ports": [5432], "egress_deny_destination": "10.0.0.0/8"}'
curl -s https://understudy-b4ifn2ibuq-el.a.run.app/api/rehearsals/<rehearsal_id>/summary
The schema is at /api/openapi.json. Rehearsals started per client are rate-limited, and one rehearsal runs at a time: a busy reply (409) names the running one.