tinysnap
Provides macOS screen capture via ScreenCaptureKit, exposing full-screen and cropped PNG screenshots through a local HTTP API and MCP tools.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
tinysnap
Screenshots for coding agents. A 6 MB menu-bar app that holds the macOS Screen Recording permission once, and hands it to any agent that asks — over a local HTTP API or MCP.
agent ──MCP stdio──▶ tinysnap-mcp.mjs ──HTTP──▶ tinysnap.app ──▶ PNG
(pi, Claude, │
Codex, anything) ~/.tinysnap/shots/*.pngWhy not screencapture in a terminal? The permission is per app, so the terminal has to be
granted first — and agents run in whatever terminal they were launched from. tinysnap is granted
once and every agent borrows it.
Built with tinyjs: txiki.js backend + system webview, no Electron, no node_modules at runtime.
Quickstart
git clone https://github.com/math4mad/tinysnap && cd tinysnap
./scripts/install.sh --with-pi # build → ~/Applications/tinysnap.app → login item → pi MCPThen grant the permission once:
System Settings → Privacy & Security → Screen & System Audio Recording
Turn on tinysnap (or
+, then pickdist/tinysnap.app)Restart it:
launchctl kickstart -k gui/$(id -u)/com.local.tinysnap
If tinysnap is not in the list at all (this happens — macOS only adds an app once it actually asks to capture, and a silent denial never asks): reset the decision, restart the app, and trigger one capture so the prompt can appear:
tccutil reset ScreenCapture local.tinysnap
launchctl kickstart -k gui/$(id -u)/com.local.tinysnap
curl -s -XPOST localhost:8799/capture >/dev/null # macOS shows the promptCheck it:
node scripts/selftest.mjs # 16 checks: HTTP, crops, MCP, PNG headersExpected:
HTTP GET / · /health · /display · capture(rect) · cropped size 400x60 ✓ · capture(full)
3456x2234 ✓ · bad request 400 ✓ · /recent ✓ · 404 ✓
MCP initialize ✓ · tools/list (3) ✓ · list_screens ✓ · capture_screen → image 400x60 ✓
· recent_shots ✓ · unknown tool → tool error ✓
16 passed, 0 failedManual (no install script):
npm install
tinyjs build
open dist/tinysnap.appRequirements: macOS 14+, tinyjs (curl -fsSL https://tinyjs.app/install | sh),
node 18+ for the MCP bridge. Optional: gh for nothing, this is it.
Related MCP server: CaptureScreenMCP
Use it from an agent (MCP)
Add to your client's MCP config — pi: ~/.pi/agent/mcp.json, Claude Code: .mcp.json,
Claude Desktop: claude_desktop_config.json:
{
"mcpServers": {
"tinysnap": {
"command": "node",
"args": ["/abs/path/to/tinysnap/mcp/tinysnap-mcp.mjs"]
}
}
}(scripts/install.sh prints the exact snippet with your path.)
Tools
tool | what you get |
| the PNG as an image block (the agent can actually see it), plus path, byte size and capture time. |
| main display size in points + pixel scale — call it before converting pixels to points |
| paths of the last N captures, newest first |
// what an agent does, roughly
await call('list_screens'); // 1728x1117 pt, scale=2
await call('capture_screen', { x: 100, y: 80, w: 800, h: 600 });
// → sees the image, then fixes the CSS, then captures againPoints vs pixels: window APIs, 截图 coordinates and CSS pixels are points; the PNG is
pixels (2× on a Retina display). Multiply points by scale to compare against an image.
Writing the prompt (the part that decides if it works)
The tools are three; the prompt decides whether the agent looks or guesses.
先看 list_screens 拿到屏幕 point 尺寸和 scale,
再用 capture_screen 截变化的那块(point),
看图 → 改 → 再截同一块对比。
最后说明"截图里具体哪里对了、哪里还差"。Copy-paste templates for web dev, desktop/notch windows, before/after diffs, and a "固定说明" block for CLAUDE.md / AGENTS.md: docs/prompts.md.
Use it from a shell
curl -s localhost:8799/health | jq
curl -s -XPOST localhost:8799/capture -d '{"x":739,"y":0,"w":250,"h":33}' | jq -r .path
curl -s -XPOST localhost:8799/capture | jq -r .path # whole screen
curl -s 'localhost:8799/recent?limit=5' | jqEvery capture is also written to ~/.tinysnap/shots/snap-<ISO>.png, so a human can open it.
API
endpoint | |
| plain-text endpoint list |
|
|
|
|
| body |
| newest shots, newest first |
Loopback only (127.0.0.1:8799), TINYSNAP_PORT overrides the port. w/h without x/y is a
400 — otherwise you would silently get the top-left corner.
Recipes
Web dev — "did my CSS change actually work?"
./examples/verify-webapp.sh http://127.0.0.1:5173/ # captures 900x700 pt and opens itor from the agent: capture_screen the browser area, look, fix, repeat. See examples/verify-webapp.sh
for the shape of it.
Desktop dev — check a window you just moved/resized:
list_screens→ get points + scalecapture_screenthe window rect (points, from your window API)look at the PNG, compare with the intent
Notch / menu-bar apps — a 250×33 pt pill is a two-line capture:
curl -s -XPOST localhost:8799/capture -d '{"x":739,"y":0,"w":250,"h":33}' | jq -r .pathCI / no display — not supported: the capture is ScreenCaptureKit, it needs a window server.
On a headless mac, run the app in a user session (or use xvfb-style tooling elsewhere).
How it works
tinyjs.json mainWindow:false + activation:accessory → tray app, no window, no Dock icon
backend/capture.ts captureScreen() → sips crop → ~/.tinysnap/shots → Shot
backend/main.ts HTTP API + tray menu
mcp/…mjs MCP stdio ⇄ HTTP (zero deps, node)
scripts/selftest.mjs 16 end-to-end checks (parses PNG IHDR, not just trusting the daemon)Cropping without dependencies:
sips -c <pxH> <pxW> --cropOffset <pxY> <pxX> in --out out(system tool, no image library, nosharp).Point size without a display API: tinyjs's backend has none (only the page does), so the main display's point size comes from Finder's desktop bounds via
osascript— no extra permission.One capture at a time: a queue serialises captures, so two agents shooting at once can't interleave temp files.
Launch it via LaunchServices, not exec: TCC auto-denies an app that is exec'd as a background process (raw binary, or a launchd agent whose program is that binary) — no prompt, no list entry.
open -aputs it in the user session where macOS will ask. This is whatscripts/install.shdoes.Stable install path:
scripts/install.shcopies the bundle to~/Applications/tinysnap.appand points the login item there. macOS keys the Screen Recording grant to the app's identity and path, so rebuilding in the repo'sdist/(ad-hoc signature, new hash every time) drops the grant, while the installed copy keeps it until you re-run the installer.
Troubleshooting
symptom | fix |
| Grant Screen & System Audio Recording to tinysnap, restart the app (the TCC verdict is cached per process). |
| The app is not running: |
Crop is one pixel / wrong area |
|
Permission prompt never appears | macOS won't re-prompt after a denial. Reset it: |
tinysnap is not in the Screen Recording list | macOS only lists an app after it asks to capture. Force the ask: reset ( |
Works, then a rebuild breaks it | Install to the stable path: |
Never prompts, never shows up in the list, | How the app is launched matters. Launching the binary directly — |
Port 8799 taken |
|
Security
Listens on
127.0.0.1only; nothing is exposed to the network.Any local process can ask for a screenshot — that is the point, but it means anything running as you can too. Same trust boundary as your clipboard.
No telemetry, no network calls. The MCP bridge only ever talks to the daemon.
License
MIT — see LICENSE. tinyjs itself is by the tinyjs authors; the backend/*.d.ts files are
tinyjs's type definitions, kept so npm run typecheck works out of the box.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Clean PNG/JPEG screenshots via REST or MCP, with goal-driven multi-step navigation.
Image processing over MCP: compress and split images, generate images and QR codes.
Screenshots, PDFs, image editing, QR codes, email validation and more through one hosted MCP server.
OCR, transcription, file extraction, and image generation for AI agents via MCP.
Related MCP Servers
- FlicenseAqualityDmaintenanceEnables LLMs to capture screenshots and screen recordings through MCP with chunked session-based transfers for reliable image consumption. Supports multi-monitor selection, timeline capture, and compatibility with both vision and non-vision language models.111-
- AlicenseNot gradedqualityDmaintenanceA Windows-local MCP server for capturing screenshots (full screen, displays, regions, active window) and managing capture images via deletion tools, using a .NET tool interface.3MIT
- AlicenseNot gradedqualityCmaintenanceEnables capturing full-screen or selected region screenshots on Windows, saving them as PNG files locally and returning image data via MCP.2,530 npmMIT
- AlicenseAqualityBmaintenanceMCP server that captures short screen recordings as numbered, timestamped still frames and composes them into a single contact sheet returned as image content, letting AI agents reason about motion, animations, and UI transitions instead of inspecting video frame by frame. Also supports single screenshots and listing targetable windows.653 npm1MIT