Command Palette

Search for a command to run...

UnylyUnyly
Browse all

Webshot

FreeNot checked

MCP server that gives agents eyes: full-page or element screenshots via an already-running Chrome (CDP), with an SSRF-aware URL policy

GitHubEmbed

About

MCP server that gives agents eyes: full-page or element screenshots via an already-running Chrome (CDP), with an SSRF-aware URL policy

README

Give your agent eyes — without giving it a browser or your network. An MCP server with two tools, screenshot and page_text, that connects to a Chrome you already have running (over CDP) and captures full pages or single elements. No browser is ever launched or downloaded; private-network targets are blocked by an SSRF-aware URL policy.

Why this exists

Two lessons from running visual check → fix loops with coding agents:

  1. Launching a browser per screenshot is the slow, flaky way. A persistent headless Chromium (Docker sidecar, CI service, your desktop Chrome with --remote-debugging-port) is warm, shared, and reliable. The missing piece is a disciplined client: connect over CDP, open a fresh context per shot, close only what you opened, never kill the shared browser. That discipline is this repo.
  2. A screenshot tool inside your network is an SSRF proxy with a camera. An agent that can be talked into "screenshot http://169.254.169.254/…" or http://redis.internal:6379/ will happily photograph your cloud metadata endpoint. So the URL policy blocks loopback, RFC-1918, link-local, CGNAT, and v6-local targets — including hostnames that resolve to them — unless you allowlist the hostname explicitly. Local dev servers are the legitimate exception, and you name them one by one.

Quick start

npm install
npm test        # URL-policy test suite — no browser needed
npm run demo    # policy walkthrough + a real screenshot if a CDP Chrome is reachable

Get a CDP-enabled Chrome (any one of):

# your installed Chrome, headless
chrome --headless --remote-debugging-port=9222 --remote-debugging-address=127.0.0.1 about:blank

# or a Docker sidecar you keep running
docker run -d -p 127.0.0.1:9222:9222 chromedp/headless-shell

Wire into Claude Code:

claude mcp add webshot \
  -e WEBSHOT_CDP_URL=http://127.0.0.1:9222 \
  -e WEBSHOT_ALLOW_HOSTS=localhost,127.0.0.1 \
  -- npx tsx src/server.ts

Then ask the agent things like "screenshot the hero section of localhost:5173 — just .hero — and tell me what's off": selector crops to one element, which keeps the agent's attention (and your tokens) on the part under discussion instead of a 4,000-px page.

Tools

Tool Contract
screenshot url, optional selector (element crop), fullPage, viewport width/height, settleMs. Returns the PNG as MCP image content + {finalUrl, title, httpStatus}. Refuses to capture HTTP ≥ 400 — a screenshot of an error page silently poisons whatever the agent does next.
page_text Body innerText — the cheap check when the agent needs to read, not see. Same URL policy.

Design notes

  • Fresh context per shot, shared browser for life. Contexts are cheap and isolated (cookies, cache, viewport); the browser is expensive and shared. browser.close() on a CDP connection disconnects without killing the remote browser — the server can restart all day without touching Chrome.
  • DNS is checked, rebinding is documented. Non-IP hostnames are resolved and every returned address re-verified against the private ranges. A malicious DNS server that answers differently on the browser's own second resolution (classic rebinding) is out of scope for a screenshot tool — noted here rather than hand-waved.
  • deviceScaleFactor: 2 — retina captures, because agents (and humans) misread blurry text in screenshots more often than you'd think.
  • Policy is fail-closed and testable. evaluateUrl is a pure function with the entire threat table in its test file; the server never calls the browser before the policy says yes.

Stack

TypeScript · @modelcontextprotocol/sdk (stdio) · playwright-core (CDP client only — no bundled browsers) · zod · vitest.

License

MIT © Brandon Ta

from github.com/Brandon-35/webshot-mcp

Install Webshot in Claude Desktop, Claude Code & Cursor

Recommended · one command, every IDE
unyly install webshot

Installs into Claude Desktop, Claude Code, Cursor & VS Code — handles npx, uvx and build-from-source repos for you.

First time? Get the CLI: curl -fsSL https://unyly.org/install | sh

Or configure manually

Run in your terminal:

claude mcp add webshot -- npx -y github:Brandon-35/webshot-mcp

Step-by-step: how to install Webshot

FAQ

Is Webshot MCP free?

Yes, Webshot MCP is free — one-click install via Unyly at no cost.

Does Webshot need an API key?

No, Webshot runs without API keys or environment variables.

Is Webshot hosted or self-hosted?

Self-hosted: the server runs locally on your machine via the install command above.

How do I install Webshot in Claude Desktop, Claude Code or Cursor?

Open Webshot on unyly.org, pick your client tab (Claude Desktop, Claude Code, Cursor) and press Install — the config is generated automatically, no JSON editing.

Related MCPs

Playwright

Browser automation, scraping, screenshots

Microsoftby Microsoft

Puppeteer

Browser automation and web scraping.

modelcontextprotocolby modelcontextprotocol

opentabs-dev/opentabs

Plugin-based MCP server + Chrome extension that gives AI agents access to web applications through the user's authenticated browser session. 100+ plugins with a

opentabs-devby opentabs-dev

robhunter/agentdeals

1,500+ developer infrastructure deals, free tiers, and startup programs across 54 categories. Search deals, compare vendors, plan stacks, and track pricing chan

robhunterby robhunter

hlydecker/ucsc-genome-mcp

MCP server to interact with the UCSC Genome Browser API, letting you find genomes, chromosomes, and more.

hlydeckerby hlydecker

34892002/bilibili-mcp-js

A MCP server that supports searching for Bilibili content. Provides LangChain integration examples and test scripts.

34892002by 34892002

achiya-automation/safari-mcp

Native Safari browser automation for AI agents with 80+ tools. No Chrome dependency, optimized for Apple Silicon with 60% less CPU overhead.

achiya-automationby achiya-automation

agent-infra/mcp-server-browser

Browser automation capabilities using Puppeteer, both support local and remote browser connection.

bytedanceby bytedance

aparajithn/agent-scraper-mcp

Web scraping MCP server for AI agents. 6 tools: clean content extraction, structured scraping with CSS selectors, full-page screenshots via Playwright, link ext

aparajithnby aparajithn

apireno/DOMShell

Browse the web using filesystem commands (ls, cd, grep, click). 38 MCP tools map Chrome's Accessibility Tree to a virtual filesystem via a Chrome Extension.

apirenoby apireno

Compare Webshot with

Not sure what to pick?

Find your stack in 60 seconds

Author?

Embed badge for your README

Browse similar

All browse MCPs