Install
Keep it isolated and globally available through uv tool.
uv tool install --force \
--with 'mcp>=2,<3' \
'git+https://github.com/Protocol-Lattice/harness-router.git@main'
harness-router keeps the easy path cheap. Obvious action? Call the tool. Real ambiguity? Ask Jev. Multi-step consequences? Search a bounded tree.
uv tool install --force --with 'mcp>=2,<3' 'git+https://github.com/Protocol-Lattice/harness-router.git@main'
Earlier skill-driven routing paid extra planner turns around Jev and made the
complete loop slower. The current design reverses the default:
normal tool calling is the fast path. route exists only for
real closed-choice ambiguity.
No routing call. The next action is already obvious.
No routing call. Deterministic transitions stay local.
Compact state in. One tool choice out.
Codex gets a native stdio server instead of a heavy helper flow.
route takes a compact goal, latest observation, and a small shortlist.
The server keeps its provider alive, reuses connections, and returns a tiny structured result.
[mcp_servers.harness-router]
command = "harness-router-mcp"
env_vars = ["OPENROUTER_API_KEY"]
enabled = true
startup_timeout_sec = 10
tool_timeout_sec = 5
# then restart Codex
/mcp
route
route_mcts
route_mcts explores a supplied side-effect-free state graph.
Jev can seed the root once; the remaining simulations are local.
The server never executes simulated writes, shell commands, browser mutations,
or network mutations. It selects only the first real action.
Two experiments. 24 paired decisions each. Four, eight, or sixteen candidates. Timing stopped at the choice; selected tools were never executed.
Milliseconds · same scale · lower is faster
routeOrdinary tool choices
9.5× faster · observed mean latency24/24 choices match CodexAgreement only
route_mctsThree-step trees · 4,096 sims
12.3× faster · observed mean latency24/24 optimal · 100%Codex: 24/24 · 100%
routeOrdinary tool choices
10.2× faster · observed median latency24/24 choices match CodexAgreement only
route_mctsThree-step trees · 4,096 sims
11.6× faster · observed median latency24/24 optimal · 100%Codex: 24/24 · 100%
routeOrdinary tool choices
9.0× faster · observed p95 latency24/24 choices match CodexAgreement only
route_mctsThree-step trees · 4,096 sims
12.8× faster · observed p95 latency24/24 optimal · 100%Codex: 24/24 · 100%
Each experiment has its own Codex baseline and different timing boundaries. Ratios compare observed latency. The MCTS budget was tuned on these same 24 cases.
Codex chose a name only; its timer includes response generation, host scheduling, and dispatch. Router timings include MCP transport and the provider round trip; MCTS also includes local search. Graph preparation is excluded. Pure reasoning time and task completion time were not measured.
These exploratory runs used different workloads in an existing Codex conversation, with cases authored by Codex. They do not isolate the cost of MCTS over ordinary routing. Matching choices measure agreement; the MCTS test checks the highest-reward branch. No Python scripts or OpenAI API calls were used.
route · 24 paired choicesOrdinary tool selection with 4, 8, or 16 candidates. All measured samples are included. Zero router fallbacks or errors. One 695 ms warmup is excluded.
route_mcts · 24 paired trees4,096 simulations, depth 3, Jev prior enabled. One policy evaluation per response. A separate budget check and this timed rerun each reached 24/24 on the same fixtures; this is not a held-out result. All measured samples are included, with zero final fallbacks or errors. Budget-selection calls and a 412 ms pre-run check are excluded from these timings.
Install the latest main branch, expose your OpenRouter key to the local MCP process, and register the server in Codex.
Keep it isolated and globally available through uv tool.
uv tool install --force \
--with 'mcp>=2,<3' \
'git+https://github.com/Protocol-Lattice/harness-router.git@main'
The server can load without it. Jev routing needs it when route is called.
export OPENROUTER_API_KEY="..."
command -v harness-router-mcp
Add the stdio server, restart Codex, then verify both tools with /mcp.
codex mcp add harness-router -- \
harness-router-mcp
codex mcp list
Use the model where reasoning matters. Use Jev where the choice is closed. Use MCTS where the next few moves matter. Skip all of it when the next step is obvious.