Phase AI Proxy fetch
One tool, fetch_via_phase_proxy, that fetches an http(s) URL through a local Phase AI Proxy gate (paid SOCKS5, exits via Phase network nodes). Submitted by the Phase team.
Documentation
phase-proxy-mcp
MCP server with one tool, fetch_via_phase_proxy(url, method="GET", headers=None): fetches an http(s) URL through an already open Phase AI Proxy gate. GET and HEAD only; nothing is stored.
Traffic through the gate is charged to the user's deposit, so every call is bounded. Exactly what is bounded:
| Bound | Variable (default) | Behaviour |
|---|---|---|
| Total time of one call | PHASE_PROXY_TIMEOUT (30 s) | One deadline for connect, all redirect hops, headers and body. When it passes, the connection is closed and the tool raises an error. It is not a per-read timeout |
| Body bytes read from the gate | PHASE_PROXY_MAX_BYTES (262144) | The tool stops reading at the cap and closes the connection. A response whose Content-Length is over the cap is refused before any body is read (refused says why) |
| Decoded size | same cap | The tool asks for Accept-Encoding: gzip only and inflates with the cap on the output, so a small compressed body cannot expand in memory |
| Redirects | PHASE_PROXY_MAX_REDIRECTS (5) | Followed by the tool itself; bodies of redirect responses are not read. A redirect from https to http, or to another scheme, is refused. Caller headers are dropped when a redirect leaves the origin |
| Text returned to the model | PHASE_PROXY_MAX_BODY (20000 chars) | Trims the returned string only; it does not change what is downloaded |
What is not bounded: request and response headers, TLS and SOCKS handshakes, and bytes that were already on their way when the tool closed the connection (the last socket read can carry up to 64 KiB past the cap, and the exit may have relayed more). The exit meters what it relays, so those bytes count. The caps limit the download; they are not a spending limit.
One HTTP client is kept for the life of the process, so calls to the same origin reuse a kept-alive connection (one tunnel) instead of opening a new one per call. A response stopped at the cap or refused closes its connection.
The result has status, final_url, redirects, headers, body, bytes_read, truncated, refused, note, warning (set when any hop was plain http).
The server is given the gate address and nothing else; it does not read config.env or the wallet key. The key is still on the command line of the iroh-proxy process while the gate is open (see "Where the wallet key is" in the repository README), so the safest setup is: the user opens the gate, the agent gets this tool and no shell.
Open the gate first with the official scripts (see the repository README), then:
pip install ./mcp # or: uvx --from ./mcp phase-proxy-mcp
PHASE_PROXY_URL=socks5h://127.0.0.1:1080 phase-proxy-mcp
Client config: see .mcp.json. PHASE_PROXY_URL defaults to socks5h://127.0.0.1:1080.
Tests use a local fake SOCKS5 proxy and a local HTTP server, with no real network and no charges:
pip install -e "./mcp[test]" && pytest mcp/tests