Deploy Playwright browser (w/ MCP)
Private browser for Playwright scripts and AI agents (MCP), behind a token.
Playwright
Just deployed
Deploy and Host Playwright browser (w/ MCP) on Railway
A headless browser your Railway services share: scripts connect with Playwright, AI agents with Playwright MCP. It stays on the private network, behind a token generated per deploy.
Not affiliated with or endorsed by Microsoft.

About Hosting Playwright browser (w/ MCP)
The official Playwright 1.65.1 image with Chromium, Firefox and WebKit, on port 3000: /playwright for Playwright clients, /mcp for agents. Add it to the project that needs a browser: on its canvas, Add, then Template.
Use it from a script
- In your service's Variables, add
PLAYWRIGHT_WS_ENDPOINT=${{Playwright.PLAYWRIGHT_WS_ENDPOINT}}(the address, token included). - Install
playwright-coreat the server's version, the value ofPLAYWRIGHT_VERSION(1.65.1). A different minor version is refused with "Playwright version mismatch". - Connect:
const { chromium } = require('playwright-core');
const browser = await chromium.connect(process.env.PLAYWRIGHT_WS_ENDPOINT);
const page = await browser.newPage();
await page.goto('https://example.com');
console.log(await page.title());
await browser.close();
Use firefox.connect or webkit.connect for the other engines. Python, Java and .NET clients take the same address.
Use it from an AI agent
- Add
PLAYWRIGHT_MCP_URL=${{Playwright.PLAYWRIGHT_MCP_URL}}andPLAYWRIGHT_TOKEN=${{Playwright.PLAYWRIGHT_TOKEN}}to the agent's service. - Register the MCP server with the header
Authorization: Bearer YOUR_TOKEN. Claude Code:claude mcp add --transport http playwright "$PLAYWRIGHT_MCP_URL" --header "Authorization: Bearer $PLAYWRIGHT_TOKEN". Any MCP client that can send a header works the same way.
Use it from outside Railway
- Click Playwright, then Settings, Networking, Generate Domain, port 3000.
- Connect to
wss://YOUR_DOMAIN/playwright?token=YOUR_TOKEN, or MCP athttps://YOUR_DOMAIN/mcpwith the same Bearer header. Anyone with the token can use the browser, so keep it secret.
Common Use Cases
- Scheduled scraping and checks
- Browser tools for AI agents
- Screenshots and PDFs from services
Dependencies for Playwright browser (w/ MCP) Hosting
- Playwright
Deployment Dependencies
Implementation Details

Nothing to back up. Idles at about 0.15 GB. On Free (0.5 GB) use Chromium: Firefox and WebKit need 1 GB for heavy pages. To upgrade, change the image tag and PLAYWRIGHT_VERSION together.
Why Deploy Playwright browser (w/ 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 browser (w/ 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.
Updated 2026-11-14: first release, Playwright 1.65.1.
Template Content