Model Context Protocol

MCP Server for Website Screenshots

Give Claude, Cursor, VS Code, and Codex four action-oriented tools for hosted URL screenshots, HTML screenshots, mobile screenshots, and URL-to-PDF — no browser infrastructure to run.

Works with any MCP client

Claude
Cursor
GitHub Copilot
Codex
Windsurf

Runs locally over stdio today. npm publication pending namespace confirmation.

MCP client config

mcp config
{
  "mcpServers": {
    "screenshotapi": {
      "command": "bun",
      "args": ["/absolute/path/to/packages/mcp-server/src/index.ts"],
      "env": { "SCREENSHOTAPI_KEY": "sk_live_your_key_here" }
    }
  }
}

Four narrow tools

Tool names are intentionally specific so models choose the right capture path without a generic API wrapper. Each returns a file path and usage metadata.

capture_webpage_screenshot

Capture a PNG, JPEG, or WebP screenshot from a public or authorized URL.

capture_html_screenshot

Render raw HTML to an image without launching a local browser.

generate_webpage_pdf

Export a PDF from a URL or an HTML document.

capture_mobile_screenshot

Capture a mobile-sized screenshot (390×844, 2× DPR) from a URL.

Add it to your client

Set SCREENSHOTAPI_KEY and drop the server into your MCP config. The local stdio config works today; the npm config lands on publish.

Local stdio — works today
build then configure
{
  "mcpServers": {
    "screenshotapi": {
      "command": "bun",
      "args": ["/absolute/path/to/packages/mcp-server/src/index.ts"],
      "env": { "SCREENSHOTAPI_KEY": "sk_live_your_key_here" }
    }
  }
}

Run bun --cwd packages/mcp-server run build first.

After npm publish
npx
{
  "mcpServers": {
    "screenshotapi": {
      "command": "npx",
      "args": ["@screenshotapi/mcp-server"],
      "env": { "SCREENSHOTAPI_KEY": "sk_live_your_key_here" }
    }
  }
}

No local build required once published.

Claude

Claude Desktop & Claude Code

Add the server to your Claude MCP config, or run claude mcp add.

Cursor

Cursor

Add the server to .cursor/mcp.json or your global Cursor config.

VS Code & Codex

Register the server in agent mode, or call the REST API directly.

Safety model

The server and the API both enforce safe targets, so autonomous agents stay inside their boundaries.

  • API-key auth via the SCREENSHOTAPI_KEY environment variable.
  • Private IP and localhost blocking for untrusted agent requests.
  • Conservative defaults for viewport size, timeout, and cache TTL.
  • File-path and metadata outputs instead of oversized binary payloads.
  • Public or authorized URLs only — never paywalled or private content.

Frequently asked questions

What is the ScreenshotAPI MCP server?

It is a Model Context Protocol server that exposes four tools — capture_webpage_screenshot, capture_html_screenshot, generate_webpage_pdf, and capture_mobile_screenshot — so AI agents can capture hosted screenshots and PDFs without running a local browser. Each tool writes a file and returns a path plus usage metadata.

Which clients support it?

Any MCP client, including Claude Desktop, Claude Code, Cursor, VS Code agent mode, and Codex. Most clients use the standard mcpServers config shape; VS Code uses a servers block in .vscode/mcp.json.

Is the MCP server published to npm yet?

Public npm and Docker publication is pending namespace confirmation, and a hosted remote connector is on the roadmap. The server runs locally over stdio today, and the REST API and OpenAPI schema are production-ready for every agent right now.

How do agents authenticate?

The local server reads your API key from the SCREENSHOTAPI_KEY environment variable. The underlying REST API accepts the key via an x-api-key header or Authorization: Bearer header.

Can the MCP server screenshot localhost?

No. The server rejects localhost and common private-network targets before calling ScreenshotAPI, and ScreenshotAPI enforces the same boundary server-side. Capture public or authorized URLs only.

Give your agents a screenshot tool

Create a free account, grab an API key, and connect the MCP server or REST API. 200 screenshots per month, free.

Create free account