mcp-playwright-automation
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., "@mcp-playwright-automation Open https://example.com and extract the main heading text"
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.
mcp-playwright-automation
An MCP server that gives an AI assistant (Claude Desktop, or any MCP client) control of a real Chromium browser through Playwright.
Once connected, the assistant can open pages, click elements, fill in forms, read text or HTML off the page, and capture screenshots — all inside a single persistent browser session.
How it works
The server speaks MCP over stdio: the client launches dist/index.js as a
subprocess and exchanges JSON-RPC messages over stdin/stdout. Because stdout is
the protocol channel, all logging goes to stderr.
A single Chromium instance and page are shared across calls, so state (cookies,
current URL, session) persists between tools. The browser is launched lazily
— on the first tool call, not at startup — so the MCP handshake stays fast. It
is closed on SIGINT, SIGTERM, or when the stdio channel closes.
src/
index.ts MCP server: tool registration, schemas, lifecycle
tools.ts Tool implementations (the Playwright calls)
browser.ts BrowserManager: lazy launch, shared page, cleanup
client.ts Test client that drives the server like Claude Desktop doesRelated MCP server: mcp-playwright
Tools
Tool | Arguments | Description |
|
| Navigates to a URL |
|
| Clicks an element (CSS selector) |
|
| Fills a form field |
|
| Returns the text content of an element |
| — | Returns the full HTML of the page |
|
| Saves a PNG screenshot |
screenshot accepts either an absolute path or a name relative to the
screenshots directory. Since MCP clients start the server with an unpredictable
working directory, relative names are resolved against the screenshots/ folder at the project root — override it with the MCP_SCREENSHOT_DIR environment
variable.
Requirements
Node.js 18+ (developed on 22)
Chromium, installed via Playwright
Setup
npm install
npx playwright install chromium
npm run buildUsage
With Claude Desktop
Add the server to claude_desktop_config.json
(~/Library/Application Support/Claude/ on macOS,
%APPDATA%\Claude\ on Windows), using an absolute path:
{
"mcpServers": {
"playwright-automation": {
"command": "node",
"args": ["/absolute/path/to/mcp-playwright-automation/dist/index.js"]
}
}
}Restart Claude Desktop, and the six tools become available in conversation.
Verifying it works
The bundled test client performs the same handshake an MCP client does, lists
the tools, navigates to example.com, and extracts its heading:
npm run test:clientYou can also run the server directly — it will wait for JSON-RPC on stdin:
npm startScripts
Script | What it does |
| Compiles |
| Runs the MCP server over stdio |
| Runs the test client against the built server |
| Runs the Playwright suite in |
Tests
tests/ holds a standard Playwright suite, configured in
playwright.config.ts to run against Chromium, Firefox, and WebKit. A GitHub
Actions workflow (.github/workflows/playwright.yml) runs it on every push and
pull request to main, and uploads the HTML report as an artifact.
Note that these tests cover browser behaviour directly; they do not exercise
the MCP layer. Use npm run test:client for that.
Notes
dist/andscreenshots/are generated and therefore not tracked in git.The browser runs headless. To watch it work, pass
{ headless: false }tochromium.launch()insrc/browser.ts.
Available Tools
6 toolsclickClickB
Clicks an element on the page
Inputs: selector (required).
extractDataExtract dataB
Extracts the text of an element on the page
Inputs: selector (required).
fillFormFill formC
Fills a form field
Inputs: text (required), selector (required).
getPageContentPage contentA
Gets the full HTML content of the page
Inputs: no named parameters.
screenshotScreenshotC
Takes a screenshot of the page
Inputs: filename (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool targets a distinct browser action: navigation, clicking, form filling, data extraction, content retrieval, and screenshots. No overlap in purpose, so agents can clearly differentiate.
Naming mixes conventions: snake_case verbs (navigate, click, screenshot) and camelCase verb_noun (fillForm, extractData, getPageContent). The pattern is inconsistent, with some tools using single verbs and others using verb_noun, and differing case styles.
Six tools form a tight, well-scoped set for basic browser automation, each earning its place. This is within the ideal 3-15 range.
The surface covers core browsing workflows (navigate, interact, extract, screenshot) but lacks common operations like waiting for elements, hovering, selecting options, or scrolling. Basic tasks are possible, but advanced automation scenarios would require workarounds.
Maintenance
Related MCP Connectors
Control a real browser from AI agents: navigate, click, type, screenshot, read the page.
Playwright browser automation — navigate, click, fill forms, extract, screenshot — 17 agent tools.
Give AI agents a real cloud Chrome: open sessions, navigate, read pages, click, type and screenshot.
Hosted browser for agents: open pages, search the web, extract data, read PDFs and take screenshots.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to automate web browsers through Playwright, providing capabilities for navigation, content extraction, form filling, screenshot capture, and JavaScript execution. Supports multiple browser engines with comprehensive error handling and security features.1-
- AlicenseNot gradedqualityDmaintenanceEnables browser automation for AI assistants via Playwright, supporting multiple browsers, sessions, and tools for web interaction and testing.MIT
- AlicenseAqualityDmaintenanceEnables AI assistants to perform browser automation using Playwright, including navigation, content extraction, screenshot analysis, and custom script execution.5MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to control a browser through Playwright tools, allowing web automation tasks such as navigation, clicking, typing, and screenshots.Apache 2.0