record_and_gif
Record browser pages as GIFs by opening URLs, capturing screen activity for a set duration, and converting recordings into shareable animated images for simple demos.
Instructions
All-in-one: open URL, wait for specified duration, stop recording, convert to GIF. Best for simple demos.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | URL to record | |
| durationSeconds | No | How long to record (default 5 seconds) | |
| width | No | Viewport width | |
| height | No | Viewport height | |
| gifFps | No | GIF frame rate | |
| gifWidth | No | GIF width (height auto-scaled) |
Implementation Reference
- src/index.js:147-173 (handler)The implementation of the 'record_and_gif' tool, which orchestrates recording, waiting, stopping, and converting the video to a GIF.
mcp.tool( 'record_and_gif', 'All-in-one: open URL, wait for specified duration, stop recording, convert to GIF. Best for simple demos.', { url: z.string().describe('URL to record'), durationSeconds: z.number().optional().default(5).describe('How long to record (default 5 seconds)'), width: z.number().optional().default(1280).describe('Viewport width'), height: z.number().optional().default(720).describe('Viewport height'), gifFps: z.number().optional().default(10).describe('GIF frame rate'), gifWidth: z.number().optional().default(640).describe('GIF width (height auto-scaled)') }, async ({ url, durationSeconds, width, height, gifFps, gifWidth }) => { try { const rec = await startRecording(url, { width, height }); await new Promise(r => setTimeout(r, durationSeconds * 1000)); const stop = await stopRecording(rec.sessionId); const gif = await convertToGif(stop.webmPath, { fps: gifFps, width: gifWidth }); return { content: [{ type: 'text', text: `Recording complete!\n\nVideo: ${stop.webmPath} (${stop.durationSeconds}s)\nGIF: ${gif.gifPath} (${gif.sizeMB} MB)\n\nReady to use in README or documentation.` }] }; } catch (err) { return { content: [{ type: 'text', text: `Error: ${err.message}` }], isError: true }; } }