MCP Screenshot Server
Universal Screenshot MCP
AIアシスタントにスクリーンショット機能を提供するMCP (Model Context Protocol)サーバーです。PuppeteerによるWebページキャプチャと、ネイティブOSツールを使用したクロスプラットフォームのシステムスクリーンショットの両方に対応しています。
機能
Webページスクリーンショット — ヘッドレスChromiumブラウザを使用して、公開されているあらゆるURLをキャプチャ
クロスプラットフォームのシステムスクリーンショット — ネイティブOSツール(macOSの
screencapture、Linuxのmaim/scrot/gnome-screenshotなど、WindowsのPowerShell+.NET)を使用したフルスクリーン、ウィンドウ、または領域のキャプチャセキュリティ重視の設計 — SSRF防止、パストラバーサル保護、DNSリバインディング防御、コマンドインジェクション防止、DoS制限
MCPネイティブ — Claude Desktop、Cursor、およびMCP互換クライアントと直接統合
Related MCP server: Chrome DevTools MCP
要件
Node.js >= 18.0.0
Chromium は初回実行時にPuppeteerによって自動的にダウンロードされます
take_system_screenshot のプラットフォーム別要件
プラットフォーム | 必要なツール | 備考 |
macOS |
| 追加インストール不要 |
Linux |
| 全機能サポートには |
Windows |
| .NET |
Linuxインストール例
# 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インストール後、以下のコマンドでセットアップを確認できます:
npx universal-screenshot-mcp --doctorこれはホストを調査し、検出されたディストリビューションに合わせて不足しているツールのインストールコマンドを表示します。
クイックスタート
npmからインストール
npm install -g universal-screenshot-mcpまたは npx で直接実行:
npx universal-screenshot-mcpソースからインストール
git clone https://github.com/sethbang/mcp-screenshot-server.git
cd mcp-screenshot-server
npm install
npm run buildMCPクライアントの設定
MCPクライアントの設定にサーバーを追加します。Claude Desktopの場合、~/Library/Application Support/Claude/claude_desktop_config.json を編集します:
{
"mcpServers": {
"screenshot-server": {
"command": "npx",
"args": ["-y", "universal-screenshot-mcp"]
}
}
}ソースからインストールした場合は以下:
{
"mcpServers": {
"screenshot-server": {
"command": "node",
"args": ["/absolute/path/to/mcp-screenshot-server/build/index.js"]
}
}
}Claude Codeの場合、claude mcp add コマンドでサーバーを登録します:
# 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ソースからインストールした場合は以下:
claude mcp add screenshot-server -- node /absolute/path/to/mcp-screenshot-server/build/index.jsclaude mcp list でサーバーが登録されたか確認するか、セッション内で /mcp を使用してライブステータスを確認してください。
Cursorやその他のMCPクライアントについては、それぞれのドキュメントで同等の設定方法を確認してください。
ツール
このサーバーは2つのMCPツールを公開しています:
take_screenshot
ヘッドレスPuppeteerブラウザを介してWebページ(または特定の要素)をキャプチャします。
パラメータ | 型 | 必須 | 説明 |
| string | ✅ | キャプチャするURL (http/httpsのみ) |
| number | — | ビューポートの幅 (1–3840) |
| number | — | ビューポートの高さ (1–2160) |
| boolean | — | スクロール可能なページ全体をキャプチャ |
| string | — | 特定の要素をキャプチャするためのCSSセレクタ |
| string | — | キャプチャ前にこのセレクタを待機する |
| number | — | ミリ秒単位の遅延 (0–30000) |
| string | — | 出力ファイルパス (デフォルト: |
プロンプト例:
Take a screenshot of https://example.com at 1920x1080
take_system_screenshot
ネイティブOSツールを使用して、デスクトップ、特定のアプリケーションウィンドウ、または画面領域をキャプチャします。macOS、Linux、Windowsで動作します。
パラメータ | 型 | 必須 | 説明 |
| enum | ✅ |
|
| number | — | ウィンドウモード用のウィンドウID |
| string | — | ウィンドウモード用のアプリ名 (例: |
| object | — | 領域モード用の |
| number | — | マルチモニター設定用のディスプレイ番号 |
| boolean | — | キャプチャにマウスポインターを含める |
| enum | — |
|
| number | — | 秒単位のキャプチャ遅延 (0–10) |
| string | — | 出力ファイルパス (デフォルト: |
クロスプラットフォーム機能サポート
機能 | macOS | Linux | Windows |
フルスクリーン | ✅ | ✅ | ✅ |
領域 | ✅ | ✅ (maim, scrot, grim, import) | ✅ |
ウィンドウ名指定 | ✅ | ⚠️ X11 + xdotool | ⚠️ ベストエフォート |
ウィンドウID指定 | ✅ | ✅ X11のみ | ⚠️ HWND |
マルチディスプレイ | ✅ | ⚠️ ツール依存 | ✅ |
カーソルを含める | ✅ | ⚠️ ツール依存 | ⚠️ |
遅延 | ✅ | ✅ | ✅ |
プロンプト例:
Take a system screenshot of the Safari window
設定
環境変数
変数 | デフォルト | 説明 |
|
|
|
|
|
|
出力ディレクトリ
スクリーンショットはデフォルトで ~/Documents/screenshots に保存されます(SCREENSHOT_OUTPUT_DIR で設定可能)。カスタム出力パスは、以下の許可されたディレクトリのいずれかに解決される必要があります:
ディレクトリ | 説明 |
| デフォルトの出力場所 (設定可能) |
| 元のデフォルトの場所 |
| ユーザーのダウンロードフォルダ |
| ユーザーのドキュメントフォルダ |
| システム一時ディレクトリ |
セキュリティ
このサーバーは複数のセキュリティ強化レイヤーを実装しています:
ID | 脅威 | 緩和策 |
SEC-001 | SSRF / DNSリバインディング | ブロックされたIP範囲に対してURLを検証。 |
SEC-003 | コマンドインジェクション | すべてのサブプロセスで |
SEC-004 | パス・トラバーサル |
|
SEC-005 | サービス拒否 (DoS) | セマフォにより同時Puppeteerインスタンスを3つに制限 |
詳細は docs/security.md を参照してください。
開発
スクリプト
コマンド | 説明 |
| TypeScriptを |
| ファイル変更時に再コンパイル |
| ユニットテスト (高速、完全にモック化) |
| 統合テスト (実際のDNS/ファイルシステム) |
| E2Eテスト (実際のPuppeteer/ネイティブツール) |
| すべてのテスト階層をまとめて実行 |
| Docker経由のLinux e2e (Dockerが必要) |
| ウォッチモードでテストを実行 |
| カバレッジレポート付きでテストを実行 |
| ESLintでソースをリント |
| デバッグ用にMCP Inspectorを起動 |
プロジェクト構造
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)テスト
テストは Vitest を使用し、3つの階層で行われます:
ユニット (
npm test) — 完全な依存関係注入、実際のI/Oなし。高速なフィードバックループ。統合 (
npm run test:integration) — 実際のDNS解決、一時ディレクトリを使用した実際のファイルシステム、ローカルHTTPサーバーに対する実際のPuppeteer。E2E (
npm run test:e2e) — 実際のネイティブスクリーンショットツール。macOSテストはネイティブで実行。Linuxテストはnpm run test:linuxを介してDockerで実行。
npm test # Unit tests (~300ms)
npm run test:linux # Linux provider tests in Docker
npm run test:all # EverythingMCP Inspectorによるデバッグ
npm run inspectorこれにより、ビルドされたサーバーに接続された MCP Inspector が起動し、対話的にツールを呼び出すことができます。
ライセンス
Apache-2.0 — Copyright 2026 Seth Bang
Available Tools
2 toolstake_screenshotB
Capture web page or element via headless browser. Saves to ~/Documents/screenshots by default (configurable via SCREENSHOT_OUTPUT_DIR env var).
Inputs: url (required), width, height, fullPage, +4 more.
take_system_screenshotA
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.
Inputs: mode (required), delay, format, region, +5 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
The two tools split cleanly along rendering source: headless browser page capture vs. OS-level desktop/window/region capture, and descriptions make this explicit. Minor risk remains because the generic name 'take_screenshot' doesn't signal 'web page only', so an agent skimming names could pick it for a desktop capture.
Both follow the same verb_noun convention (take_screenshot, take_system_screenshot) with a consistent qualifier modifier. Predictable and readable as a set.
Two tools are proportionate for a narrow screenshot-capture domain, and each covers a genuinely separate surface. It is on the thin side — a third tool (e.g., listing or re-opening saved captures) would round out the set.
Core capture scenarios are covered: web pages (including elements) and desktop, window, or region captures across all three OSes, with configurable output. Minor gaps around browsing/retrieving saved screenshots or format/full-page options, but agents can work around these via the filesystem.
Maintenance
Related MCP Connectors
Screenshot public web pages or raw HTML as PNG, JPEG or WebP, or print them to PDF
Web scraping, browser automation, screenshots and AI data extraction for AI agents via MCP.
Full-page, mobile, PNG or PDF, as one MCP tool through Apify
Let your AI agent see any public web page: one screenshot tool, returns the page as an image.
Related MCP Servers
- AlicenseAqualityDmaintenanceCaptures screenshots of web pages using Puppeteer, allowing AI agents to visually verify web applications and see their progress when generating web apps.555MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI coding assistants to control and inspect a live Chrome browser through Chrome DevTools. Provides browser automation, performance analysis, debugging capabilities, and network request monitoring.2,911,356 npm59,715Apache 2.0
- AlicenseCqualityDmaintenanceEnables taking screenshots of web pages with support for multiple devices (desktop, mobile, tablet), custom dimensions, full-page capture, and various image formats. Built with Playwright for reliable web page rendering and screenshot generation.1MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to capture any public URL as PNG, JPEG, or PDF via REST API or MCP tools, including screenshot capture, page description, and PDF rendering.22 npmMIT