MCP Screen Capture
# MCP Screen Capture
An MCP server for capturing screenshots, recording videos, and generating animated GIFs from web pages using Playwright and ffmpeg.
## Prerequisites
- Node.js 18+
- ffmpeg (install via `brew install ffmpeg` on macOS)
## Installation
```bash
cd mcp-screen-capture
npm install
```
This will automatically install Playwright's Chromium browser via the postinstall script.
## MCP Configuration
Add to your Claude Code MCP settings (`~/.claude/settings.json`):
```json
{
"mcpServers": {
"screen-capture": {
"command": "node",
"args": ["/path/to/mcp-screen-capture/src/index.js"]
}
}
}
```
## Available Tools
### `screenshot`
Take a screenshot of a URL.
**Parameters:**
- `url` (required): URL to capture
- `outputPath` (required): Path to save the screenshot (.png)
- `width`: Viewport width (default: 1280)
- `height`: Viewport height (default: 720)
- `fullPage`: Capture full scrollable page (default: false)
- `waitForSelector`: Wait for a CSS selector before capturing
- `delay`: Delay in ms before capturing (default: 0)
**Example:**
```json
{
"url": "http://localhost:5173",
"outputPath": "/path/to/screenshot.png",
"fullPage": true
}
```
### `record_video`
Record a video of a webpage with optional auto-scrolling.
**Parameters:**
- `url` (required): URL to record
- `outputPath` (required): Path to save the video (.webm)
- `width`: Viewport width (default: 1280)
- `height`: Viewport height (default: 720)
- `duration`: Recording duration in ms (default: 5000)
- `scrollToBottom`: Auto-scroll during recording (default: false)
- `scrollSpeed`: Pixels per scroll step (default: 100)
**Example:**
```json
{
"url": "http://localhost:5173",
"outputPath": "/path/to/recording.webm",
"duration": 8000,
"scrollToBottom": true
}
```
### `video_to_gif`
Convert a video file to an animated GIF.
**Parameters:**
- `inputPath` (required): Path to input video
- `outputPath` (required): Path to save the GIF
- `fps`: Frames per second (default: 10)
- `width`: GIF width in pixels (default: 800)
- `quality`: Quality preset - "low", "medium", "high" (default: "medium")
**Example:**
```json
{
"inputPath": "/path/to/video.webm",
"outputPath": "/path/to/output.gif",
"fps": 12,
"quality": "high"
}
```
### `capture_gif`
All-in-one: Record a webpage and save directly as GIF.
**Parameters:**
- `url` (required): URL to record
- `outputPath` (required): Path to save the GIF
- `width`: Viewport width (default: 1280)
- `height`: Viewport height (default: 720)
- `duration`: Recording duration in ms (default: 5000)
- `scrollToBottom`: Auto-scroll during recording (default: false)
- `fps`: GIF frames per second (default: 10)
- `gifWidth`: Output GIF width (default: 800)
- `quality`: Quality preset (default: "medium")
**Example:**
```json
{
"url": "http://localhost:5173",
"outputPath": "/path/to/demo.gif",
"duration": 8000,
"scrollToBottom": true,
"fps": 12,
"gifWidth": 800,
"quality": "high"
}
```
## Quality Presets
| Preset | Dithering | Best For |
|--------|-----------|----------|
| `low` | None | Small file size, simple graphics |
| `medium` | Bayer | Balanced quality and size |
| `high` | Sierra | Best quality, larger files |
## Use Cases
- Generate demo GIFs for README files
- Capture screenshots for documentation
- Record UI interactions for bug reports
- Create visual regression test baselines
## License
MIT
TDQS
Scored across 4 tools
screenshot and record_video are clearly distinct (single frame vs. video), but capture_gif explicitly combines record_video and video_to_gif, creating an intentional overlap where the agent must decide between composing two tools or using the convenience shortcut. Descriptions do clarify the boundaries, but the redundancy keeps this from being fully distinct.
record_video and capture_gif follow a verb_noun pattern, but screenshot is a bare noun and video_to_gif uses a noun_to_noun conversion style. All snake_case and readable, but the verb convention is mixed rather than predictable.
Four tools is a lean but well-scoped surface for a screen-capture server. Each tool maps to a distinct output format, though capture_gif is arguably a convenience wrapper rather than an independent capability.
The set covers still images, video recording, and GIF output with both composable and shortcut paths, which is solid lifecycle coverage for the domain. Minor gaps like configurable screenshot options (full-page, viewport) aren't represented but are workable.