interceptor_spawn
Run commands with proxy environment variables configured to route traffic through an MITM proxy for network traffic capture and modification.
Instructions
Spawn a command with proxy env vars pre-configured (HTTP_PROXY, HTTPS_PROXY, SSL_CERT_FILE, NODE_EXTRA_CA_CERTS, CURL_CA_BUNDLE, and 15+ more). Traffic automatically routes through the MITM proxy.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| command | Yes | Command to run (e.g., 'curl', 'node', 'python') | |
| args | No | Command arguments | |
| cwd | No | Working directory (default: current) | |
| env | No | Additional env vars to set |
Implementation Reference
- src/tools/interceptors.ts:454-483 (handler)The 'interceptor_spawn' MCP tool handler implementation. It uses `interceptorManager.activate("terminal", ...)` to spawn a process with proxied environment variables.
server.tool( "interceptor_spawn", "Spawn a command with proxy env vars pre-configured (HTTP_PROXY, HTTPS_PROXY, SSL_CERT_FILE, NODE_EXTRA_CA_CERTS, CURL_CA_BUNDLE, and 15+ more). Traffic automatically routes through the MITM proxy.", { command: z.string().describe("Command to run (e.g., 'curl', 'node', 'python')"), args: z.array(z.string()).optional().default([]).describe("Command arguments"), cwd: z.string().optional().describe("Working directory (default: current)"), env: z.record(z.string()).optional().describe("Additional env vars to set"), }, async ({ command, args, cwd, env }) => { try { const proxyInfo = requireProxy(); const result = await interceptorManager.activate("terminal", { ...proxyInfo, command, args, cwd, env, }); return { content: [{ type: "text", text: JSON.stringify({ status: "success", ...result }), }], }; } catch (e) { return { content: [{ type: "text", text: JSON.stringify({ status: "error", error: errorToString(e) }) }] }; } }, );