Skip to main content
Glama
SnapAPI MCP Server

SnapAPI MCP Server

by Sleywill

snapapi-mcp

SnapAPI 的 MCP (Model Context Protocol) 服务器 — 可直接从 Claude Desktop、Cursor、Windsurf、Cline 和 Zed 等 AI 工具中截取屏幕截图、抓取网页、提取内容、生成 PDF、录制视频并分析页面。

这是什么?

此包运行一个本地 MCP 服务器,将您的 AI 助手连接到 SnapAPI 网络捕获 API。配置完成后,您的 AI 可以:

  • 截取屏幕截图:支持任何 URL(全页、移动端、深色模式、元素选择、设备模拟)

  • 抓取网页:使用真实浏览器获取干净的文本、HTML 或链接列表

  • 提取内容:针对 LLM 使用进行优化(Markdown、文章、元数据、结构化数据)

  • 生成 PDF:从 URL 或 HTML 生成

  • 录制视频:录制浏览器会话,支持可选的交互场景

  • 分析页面:通过 AI 进行分析(一次调用即可完成提取 + 分析)

  • 检查使用情况:查看配额和账户统计信息

Related MCP server: Local-MCP-server

先决条件

快速入门

Claude Desktop

添加到 ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) 或 %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "snapapi": {
      "command": "npx",
      "args": ["-y", "snapapi-mcp"],
      "env": {
        "SNAPAPI_API_KEY": "sk_live_your_key_here"
      }
    }
  }
}

保存后重启 Claude Desktop。

Cursor

添加到 ~/.cursor/mcp.json:

{
  "mcpServers": {
    "snapapi": {
      "command": "npx",
      "args": ["-y", "snapapi-mcp"],
      "env": {
        "SNAPAPI_API_KEY": "sk_live_your_key_here"
      }
    }
  }
}

Windsurf

添加到 ~/.codeium/windsurf/mcp_config.json:

{
  "mcpServers": {
    "snapapi": {
      "command": "npx",
      "args": ["-y", "snapapi-mcp"],
      "env": {
        "SNAPAPI_API_KEY": "sk_live_your_key_here"
      }
    }
  }
}

Cline (VS Code)

打开 Cline 设置 → MCP Servers → Add Server:

  • Command: npx

  • Args: -y snapapi-mcp

  • Environment: SNAPAPI_API_KEY=sk_live_your_key_here

VS Code (原生 MCP 支持)

添加到工作区(或用户设置)的 .vscode/mcp.json 中:

{
  "servers": {
    "snapapi": {
      "command": "npx",
      "args": ["-y", "snapapi-mcp"],
      "env": {
        "SNAPAPI_API_KEY": "sk_live_your_key_here"
      }
    }
  }
}

Zed

添加到 ~/.config/zed/settings.json:

{
  "context_servers": {
    "snapapi": {
      "command": {
        "path": "npx",
        "args": ["-y", "snapapi-mcp"],
        "env": {
          "SNAPAPI_API_KEY": "sk_live_your_key_here"
        }
      }
    }
  }
}

自动安装程序

运行随附的辅助脚本:

# For Claude Desktop
./install-mcp.sh claude

# For Cursor
./install-mcp.sh cursor

# For Windsurf
./install-mcp.sh windsurf

可用工具

ping

验证 SnapAPI 是否可达且您的 API 密钥有效。无需参数。

示例提示词: "Ping SnapAPI 以检查其是否正常工作"


screenshot

截取任何 URL 的屏幕截图,并提供丰富的自定义选项。

参数:

参数

类型

必需

描述

url

string

*

要捕获的 URL

html

string

*

要渲染的原始 HTML(URL 的替代方案)

markdown

string

*

要渲染的 Markdown(URL 的替代方案)

format

string

否

png, jpeg, webp 或 avif(默认:png)

quality

number

否

jpeg/webp 的质量 1–100(默认:80)

width

number

否

视口宽度(默认:1280)

height

number

否

视口高度(默认:800)

fullPage

boolean

否

捕获整个可滚动页面

selector

string

否

用于元素捕获的 CSS 选择器

delay

number

否

页面加载后捕获前的等待时间(毫秒)

waitUntil

string

否

load, domcontentloaded 或 networkidle

darkMode

boolean

否

深色配色方案

blockAds

boolean

否

拦截广告网络

blockCookieBanners

boolean

否

拦截 Cookie 弹窗

css

string

否

要注入的自定义 CSS

javascript

string

否

要执行的自定义 JS

device

string

否

设备预设(例如 iphone-15-pro) — 使用 list_devices 查看全部

hideSelectors

string[]

否

捕获前要隐藏的元素

*必须提供 url, html 或 markdown 中的至少一个。

示例提示词:


scrape

使用真实浏览器抓取网页内容(支持 JavaScript 渲染的页面)。

参数:

参数

类型

必需

描述

url

string

是

要抓取的 URL

type

string

否

text (Markdown), html 或 links(默认:text)

pages

number

否

要跟踪的页面数,1–10(默认:1)

waitMs

number

否

页面加载后的额外等待时间(毫秒)

blockResources

boolean

否

拦截图像/媒体/字体以加快速度

locale

string

否

浏览器区域设置(例如 en-US)

premiumProxy

boolean

否

使用住宅代理绕过拦截

示例提示词:


extract

提取针对 LLM 优化的干净、结构化的内容。

参数:

参数

类型

必需

描述

url

string

是

要提取的 URL

type

string

否

markdown, text, html, article, links, images, metadata 或 structured(默认:markdown)

selector

string

否

将提取范围限定为 CSS 元素

waitFor

string

否

提取前等待 CSS 选择器

maxLength

number

否

最大字符长度

cleanOutput

boolean

否

移除噪音(默认:true)

blockAds

boolean

否

拦截广告网络

blockCookieBanners

boolean

否

拦截 Cookie 弹窗

fields

object

否

自定义字段提取映射

示例提示词:


pdf

从 URL 或 HTML 生成 PDF。

参数:

参数

类型

必需

描述

url

string

*

要转换为 PDF 的 URL

html

string

*

要转换为 PDF 的 HTML(URL 的替代方案)

pdfOptions.pageSize

string

否

a4, a3, a5, letter, legal, tabloid(默认:a4)

pdfOptions.landscape

boolean

否

横向模式

pdfOptions.printBackground

boolean

否

包含背景图形

pdfOptions.scale

number

否

缩放比例 0.1–2

pdfOptions.marginTop

string

否

上边距,例如 1cm

pdfOptions.marginBottom

string

否

下边距

pdfOptions.marginLeft

string

否

左边距

pdfOptions.marginRight

string

否

右边距

delay

number

否

页面加载后的等待时间(毫秒)

waitUntil

string

否

load, domcontentloaded 或 networkidle

*必须提供 url 或 html 中的至少一个。

示例提示词:


analyze

在一次调用中从 URL 提取内容并使用 AI 模型进行分析。

参数:

参数

类型

必需

描述

url

string

是

要分析的 URL

prompt

string

是

AI 的分析指令

extractType

string

否

markdown, text, article 或 structured(默认:article)

maxLength

number

否

传递给 AI 的最大字符数(默认:20000)

示例提示词:


video

将浏览器会话录制为视频 (WebM)。

参数:

参数

类型

必需

描述

url

string

是

要录制的 URL

duration

number

否

录制时长(秒),1–60(默认:5)

width

number

否

视口宽度(默认:1280)

height

number

否

视口高度(默认:800)

scenario

string

否

录制期间运行的 JavaScript(滚动、点击等)

delay

number

否

开始录制前的等待时间(毫秒)

waitUntil

string

否

load, domcontentloaded 或 networkidle

darkMode

boolean

否

深色配色方案

blockAds

boolean

否

拦截广告网络

blockCookieBanners

boolean

否

拦截 Cookie 弹窗

device

string

否

设备预设 — 使用 list_devices 查看全部

示例提示词:


get_usage

检查您的 SnapAPI 配额和月度统计信息。无需参数。

示例提示词:

  • "我这个月还剩多少 SnapAPI 请求?"

  • "显示我的 SnapAPI 使用情况"


list_devices

列出所有可用于屏幕截图和视频模拟的设备预设。无需参数。

示例提示词: "有哪些可用于截图的设备预设?"


环境变量

变量

必需

描述

SNAPAPI_API_KEY

是

您的 SnapAPI API 密钥 (sk_live_...)

SNAPAPI_BASE_URL

否

API 基础 URL(默认:https://api.snapapi.pics)


开发

# Clone the repo
git clone https://github.com/Sleywill/snapapi-mcp.git
cd snapapi-mcp

# Install dependencies
npm install

# Build
npm run build

# Run locally (reads MCP protocol from stdin)
SNAPAPI_API_KEY=sk_live_your_key node dist/index.js

故障排除

"SNAPAPI_API_KEY environment variable is required" 确保 MCP 配置中的 env 块包含您的 API 密钥。检查它是否以 sk_live_ 开头。

工具未在 Claude Desktop 中显示 保存配置后重启 Claude Desktop。检查 MCP 日志:

  • macOS: ~/Library/Logs/Claude/mcp*.log

  • Windows: %APPDATA%\Claude\logs\mcp*.log

npx 首次运行时耗时过长 使用 "args": ["-y", "snapapi-mcp"] — -y 标志会自动确认安装提示,无需交互。

screenshot / scrape 返回错误

  • 在 app.snapapi.pics/dashboard 验证您的 API 密钥是否有效

  • 使用 get_usage 工具检查剩余配额

  • 对于 JavaScript 繁重的页面,尝试添加 "waitUntil": "networkidle" 和 "delay" 值

analyze 工具返回错误 分析端点需要 SnapAPI 后端上的 Anthropic API 额度。使用 extract 工具作为回退方案来获取页面内容并自行分析。


许可证

MIT

Available Tools

9 tools
analyzeA

Extract content from a URL and analyze it with an AI model. Returns AI-generated insights, summaries, sentiment, or custom analysis based on your prompt. Combines web extraction with LLM analysis in one call.

Inputs: url (required), prompt (required), extractType, maxLength.

extractA

Extract clean, structured content from a URL. Returns Markdown, plain text, article data (via Mozilla Readability), OG metadata, links, images, or custom structured fields. Optimized for feeding web content to LLMs without HTML noise.

Inputs: url (required), type, selector, waitFor, +6 more.

get_usageA

Check your SnapAPI account usage, quota, and plan details for the current billing period. Shows requests used vs. limit, remaining quota, and monthly statistics.

Inputs: no named parameters.

list_devicesA

List all available device presets for screenshot and video emulation. Each preset sets the correct viewport, device scale factor, and mobile flag (phones, tablets, desktops). Pass the device id to the screenshot or video tool.

Inputs: no named parameters.

pdfB

Generate a PDF from a URL or HTML content. Supports page sizes, margins, landscape orientation, background graphics, and custom scaling.

Inputs: url, html, pdfOptions, width, +3 more.

pingA

Check that the SnapAPI service is reachable and the API key is valid. Returns the API status and current server time. Use this to verify your configuration before making other calls.

Inputs: no named parameters.

scrapeA

Scrape a URL using a real browser and return page content as plain text (Markdown), raw HTML, or a list of links. Works on JavaScript-rendered pages.

Inputs: url (required), type, pages, waitMs, +3 more.

screenshotA

Take a screenshot of a URL or render HTML/Markdown and return the image. Supports full-page capture, device emulation, dark mode, element selection, custom CSS/JS injection, ad/cookie-banner blocking, and more.

Inputs: url, html, markdown, format, +14 more.

videoA

Record a browser session as a video (WebM). Optionally runs a JavaScript scenario (clicks, scrolls, form fills) before and during recording. Returns a URL to download the recorded video.

Inputs: url (required), width, height, duration, +7 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.8/5.0

    Scored across 9 tools

    Disambiguation3/5

    Most tools are clearly distinct by output type (image, PDF, video, usage, devices), but scrape and extract overlap significantly—both return Markdown, plain text, and links from a URL. Descriptions help differentiate raw scraping from structured extraction, but an agent could still be uncertain which to choose.

    Naming Consistency3/5

    Names are all lowercase and readable, but conventions are mixed: some are verb+object (get_usage, list_devices), some are bare verbs (scrape, extract, analyze, ping), and some are noun-like action commands (pdf, video, screenshot). There is no consistent verb_noun pattern, though the naming is still predictable enough to navigate.

    Tool Count5/5

    Nine tools is a well-scoped set for a browser automation and web content API. Each tool covers a distinct core capability or supporting function, with no obvious bloat or redundancy that would make the surface feel heavy.

    Completeness5/5

    The tool surface covers the advertised SnapAPI capabilities thoroughly: scraping, structured extraction, screenshots, PDFs, video recording, AI analysis, device presets, usage checks, and connectivity verification. There are no obvious dead ends or missing core operations for this stateless, action-oriented API.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      A
      quality
      D
      maintenance
      A lightweight Model Context Protocol (MCP) server that enables your LLM to capture screenshots of any specified URL and return only the access URL for the captured image. This tool simplifies the process of generating and sharing webpage snapshots, making it perfect for integrating visual capture ca
      1
      2
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Screenshot and HTML Rendering MCP Server for AI Agents. Capture screenshots, render HTML to images, and generate PDFs via simple API calls. Compatible with Claude, Cursor, and any MCP client.
      1
      MIT