Repository navigation
Description
Problem
Agent runs on the Sprites runtime reach ProPR's MCP only through a public HTTPS URL (restrictedSpriteMcpEndpoint in packages/core/src/agents/runtime/sprites/spritesNetwork.ts). A self-hosted instance behind NAT without a public URL has no such URL: the hosted UI tunnel and MCP through ProPR Connect are Plus features. Today such a run is refused ("Sprites cannot reach ProPR MCP … set PROPR_SPRITES_MCP_URL …"). Automations depend on ProPR MCP, so running without it isn't an option.
Design: per-run SSH reverse forward over the Sprites API
The worker already connects out to each Sprite. Carry MCP back over that path, with nothing public:
- Per run, the worker generates an ephemeral SSH keypair (never persisted or logged). During provisioning it starts
sshdin the Sprite bound to127.0.0.1only, with only that public key authorized, no password auth, and forwarding limited to what's needed. Install openssh-server in provisioning if the base image lacks it; check the agent images first. - The worker opens
sprite.proxyPort(@fly/sprites0.2.5,dist/proxy.d.ts) to the Sprite's sshd port, then establishesssh -R 127.0.0.1:<port>:<internal api host>:<api port>through it. Use thesshbinary or a Node SSH library; pick whichever handles reconnects and teardown more simply. - The agent's ProPR MCP config inside the Sprite points to
http://127.0.0.1:<port>/api/mcp. The per-run MCP grant token is still required. Because the address is loopback, the Sprite network policy needs no MCP host entry. - Lifecycle: the forward starts before the agent and is torn down with the run (also on cancel, timeout and reattach failure). If the forward drops mid-run, reconnect with bounded retries; after that, fail the run with a clear MCP-transport error rather than letting tool calls hang.
Selection order (new transport kind next to reachable-url / private-network in agentRunMcpTransport.ts):
- an explicit or public HTTPS MCP URL (
PROPR_SPRITES_MCP_URL/PROPR_AGENT_MCP_URL/API_PUBLIC_URL; ProPR hosted on Fly, or Plus), used directly; - otherwise the SSH reverse forward;
- otherwise refuse the run with an actionable message, as today.
Fly Machines runs are out of scope: they use Fly's private network (flyMcpEndpoint).
Acceptance
-
Live: a self-hosted instance with no public URL (
API_PUBLIC_URLunset, no tunnel) runs on Sprites:- a Claude issue run that calls a ProPR MCP tool;
- an automation run that depends on MCP. Streaming and SSE responses must work.
Attach evidence (task logs showing the transport kind and the MCP calls succeeding).
-
Security checks:
- sshd is not reachable except through the worker's proxy;
- the key is single-use per run;
- the private key and grant token never appear in logs;
- the forward exposes only the MCP API path's host and port.
-
Tests:
- transport selection;
- the refused case;
- lifecycle teardown on success, failure and cancel;
- a reconnect after a dropped forward;
- the sshd config (loopback bind, key-only).
-
Docs: update
docs/docs/features/mcp.mdand the Sprites runtime docs: how runs reach MCP and when a public URL is preferred.
Part of the runtime epic (#3758), alongside #3807 (runtime packages) and #3808 (Extension Library).
Activity
propr-dev commentedon Nov 26, 2026
🤖 AI processing has started for this issue using claude agent with claude-opus-5-5 model.
I'll analyze the problem and work on a solution. This may take a few minutes.
Processing Details:
claudeclaude-opus-5-53813/claude-opus-5-5-remote-runtimes-reach-pro-20261126-0040-t663758-epic-runtime-abstraction-sc0issue-3813-20261126-0040-claude-opus-5-5-t66🔍 Track Task Execution
chore: reach ProPR MCP from Sprites via SSH reverse forward
integry commentedon Dec 1, 2026
Done in #3817, which merged into the runtime epic; the epic merged into
mainwith #3774 and ships in 0.9.4.