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 分