Snapmcp

io.github.reeinharddd由 GitHub 帳號 reeinharddd 發布v2.3.2更新於 Oct 24, 2026

Visual capture MCP server: terminal colors, code, diffs, PDFs, GIFs. 13 tools, SSRF on by default.

概覽

AI 產生的概覽

本機 MCP 伺服器,把終端機輸出、程式碼、差異、Markdown、HTML、瀏覽器頁面和網址渲染成帶樣式的圖片、PDF 和 GIF,供文件使用。

可以做什麼
擷取終端機輸出並保留實際偵測到的終端機配色,把程式碼或檔案渲染成 Shiki 語法高亮圖片,支援多種語言與主題,並產生綠增紅刪的視覺化 git 差異。把 Markdown、任意 HTML 片段和瀏覽器頁面(整頁或視窗範圍)渲染成圖片,並把網址轉成 PDF。一次呼叫可批次擷取多個項目,用多張截圖合成動畫 GIF 或並排序列,並產生內嵌截圖的 Markdown、HTML 或 PDF 文件。向 MCP 用戶端提供能力提示。
適用情境
適合助理撰寫文件、教學或 PR 說明時需要像素級真實配圖的情境:安裝指令的終端機截圖、高亮的設定檔、遷移差異、UI 改動前後對照。它只負責呈現,不負責點擊或填寫頁面,互動類任務應搭配瀏覽器自動化伺服器。
執行需求
以 npm 套件形式在本機透過 stdio 執行(npx snapmcp 或全域安裝);需要 Node.js 20 以上,或 Bun 1.2 以上。需要 Chrome/Chromium,可用系統安裝的版本或首次安裝時自動下載,可透過 SNAPMCP_CHROME_EXECUTABLE 和 SNAPMCP_CHROME_PROFILE 指定。輸出目錄由 SNAPMCP_DIR 指定(預設 ./captures)。檔案擷取預設全部拒絕,需在 SNAPMCP_ALLOWED_PATHS 中列出路徑。
安裝前請注意
capture_file 會讀取本機檔案,只有列入 SNAPMCP_ALLOWED_PATHS 的路徑可存取,應盡量縮小該清單。瀏覽器和 PDF 擷取會存取網址,SSRF 防護預設開啟(SNAPMCP_SSRF_PROTECTION),關閉後擷取可能存取內網位址。設定 SNAPMCP_CHROME_PROFILE 會讓擷取使用真實 Chrome 設定目錄,其中可能含 Cookie 和已登入工作階段。截圖會寫入 SNAPMCP_DIR 指定的磁碟目錄。

安裝

在 SourceWeft 中

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

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

其他 MCP 客戶端

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

README

[snapmcp]

The visual documentation MCP server.
Terminal · Code · Browser · Markdown · Diff · HTML · PDF · GIF
For documentation workflows — when structured snapshots aren't enough.

[npm version] [npm downloads] [tests] [stars] [MIT]


Real terminal colors, Shiki-highlighted code, visual diffs, PDFs and GIFs — one MCP server, 13 tools. Renders with your system Chrome, or auto-installs Chromium at first setup. SSRF protection on by default. Built for agents that write documentation, not just drive browsers.

Quick Start

Three steps, under two minutes:

1. Install

bash
npm install -g snapmcp# or run without installing: npx -y snapmcp

2. Add to Claude Code (~/.claude/claude.json)

json
{  "mcpServers": {    "snapmcp": {      "command": "npx",      "args": ["-y", "snapmcp"],      "env": {        "SNAPMCP_DIR": "./captures",        "SNAPMCP_THEME": "nord"      }    }  }}

3. Capture

Ask your agent in natural language:

"Capture a terminal screenshot of git log --oneline -5 and a syntax-highlighted PNG of src/index.ts."

The agent calls capture_terminal and capture_file — images land in ./captures/ with your real terminal theme and the chosen syntax theme applied.

Other clients: OpenCode, VS Code / Cline, Docker

OpenCode (opencode.json):

json
{  "mcpServers": {    "snapmcp": {      "command": "npx",      "args": ["-y", "snapmcp"],      "env": {        "SNAPMCP_DIR": "./captures",        "SNAPMCP_FORMAT": "jpeg",        "SNAPMCP_QUALITY": "95"      }    }  }}

VS Code / Cline / Roo-Cline (settings.json → cline.mcpServers):

json
{  "mcpServers": {    "snapmcp": {      "command": "npx",      "args": ["-y", "snapmcp"],      "env": {        "SNAPMCP_DIR": "./captures",        "SNAPMCP_FORMAT": "jpeg"      }    }  }}

Docker:

bash
docker run -i --rm \  -e SNAPMCP_DIR=/captures \  -e SNAPMCP_THEME=nord \  -v /path/to/output:/captures \  ghcr.io/reeinharddd/snapmcp

What it looks like

CapturePreview
Terminal (real detected colors)[terminal capture]
Code (Shiki syntax)[code capture]
Diff (green/red)[diff capture]

Why snapmcp vs Playwright MCP

Different tools for different jobs. Playwright MCP drives a browser through token-efficient accessibility snapshots; snapmcp renders pixel-faithful images for humans to read. If your agent needs to click, use Playwright. If it needs to show, use snapmcp.

Use casesnapmcpPlaywright MCP
Terminal capture with real colors✅ auto-detects Kitty, Gnome, Alacritty, WezTerm themes❌ no terminal support
Code → syntax-highlighted image✅ Shiki, 50+ languages, 27 themes❌ not its purpose
Git diff → visual red/green image✅ capture_diff❌
URL → PDF document✅ capture_pdf❌
Animated GIF from captures✅ capture_gif (zero-dep gifenc)❌
Markdown → styled document✅ capture_markdown, capture_document❌
Browser page screenshot✅ capture_browser (full-page or viewport)✅
Browser automation (click, fill, navigate)❌ screenshots only✅ accessibility-tree driven, token-efficient — the right tool for this

Most documentation pipelines pair them: Playwright MCP to interact, snapmcp to document.

Tools

ToolDescription
capture_terminalTerminal output with syntax-colored prompts (auto-detects real terminal theme)
capture_codeSyntax-highlighted code via Shiki (50+ languages, 27 themes)
capture_browserFull-page or viewport screenshots (uses system Chrome profile when available)
capture_fileFile → auto-detected language → highlighted screenshot
capture_markdownRendered markdown as a styled document
capture_htmlArbitrary HTML snippet rendered as image
capture_diffGit diffs with green additions / red deletions
capture_pdfURL → PDF document
capture_batchBatch capture multiple items in one call
capture_gifAnimated GIF from multiple screenshots
capture_sequenceSide-by-side animated sequence
capture_documentCreate document (MD/HTML/PDF) with embedded captures
snapmcp-hintServer capability hints for MCP clients

Use cases

Automated documentation — an agent writes a setup guide and embeds real captures: the terminal output of the install command (with your actual theme), the config file syntax-highlighted, the diff of the migration. One prompt, three capture_* calls, images saved next to the markdown.

Visual QA — after a UI change, the agent captures the affected pages with capture_browser, batches before/after with capture_batch, and assembles an animated comparison with capture_gif for the PR description.

Terminal guides — CLI tutorials where the screenshots must match what readers will see: capture_terminal reproduces the real prompt colors instead of a generic dark rectangle.

Security

SSRF protection is on by default — no opt-in required.

FeatureDescription
SSRF ProtectionOn by default (disable with SNAPMCP_SSRF_PROTECTION=false). Blocks IP literals (v4 + v6), localhost variants, and DNS names that resolve to private ranges (127.0.0.0/8, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, fc00::/7, fe80::/10, etc.); every page request (redirects included) is re-checked
File AllowlistSNAPMCP_ALLOWED_PATHS defaults to deny-all when unset; only explicitly allowed paths can be captured
Path TraversalPrevents ../ escapes, symlink traversal (via realpath), and null byte injection
Input LimitsTerminal 1000 lines; code/markdown/HTML 200KB; diff 500KB; file reads 5MB; max GIF frames 60; max GIF canvas 8192×8192
Audit LogOptional structured JSON log file with timestamped events
Chromium SandboxSandbox availability checked at startup

Configuration

Environment variables for the MCP server:

VariableDefaultDescription
SNAPMCP_DIR./capturesOutput directory for captures
SNAPMCP_THEMEauto-detectedSyntax theme (27 built-in themes + auto-detected terminal)
SNAPMCP_FORMATpngOutput format (png, jpeg)
SNAPMCP_QUALITY90JPEG quality (1-100)
SNAPMCP_PADDING32Content padding in pixels
SNAPMCP_SHADOWnoneDrop shadow (none, soft, medium, strong; aliases sm/md/lg)
SNAPMCP_WINDOW_CHROMEfalsemacOS-style title bar frame
SNAPMCP_BORDER_RADIUS0Window corner radius
SNAPMCP_BADGEfalseFooter badge
SNAPMCP_LOG_FILE—Audit log file path
SNAPMCP_CHROME_EXECUTABLE—Path to Chrome/Chromium binary
SNAPMCP_CHROME_CHANNEL—Chrome channel (stable, beta, dev, canary)
SNAPMCP_CHROME_PROFILE—Chrome profile directory name
SNAPMCP_ALLOWED_PATHS(deny-all)Comma- or semicolon-separated allowed file paths for capture_file

27 built-in Shiki themes: dracula, one-dark-pro, nord, tokyo-night, catppuccin-mocha, catppuccin-latte, ayu-dark, ayu-light, vitesse-dark, vitesse-light, min-dark, min-light, poimandres, rose-pine, rose-pine-moon, rose-pine-dawn, slack-dark, slack-ochin, snazzy-light, github-dark-dimmed, github-light, one-light, solarized-light, solarized-dark, material-theme, material-theme-lighter, material-theme-ocean

CLI

SnapMCP ships with a full CLI beyond the MCP server:

snapmcp        — Start the MCP serversnapmcp init   — Interactive setup wizard (detects Chrome, terminal theme, output dir)snapmcp doctor — Health check: 7 checks across Node, Chromium, paths, envsnapmcp test   — Generate test captures (terminal + code) to verify the setup

Documentation

PageContents
Getting StartedInstallation, quick start, MCP client setup
Tools ReferenceAll 13 tools with parameters and examples
ConfigurationAll SNAPMCP_* env vars, themes, defaults
CLI ReferenceInit, doctor, test commands
GuidesTerminal capture, browser capture, GIF animation
ARCHITECTURE.mdModule map, data flow, security architecture
CONTRIBUTING.mdDev workflow, testing guidelines, PR checklist

Development

bash
git clone https://github.com/reeinharddd/snapmcpcd snapmcpbun installbun run build    # tsc → dist/bun test         # 317 tests

Requirements: Node.js ≥ 20 or Bun ≥ 1.2. CI runs on ubuntu / macOS / windows via GitHub Actions.

License

MIT — see LICENSE.

來源:README.md,提交 9d51c81

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v2.3.2最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

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

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

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

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分