Skip to content

HarnessRouter Community Edition: the self-hosted, Apache-2.0 edition of the unified interface for agent harnesses. Run Codex, Claude Code, Hermes, PI, DSH, and more through one API, with sessions, streaming, files, cancellation, and failure handling. Implements the Unified Harness Protocol (UHP), an open standard. Your keys, your infrastructure.

Runner: pi registers MCP tools directly, as every other CLI does (#277)

github-actions[bot]75f41f912e03
diff --git a/runner/server.py b/runner/server.py
index 9e8b2b9d..4e77a8be 100644
--- a/runner/server.py
+++ b/runner/server.py
@@ -2351,7 +2351,14 @@ def _pi_write_mcp(home: pathlib.Path, servers: list[dict] | None) -> bool:
return False
path = home / ".pi" / "agent" / "mcp.json"
path.parent.mkdir(parents=True, exist_ok=True)
- path.write_text(json.dumps({"mcpServers": entries}, indent=2))
+ # directTools: the tools are registered on the agent one by one, as every other CLI lists
+ # MCP tools. The adapter's default hides them behind one `mcp` proxy tool (search, then call),
+ # and a model that is not told to search answers that it has no such tool: a harness with the
+ # browser plugin included said "I can't directly control a browser here" to Richard on
+ # 2026-09-25 while all thirteen tools sat in the adapter's cache. The proxy goes with it, so
+ # the model has one way to a tool, not two.
+ path.write_text(json.dumps({"settings": {"directTools": True, "disableProxyTool": True},
+ "mcpServers": entries}, indent=2))
return True
diff --git a/runner/tests/test_uhp_plugins.py b/runner/tests/test_uhp_plugins.py
index e57a267b..f4d3d84d 100644
--- a/runner/tests/test_uhp_plugins.py
+++ b/runner/tests/test_uhp_plugins.py
@@ -143,7 +143,10 @@ def test_pi_adapter_gets_a_stdio_command_entry(tmp_path):
"args": ["--data", "/ws/.harness/plugin-data/hr_probe"], "plugin": "hr-probe"},
{"name": "remote", "url": "https://mcp.example.invalid/mcp", "headers": {"X-Team": "t"}}]
assert rn._pi_write_mcp(home, servers) is True
- cfg = json.loads((home / ".pi" / "agent" / "mcp.json").read_text())["mcpServers"]
+ doc = json.loads((home / ".pi" / "agent" / "mcp.json").read_text())
+ # the tools are registered one by one, as on every other CLI; not behind the adapter's proxy
+ assert doc["settings"] == {"directTools": True, "disableProxyTool": True}
+ cfg = doc["mcpServers"]
assert cfg["probe"] == {"command": "/ws/.harness/plugin-data/hr_probe/.launch-probe.sh",
"args": ["--data", "/ws/.harness/plugin-data/hr_probe"]}
assert cfg["remote"] == {"url": "https://mcp.example.invalid/mcp", "headers": {"X-Team": "t"}}