playwright-spa-mcp
π Playwright SPA MCP
The Playwright MCP server built for modern web apps β persistent sessions, React/Vue/Angular support, 143+ devices and smart DOM waiting.
Installation Β· Why Β· Tools Β· Examples Β· Limitations
Overview
An MCP server that drives a real Chromium browser, purpose-built for Single Page Applications. Your assistant can log in, click, type and screenshot β and the SPA's state survives across calls:
You: Log into app.example.com, open the dashboard and screenshot it.
Assistant: (calls
spa_session_start, thenspa_chain[type-realistic β click β wait-for-idle], thenspa_screenshot) Logged in and captured the dashboard β React state preserved across the session.
Related MCP server: MCP Playwright Server
Why this server?
Feature | playwright-spa-mcp | Other Playwright MCPs |
Persistent sessions | β | β |
React/Vue/Angular detection | β | β |
Smart DOM idle waiting | β | β |
Realistic typing | β | β |
Device emulation | 143+ | Limited |
Action chains | β | β |
HTTP with browser cookies | β | β |
Installation
# One command β no clone needed
claude mcp add playwright-spa -- npx -y github:manganate006/playwright-spa-mcp
# Install the Chromium browser Playwright drives
npx playwright install chromiumClaude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"playwright-spa": {
"command": "npx",
"args": ["-y", "github:manganate006/playwright-spa-mcp"]
}
}
}git clone https://github.com/manganate006/playwright-spa-mcp.git
cd playwright-spa-mcp
npm install
npx playwright install chromium
claude mcp add playwright-spa -- node $(pwd)/src/index.jsTools
22 tools, spa_ prefix. Chain-action list, 143+ device shortcuts and CLI usage: docs/ADVANCED.md.
Group | Tools |
πΈ Screenshot & navigation |
|
π Interactions |
|
βοΈ Chains |
|
π Sessions |
|
π Inspection |
|
πΌοΈ iframes |
|
βΉοΈ Discovery |
|
Examples
Log into a React app and keep the session β realistic typing fires React's onChange:
spa_session_start({ session: "myapp" })
spa_chain({
session: "myapp",
url: "https://app.example.com/login",
spaMode: "react",
chain: [
{ action: "type-realistic", selector: "#email", value: "user@example.com" },
{ action: "type-realistic", selector: "#password", value: "secret123" },
{ action: "click", selector: "button[type=submit]" },
{ action: "wait-for-idle" },
{ action: "screenshot" }
]
})
// Same session β React state is preserved
spa_click({ session: "myapp", selector: ".dashboard-item" })Mobile device emulation:
spa_screenshot({ url: "https://example.com", device: "iPhone 15 Pro", fullPage: true })Authenticated API call reusing the session cookies:
spa_http_request({ session: "myapp", url: "https://api.example.com/user/profile", method: "GET" })Limitations
Chromium only β Firefox/WebKit are not wired up; requires
npx playwright install chromiumLocal browser β spawns a real browser process; not suited to sandboxes without one
SPA heuristics β React/Vue/Angular readiness is detected heuristically (
spaMode: "auto"); heavy custom frameworks may need explicitwait-for/wait-for-idleSessions are in-memory β they live with the server process and don't persist across restarts
SPA framework support
Detects and waits correctly for React (finishes rendering, proper onChange), Vue (v-model bindings) and Angular (Zone.js stability). Use spaMode: "auto" to detect automatically. Details in docs/ADVANCED.md.
Built with this MCP
Project | Description |
πΎ ATP tennis stats since 1968 | |
π Pool-party finder in France |
License
MIT Β© manganate006
Available Tools
22 toolsspa_assertC
Run assertions on page elements.
Inputs: type (required), selector (required), url, value, +2 more.
spa_chainA
Execute a chain of actions in sequence. Supports all browser actions plus chain-specific commands like wait, wait-for-idle, press, etc.
Inputs: chain (required), url, device, session, +2 more.
spa_clickB
Click an element with SPA-aware waiting. Waits for DOM to stabilize after click.
Inputs: selector (required), url, session, spaMode, +2 more.
spa_dragC
Drag an element and drop it on another element.
Inputs: target (required), selector (required), url, session, +1 more.
spa_evaluateB
Execute JavaScript in the page context.
Inputs: script (required), url, session.
spa_fillA
Fill an input field with React/Vue/Angular compatibility. Properly triggers framework change events.
Inputs: value (required), selector (required), url, session, +2 more.
spa_get_textC
Get text content of an element.
Inputs: selector (required), url, session.
spa_go_backB
Navigate back in browser history.
Inputs: session, screenshot.
spa_go_forwardA
Navigate forward in browser history.
Inputs: session, screenshot.
spa_http_requestA
Make an HTTP request using the browser context (includes cookies and auth).
Inputs: url (required), body, method, headers, +2 more.
spa_iframe_clickB
Click an element inside an iframe.
Inputs: frame (required), selector (required), url, session, +1 more.
spa_iframe_fillB
Fill an input field inside an iframe.
Inputs: frame (required), value (required), selector (required), url, +2 more.
spa_list_actionsA
List all available actions for the chain command.
Inputs: no named parameters.
spa_list_devicesB
List available device emulation presets.
Inputs: search.
spa_screenshotB
Take a screenshot of a web page with SPA framework support. Waits for DOM to stabilize before capturing.
Inputs: url, device, session, spaMode, +3 more.
spa_session_endB
End a browser session and close the browser.
Inputs: session.
spa_session_listA
List all active browser sessions.
Inputs: no named parameters.
spa_session_startB
Start a new persistent browser session. Use sessions to maintain state between tool calls.
Inputs: device, session, viewport, userAgent.
spa_type_realisticB
Type text character by character with realistic delays. Best for React controlled inputs and forms with live validation.
Inputs: value (required), selector (required), url, delay, +4 more.
spa_uploadC
Upload a file to a file input element.
Inputs: selector (required), url, file, files, +2 more.
spa_wait_idleA
Wait for DOM to become idle (no mutations). Useful for SPAs that update the DOM frequently.
Inputs: maxWait, session, idleTime.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 22 tools
Most tools map cleanly to distinct actions, such as navigate, click, fill, screenshot, and session management. The main ambiguity is between spa_fill and spa_type_realistic for input handling, and spa_chain subsumes many individual actions, but the descriptions generally clarify intent.
All tools share the consistent spa_ prefix and use snake_case, which makes the set feel coherent. Some names are verb-first like spa_get_text, while others are object-first like spa_iframe_click or noun-like spa_http_request, so the pattern is not perfectly uniform.
With 22 tools, the server sits in the heavy 16-25 range. Many tools are justified for browser automation, but iframe variants, the chain command, and session management tools could potentially be consolidated, making the surface feel slightly bloated.
The tool surface covers the core SPA testing lifecycle well: navigation, clicking, filling, typing, iframes, uploads, drag-and-drop, assertions, sessions, screenshots, and JavaScript evaluation. Minor gaps like explicit dropdown/select handling, hover, and dedicated element-wait commands exist, but they can be worked around with spa_evaluate or spa_chain.
Related MCP Connectors
Playwright browser automation β navigate, click, fill forms, extract, screenshot β 17 agent tools.
Browser agents and stealth cloud browsers for AI: run web tasks, fill forms, extract data.
Load testing and synthetic monitoring platform: test with Playwright, Browser Bot, or Protocol Bots.
Programmatic headless browser sessions: create, interact, browse, and extract - rendered in a real
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables automated browser testing of web applications using Playwright, supporting user interactions, form submissions, console monitoring, network request inspection, and visual verification through screenshots.-
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to control web browsers through Playwright automation, providing 50+ tools for navigation, interaction, testing, accessibility audits, and visual testing across Chromium, Firefox, and WebKit.24 npmMIT
- AlicenseBqualityDmaintenanceA universal browser automation server featuring 63 tools for programmatic Chrome control, multi-tab management, and media interaction using Playwright. It enables advanced actions like session recording, performance profiling, and pixel-based interaction through a safe, isolated browser profile.6328 npm1MIT
- FlicenseNot gradedqualityDmaintenancePlaywright E2E test runner with deep debuggingβ action capture, DOM snapshots, network analysis, error pattern matching, behavioral bisection, and interactive browser exploration.12-