proxy_replay_session
Replay recorded HTTP requests from a session with filtering options and safety previews to test API interactions or debug network traffic.
Instructions
Replay selected requests from a recorded/imported session. Default mode is dry_run for safety.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| session_id | Yes | Session ID | |
| mode | No | dry_run previews replay plan; execute sends the requests | dry_run |
| limit | No | ||
| offset | No | ||
| sort | No | desc | |
| method | No | HTTP method filter | |
| hostname_contains | No | Filter by hostname substring | |
| url_contains | No | Filter by URL substring | |
| status_code | No | Response status code filter | |
| from_ts | No | Unix ms lower-bound timestamp | |
| to_ts | No | Unix ms upper-bound timestamp | |
| text | No | Generic text filter | |
| exchange_ids | No | Explicit exchange IDs to replay (overrides query filters) | |
| target_base_url | No | Optional base URL override (keeps original path+query) | |
| timeout_ms | No | Per-request timeout in milliseconds |
Implementation Reference
- src/tools/sessions.ts:235-298 (handler)Implementation of the 'proxy_replay_session' tool handler. It registers the tool with the MCP server, defines the input schema using zod, and delegates the execution to `proxyManager.replaySession`.
server.tool( "proxy_replay_session", "Replay selected requests from a recorded/imported session. Default mode is dry_run for safety.", { session_id: z.string().describe("Session ID"), mode: z.enum(["dry_run", "execute"]).optional().default("dry_run") .describe("dry_run previews replay plan; execute sends the requests"), limit: z.number().optional().default(100), offset: z.number().optional().default(0), sort: z.enum(["asc", "desc"]).optional().default("desc"), method: z.string().optional().describe("HTTP method filter"), hostname_contains: z.string().optional().describe("Filter by hostname substring"), url_contains: z.string().optional().describe("Filter by URL substring"), status_code: z.number().optional().describe("Response status code filter"), from_ts: z.number().optional().describe("Unix ms lower-bound timestamp"), to_ts: z.number().optional().describe("Unix ms upper-bound timestamp"), text: z.string().optional().describe("Generic text filter"), exchange_ids: z.array(z.string()).optional().describe("Explicit exchange IDs to replay (overrides query filters)"), target_base_url: z.string().optional() .describe("Optional base URL override (keeps original path+query)"), timeout_ms: z.number().optional().default(15000).describe("Per-request timeout in milliseconds"), }, async ({ session_id, mode, limit, offset, sort, method, hostname_contains, url_contains, status_code, from_ts, to_ts, text, exchange_ids, target_base_url, timeout_ms, }) => { try { const result = await proxyManager.replaySession(session_id, { mode, limit, offset, sort, method, hostnameContains: hostname_contains, urlContains: url_contains, statusCode: status_code, fromTs: from_ts, toTs: to_ts, text, exchangeIds: exchange_ids, targetBaseUrl: target_base_url, timeoutMs: timeout_ms, }); return { content: [{ type: "text", text: truncateResult({ status: "success", ...result }) }], }; } catch (e) { return { content: [{ type: "text", text: JSON.stringify({ status: "error", error: toError(e) }) }] }; } }, );