proxy_set_host_upstream
Configure per-host proxy overrides to route traffic for specific hostnames through designated upstream proxies instead of the global proxy.
Instructions
Set a per-host upstream proxy override. Traffic to this hostname will use the specified proxy instead of the global one.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hostname | Yes | Hostname to override (e.g., api.example.com) | |
| proxy_url | Yes | Upstream proxy URL for this host | |
| no_proxy | No | Hostnames to bypass this proxy |
Implementation Reference
- src/tools/upstream.ts:55-79 (handler)Implementation of the proxy_set_host_upstream tool handler.
server.tool( "proxy_set_host_upstream", "Set a per-host upstream proxy override. Traffic to this hostname will use the specified proxy instead of the global one.", { hostname: z.string().describe("Hostname to override (e.g., api.example.com)"), proxy_url: z.string().describe("Upstream proxy URL for this host"), no_proxy: z.array(z.string()).optional().describe("Hostnames to bypass this proxy"), }, async ({ hostname, proxy_url, no_proxy }) => { try { await proxyManager.setHostUpstream(hostname, { proxyUrl: proxy_url, noProxy: no_proxy }); return { content: [{ type: "text", text: JSON.stringify({ status: "success", message: `Upstream for '${hostname}' set to ${proxy_url}`, }), }], }; } catch (e) { return { content: [{ type: "text", text: JSON.stringify({ status: "error", error: String(e) }) }] }; } }, );