# MCP server

> Give AI agents a take_screenshot tool: set up the Shotfly MCP server in Claude Code, Claude Desktop, Cursor and other MCP clients.

The Shotfly MCP server gives AI agents a `take_screenshot` tool. It renders a page in a real browser and returns the image together with the page title, description and Open Graph image. It is the npm package [@shotfly/mcp](https://www.npmjs.com/package/@shotfly/mcp), listed in the official MCP Registry as `dev.shotfly/mcp`, and it runs on your machine as a thin client of the public API: requests are billed, cached and checked exactly like any other API call.

You need Node.js 22 or newer and a secret key (`sk_…`) from the [dashboard](https://shotfly.dev/dashboard/keys). The free plan includes 100 screenshots a month.

## Setup

Claude Code:

```bash
claude mcp add shotfly --env SHOTFLY_API_KEY=sk_your_key -- npx -y @shotfly/mcp
```

Claude Desktop, Cursor:

```json
{
  "mcpServers": {
    "shotfly": {
      "command": "npx",
      "args": ["-y", "@shotfly/mcp"],
      "env": { "SHOTFLY_API_KEY": "sk_your_key" }
    }
  }
}
```

For Claude Desktop the JSON goes in `claude_desktop_config.json`; for Cursor, in `.cursor/mcp.json`. Other MCP clients take the same command, arguments and environment. The key stays on your machine and is sent only to the Shotfly API.

## take_screenshot

| Argument | Type | Description |
| --- | --- | --- |
| `url` | string, required | Page to capture (http or https). |
| `full_page` | boolean | Capture the whole scrollable page. |
| `device` | `desktop`, `desktop_hd`, `iphone_15`, `pixel_8`, `ipad` | Viewport preset. |
| `format` | `png`, `jpeg`, `webp` | Image format. Default `webp`. |
| `dark_mode` | boolean | Emulate `prefers-color-scheme: dark`. |
| `wait_for_selector` | string | Wait until this CSS selector is visible before capturing. |

The result is the screenshot as an image plus JSON with a link to the file (valid for one hour), its width and height, `credits_charged` and the page `metadata`. Images larger than 4 MB come back as the link only, to keep the model context small. Cookie banners are rejected and ads are blocked. A failed render comes back as an error with its [error code](https://shotfly.dev/docs/errors) and costs nothing.

## get_usage

Returns the current plan, billing period and credits used, the same as `GET /v1/usage`.

## Configuration

| Variable | Required | Description |
| --- | --- | --- |
| `SHOTFLY_API_KEY` | yes | Secret key (`sk_…`) from the dashboard. |
| `SHOTFLY_API_URL` | no | API origin. Default `https://api.shotfly.dev`. |

## Billing

Each successful screenshot costs credits like any other request; see [pricing](https://shotfly.dev/pricing). Failed renders, bot challenges, blank pages and cache hits cost nothing, and every result reports `credits_charged`. To give an agent the page text as well as the image, call the API with `markdown=true`; see [Screenshots for AI agents](https://shotfly.dev/use-cases/ai-agents).

---

Source: https://shotfly.dev/docs/mcp · Last updated 2026-12-01
