monitor_cookie_changes
Start, stop, or retrieve recorded cookie changes across browser tabs. Optionally filter by domain to track specific site cookies.
Instructions
Monitor cookie changes across all tabs. Start monitoring, get recorded changes, or stop. Optionally filter by domain.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | Start, stop, or get recorded changes | |
| domain | No | Filter by domain | |
| apiKey | No | API key for authentication if enabled |
Implementation Reference
- src/tools/monitoring.ts:31-51 (registration)Tool registration on the MCP server using server.tool() — defines name, description, schema, and handler.
server.tool( 'monitor_cookie_changes', 'Monitor cookie changes across all tabs. Start monitoring, get recorded changes, or stop. Optionally filter by domain.', { action: z.enum(['start', 'stop', 'get']).describe('Start, stop, or get recorded changes'), domain: z.string().optional().describe('Filter by domain'), apiKey: z.string().optional().describe('API key for authentication if enabled'), }, async ({ action, domain, apiKey }) => { const result = await bridge.sendCommand({ command: 'monitor_cookie_changes', params: { action, domain }, apiKey, timeout: LONG_TIMEOUT, }); if (!result.success) { return { content: [{ type: 'text', text: `Error: ${result.error?.message}` }], isError: true }; } return { content: [{ type: 'text', text: JSON.stringify(result.data, null, 2) }] }; } ); - src/tools/monitoring.ts:34-38 (schema)Zod schema defining the tool's input parameters: action (start/stop/get), optional domain filter, and optional apiKey.
{ action: z.enum(['start', 'stop', 'get']).describe('Start, stop, or get recorded changes'), domain: z.string().optional().describe('Filter by domain'), apiKey: z.string().optional().describe('API key for authentication if enabled'), }, - src/tools/monitoring.ts:39-50 (handler)Handler function that sends the 'monitor_cookie_changes' command via WebSocketBridge to the browser extension.
async ({ action, domain, apiKey }) => { const result = await bridge.sendCommand({ command: 'monitor_cookie_changes', params: { action, domain }, apiKey, timeout: LONG_TIMEOUT, }); if (!result.success) { return { content: [{ type: 'text', text: `Error: ${result.error?.message}` }], isError: true }; } return { content: [{ type: 'text', text: JSON.stringify(result.data, null, 2) }] }; }