PluginBench
MCP Server
Active
Apache-2.0

Universal Screenshot MCP MCP Server

io.github.sethbang/screenshot-server

Capture web pages and system screenshots across macOS, Linux, and Windows via AI assistants.

What is the Universal Screenshot MCP MCP server?

Universal Screenshot MCP is an MCP server that provides AI assistants with screenshot capabilities for both web pages (via Puppeteer) and cross-platform system screenshots (macOS, Linux, Windows). It integrates directly with Claude Desktop, Cursor, and other MCP-compatible clients with security-first design including SSRF prevention and path traversal protection.

This server enables AI assistants to capture screenshots of web pages at specified URLs and dimensions, or take system screenshots of the desktop, specific application windows, or screen regions. It's useful for visual inspection tasks, documentation, testing, and any workflow where an AI needs to see what's on screen or how a webpage renders.

How to install Universal Screenshot MCP

Copy-paste configuration for popular MCP clients.

transport: stdio
Config generated by PluginBench — verify against the source before use.
~/Library/Application Support/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "screenshot-server": {
      "command": "npx",
      "args": [
        "-y",
        "universal-screenshot-mcp"
      ]
    }
  }
}

Tools & capabilities

Tools this server exposes to the agent.

  • take_screenshot — Captures a web page or specific element via headless Puppeteer browser. Supports custom viewport dimensions, full-page capture, CSS selectors, element waiting, delays, and custom output paths.
  • take_system_screenshot — Captures the desktop, application window, or screen region using native OS tools (macOS screencapture, Linux maim/scrot/gnome-screenshot/etc., Windows PowerShell). Supports fullscreen, window, and region modes with multi-display, cursor inclusion, and format options.

Use cases

  • Capture screenshots of web pages at specific dimensions for testing responsive design
  • Take system screenshots of application windows for documentation and bug reporting
  • Monitor how a website renders across different viewport sizes
  • Capture desktop or region screenshots for visual verification tasks
  • Document UI state and layout for accessibility or design review

Universal Screenshot MCP MCP server FAQ

What is Universal Screenshot MCP?

It's an MCP server that gives AI assistants the ability to take screenshots of web pages via Puppeteer and system screenshots across macOS, Linux, and Windows using native OS tools.

Is it free?

Yes, Universal Screenshot MCP is open-source under the Apache-2.0 license and available on npm.

How do I install it in Claude Desktop?

Install via npm (npm install -g universal-screenshot-mcp) or run with npx, then add it to ~/Library/Application Support/Claude/claude_desktop_config.json with the command 'npx -y universal-screenshot-mcp'.

How do I install it in Cursor?

Use the 'claude mcp add' command: claude mcp add screenshot-server -- npx -y universal-screenshot-mcp (project scope) or with --scope user for global availability.

Does it require authentication?

No authentication is required. However, web page screenshots only work with public URLs (http/https), and localhost is blocked by default unless ALLOW_LOCAL=true is set.

What are the platform requirements?

Node.js >= 18.0.0 is required. macOS has built-in screencapture. Linux requires one of: maim, scrot, gnome-screenshot, spectacle, grim, or ImageMagick. Windows uses built-in PowerShell.

README (reference)

Source of truth, from the repository.

Universal Screenshot MCP

npm version MCP Registry License

An MCP (Model Context Protocol) server that provides AI assistants with screenshot capabilities — both web page capture via Puppeteer and cross-platform system screenshots using native OS tools.

Features

  • Web Page Screenshots — Capture any public URL using a headless Chromium browser
  • Cross-Platform System Screenshots — Fullscreen, window, or region capture using native OS tools (macOS screencapture, Linux maim/scrot/gnome-screenshot/etc., Windows PowerShell+.NET)
  • Security-First Design — SSRF prevention, path traversal protection, DNS rebinding defense, command injection prevention, and DoS limiting
  • MCP Native — Integrates directly with Claude Desktop, Cursor, and any MCP-compatible client

Requirements

  • Node.js >= 18.0.0
  • Chromium is downloaded automatically by Puppeteer on first run

Platform-Specific Requirements for take_system_screenshot

PlatformRequired ToolsNotes
macOSscreencapture (built-in)No additional installation needed
LinuxOne of: maim, scrot, gnome-screenshot, spectacle, grim, or import (ImageMagick)maim or scrot recommended for full feature support. For window-by-name capture, also install xdotool.
Windowspowershell (built-in)Uses .NET System.Drawing — no additional installation needed

Linux Installation Examples

# Ubuntu/Debian (recommended)
sudo apt install maim xdotool

# Fedora
sudo dnf install maim xdotool

# Arch Linux
sudo pacman -S maim xdotool

# Wayland (Sway, etc.)
sudo apt install grim

After installing, you can verify your setup with:

npx universal-screenshot-mcp --doctor

This probes the host and prints copy-pasteable install commands for any missing tools, tailored to your detected distro.

Quick Start

Install from npm

npm install -g universal-screenshot-mcp

Or run directly with npx:

npx universal-screenshot-mcp

Install from Source

git clone https://github.com/sethbang/mcp-screenshot-server.git
cd mcp-screenshot-server
npm install
npm run build

Configure Your MCP Client

Add the server to your MCP client configuration. For Claude Desktop, edit ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "screenshot-server": {
      "command": "npx",
      "args": ["-y", "universal-screenshot-mcp"]
    }
  }
}

Or if installed from source:

{
  "mcpServers": {
    "screenshot-server": {
      "command": "node",
      "args": ["/absolute/path/to/mcp-screenshot-server/build/index.js"]
    }
  }
}

For Claude Code, register the server with the claude mcp add command:

# Project scope (current directory only)
claude mcp add screenshot-server -- npx -y universal-screenshot-mcp

# User scope (available across all projects)
claude mcp add --scope user screenshot-server -- npx -y universal-screenshot-mcp

Or if installed from source:

claude mcp add screenshot-server -- node /absolute/path/to/mcp-screenshot-server/build/index.js

Verify the server registered with claude mcp list, or check live status from inside a session with /mcp.

For Cursor or other MCP clients, consult their documentation for the equivalent configuration.

Tools

The server exposes two MCP tools:

take_screenshot

Captures a web page (or a specific element) via a headless Puppeteer browser.

ParameterTypeRequiredDescription
urlstring✅URL to capture (http/https only)
widthnumber—Viewport width (1–3840)
heightnumber—Viewport height (1–2160)
fullPageboolean—Capture the full scrollable page
selectorstring—CSS selector to capture a specific element
waitForSelectorstring—Wait for this selector before capturing
waitForTimeoutnumber—Delay in milliseconds (0–30000)
outputPathstring—Output file path (default: ~/Documents/screenshots)

Example prompt:

Take a screenshot of https://example.com at 1920x1080

take_system_screenshot

Captures the desktop, a specific application window, or a screen region using native OS tools. Works on macOS, Linux, and Windows.

ParameterTypeRequiredDescription
modeenum✅fullscreen, window, or region
windowIdnumber—Window ID for window mode
windowNamestring—App name (e.g. "Safari", "Firefox") for window mode
regionobject—{ x, y, width, height } for region mode
displaynumber—Display number for multi-monitor setups
includeCursorboolean—Include the mouse cursor in the capture
formatenum—png (default) or jpg
delaynumber—Capture delay in seconds (0–10)
outputPathstring—Output file path (default: ~/Documents/screenshots)

Cross-Platform Feature Support

FeaturemacOSLinuxWindows
Fullscreen✅✅✅
Region✅✅ (maim, scrot, grim, import)✅
Window by name✅⚠️ X11 + xdotool⚠️ best-effort
Window by ID✅✅ X11 only⚠️ HWND
Multi-display✅⚠️ tool-dependent✅
Include cursor✅⚠️ tool-dependent⚠️
Delay✅✅✅

Example prompt:

Take a system screenshot of the Safari window

Configuration

Environment Variables

VariableDefaultDescription
SCREENSHOT_OUTPUT_DIRDocuments/screenshotsDefault output directory relative to ~
ALLOW_LOCALfalseSet to true to allow screenshotting localhost/127.x.x.x/[::1] (useful for local dev servers)

Output Directories

Screenshots are saved to ~/Documents/screenshots by default (configurable via SCREENSHOT_OUTPUT_DIR). Custom output paths must resolve to one of these allowed directories:

DirectoryDescription
~/Documents/screenshotsDefault output location (configurable)
~/Desktop/ScreenshotsOriginal default location
~/DownloadsUser downloads folder
~/DocumentsUser documents folder
/tmpSystem temp directory

Security

This server implements multiple layers of security hardening:

IDThreatMitigation
SEC-001SSRF / DNS rebindingURLs validated against blocked IP ranges; DNS resolved pre-request with IP pinning via --host-resolver-rules; navigation redirects re-validated
SEC-003Command injectionAll subprocesses use execFile (no shell); app names validated against SAFE_APP_NAME_PATTERN
SEC-004Path traversalOutput paths validated with fs.realpath() symlink resolution; restricted to allowed directories
SEC-005Denial of serviceConcurrent Puppeteer instances limited to 3 via semaphore

For full details, see docs/security.md.

Development

Scripts

CommandDescription
npm run buildCompile TypeScript to build/
npm run watchRecompile on file changes
npm testUnit tests (fast, fully mocked)
npm run test:integrationIntegration tests (real DNS/filesystem)
npm run test:e2eE2E tests (real Puppeteer/native tools)
npm run test:allAll test tiers together
npm run test:linuxLinux e2e via Docker (requires Docker)
npm run test:watchRun tests in watch mode
npm run test:coverageRun tests with coverage report
npm run lintLint source with ESLint
npm run inspectorLaunch MCP Inspector for debugging

Project Structure

src/
├── index.ts                 # Entry point — stdio transport
├── server.ts                # MCP server factory
├── config/
│   ├── index.ts             # Static constants (limits, allowed dirs)
│   └── runtime.ts           # Singleton semaphore, default directory
├── tools/
│   ├── take-screenshot.ts   # Web page capture tool
│   └── take-system-screenshot.ts  # macOS system capture tool
├── types/
│   └── index.ts             # Shared TypeScript interfaces
├── utils/
│   ├── helpers.ts           # Response builders, file utilities
│   ├── screenshot-provider.ts # Cross-platform provider interface + factory
│   ├── macos-provider.ts    # macOS: screencapture wrapper
│   ├── linux-provider.ts    # Linux: maim/scrot/gnome-screenshot/etc.
│   ├── windows-provider.ts  # Windows: PowerShell + .NET System.Drawing
│   ├── macos.ts             # Window ID lookup via CoreGraphics
│   └── semaphore.ts         # Async concurrency limiter
└── validators/
    ├── path.ts              # Output path validation (SEC-004)
    └── url.ts               # URL/SSRF validation (SEC-001)

Testing

Tests use Vitest in three tiers:

  • Unit (npm test) — Full dependency injection, no real I/O. Fast feedback loop.
  • Integration (npm run test:integration) — Real DNS resolution, real filesystem with temp directories, real Puppeteer against a local HTTP server.
  • E2E (npm run test:e2e) — Real native screenshot tools. macOS tests run natively; Linux tests run in Docker via npm run test:linux.
npm test                 # Unit tests (~300ms)
npm run test:linux       # Linux provider tests in Docker
npm run test:all         # Everything

Debugging with MCP Inspector

npm run inspector

This launches the MCP Inspector connected to your built server, allowing you to invoke tools interactively.

License

Apache-2.0 — Copyright 2026 Seth Bang

Related MCP servers

Unofficial Proton Mail MCP — send, read, search & organize email over SMTP and IMAP

3
TypeScript
MIT
View repository →

API Schema Drift Monitor — detect breaking changes in OpenAPI specs

0
TypeScript
MIT
View repository →

Manage your local model machine over MCP: state, model pull/remove, service switch, LoRA training

0
Python
MIT
View repository →

Call your local Ollama or vLLM model over MCP with schema-validated JSON output

0
Python
MIT
View repository →

Work your Luca workspace from any MCP client: 183 API tools + 15 task tools for leads and calls.

China state-owned enterprise campus recruitment: search jobs, deadlines, official source links.

0
MIT
View repository →