MCP server
Start the server with runeconomy mcp --root PATH to resolve tool path
arguments relative to that directory. For an authenticated doctor probe, add
--doctor-endpoint BASE_URL KEY_ENV when launching the server. Use a dash
for an anonymous endpoint. Each doctor call must match that configuration.
Runs require an intact freeze by default. Set require_frozen to false
for an exploratory run. Reviewed agent commands and executable evaluators
require independent opt-ins via allow_exec_agents and allow_exec_evaluators.
runeconomy mcp serves RunEconomy as Model Context Protocol tools over stdio.
A coding agent can then take a repository from evidence to a frozen, executed
and reported experiment without editing JSON.
# Claude Code
claude mcp add runeconomy -- runeconomy mcp
# Any client that launches stdio servers (Cursor, Claude Desktop, ...)
{
"mcpServers": {
"runeconomy": { "command": "runeconomy", "args": ["mcp"] }
}
}
Doctor, analyze, validate and plan call the same in-process Python operations as the CLI. Mutation and execution tools use isolated CLI subprocesses. Results use the versioned JSON contracts.
Clients can list the audit and verification prompts. After workspace validation or result inspection, list and read the selected manifest or decision resource. For approved runs, send an MCP progress token to receive completed pair counts, joint evaluator successes and estimated time remaining.
Tools
| Tool | Command | Read-only |
|---|---|---|
doctor |
runeconomy doctor |
yes (probes metadata only) |
import_evidence |
runeconomy import |
writes the evidence bundle |
analyze |
runeconomy analyze |
yes |
init_experiment |
runeconomy experiment init |
creates a workspace |
validate_experiment |
runeconomy experiment validate |
yes |
patch_experiment |
runeconomy experiment patch |
writes with provenance |
freeze_experiment |
runeconomy experiment freeze |
irreversible for the workspace |
plan_experiment |
runeconomy experiment plan |
yes |
run_experiment |
runeconomy experiment run |
requires approval |
render_report |
runeconomy experiment report |
writes the report |
inspect_result |
reads a result JSON | yes |
Tool annotations mark read-only, destructive and open-world behavior so clients can apply their own confirmation policy.
The approval boundary
run_experiment executes agent commands and contacts serving backends, so it
can spend money. Its first call never executes anything. It returns:
- the planner state, planned pairs and total attempts
- the declared cost estimate and the manifest's
cost_model - the exact local commands that will run
- whether the workspace is frozen and intact
- a single-use
approval_token
The agent must show this to the human and call again with the token only after explicit approval. Each estimate issues a fresh random token. The server binds it to:
- the exact tool arguments
- the current digests of
manifest.json,workspace.json,preregistration.json, the dataset and the evaluator
Changing any of them invalidates the token, as does reuse or the 15-minute expiry. Tokens live only in the server process. If the operator requests a change, apply the patch, obtain a fresh estimate and ask them to approve the revised run. Repeat that handshake after a server restart. Keep execution through the connected MCP tool so shell access cannot bypass approval.
Zero-JSON-edit path
init_experiment(agent-process, orfrom_evidenceafterimport_evidence)patch_experimentwithsetfordesign.planningand any gate changesfreeze_experimentwithlocknaming the agent codeplan_experimentto review power and the preregistrationrun_experimentwithrequire_frozen: true, which returns an estimate after approval, call it again with the tokenrender_reportandinspect_result
tests/test_mcp_server.py exercises this sequence end to end over JSON-RPC.