DEV Community

Cover image for How to Add a Screenshot Tool to Your AI Agent with MCP
Nico Acosta for Grabbit

Posted on • Originally published at grabbit.live

How to Add a Screenshot Tool to Your AI Agent with MCP

An AI agent that writes frontend code has no way to see the result. It edits CSS, ships a component, and moves on, blind to whether the page actually renders correctly. The fix is to give the agent a tool that turns a URL into an image it can look at. Model Context Protocol (MCP) is the standard that makes wiring that tool a one-line job.

A screenshot MCP server exposes exactly one capability the agent was missing: send a URL, get back a rendered image. This walks through what a screenshot MCP server is, how to add a hosted one to Claude Code, Cursor, or any MCP host in a single command, and when a hosted server beats a self-hosted one that runs Chromium on your machine.

What a screenshot MCP server actually does

MCP is a protocol for connecting AI hosts to external tools. A host (Claude Code, Cursor, Claude Desktop, an agent framework) speaks MCP to a server, discovers the tools that server offers, and calls them mid-conversation. The agent never needs to know how the tool works internally, only its name, description, and inputs.

A screenshot MCP server offers a capture tool. The contract is simple:

  1. The agent calls the tool with a URL (and optional width, format, and a few knobs).
  2. The server renders the page in a real browser.
  3. The server returns a hosted image, which the host passes back to the model as an image block.
  4. The model looks at the pixels and reasons about them: spacing, overflow, a broken hero, a layout that only breaks at a real viewport.

That is the whole loop. What varies between servers is where the rendering happens. Some servers wrap a local Puppeteer or Playwright install and screenshot on your machine. A hosted server runs the browser on its own infrastructure, so there is nothing to install and nothing to keep alive.

Add a hosted screenshot MCP server in one command

Grabbit is a hosted screenshot MCP server at mcp.grabbit.live, spoken over Streamable HTTP. In Claude Code, adding it is one command plus a browser sign-in:

# Add Grabbit's hosted MCP server (Streamable HTTP)
claude mcp add --transport http grabbit https://mcp.grabbit.live

# Authenticate in your browser (no API key to paste):
#   /mcp   → select "grabbit" → Authenticate
Enter fullscreen mode Exit fullscreen mode

That registers five tools with the host: grab (screenshot a URL), get_grab and list_grabs (fetch or browse past captures), get_usage (credits and plan), and get_pricing (an honest, dated comparison against ScreenshotOne, Urlbox, Browserless, and others). The agent can now call grab any time it needs to see a page.

Prefer a key over the OAuth flow? Pass a Bearer token as a header instead. A free test key (sk_test_...) returns placeholder renders at no cost, so you can prove the wiring before paying:

# Alternative: pass a key as a header instead of the OAuth flow.
claude mcp add --transport http grabbit https://mcp.grabbit.live \
  --header "Authorization: Bearer sk_test_..."
Enter fullscreen mode Exit fullscreen mode

The same server works for any MCP host that speaks Streamable HTTP, not just Claude Code. Cursor, Claude Desktop, and agent frameworks point at the same https://mcp.grabbit.live endpoint and discover the same tools.

The see, fix, verify loop

The reason this matters shows up the moment an agent is doing visual work. Without a screenshot tool, a coding agent writes CSS and hopes. With one, it can close the loop:

You, in Claude Code:
  "Screenshot https://my-feature.preview.vercel.app and check the
   hero spacing against the mockup."

Claude calls the grab tool, looks at the returned image, edits the
CSS, then screenshots again to confirm the fix.
Enter fullscreen mode Exit fullscreen mode

The agent captures the page it just shipped, looks at the rendered pixels, fixes what is off, and screenshots again to confirm. This is the same pattern practitioners keep landing on independently: give the agent a real rendered reference instead of asking it to reason about a page it cannot see. It generalizes past frontend work to visual QA after a deploy, verifying an OG card before a post goes live, or feeding a live competitor page into a vision step.

Because Grabbit captures public URLs and blocks localhost (SSRF protection is on by default), point the agent at a deployed preview or staging URL. That constraint is also what makes the loop work inside CI and remote runners: there is no local browser to drive, and the hosted render does not care.

When to self-host and when to use a hosted server

Search "screenshot MCP server" and most of the results are open-source repos that wrap Puppeteer or Playwright and run the capture locally. Those are a good fit when you want the browser on your own machine and are happy to maintain it. Be honest about what that maintenance is: a headless Chromium to install and patch, memory leaks to bound, fonts and locale to get right on Linux, and the same anti-bot walls a local browser hits on the open web.

A hosted screenshot MCP server removes that surface entirely. There is no Chromium in your environment, the render runs on infrastructure that already handles cookie and consent banners and JavaScript-heavy pages, and it works in sandboxes and CI where a local browser would have nothing to drive. The tradeoff is that you pay per capture instead of paying in devops time.

Grabbit's pricing is a flat $0.002 per live capture on the $50/year plan (25,000 captures), with prepaid credits that never reset or expire monthly, and test-environment captures are free. Browserless and Thum.io list a lower per-grab rate; Grabbit's edge is flat annual billing with no monthly-reset waste and the one-line MCP onboarding above. If your only need from a browser is a screenshot of a URL, a hosted server is the shorter path.

A screenshot server and a browser-automation server do different jobs

A screenshot MCP server is not a replacement for a browser-driving one. Playwright MCP gives an agent a real browser to click, type, and read the accessibility tree, which is what you want to walk through a login or a multi-step flow. A screenshot server has a narrower job: turn a URL into an image the agent can look at.

They pair naturally. The accessibility tree tells the agent what is on the page; a rendered screenshot shows it what the page looks like: visual bugs, CSS regressions, whether the thing actually looks right. Many agents use both. For the deeper pattern of feeding rendered images into a vision model, see Screenshots for AI Agents. To call the same capture from your own code without MCP, How to Screenshot a Website from a URL covers the plain HTTP path.

Calling the same capture over plain HTTP

MCP is the agent-native front door, but the same capture is one HTTP POST when you want it in a script, a cron job, or a framework tool you define by hand. This is what the grab MCP tool calls under the hood:

curl -X POST https://api.grabbit.live/v1/grabs \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://my-feature.preview.vercel.app",
    "width": 1280,
    "height": 720,
    "format": "webp",
    "full_page": true,
    "delay_ms": 500
  }'
Enter fullscreen mode Exit fullscreen mode

The response includes a hosted image_url you pass straight to a vision model as an image input. The knobs that matter most for agent work: full_page captures the whole document, delay_ms (0 to 10000) waits for late-loading content to settle, selector targets a single element by CSS selector, and format: "webp" keeps images small when you are passing them into a model. Width accepts 320 to 1920, height 240 to 1080.

Whether you wire it through MCP or call it directly, the point is the same: the agent stops working blind. It gets eyes on the web it is building.

For the full API reference, see the Grabbit screenshot API.


Originally published on the Grabbit blog.

Top comments (0)