playwright-spa-mcp
Playwright browser automation tuned for single-page apps (React/Vue/Angular) โ screenshots, form filling, action chains, persistent sessions and 140+ device presets.
README
<div align="center">
๐ญ 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
</div>
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.
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 chromium
Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"playwright-spa": {
"command": "npx",
"args": ["-y", "github:manganate006/playwright-spa-mcp"]
}
}
}
<details> <summary>Alternative: clone & install locally</summary>
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.js
</details>
Tools
22 tools, spa_ prefix. Chain-action list, 143+ device shortcuts and CLI usage: docs/ADVANCED.md.
| Group | Tools |
|---|---|
| ๐ธ Screenshot & navigation | spa_screenshot, spa_navigate, spa_go_back, spa_go_forward, spa_wait_idle |
| ๐ Interactions | spa_click, spa_fill, spa_type_realistic, spa_upload, spa_drag |
| โ๏ธ Chains | spa_chain (run many actions in one call) |
| ๐ Sessions | spa_session_start, spa_session_end, spa_session_list |
| ๐ Inspection | spa_get_text, spa_assert, spa_evaluate, spa_http_request |
| ๐ผ๏ธ iframes | spa_iframe_click, spa_iframe_fill |
| โน๏ธ Discovery | spa_list_devices, spa_list_actions |
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 chromium - Local 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-idle - Sessions 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.mangi.fr | ๐พ ATP tennis stats since 1968 |
| piscinade.com | ๐ Pool-party finder in France |
License
MIT ยฉ manganate006
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.