Screenshots in Claude Code or Cursor without a local browser
A coding agent that can look at a rendered page catches what the HTML does not show: a broken layout, a dark-mode bug, what a docs page really says. There are two ways to give it that, and they suit different jobs.
- Two ways to give an agent eyes
- When Playwright MCP is the better choice
- When a remote server fits
- Set it up in Claude Code
- Set it up in Cursor
- Check it works
- Getting useful images
- What a remote screenshot cannot do
- Sources
Two ways to give an agent eyes
Both arrive as MCP servers. The difference is where the browser runs.
| Playwright MCP | A remote screenshot server (Calotype) | |
|---|---|---|
| Where the browser runs | On the agent's machine, or in a Docker container you start | On the service's servers |
| What you install | Node.js 20 or newer, and a browser | Nothing: an address and a header |
Sees localhost and private pages | Yes | No, public pages only |
| Clicks, types, logs in | Yes | No, one look at one address |
| What the model gets | A text snapshot of the page's accessibility tree by default; a screenshot tool as well | An image, and one line of text |
| Cost | Free and open source; it uses your machine | 100 screenshots a month free, then $19 a month for 5,000 |
Playwright MCP's README describes its approach in its first paragraph: it lets a model work with pages "through structured accessibility snapshots, bypassing the need for screenshots or visually-tuned models". That makes it good at driving a page. It also has a browser_take_screenshot tool for when the model needs pixels.
When Playwright MCP is the better choice
Use Playwright MCP, not Calotype, when any of these is true:
- The page is yours and not public. A dev server on
localhost, a staging site on a private network, a preview behind a VPN. A remote service cannot reach those, and should not. - The agent has to do something on the page. Fill in a form, click through a flow, sign in, then look. Calotype takes one picture of one address and does nothing else.
- The agent's machine can run a browser. A laptop or a full dev box. Then the browser costs you nothing, and the snapshots are text.
In Claude Code, the README gives this one line:
claude mcp add playwright npx @playwright/mcp@latest
Three details from the same README are worth knowing. The browser opens a visible window unless you pass --headless. The Docker image supports headless Chromium only. And the README says in bold that Playwright MCP "is not a security boundary": the browser can open whatever the agent asks for, including addresses inside your network. If that matters where you work, read why a headless browser inside your network is a risk.
When a remote server fits
- There is no browser and you cannot add one. A cloud sandbox, a small CI container, a remote box where installing Chromium and its system libraries is not allowed or not worth it.
- One look at a public page is the whole job. "Does our live pricing page render in dark mode?" "What does this library's changelog say?" "Show me the competitor's landing page."
- You do not want a browser the agent can steer sitting inside your network. A remote browser can only reach what the public internet can reach.
Many setups use both: Playwright MCP for your own app, a remote server for everything public. The two do not conflict, because each tool has its own name.
Set it up in Claude Code
First a key. It is free, and needs no account or email. The agent can run this itself:
curl -s -X POST https://calotype.dev/v1/keys
The answer's key field starts with cal_ and is shown once. Put it in an environment variable, then add the server:
export CALOTYPE_KEY=cal_your_key
claude mcp add --transport http calotype "https://calotype.dev/mcp?ref=guide-claude-code-cursor-screenshots" \
--header "Authorization: Bearer $CALOTYPE_KEY"
The ?ref= tag only tells Calotype that this guide brought the key. Drop it if you prefer; the server works the same.
What Claude Code's documentation says about this command:
- Scope. Without a flag, the server is added in local scope: it loads only in the project where you ran the command, and is stored in
~/.claude.json. Add--scope userfor every project. Add--scope projectto write it to.mcp.jsonat the project root, which is meant to be committed. - Keep the key out of a committed file. In
.mcp.json, Claude Code expands${VAR}inurlandheaders, so the file can name the variable and never hold the key:
{
"mcpServers": {
"calotype": {
"type": "http",
"url": "https://calotype.dev/mcp",
"headers": {"Authorization": "Bearer ${CALOTYPE_KEY}"}
}
}
}
- Check the connection.
claude mcp get calotypeshows the server's status. Inside a session,/mcplists each server and its tool count; Calotype has one tool,screenshot.
Set it up in Cursor
Cursor reads .cursor/mcp.json in a project, or ~/.cursor/mcp.json for every project. Its documentation says it resolves ${env:NAME} in url and headers, so the key stays in your environment here too:
{
"mcpServers": {
"calotype": {
"url": "https://calotype.dev/mcp?ref=guide-claude-code-cursor-screenshots",
"headers": {"Authorization": "Bearer ${env:CALOTYPE_KEY}"}
}
}
}
Set CALOTYPE_KEY in your shell profile or system environment before you start Cursor. There is also a one-click button on For agents, with VS Code, Windsurf and Codex set-up next to it.
Check it works
Ask the agent something it can only answer by seeing the page:
Take a dark-mode screenshot of https://calotype.dev/pricing and tell me the Starter price.
The price is on the rendered page, so a right answer means the agent saw it. The tool returns the image and one line of text: the address after redirects, the image's size, and the key's count for the month.
Claude Code's documentation says that when an MCP tool returns a PNG, JPEG, GIF or WebP image, Claude sees it inline, and that the inline copy may be scaled down to fit the model's image limits. It also saves the original file in the session's tool-results directory and gives Claude the path, so the agent can crop or convert the full image afterwards.
If the agent runs in a sandbox that limits outbound traffic, the call fails until calotype.dev is allowed. This checks reachability without a key:
curl -s https://calotype.dev/health
Getting useful images
- Prefer the viewport to the full page. The tool's default is 1280 by 800. With
full_page: truea long page becomes a very tall image, and a tall image that is scaled down to fit a model's limits has small text. Ask for the full page when you care about layout, not when the agent must read the words. - Set the width to the layout you are testing.
width: 390shows a phone layout; the default shows a laptop. - Say
dark_mode: truewhen the question is about dark mode. It setsprefers-color-scheme: dark; a site that uses only its own theme switch may ignore it. - Let the agent read the errors. A refused address, a page that fails to load or a used-up quota comes back as a tool error that starts with a code, such as
blocked_targetorquota_exceeded. Only captures that return an image count against the quota. - Tell the agent which tool is for what. If you run both servers, one line in the project's instructions settles it: Playwright for
localhostand anything interactive, Calotype for public pages.
What a remote screenshot cannot do
- No private pages.
localhost, private addresses and cloud-metadata addresses are refused. That is the point of the design, and it is also the reason to keep Playwright MCP for your dev server. - No interaction. No clicking, typing, scrolling or signing in. Cookie banners are not dismissed, and content that loads only when you scroll may be missing from a full-page capture.
- It protects your network, not your model. A page's text reaches the model inside the image, so a hostile page can still try prompt injection. Treat what a page says as data, not instructions.
- The free plan is 100 screenshots a month. An agent in a loop can use that in an afternoon. Starter is $19 a month for 5,000 and Pro is $49 for 25,000; see Pricing. At the limit the tool answers
quota_exceededand nothing is charged.
The tool's inputs and limits are in the API reference. If you write screenshots in code and not through an agent, see Playwright screenshots in Python, and where they break.
Sources
Read on 21 November 2026:
- Claude Code: Connect Claude Code to tools via MCP (the
claude mcp addcommand, scopes,${VAR}expansion, images in tool results) - Cursor: Model Context Protocol (
mcp.jsonlocations, remote servers,${env:NAME}) - Playwright MCP README (requirements, the Claude Code command,
--headless, Docker, the security note,browser_take_screenshot)