SnapStack Server

SnapStack Server

Enables MCP-capable LLM clients to read browser screenshots captured by the SnapStack extension, stored locally and served over Streamable HTTP.

Category
访问服务器

README

<p align="center"> <img src="assets/logo.png" alt="SnapStack" width="440"> </p>

<p align="center"> <a href="https://github.com/bgaze/snapstack-server/actions/workflows/ci.yml"><img src="https://github.com/bgaze/snapstack-server/actions/workflows/ci.yml/badge.svg" alt="CI"></a> <a href="LICENSE"><img src="https://img.shields.io/github/license/bgaze/snapstack-server?color=blue" alt="License: MIT"></a> <img src="https://img.shields.io/badge/node-%3E%3D18-brightgreen" alt="Node >= 18"> <a href="https://modelcontextprotocol.io"><img src="https://img.shields.io/badge/MCP-compatible-blueviolet" alt="MCP compatible"></a> <img src="https://img.shields.io/badge/100%25-local-success" alt="100% local"> <a href="https://www.npmjs.com/package/snapstack-server"><img src="https://img.shields.io/npm/v/snapstack-server?label=npm" alt="npm version"></a> <a href="https://www.npmjs.com/package/snapstack-server"><img src="https://img.shields.io/npm/dm/snapstack-server?label=downloads" alt="npm downloads"></a> </p>

<p align="center"> <img src="assets/demo.gif" alt="SnapStack demo — capture a browser tab, your AI reads the screenshots over MCP" width="900"> </p>

The SnapStack server is a single always-on Node process: it receives browser captures from the extension, stacks them on disk, and serves them to any MCP-capable LLM client over Streamable HTTP. It listens only on 127.0.0.1 — nothing ever leaves your machine.

New here? The full install + usage guide lives in the extension README: snapstack-extension. This page is the technical reference.

Architecture

One always-on process serves both the extension (capture) and your MCP client, decoupled by a folder on disk.

[MV3 extension]  --POST /push (bytes)-->  ┐
                                          ▼
                            [SnapStack server]   127.0.0.1:4123
                               ├─ writes ─►  ~/.snapstack/   (stack on disk)
                               └─ MCP /mcp (HTTP)  ◄── MCP client
  • Capture — the extension encodes the shot as WebP (PNG fallback), downscales it, and POSTs it here.
  • Stack — one image file (.webp/.png) plus a twin .json (url, title, timestamp, dimensions) per capture, named NN <timestamp>: a stable two-digit number (assigned in capture order, restarts at 01 when the stack empties) plus a timestamp, under ~/.snapstack/.
  • Retrievalget_screenshots returns a JSON manifest (number, absolute path, dimensions, metadata — no image bytes); the client reads only the files it needs, by path. Deletion is a separate, explicit clear_screenshots step. Retrieval never deletes.

Requirements

  • Node.js ≥ 18 (tested on Node 20). No git needed at runtime.
  • An MCP-capable LLM client speaking the HTTP (Streamable HTTP) or stdio transport.
  • The snapstack-extension loaded in your browser.

Install & run

Run it once in the foreground:

npx -y snapstack-server@latest        # → SnapStack server listening on http://127.0.0.1:4123

For start-at-login + crash-restart + self-update, install the auto-start unit (launchd on macOS, systemd --user on Linux, a logon scheduled task on Windows):

npx -y snapstack-server@latest install     # register auto-start; uninstall with `… uninstall`

The unit runs a best-effort npm install --prefix <appDir> snapstack-server@latest then launches the locally installed copy — so the server self-updates on each (re)start, and still starts offline once installed. No git involved.

The full end-to-end walkthrough (idiomatic install paths, MCP client registration, the extension) is in the extension README.

MCP

SnapStack speaks two MCP transports over the same on-disk stack — pick whichever your client supports:

// HTTP (server already running) — register http://127.0.0.1:4123/mcp; copy deploy/mcp.json
{ "type": "http", "url": "http://127.0.0.1:4123/mcp" }
// stdio (the client spawns the process)
{ "command": "npx", "args": ["-y", "-p", "snapstack-server", "snapstack-mcp"] }

The HTTP /mcp endpoint is stateless (a fresh server + transport per request); the stdio front-end (snapstack-mcp) is spawned on demand and reads the same ~/.snapstack stack. Capture intake (/push) always stays in the running server, independent of either MCP front-end.

Exposed tools

Tool Description
get_screenshots Lists pending captures as a JSON manifest (stable number, absolute path, dimensions, metadata) — no image bytes, no deletion. Pass numbers (e.g. [1,3]) to list only those.
clear_screenshots Deletes captures. Pass numbers to delete specific ones; omit to clear the whole stack. Numbering restarts at 01 once empty.
count_screenshots Number of pending captures, without retrieving them.

get_screenshots and count_screenshots are read-only; only clear_screenshots is destructive. To run a tool without a per-call confirmation, add its identifier to your client's allow-list (for Claude Code: mcp__snapstack__<tool> in permissions.allow).

Token cost: get_screenshots returns only the manifest, so it stays cheap whatever the stack size — the client then reads just the files it needs. WebP + downscaling keep those reads light.

Configuration

Environment variables (infrastructure)

Variable Default Purpose
SNAPSTACK_DIR ~/.snapstack Stack folder.
SNAPSTACK_PORT 4123 Listening port (always on 127.0.0.1).

Capture policy (shared across your browsers)

The encoding/capture settings are owned by the server and stored in ~/.snapstack/config.json, so a single edit applies to every browser running the extension. They are edited from the extension's options page — not an environment variable — and fetched by the extension before each capture.

Key Default Meaning
format webp Image format: webp, png or jpg.
quality 0.85 Lossy quality (01; the extension UI shows it as a percentage).
maxWidth 1568 Downscale captures wider than this to this width in px (0 = no resize).
maxSlices 50 Full-page capture: hard cap on stitched slices.

Two endpoints back it: GET /config returns the effective policy; POST /config validates and replaces it (host- + CORS-guarded like every capture route). The file is a non-image, so a stack clear never touches it; deleting it just restores the defaults above.

Troubleshooting

  • "Capture server not started" (in the extension): start the server (npm start) or check the auto-start. Test: curl http://127.0.0.1:4123/health.
  • Port already in use (EADDRINUSE): set SNAPSTACK_PORT to another value.
  • The client doesn't see the tools: the server must run before the MCP client starts; check the config (type: "http", correct URL). Direct test: curl http://127.0.0.1:4123/count.
  • Inspect the stack: ls ~/.snapstack (image files + human-readable .json).

License

MIT — see LICENSE.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选