visual-inspector-mcp
The visual-inspector-mcp server enables AI agents to see and interact with real web pages through a persistent headless Chromium browser session, preserving login state, scroll position, and client-side SPA state across calls.
Navigate to URLs — Load any URL (local dev server,
file://, or public site) in a persistent browser instance.Take screenshots — Capture the page as PNG or JPEG, scoped to a specific element (via CSS selector), the viewport, or the full scrollable page.
Click elements — Simulate clicks to reach UI states (e.g., open modals, menus, or tabs) before screenshotting.
Fill form fields — Set values on inputs, textareas, and selects, dispatching events React controlled components need; supports batch-filling multiple fields in one call.
Type per-keystroke — Simulate typing one character at a time (firing keydown/keypress/keyup per character) for inputs that require real keystroke events.
Press keyboard keys — Send keys like
Enter,Tab,Escape, or combos likeControl+Ato a specific or currently focused element.Resize the viewport — Change browser dimensions to test responsive breakpoints without reloading or losing client-side state.
Retrieve console logs — Fetch recent browser console messages and page errors, with options to filter to errors only, limit count, and include timestamps.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@visual-inspector-mcp Navigate to https://example.com and take a screenshot"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
visual-inspector-mcp
English | فارسی
An MCP server that lets Claude Code — or any MCP-compatible client — actually see and interact with the web pages it's working on, instead of only reading the source. It runs a persistent headless Chromium browser (via Playwright) and returns screenshots as inline images the model can view directly in the tool result.
"This icon looks wrong" → the agent screenshots the icon and looks at it, instead of guessing from the CSS.
Why
Coding agents are excellent at reading and writing code, but blind to what that code actually renders as. A misaligned icon, a color that doesn't match the design, a responsive layout that breaks at a certain width, a modal that overlaps its own close button — none of these are visible from source alone. This server closes that gap with a set of small, composable tools built around a single persistent browser session — including full form interaction, so the agent can fill inputs, type keystrokes, and submit forms before looking at the result.
Related MCP server: Browser MCP
Tools
Tool | Description |
| Load a URL (dev server, |
| Screenshot the current page, or a single element by CSS selector / Playwright locator syntax (e.g. |
| Click an element to reach a UI state (open a modal, menu, tab) before screenshotting it. |
| Set the value of an input/textarea/select by selector ( |
| Type into a field one key at a time ( |
| Press a keyboard key such as |
| Change the viewport size to check a responsive breakpoint, independent of navigating or screenshotting — so you can resize → click → screenshot without reloading the page (and losing client-side state). |
| Recent browser console messages and page errors, to correlate a visual issue with a JS error. Supports |
Full parameter reference is in the tool descriptions themselves (visible to
any MCP client) and in index.js.
Requirements
Node.js 18 or later
~200 MB free disk space (Playwright downloads a Chromium build on install)
Installation
git clone https://github.com/MatinMHF/visual-inspector-mcp.git
cd visual-inspector-mcp
npm install # installs dependencies and downloads Chromium via postinstallConfiguration
Claude Code
claude mcp add --scope user visual-inspector -- node /absolute/path/to/visual-inspector-mcp/index.js--scope user registers it for every project. Use --scope project instead
to scope it to the current repo, or omit --scope for the current session
only. Restart Claude Code (or start a new session) after adding it — a
running session won't pick up a newly registered server.
On Windows PowerShell, quote the -- separator:
claude mcp add --scope user visual-inspector "--" node "C:/path/to/visual-inspector-mcp/index.js"Verify it's connected:
claude mcp listClaude Desktop (or any client using claude_desktop_config.json)
Add to your claude_desktop_config.json:
{
"mcpServers": {
"visual-inspector": {
"command": "node",
"args": ["/absolute/path/to/visual-inspector-mcp/index.js"]
}
}
}Other MCP clients
This is a standard stdio MCP server — node index.js speaks MCP over
stdin/stdout. Any client that supports stdio-transport MCP servers can run it
the same way.
Usage
Once configured, just ask naturally:
"Navigate to localhost:3000/settings and screenshot the save icon in the toolbar — does it look right?"
"Resize to 375x667 and check what the mobile nav looks like after I click the hamburger menu."
"Fill in the signup form with test data and submit it — any errors?"
"Any console errors on the checkout page?"
Typical tool sequences:
// Visual inspection
navigate({ url: "http://localhost:3000/settings" })
screenshot({ selector: "#save-icon" }) // isolate just the element
console_logs({ level: "error" }) // check for related JS errors
// Form interaction
navigate({ url: "http://localhost:3000/signup" })
fill({ fields: [{ selector: "#name", value: "Ada" }, { selector: "#email", value: "ada@example.com" }] })
press({ key: "Enter", selector: "[type=submit]" })
screenshot({}) // see the result
// Responsive check
resize({ width: 375, height: 667 })
screenshot({ fullPage: true })Design notes
One persistent page per server process.
navigatedoesn't spin up a new browser each call — it reuses the same page/context so state (login, scroll position, SPA client state) survives acrossclick→fill→screenshotsequences.fillvstype.fillis almost always the right choice — it clears the field, sets the value atomically, and fires the input/change events React's controlled components need. Usetypeonly when the input's handler specifically reacts to individual keystrokes (e.g. an autocomplete that fires onkeydown).Cheapest-capture-first.
screenshot's tool description actively steers the calling model towardselector(one element) over the default viewport, and viewport overfullPage(most expensive in image tokens).Lossless by default. Screenshots are PNG unless you explicitly opt into
format: "jpeg". On flat-color UI (icons, buttons), JPEG is often no smaller — so PNG stays the default; on photo-heavy full-page captures, JPEG at quality 80 measured ~75–80% smaller in testing.Bounded log output.
console_logsdefaults to the last 30 entries with no timestamps — passlimit/withTimestampsfor more.
Security note
This server gives the connected AI client the ability to navigate a real
(headless) browser to any URL it's given — including localhost and other
addresses on your local network. It's designed to run locally over stdio for
trusted development use, the same way you'd trust any other local dev
tooling. Don't expose it over a network transport or hand it to an untrusted
client.
Development
npm test # runs smoke-test.mjs: spins up the server as a subprocess and
# exercises every tool + parameter over the real MCP protocolsmoke-test.mjs is also run in CI on every push/PR (see
.github/workflows/test.yml).
Changelog
v1.1.0
Added
filltool — set input/textarea/select values (supports batchfields[])Added
typetool — per-keystroke typing for inputs needing real keydown eventsAdded
presstool — send keyboard keys (Enter,Tab,Escape,Control+A, …)Extended smoke test with full form interaction coverage
v1.0.0
Initial release:
navigate,screenshot,click,resize,console_logs
License
Available Tools
8 toolsclickClickA
Click an element by selector to reach a UI state (open a menu/modal/tab) before screenshotting it.
Inputs: selector (required).
console_logsConsole logsARead-only
Recent browser console messages and page errors — correlate a visual issue with a JS error.
Inputs: clear, level, limit, withTimestamps.
fillFill form fieldA
Set the value of an input/textarea/select by selector (Playwright locator.fill — clears then types, and dispatches the input/change events React controlled components need). Pass fields to fill several inputs in one call. Use type instead only for inputs that require per-keystroke keydown events.
Inputs: value, fields, selector.
pressPress keyA
Press a keyboard key such as 'Enter' (submit a form), 'Tab', or 'Escape'. With selector the key is sent to that element; without it, to the focused element. Supports Playwright key syntax (e.g. 'Control+A').
Inputs: key (required), selector.
resizeResize viewportA
Resize the viewport, e.g. to check a responsive breakpoint before screenshotting.
Inputs: width (required), height (required).
screenshotScreenshotARead-only
Screenshot the current page and return it as a viewable image — see the actual rendered UI instead of guessing from code. Prefer selector (one element, cheapest) over the default viewport, and viewport over fullPage (priciest); use the smallest capture that answers the question. Requires navigate first.
Inputs: format, quality, fullPage, selector.
typeType text (per-keystroke)A
Type into a field one key at a time (Playwright locator.pressSequentially), firing a keydown/keypress/keyup per character — for inputs whose handlers need real keystrokes and don't react to fill. Set clear to empty the field first.
Inputs: text (required), selector (required), clear, delay.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Each tool has a distinct purpose: clicking, filling inputs, navigating, taking screenshots, etc. There is no functional overlap or ambiguity between tools.
All tool names follow a consistent lowercase_snake_case verb pattern (click, fill, navigate, press, resize, screenshot, type), except console_logs which is a noun but still clear. Overall very consistent.
With 8 tools, the server is well-scoped for browser automation and visual inspection. Each tool serves a necessary function without excessive granularity.
The tool set covers core browser interactions (navigation, clicking, input, keyboard, screenshots) and console logs. Minor gaps like explicit wait or scrolling are absent, but the surface is sufficient for most visual inspection tasks.
Maintenance
Related MCP Connectors
Official Browserless MCP server: browser automation, scraping, screenshots and PDFs for AI agents.
Web scraping, browser automation, screenshots and AI data extraction for AI agents via MCP.
Hosted Web Crawler MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
Live browser debugging for AI assistants — DOM, console, network via MCP.
Related MCP Servers
- AlicenseBqualityDmaintenanceAn MCP server that enables AI assistants to capture and analyze web page screenshots using Puppeteer, supporting multi-breakpoint captures, error reporting, and page interactions.157 npm6MIT
- AlicenseNot gradedqualityCmaintenanceAn MCP server for browser automation using Puppeteer that enables AI assistants to navigate web pages, interact with UI elements, and capture screenshots. It supports comprehensive web tasks including form filling, content extraction, and executing custom JavaScript within the browser context.2MIT
- AlicenseAqualityDmaintenanceAn MCP server that uses headless Chromium (Puppeteer) to capture pixel-perfect screenshots and extract DOM from URLs, with LLM-friendly step-based workflows.29 npm3MIT
- AlicenseNot gradedqualityDmaintenanceMCP server for headless browser automation using Puppeteer, enabling AI to navigate, click, fill forms, take screenshots, and execute JavaScript on web pages.MIT