Allow configuring the advertised MCP Apps sandbox URL (e.g. MCP_SANDBOX_FULL_ADDRESS)
Summary
Please add a way to override the public MCP Apps sandbox URL returned by GET /api/config as sandboxUrl, independent of the process bind address.
Today the sandbox listen URL is built in clients/web/server/sandbox-controller.ts roughly as:
sandboxUrl = `http://${urlHost}:${actualPort}/sandbox`;
When the server binds 0.0.0.0, urlHost is forced to localhost. There is MCP_SANDBOX_PORT for the port, but no env/config for scheme + hostname (unlike v1’s MCP_PROXY_FULL_ADDRESS for the proxy).
Why this matters
In remote / container / lab setups the browser does not share the Inspector process’s localhost:
- UI is reached at a public hostname, e.g.
https://inspector.example.com/
- Sandbox is (or can be) routed separately, e.g.
https://inspector-sandbox.example.com/sandbox
/api/config still advertises http://localhost:6275/sandbox
- “Open App” points the iframe at the browser’s localhost → connection refused / mixed content on HTTPS
Routing port 6275 and setting ALLOWED_ORIGINS is not enough; the advertised sandboxUrl must be a URL the browser can actually open.
This also affects Docker, k8s ingress, and any reverse-proxy hostname split between UI and sandbox.
Proposed solution
Something parallel to v1 MCP_PROXY_FULL_ADDRESS, for example:
MCP_SANDBOX_FULL_ADDRESS=https://inspector-sandbox.example.com/sandbox
Behavior:
- If set, use it as
sandboxUrl in GET /api/config (and banner).
- If unset, keep current bind-derived
http://<host>:<port>/sandbox behavior.
- Document that the process must still listen on
MCP_SANDBOX_PORT (or equivalent) and that the public URL must be routed to that listener.
ALLOWED_ORIGINS remains responsible for UI origin / frame-ancestors (orthogonal).
Alternatives considered
- SSH/port-forward both 6274 and 6275 so the browser uses localhost (works for dev; not for public Instruqt/k8s hostnames).
- Rewrite
/api/config at the gateway (works as a lab hack; shouldn’t be required).
- Patch
sandbox-controller.ts locally.
Related
- Docs already note forwarding both UI and sandbox ports for remote App review.
- #1276 is related remote/embed friction (referrer allowlist), but not the advertised URL override.
- v1 precedent:
MCP_PROXY_FULL_ADDRESS.
Environment
@modelcontextprotocol/inspector v2.0.0
- Instruqt / k3d: UI on public HTTPS hostname; sandbox needs a second public hostname → pod
:6275
Allow configuring the advertised MCP Apps sandbox URL (e.g.
MCP_SANDBOX_FULL_ADDRESS)Summary
Please add a way to override the public MCP Apps sandbox URL returned by
GET /api/configassandboxUrl, independent of the process bind address.Today the sandbox listen URL is built in
clients/web/server/sandbox-controller.tsroughly as:When the server binds
0.0.0.0,urlHostis forced tolocalhost. There isMCP_SANDBOX_PORTfor the port, but no env/config for scheme + hostname (unlike v1’sMCP_PROXY_FULL_ADDRESSfor the proxy).Why this matters
In remote / container / lab setups the browser does not share the Inspector process’s localhost:
https://inspector.example.com/https://inspector-sandbox.example.com/sandbox/api/configstill advertiseshttp://localhost:6275/sandboxRouting port 6275 and setting
ALLOWED_ORIGINSis not enough; the advertisedsandboxUrlmust be a URL the browser can actually open.This also affects Docker, k8s ingress, and any reverse-proxy hostname split between UI and sandbox.
Proposed solution
Something parallel to v1
MCP_PROXY_FULL_ADDRESS, for example:Behavior:
sandboxUrlinGET /api/config(and banner).http://<host>:<port>/sandboxbehavior.MCP_SANDBOX_PORT(or equivalent) and that the public URL must be routed to that listener.ALLOWED_ORIGINSremains responsible for UI origin /frame-ancestors(orthogonal).Alternatives considered
/api/configat the gateway (works as a lab hack; shouldn’t be required).sandbox-controller.tslocally.Related
MCP_PROXY_FULL_ADDRESS.Environment
@modelcontextprotocol/inspectorv2.0.0:6275