RunEconomy

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 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:

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

  1. init_experiment (agent-process, or from_evidence after import_evidence)
  2. patch_experiment with set for design.planning and any gate changes
  3. freeze_experiment with lock naming the agent code
  4. plan_experiment to review power and the preregistration
  5. run_experiment with require_frozen: true, which returns an estimate after approval, call it again with the token
  6. render_report and inspect_result

tests/test_mcp_server.py exercises this sequence end to end over JSON-RPC.