intercept_existing_terminal
Generate shell commands to intercept HTTP(S) traffic from processes launched in an existing terminal by routing through a specified proxy port.
Instructions
Get a command to run in an existing terminal to start intercepting HTTP(S) traffic from processes launched in that terminal. Returns shell-specific commands for bash, zsh, fish, etc.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| proxyPort | Yes | Proxy port to route traffic through |
Implementation Reference
- src/index.ts:176-186 (handler)Tool registration and handler definition for 'intercept_existing_terminal', which uses the client to activate the interceptor.
server.registerTool( 'intercept_existing_terminal', { title: 'Intercept Existing Terminal', description: 'Get a command to run in an existing terminal to start intercepting HTTP(S) traffic from processes launched in that terminal. Returns shell-specific commands for bash, zsh, fish, etc.', inputSchema: z.object({ proxyPort: z.number().describe('Proxy port to route traffic through'), }), }, async ({ proxyPort }) => jsonResult(await client.activateInterceptor('existing-terminal', proxyPort)) ); - src/httptoolkit-client.ts:101-111 (helper)The underlying HttpToolkitClient implementation for activating an interceptor.
async activateInterceptor( id: string, proxyPort: number, options?: unknown ): Promise<{ result: { success: boolean; metadata?: unknown } }> { return this.request( 'POST', `/interceptors/${encodeURIComponent(id)}/activate/${proxyPort}`, options || {} ); }