Deploy Playwright MCP
Playwright MCP headless browser for AI agents, behind a token gateway.
playwright
Just deployed
gateway
Just deployed
Deploy and Host Playwright MCP on Railway
Playwright MCP is Microsoft's Model Context Protocol server that gives AI agents a real browser. Agents navigate pages, click, type, fill forms, take screenshots and read structured accessibility snapshots instead of pixels, which makes web automation reliable for Claude, Cursor, VS Code, Codex and other MCP clients.
About Hosting Playwright MCP
This template deploys Playwright MCP v0.0.82 with headless Chromium on the Railway private network and a small Caddy gateway in front. The gateway requires a generated bearer token on every request, because the server itself has no authentication and its browser can reach anything the service can. Each session uses an isolated in-memory profile, so nothing persists between sessions. Connect your MCP client to the gateway's /mcp URL with the token as a header. Chromium needs a few hundred megabytes of memory per session; the Hobby plan handles light use.
Common Use Cases
- Giving coding agents and chat assistants a remote browser
- Agent-driven testing and QA of web applications
- Web research and data collection from pages that need JavaScript
Dependencies for Playwright MCP Hosting
mcr.microsoft.com/playwright/mcp:v0.0.82(official image)caddy:2.11.4-alpineas the authenticating gateway
Deployment Dependencies
- Playwright MCP on GitHub
- Playwright MCP v0.0.82 release
- Model Context Protocol
- Railway private networking
Implementation Details
| Service | Image | Networking | Storage |
|---|---|---|---|
| gateway | caddy:2.11.4-alpine | public domain on 8080 | none |
| playwright | mcr.microsoft.com/playwright/mcp:v0.0.82 | private only, port 8931 | none |
Claude Code:
claude mcp add --transport http playwright https:///mcp \
--header "Authorization: Bearer "
| Variable | Service | Default | Purpose |
|---|---|---|---|
MCP_API_TOKEN | gateway | generated | Bearer token required on every request |
MCP_URL | gateway | https:///mcp | Endpoint for MCP clients |
Notes:
- Use
browser_snapshotto get page content inline;browser_navigaterefers to a snapshot file kept inside the container. - The browser can reach the Railway private network, so treat the token like a password.
This is a community-maintained deployment package and does not imply affiliation with or endorsement by the Playwright MCP project or its maintainers.
Why Deploy Playwright MCP on Railway?
Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.
By deploying Playwright MCP on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.
Template Content
playwright
mcr.microsoft.com/playwright/mcp:v0.0.82gateway
caddy:2.11.4-alpine