Universal Screenshot MCP

io.github.sethbang由 GitHub 帳號 sethbang 發布v1.5.0更新於 Oct 30, 2026

MCP server for web page and cross-platform system screenshots (macOS, Linux, Windows)

發布方自己的服務:screenshot.com.ar

已驗證STDIO僅桌面瀏覽器自動化媒體與設計

概覽

AI 產生的概覽

本機 MCP 伺服器,讓助理用無頭 Chromium 擷取網頁,並在 macOS、Linux、Windows 上擷取桌面、視窗或區域畫面。

可以做什麼
  • 透過無頭 Chromium 擷取公開網頁或指定 CSS 元素,可設定視窗尺寸、整頁、等待選擇器與延遲
  • 使用系統原生工具擷取全螢幕、以名稱或 ID 指定的應用程式視窗,或螢幕區域,可設定格式、游標與延遲
  • 將圖片存到預設截圖資料夾或其他允許的輸出資料夾
適用情境
適合需要視覺證據的情況:把網頁或頁面元素轉成圖片,或抓取使用者目前的螢幕、某個視窗或螢幕局部,用於文件、問題回報或介面檢查。
執行需求
以本機 stdio 程序執行,來自 npm 套件 universal-screenshot-mcp,需要 Node.js 18 以上;Puppeteer 首次執行會自動下載 Chromium。系統截圖需要原生工具:macOS 的 screencapture,Linux 的 maim、scrot、gnome-screenshot、spectacle、grim 或 import 其中之一(依視窗名稱截圖還需 xdotool),Windows 的 PowerShell。可選環境變數 SCREENSHOT_OUTPUT_DIR 與 ALLOW_LOCAL。僅支援桌面端。
安裝前請注意
系統截圖會抓取使用者螢幕上的內容,可能包含隱私或敏感資訊,圖片會寫入 Documents、Desktop、Downloads 或 /tmp 等允許的資料夾。網頁截圖會存取任意公開 URL,由本機發出請求;除非將 ALLOW_LOCAL 設為 true,否則 localhost 會被封鎖。輸出路徑限制在固定資料夾內。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Universal Screenshot MCP,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

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
# Fedorasudo dnf install maim xdotool
# Arch Linuxsudo 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.gitcd mcp-screenshot-servernpm installnpm 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
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; 120 s hard deadline per call, after which the browser is killed and the slot freed
SEC-006Popup SSRF bypassChromium's popup blocker kept on (Puppeteer disables it by default); any popup that still opens is closed

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; Windows tests run on the windows-latest CI runner.
bash
npm test                 # Unit tests (~300ms)npm run test:linux       # Linux provider tests in Dockernpm 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

來源:README.md,提交 d782ff3

工具

2

take_screenshot

Capture web page or element via headless browser. Saves to ~/Documents/screenshots by default (configurable via SCREENSHOT_OUTPUT_DIR env var).

輸入參數url必填widthheightfullPageselectoroutputPathwaitForTimeoutwaitForSelector

take_system_screenshot

Capture desktop, window, or region screenshot. Cross-platform: macOS (screencapture), Linux (maim/scrot/gnome-screenshot/etc.), Windows (PowerShell+.NET). Saves to ~/Documents/screenshots by default (configurable via SCREENSHOT_OUTPUT_DIR env var). For window mode, provide windowName (app name like "Safari") or windowId.

輸入參數mode必填delayformatregiondisplaywindowIdoutputPathwindowNameincludeCursor

版本歷史

2
  1. v1.5.0最新Oct 30, 2026
  2. v1.4.0Sep 16, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

其他 Screenshot 整合