snapmcp
snapmcp is a visual documentation MCP server that captures agent-provided content as saved artifacts and returns file paths instead of image bytes.
Capture styled terminal screenshots from text lines, including prompt coloring.
Render syntax-highlighted code and allowlisted files with Shiki, 300+ languages, 27 themes, and line ranges.
Screenshot HTTP(S) pages with Chromium, including full-page or viewport captures with SSRF protection.
Render GitHub-flavored Markdown and sanitized HTML/CSS as document screenshots.
Render unified diffs with color-coded additions and deletions.
Print complete HTTP(S) URLs to PDF.
Batch up to 10 independent captures in one call.
Capture ordered sequences up to 60 steps and optionally compile them into a GIF.
Create animated GIFs from 2-60 frames.
Compose captioned documents with embedded captures as Markdown, self-contained HTML, or PDF.
Discover tools, setup, security, sandbox, and token guidance via snapmcp-hint.
Confine outputs to SNAPMCP_DIR and support file allowlists, SSRF checks, and structured result payloads with path, format, and size.
Auto-detects the local Alacritty terminal theme so that terminal captures reproduce the user's real prompt and ANSI colors instead of a generic dark rectangle.
Auto-detects the GNOME Terminal color theme, letting terminal captures render with the user's actual GNOME terminal colors and highlighting.
Auto-detects the WezTerm color scheme so terminal captures match the real colors a reader would see in WezTerm.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@snapmcp Capture a terminal screenshot of `git log --oneline -5` and a syntax-highlighted PNG of `src/index.ts`."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
snapmcp 2.3.11 turns agent-provided content into visual documentation artifacts: syntax-highlighted code, terminal sessions, browser pages, diffs, PDFs, GIFs, and captioned documents. It exposes exactly 13 MCP tools. The 12 capture/document tools return saved file paths rather than image bytes, while snapmcp-hint returns text guidance, keeping agent context small. Every tool also returns a structured payload with the saved path, format, and size.
Quick start
1. Install and initialize
Node.js 20 or newer is the primary runtime. Bun 1.2 or newer is optional.
npm install -g snapmcp
snapmcp initnpm and npx work without Bun. Package installation does not download a browser; snapmcp init explicitly installs Playwright Chromium for the reproducible default browser.
To try the server without a global install:
npx -y snapmcp init
npx -y snapmcp2. Register it with an MCP client
Claude Code (~/.claude/claude.json):
{
"mcpServers": {
"snapmcp": {
"command": "npx",
"args": ["-y", "snapmcp"],
"env": {
"SNAPMCP_DIR": "./captures",
"SNAPMCP_THEME": "nord"
}
}
}
}OpenCode (opencode.json or opencode.jsonc) keeps local servers under mcp.servers:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"servers": {
"snapmcp": {
"type": "local",
"command": ["npx", "-y", "snapmcp"],
"environment": {
"SNAPMCP_DIR": "./captures",
"SNAPMCP_FORMAT": "jpeg",
"SNAPMCP_QUALITY": "95"
}
}
}
}
}snapmcp init writes the current OpenCode V2 shape under mcp.servers for JSON and JSONC configuration files. JSONC comments, trailing commas, and unrelated settings are preserved. It also recognizes an existing deprecated mcp.snapmcp entry and leaves it unchanged to avoid creating a duplicate.
VS Code, Cline, and Roo-Cline use the same stdio command in their MCP server configuration.
3. Capture something
Ask the agent in natural language:
Capture a terminal screenshot of
git log --oneline -5and a syntax-highlighted image ofsrc/index.ts.
The agent selects capture_terminal and capture_file. The capture_file call succeeds only when src/index.ts is covered by SNAPMCP_ALLOWED_PATHS; otherwise the agent can use capture_code with source text already in context. Generated files are saved under SNAPMCP_DIR, and the tool response contains their paths.
Related MCP server: aifmt
Why snapmcp versus Playwright MCP
Use Playwright MCP for browser interaction: clicking, filling forms, navigating, and reading accessibility trees. Use snapmcp when the deliverable is a visual artifact for a person to read.
Use case | snapmcp | Playwright MCP |
Terminal capture with detected terminal colors | Yes | No |
Code to syntax-highlighted image | Yes | No |
Git diff to visual red/green image | Yes | No |
URL to PDF | Yes | No |
Captures to animated GIF | Yes | No |
Browser page screenshot | Yes | Yes |
Browser interaction and automation | No | Yes |
The 13 tools
Tool | Use it for | Result |
| Terminal or CLI output, including | PNG/JPEG path |
| Source code with Shiki highlighting for 300+ bundled languages, 27 themes, and an optional inclusive line range | PNG/JPEG path |
| Full-page or viewport screenshot of an HTTP(S) page | PNG/JPEG path |
| An allowlisted file, with extension-based language mapping and optional inclusive line range | PNG/JPEG path |
| GitHub-flavored Markdown rendered as a document | PNG/JPEG path |
| Sanitized HTML/CSS rendered as a document | PNG/JPEG path |
| Unified diff with additions and deletions highlighted | PNG/JPEG path |
| The complete HTTP(S) URL document printed with Chromium | PDF path |
| Up to 10 independent captures in one call | Image paths |
| Up to 60 ordered step images, with an optional GIF | Image paths and optional GIF path |
| An animation built from 2 to 60 captures | GIF path |
| Up to 30 captioned captures embedded in a document | Markdown/HTML/PDF/PPTX/DOCX path |
| Tool discovery, setup, security, and token guidance | Text |
There is no additional capture tool. capture_batch, capture_sequence, capture_gif, and capture_document compose the same seven capture types: terminal, code, file, browser, Markdown, HTML, and diff.
Discovery for agents
Agents do not need to load the full documentation before choosing a tool:
MCP
tools/listis the canonical tool catalog.snapmcp-hintaccepts a natural-languagequery, such as"website screenshot"or"pdf export".The MCP resource
snapmcp://capabilitiesreturns the machine-readable capability manifest.snapmcp capabilities --jsonprints the same compact manifest for shell and code-mode workflows.snapmcp search "<intent>" --jsonreturns ranked matches for an intent.llms.txtand the server instructions provide concise selection guidance.
See the agent guide for selection rules, token-efficient behavior, and OpenCode/code-mode examples.
Common workflows
Automated documentation. Capture terminal output, highlighted source, and a visual diff, then embed the generated images in a guide or PR description.
Visual QA. Capture affected pages with capture_browser, produce several independent images with capture_batch, or record an ordered walkthrough with capture_sequence.
Technical tutorials. Use capture_sequence for ordered step images and capture_document when the final artifact should be a captioned Markdown, self-contained HTML, print-quality PDF, editable PowerPoint, or editable Word document.
Security boundaries
The defaults are designed for local use, not as a complete isolation boundary for hostile content.
URL tools accept HTTP(S) only. With
SNAPMCP_SSRF_PROTECTION=trueby default, private and local IPv4/IPv6 literals, IPv4-mapped IPv6 addresses, localhost variants, and DNS names resolving to private addresses are blocked. Requests are revalidated as they occur.URL captures run through a local validating proxy that resolves and pins every target, including each redirect hop, so the address that was validated is the address that is connected to. Chromium is launched with a resolver rule that stops it from resolving target hostnames itself.
File reads are deny-all until
SNAPMCP_ALLOWED_PATHSis configured. Allowed files are resolved before the boundary check so symlinks cannot escape the allowlist.Every output is confined to
SNAPMCP_DIR, including composite-tool outputs. Traversal and symlink escapes are rejected.Synthetic captures, including terminal, code, diff, Markdown, HTML, and generated document PDFs, render in an isolated browser context with JavaScript disabled, external network resources blocked, and a restrictive Content Security Policy. Markdown and HTML add content-specific handling: raw HTML in Markdown is escaped and raw HTML input is DOM-sanitized. These are defense-in-depth controls, not a guarantee of perfect sanitizer safety.
Inputs are bounded: terminal 1,000 lines; code, Markdown, and HTML 200 KB each; diff 500 KB; file 5 MB by default; batch 10 items; sequence 60 steps; GIF 2 to 60 frames; document 30 captures with up to 25 MB per embedded image and 75 MB total.
SNAPMCP_SSRF_PROTECTION=falsedisables SSRF checks.SNAPMCP_SECURITY_CHECKS=falsedisables the broader validation layer, including the file-read allowlist and additional byte/file-size checks. Output confinement and HTTP(S)-only URL validation remain in force. Do not disable either in shared or hostile environments.
Read SECURITY.md for the enforced controls and their limits.
Configuration
Variable | Default | Description |
|
| Confined output directory for every generated file |
| detected terminal theme | One of 27 built-in Shiki themes |
|
| Image format: |
|
| JPEG quality from 1 to 100 |
|
| Content padding in pixels |
|
|
|
|
| Show a macOS-style title bar |
|
| Window corner radius in pixels |
|
| Show the snapmcp footer badge |
| unset | Optional structured audit log path |
| unset | Explicit system Chrome/Chromium executable; bundled Playwright Chromium is the default |
| unset | Playwright Chrome channel such as |
| unset | Experimental persistent Chromium user-data directory: detected profile key/name or absolute path |
| deny-all | Comma- or semicolon-separated file-read allowlist |
|
| Block private and local URL targets |
|
| Enable the broader validation layer |
Terminal color detection is heuristic: it reads colors from common terminal configuration files when possible. It does not parse ANSI escape sequences.
Browser profile support is experimental and is never selected automatically. SNAPMCP_CHROME_PROFILE launches Chromium with a persistent user-data directory; URL captures run in that context, so cookies and session state can be sent to the target site. Synthetic captures remain isolated. Use a dedicated profile and treat it as sensitive.
CLI
snapmcp Start the MCP server on stdio
snapmcp init Install Chromium and configure the environment
snapmcp doctor Diagnose runtime, browser, paths, and configuration
snapmcp doctor --json Machine-readable diagnostics
snapmcp test Generate verification captures
snapmcp capabilities --json Print the capability manifest
snapmcp search "<intent>" --json
Search tools by intentDocker (optional)
Docker is an optional packaging surface. The image includes Chromium, runs as a non-root user, and speaks MCP over stdio:
docker run -i --rm \
-e SNAPMCP_DIR=/app/captures \
-v /path/to/output:/app/captures \
ghcr.io/reeinharddd/snapmcpThe mounted output directory must be writable by the container's non-root user.
Documentation
Page | Contents |
Installation, initialization, and client setup | |
All 13 tools and the flat discriminated-union schemas | |
Tool selection, discovery, token policy, and safety limits | |
Environment variables, browser behavior, and theme notes | |
Setup, diagnostics, discovery, and verification commands | |
Terminal, browser, GIF, and workflow examples | |
Enforced controls and known limits | |
Capability catalog, request flow, and security architecture | |
Concise link-oriented guidance for agents |
Development
git clone https://github.com/reeinharddd/snapmcp
cd snapmcp
bun install
bun run build
bun testNode.js 20 or newer is the primary runtime. Bun is optional for package installation and local development.
License
MIT. See LICENSE.
Available Tools
13 toolscapture_batchCapture multiple artifactsARead-only
Capture multiple items in a single call. Each capture is processed sequentially with its own parameters. Use for batch documentation generation (e.g., capture terminal output, code file, and browser screenshot together). Maximum 10 captures per call.
Inputs: captures (required), output. Returns: count, captures
capture_browserCapture a web pageARead-only
Take a screenshot of an HTTP(S) URL using headless Chromium. Uses Playwright's bundled Chromium by default; set SNAPMCP_CHROME_EXECUTABLE or the experimental SNAPMCP_CHROME_PROFILE to opt into a system Chrome or persistent profile. Explicit profile mode can send profile cookies and session state to the target site. SSRF protection is enabled by default and blocks private/local targets. Supports full-page or viewport captures.
Inputs: url (required), width, height, output, +1 more. Returns: path, bytes, width, format, +1 more
capture_codeCapture highlighted codeARead-only
Generate a syntax-highlighted code screenshot using Shiki (300+ bundled languages and 27 themes). Supports inclusive startLine/endLine ranges and optional window chrome. Ideal for code documentation, tutorials, and sharing snippets with an IDE-like appearance.
Inputs: code (required), title, output, endLine, +2 more. Returns: path, bytes, width, format, +1 more
capture_diffCapture a code diffARead-only
Render a unified diff with color-coded additions (green) and deletions (red). Shows file headers, hunk markers, and context lines. Ideal for PR reviews, migration guides, and change documentation. Maximum input 500KB.
Inputs: diff (required), output. Returns: path, bytes, width, format, +1 more
capture_documentCapture a visual documentARead-only
Create a document with embedded step-by-step captures. Each capture is rendered as an image and embedded in the document with optional captions. Output formats: markdown (with image references), html (self-contained with base64 images), pdf (print-quality), pptx (editable PowerPoint deck), or docx (editable Word document). Maximum 30 captures per document; 25 MB per embedded image and 75 MB total.
Inputs: title (required), captures (required), format, output, +1 more. Returns: path, bytes, format, captureCount
capture_fileCapture a source fileARead-only
Read a file and generate a syntax-highlighted screenshot with automatic language detection from file extension. Supports 300+ bundled Shiki languages. Requires SNAPMCP_ALLOWED_PATHS to be set for security (deny-all by default). Maximum file size 5MB.
Inputs: filePath (required), output, endLine, startLine. Returns: path, bytes, width, format, +1 more
capture_gifCapture an animated GIFARead-only
Create an animated GIF from 2-60 sequential captures. Frames are rendered as PNG, compiled into a GIF, and removed after encoding. loop=true repeats forever; loop=false plays once. Maximum canvas 8192x8192.
Inputs: captures (required), loop, title, output, +1 more. Returns: path, bytes, width, format, +2 more
capture_htmlRender HTMLARead-only
Render HTML/CSS as a screenshot in an isolated, JavaScript-disabled context. Inline styles and embedded data images are supported; scripts, frames, external stylesheets, and other external resources are removed or blocked. Maximum input 200KB.
Inputs: html (required), title, output. Returns: path, bytes, width, format, +1 more
capture_markdownRender MarkdownARead-only
Render GitHub-flavored Markdown as a styled document screenshot. Supports tables, task lists, and fenced code blocks with syntax highlighting. Raw HTML is escaped, JavaScript is disabled, and external resources are blocked. Maximum input 200KB.
Inputs: markdown (required), title, output. Returns: path, bytes, width, format, +1 more
capture_pdfCapture a URL as PDFARead-only
Convert a URL to a print-quality PDF using headless Chromium. The complete paginated document is printed. Uses a system Chrome profile only when explicitly configured. SSRF protection is enabled by default (blocks private IPs and localhost).
Inputs: url (required), width, height, output. Returns: path, bytes, format
capture_sequenceCapture a process sequenceARead-only
Capture ordered process steps as individual image files and optionally compile them into a GIF. Each step has typed capture parameters plus stepNumber and label. When GIF output is requested, frames are rendered as PNG. Maximum 60 steps.
Inputs: steps (required), loop, output, compileGif, +1 more. Returns: steps, gifPath, gifBytes, stepCount
capture_terminalCapture terminal outputARead-only
Generate a styled terminal screenshot from text lines. Uses a detected terminal palette when available (Kitty, GNOME, Alacritty, WezTerm, and others) and otherwise falls back to the configured theme. Use for CLI tutorials, command output documentation, and terminal-based guides.
Inputs: lines (required), title (required), output. Returns: path, bytes, width, format, +1 more
snapmcp-hintFind the right snapmcp toolARead-onlyIdempotent
Find the right snapmcp tool by natural-language intent, or get concise setup, security, sandbox, agent, and token guidance. Use when tool selection is unclear or before loading the full documentation.
Inputs: query, topic. Returns: kind, query, answer, matches
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 13 tools
Most tools are cleanly separated by input type (terminal, code, file, browser, markdown, html, diff, pdf). The trio capture_sequence / capture_gif / capture_batch overlaps conceptually (all orchestrate multiple captures), and capture_code vs capture_file both produce highlighted code images, though descriptions clarify input source and output form.
Twelve of thirteen tools follow a clear capture_<target> snake_case pattern that is easy to scan and predict. The single outlier, snapmcp-hint, uses a hyphenated server-prefixed name and a non-verb style, breaking the otherwise uniform convention.
13 tools is well within a healthy range for a multi-format screenshot/rendering server. Each tool maps to a distinct render target or orchestration mode, and none feels redundant enough to remove.
The surface covers essentially every common capture source: terminal, code, file, browser, markdown, html, diff, pdf, plus GIF, sequence, document, and batch composition. Remaining gaps are minor, e.g. no plain-text capture, no image post-processing/annotation, and no output listing or cleanup tool.
Maintenance
Related MCP Connectors
Screenshots, PDFs, image editing, QR codes, email validation and more through one hosted MCP server.
MCP server for agentverse documentation, generated by doc2mcp.
One MCP server for all your MCP servers: code mode, per-tool permissions, approvals and audit.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceMCP server that lets AI agents see and interact with terminal/CLI applications through virtual terminals and PNG screenshots.75 npmMIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that fixes, validates, and generates visual text content for AI coding assistants.MIT
- AlicenseBqualityDmaintenanceMCP server providing 26 visual tools for text-only LLMs, enabling description, coordinate location, OCR, annotation, cropping/zooming, anomaly scanning, and computer control with switchable VLM backends.279MIT
- FlicenseAqualityDmaintenanceAn MCP server for image understanding via OpenAI-compatible vision models, offering tools for OCR, error screenshot diagnosis, technical diagram reading, data visualization analysis, UI-to-code conversion, and UI diff comparison.7-