proxy_session_start
Start persistent network traffic capture for proxy analysis, storing data on disk with configurable session parameters.
Instructions
Start persistent on-disk capture for the current proxy run.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| session_name | No | Optional session name | |
| capture_profile | No | preview=body previews only, full=full request/response bodies | preview |
| storage_dir | No | Custom storage directory | |
| max_disk_mb | No | Session disk cap in MB |
Implementation Reference
- src/tools/sessions.ts:31-48 (handler)The handler implementation for the `proxy_session_start` tool, which delegates to `proxyManager.startSession` after verifying that the proxy is running.
async ({ session_name, capture_profile, storage_dir, max_disk_mb }) => { try { if (!proxyManager.isRunning()) { return { content: [{ type: "text", text: JSON.stringify({ status: "error", error: "Proxy is not running. Start it first with proxy_start." }) }] }; } const session = await proxyManager.startSession({ sessionName: session_name, captureProfile: capture_profile, storageDir: storage_dir, maxDiskMb: max_disk_mb, }); return { content: [{ type: "text", text: JSON.stringify({ status: "success", session }) }], }; } catch (e) { return { content: [{ type: "text", text: JSON.stringify({ status: "error", error: toError(e) }) }] }; } }, - src/tools/sessions.ts:21-30 (registration)The registration of the `proxy_session_start` tool within the McpServer, including input schema validation using Zod.
server.tool( "proxy_session_start", "Start persistent on-disk capture for the current proxy run.", { session_name: z.string().optional().describe("Optional session name"), capture_profile: z.enum(["preview", "full"]).optional().default("preview") .describe("preview=body previews only, full=full request/response bodies"), storage_dir: z.string().optional().describe("Custom storage directory"), max_disk_mb: z.number().optional().default(1024).describe("Session disk cap in MB"), },