Universal Screenshot MCP

平台与服务

by sethbang

提供网页与跨平台系统截图的 MCP 服务,支持 macOS、Linux 和 Windows,便于自动化采集与界面留档。

什么是 Universal Screenshot MCP

提供网页与跨平台系统截图的 MCP 服务,支持 macOS、Linux 和 Windows,便于自动化采集与界面留档。

README

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

bash
# 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:

bash
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

bash
npm install -g universal-screenshot-mcp

Or run directly with npx:

bash
npx universal-screenshot-mcp

Install from Source

bash
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:

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

Or if installed from source:

json
{
  "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:

bash
# 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:

bash
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
urlstringURL to capture (http/https only)
widthnumberViewport width (1–3840)
heightnumberViewport height (1–2160)
fullPagebooleanCapture the full scrollable page
selectorstringCSS selector to capture a specific element
waitForSelectorstringWait for this selector before capturing
waitForTimeoutnumberDelay in milliseconds (0–30000)
outputPathstringOutput 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
modeenumfullscreen, window, or region
windowIdnumberWindow ID for window mode
windowNamestringApp name (e.g. "Safari", "Firefox") for window mode
regionobject{ x, y, width, height } for region mode
displaynumberDisplay number for multi-monitor setups
includeCursorbooleanInclude the mouse cursor in the capture
formatenumpng (default) or jpg
delaynumberCapture delay in seconds (0–10)
outputPathstringOutput 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

code
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.
bash
npm test                 # Unit tests (~300ms)
npm run test:linux       # Linux provider tests in Docker
npm run test:all         # Everything

Debugging with MCP Inspector

bash
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

常见问题

Universal Screenshot MCP 是什么?

提供网页与跨平台系统截图的 MCP 服务,支持 macOS、Linux 和 Windows,便于自动化采集与界面留档。

相关 Skills

Slack动图

by anthropics

Universal
热门

面向Slack的动图制作Skill,内置emoji/消息GIF的尺寸、帧率和色彩约束、校验与优化流程,适合把创意或上传图片快速做成可直接发送的Slack动画。

帮你快速做出适配 Slack 的动图,内置约束规则和校验工具,少踩上传与播放坑,做表情包和演示都更省心。

平台与服务
未扫描164.6k

MCP构建

by anthropics

Universal
热门

聚焦高质量 MCP Server 开发,覆盖协议研究、工具设计、错误处理与传输选型,适合用 FastMCP 或 MCP SDK 对接外部 API、封装服务能力。

想让 LLM 稳定调用外部 API,就用 MCP构建:从 Python 到 Node 都有成熟指引,帮你更快做出高质量 MCP 服务器。

平台与服务
未扫描164.6k

接口测试套件

by alirezarezvani

Universal
热门

扫描 Next.js、Express、FastAPI、Django REST 的 API 路由,自动生成覆盖鉴权、参数校验、错误码、分页、上传与限流场景的 Vitest 或 Pytest 测试套件。

帮你把API与集成测试自动化跑顺,减少回归漏测;能力全面,尤其适合复杂接口场景的QA团队。

平台与服务
未扫描23.3k

相关 MCP Server

Slack 消息

编辑精选

by Anthropic

热门

Slack 是让 AI 助手直接读写你的 Slack 频道和消息的 MCP 服务器。

这个服务器解决了团队协作中需要 AI 实时获取 Slack 信息的痛点,特别适合开发团队让 Claude 帮忙汇总频道讨论或发送通知。不过,它目前只是参考实现,文档有限,不建议在生产环境直接使用——更适合开发者学习 MCP 如何集成第三方服务。

平台与服务
89.0k

by netdata

热门

io.github.netdata/mcp-server 是让 AI 助手实时监控服务器指标和日志的 MCP 服务器。

这个工具解决了运维人员需要手动检查系统状态的痛点,最适合 DevOps 团队让 Claude 自动分析性能数据。不过,它依赖 NetData 的现有部署,如果你没用过这个监控平台,得先花时间配置。

平台与服务
79.5k

by d4vinci

热门

Scrapling MCP Server 是专为现代网页设计的智能爬虫工具,支持绕过 Cloudflare 等反爬机制。

这个工具解决了爬取动态网页和反爬网站时的头疼问题,特别适合需要批量采集电商价格或新闻数据的开发者。不过,它依赖外部浏览器引擎,资源消耗较大,不适合轻量级任务。

平台与服务
71.5k

评论