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.

fast-agent reaches an MCP server at any path (the browser on servers at /v1/mcp/plugs) (#596)

github-actions[bot]ef9e12e29b61
diff --git a/docs/support-matrix-notes.md b/docs/support-matrix-notes.md
index 496c935d..d3735a3e 100644
--- a/docs/support-matrix-notes.md
+++ b/docs/support-matrix-notes.md
@@ -5386,3 +5386,24 @@ The same harness on the other three new bases, the same two turns, four fresh co
- vibe: four of four wrote the file at the workspace root, and the console showed it.
The model is off fast-agent and docker-agent too, and their rows left support-matrix-results.json. vibe keeps it.
+
+### fast-agent reaches a server at any path (0.37.3)
+
+The browser column of 0.37.0 read fast-agent's crash on the plugs server ("MCP Server: 'plugs': Failed to
+initialize … MCPError: Not Found", then "RuntimeError: Core not initialized") as a refusal of the loopback
+address, because bridging the loopback url fixed it. The hosted service's column (2026-10-26) put the plugs
+server at a public https url and fast-agent failed the same way, twice, with the bearer it was given. A stand-in
+server that logs each request settled it: fast-agent 0.10.47 posted twice to `/v1/mcp/plugs/mcp`. Its url parser
+appends `/mcp` to a streamable-HTTP url with no query string whose path does not end in `/mcp` (or `/sse`), and
+the 404 for the path it made up became the whole turn's failure. The host never mattered; the path did.
+
+So fast-agent now bridges exactly the servers its parser would rewrite, on any host, and keeps its own client
+for the rest (the public probe at `/mcp`, deepwiki). It leaves the loopback set, where nanobot and docker-agent
+stay: their refusals are of the address, measured on their own. A server a person adds at a path like
+`/api/tools` reaches fast-agent through the bridge too, which it did not before.
+
+The same column found docker-agent running part of the built-in officecli skill as a shell command each time it
+read the skill. docker-agent expands ``!`command` `` in every local SKILL.md, as Claude Code's skills do, and the
+skill's line "with morph `!!` prefix awareness" holds that sequence, so the text up to the next backtick ran as a
+command, failed, and left an error inside the skill text the model read. The line is reworded in the skills
+repository (HarnessRouter/skills 1553417); an image built from now on carries it.
diff --git a/runner/server.py b/runner/server.py
index c3ec8ca3..ad84d7c8 100644
--- a/runner/server.py
+++ b/runner/server.py
@@ -1918,13 +1918,7 @@ _MCP_BRIDGE = os.path.join(os.path.dirname(os.path.abspath(__file__)), "mcp_brid
# `allow_private_ips: true` is the documented opt-in. The bridge does not need it: bridged, there is
# no url left to refuse, and its own remote client keeps handling public servers, which the plugin
# matrix measured on both transports.
-# fast-agent is the THIRD, and it fails the other way: it DOES try the loopback url and its MCP
-# startup dies, taking the turn with it — "MCP Server: 'plugs': Failed to initialize … Details:
-# MCPError: Not Found", then "RuntimeError: Core not initialized, please call initialize() first".
-# Three runs of the browser column, same crash each time, no browser call in any of them. Bridged
-# it has no url to start, and its own remote client keeps the public servers the plugin matrix
-# measured on both transports.
-_BRIDGE_LOOPBACK_BACKENDS = {"nanobot", "docker-agent", "fast-agent"}
+_BRIDGE_LOOPBACK_BACKENDS = {"nanobot", "docker-agent"}
_LOOPBACK_HOSTS = ("localhost", "127.", "::1", "0.0.0.0", "169.254.", "10.", "192.168.")
@@ -1940,6 +1934,28 @@ def _mcp_url_is_loopback(url: str) -> bool:
return host == "localhost" or host.endswith(".localhost") or host.startswith(_LOOPBACK_HOSTS)
+# fast-agent fails on a server's PATH, not its host: its url parser (cli/commands/url_parser.py,
+# 0.10.47) appends /mcp to a streamable-HTTP url with no query string whose path does not already
+# end in /mcp (or /sse). Every server this product hosts is at a path like that (/v1/mcp/plugs), so
+# fast-agent posted to /v1/mcp/plugs/mcp, got a 404, and its MCP startup died with the turn: "MCP
+# Server: 'plugs': Failed to initialize … MCPError: Not Found", then "RuntimeError: Core not
+# initialized". It was first read as a loopback refusal (the browser column, 2026-10-21) because the
+# loopback bridge fixed it; the hosted service, where the plugs server is a public https url, failed
+# the same way twice (2026-10-26), and a stand-in server that logs each request showed the two POSTs
+# to the suffixed path, with the bearer. Bridged, the runner speaks to the url as given; a server
+# whose path ends in /mcp (the public probe, deepwiki) stays on fast-agent's own client.
+_BRIDGE_SUFFIXED_HTTP_BACKENDS = {"fast-agent"}
+
+
+def _http_url_gets_mcp_suffix(url: str, transport: str) -> bool:
+ """Whether fast-agent's url parser would append /mcp to this server's url."""
+ if transport != "http":
+ return False
+ parts = urllib.parse.urlsplit(url)
+ path = (parts.path or "").rstrip("/")
+ return not parts.query and not path.endswith("/mcp") and not path.endswith("/sse")
+
+
def _sse_bridges(cwd: str, servers: list[dict] | None, backend: str) -> list[dict]:
"""Each remote server whose transport this backend's client cannot reach becomes a stdio
launcher that runs the bridge with the url, the transport and the headers in its environment
@@ -1948,14 +1964,16 @@ def _sse_bridges(cwd: str, servers: list[dict] | None, backend: str) -> list[dic
backends pass untouched."""
bridged = _BRIDGED_TRANSPORTS.get(backend)
loopback_only = backend in _BRIDGE_LOOPBACK_BACKENDS
- if not bridged and not loopback_only:
+ suffixed = backend in _BRIDGE_SUFFIXED_HTTP_BACKENDS
+ if not bridged and not loopback_only and not suffixed:
return list(servers or [])
out: list[dict] = []
for s in servers or []:
s = s or {}
url = str(s.get("url") or "").strip()
transport = str(s.get("transport") or "http").lower()
- if not url or not (transport in (bridged or ()) or (loopback_only and _mcp_url_is_loopback(url))):
+ if not url or not (transport in (bridged or ()) or (loopback_only and _mcp_url_is_loopback(url))
+ or (suffixed and _http_url_gets_mcp_suffix(url, transport))):
out.append(s)
continue
name = _mcp_name(str(s.get("name") or s.get("id") or "mcp"))
diff --git a/runner/tests/test_batch4_backends.py b/runner/tests/test_batch4_backends.py
index d8699497..5b94bd85 100644
--- a/runner/tests/test_batch4_backends.py
+++ b/runner/tests/test_batch4_backends.py
@@ -510,22 +510,42 @@ def test_a_loopback_server_is_bridged_for_docker_agent():
assert "HR_MCP_URL" in launcher and "127.0.0.1:8080" in launcher
-def test_a_loopback_server_is_bridged_for_fast_agent_too():
- """The same class, the other failure mode: fast-agent DOES try the loopback url and its MCP
- startup dies, taking the whole turn with it — "MCP Server: 'plugs': Failed to initialize …
- MCPError: Not Found", then "RuntimeError: Core not initialized". Three runs of the browser
- column, the same crash each time and no browser call in any of them; bridged, it passed in 12 s
- (2026-10-21)."""
+def test_the_plugs_server_is_bridged_for_fast_agent():
+ """fast-agent appends /mcp to a streamable-HTTP path that does not end in it, so it posted to
+ /v1/mcp/plugs/mcp, got a 404, and its MCP startup took the turn with it ("MCPError: Not Found",
+ then "RuntimeError: Core not initialized"). Bridged, it passed in 12 s (2026-10-21)."""
ws = _ws()
out = _sse_bridges(ws, [{"name": "plugs", "url": "http://127.0.0.1:8080/v1/mcp/plugs",
"headers": {"Authorization": "Bearer t"}}], "fast-agent")
assert out[0].get("command") and "url" not in out[0]
-def test_a_public_server_still_goes_to_fast_agents_own_client():
+def test_a_public_server_at_such_a_path_is_bridged_for_fast_agent_too():
+ """The hosted service's plugs server is a public https url at the same kind of path: fast-agent
+ failed on it the same way, twice (2026-10-26). The path decides, not the host."""
ws = _ws()
- out = _sse_bridges(ws, [{"name": "probe", "url": "https://probe.example/mcp"}], "fast-agent")
- assert out[0].get("url") == "https://probe.example/mcp" and "command" not in out[0]
+ out = _sse_bridges(ws, [{"name": "plugs", "url": "https://gw.example/v1/mcp/plugs",
+ "headers": {"Authorization": "Bearer t"}}], "fast-agent")
+ assert out[0].get("command") and "url" not in out[0]
+ assert "https://gw.example/v1/mcp/plugs" in pathlib.Path(out[0]["command"]).read_text()
+
+
+def test_a_server_fast_agent_does_not_rewrite_stays_on_its_own_client():
+ ws = _ws()
+ for url, transport in (("https://probe.example/mcp", "http"), ("https://probe.example/mcp/", "http"),
+ ("https://probe.example/sse", "sse"), ("https://probe.example/v1/stream?k=1", "http"),
+ ("https://probe.example/events", "sse")):
+ out = _sse_bridges(ws, [{"name": "probe", "url": url, "transport": transport}], "fast-agent")
+ assert out[0].get("url") == url and "command" not in out[0], url
+
+
+def test_the_path_rule_is_fast_agents_alone():
+ # docker-agent and nanobot take /v1/mcp/plugs as given on a public host (the hosted service's browser
+ # column passed docker-agent on 2026-10-26 and nanobot on 2026-10-14); only a loopback url bridges them
+ ws = _ws()
+ for backend in ("docker-agent", "nanobot", "claude"):
+ out = _sse_bridges(ws, [{"name": "plugs", "url": "https://gw.example/v1/mcp/plugs"}], backend)
+ assert out[0].get("url") == "https://gw.example/v1/mcp/plugs" and "command" not in out[0], backend
def test_a_public_server_still_goes_to_docker_agents_own_client():