Snapgrab

io.github.ArkNill由 GitHub 账号 ArkNill 发布v0.1.0更新于 Oct 24, 2026

URL to screenshot with metadata. Python MCP server. Claude Vision optimized.

概览

AI 生成的概览

Snapgrab 让助手截取网页截图并附带页面元数据,支持视口预设和 Claude Vision 令牌估算。

可以做什么
Snapgrab 是一个本地 Python MCP 服务器,用 Playwright 渲染 URL,返回截图和页面元数据。其工具包括 capture_screenshot(截图并附带元数据和视觉令牌估算)、capture_comparison(对比桌面与移动端或其他视口)以及 extract_page_metadata(仅元数据,不截图)。支持 PNG、JPEG、PDF 输出、整页截图、按 CSS 选择器截取元素、深色模式,并自动缩放到 1568px 以适配 Claude Vision。
适用场景
适合助手需要查看或核对网页外观、比较响应式布局,或在不截图的情况下获取标题、描述、Open Graph 标签、favicon 和 HTTP 状态码。可用于视觉检查、页面监控,以及把页面图像交给视觉模型。
运行要求
以 Python 包形式通过 stdio 在本地运行(pip install snapgrab,MCP 服务器需 snapgrab[mcp])。需要 Python 和 Playwright 的 Chromium 浏览器,用 playwright install chromium 安装。仅限桌面端;未声明账户、API 密钥或环境变量。
安装前请注意
该服务器会抓取任意 URL,因此截取的页面及其元数据来自第三方网站,请求会向这些网站暴露目标 URL。截图会写入本地磁盘(例如 /tmp/snapgrab 下)。安装 Playwright 会下载浏览器二进制文件。不要求任何凭据。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Snapgrab,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

Snapgrab

[PyPI] [Python] [License] [Tests]

한국어 문서 · llms.txt

URL to screenshot with metadata. Claude Vision optimized.

python
from snapgrab import capture
result = await capture("https://example.com")print(result.path)           # /tmp/snapgrab/example_com_desktop_20260317_120000.pngprint(result.metadata.title) # "Example Domain"print(result.vision_tokens)  # ~2764

Features

  • Screenshot capture — PNG, JPEG, PDF with full-page support
  • Page metadata — title, description, Open Graph tags, favicon, HTTP status
  • Claude Vision optimized — auto-resize to 1568px, token cost estimation
  • Viewport presets — desktop (1920x1080), tablet (768x1024), mobile (375x812)
  • MCP server included — 3 tools for Claude Code / MCP clients
  • Element capture — screenshot specific CSS selectors
  • Dark mode — force light/dark color scheme

Install

bash
pip install snapgrab

First run will prompt to install Playwright browsers:

bash
playwright install chromium

Usage

Python API

python
import asynciofrom snapgrab import capture
async def main():    # Basic screenshot    result = await capture("https://example.com")
    # Mobile viewport, full page    result = await capture("https://example.com", viewport="mobile", full_page=True)
    # Dark mode, JPEG format    result = await capture("https://example.com", dark_mode=True, format="jpeg")
    # Specific element    result = await capture("https://example.com", selector="#main-content")
    # Custom viewport    result = await capture("https://example.com", viewport=(1440, 900))
asyncio.run(main())

CLI

bash
snapgrab https://example.com                          # basic PNGsnapgrab https://example.com -v mobile -f             # mobile, full pagesnapgrab https://example.com --format jpeg -q 90      # JPEG quality 90snapgrab https://example.com -s "#hero" --dark-mode   # element + dark modesnapgrab https://example.com -j                       # JSON outputsnapgrab meta https://example.com                     # metadata only

MCP Server

bash
pip install "snapgrab[mcp]"snapgrab-mcp  # starts stdio MCP server

Tools:

  • capture_screenshot — capture URL with metadata and vision token estimate
  • capture_comparison — compare desktop vs mobile (or any viewports)
  • extract_page_metadata — metadata only, no screenshot

How It Works

mermaid
flowchart LR    A["🔗 URL"] --> B["Playwright\nlaunch browser"]    B --> C["📸 Screenshot\nfull page / viewport"]    C --> D["Resize for\nClaude Vision"]    D --> E["✅ Image +\nMetadata"]

CaptureResult

python
result.path            # saved file pathresult.format          # "png", "jpeg", "pdf"result.width           # viewport widthresult.height          # page height (full_page) or viewport heightresult.file_size       # bytesresult.vision_tokens   # estimated Claude Vision token costresult.vision_path     # path to Vision-optimized image (≤1568px)result.processing_time_msresult.metadata.titleresult.metadata.descriptionresult.metadata.og_titleresult.metadata.og_imageresult.metadata.favicon_urlresult.metadata.status_coderesult.metadata.url    # final URL after redirects

Used in

  • watchdeck — Web page monitoring with visual diffs and safety guards

License

MIT


Part of the QuartzUnit ecosystem — composable Python libraries for data collection, extraction, search, and AI agent safety.

来源:README.md,提交 9985f7c

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.0最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分