Deploy Playwright browser (w/ MCP)

Private browser for Playwright scripts and AI agents (MCP), behind a token.

Deploy Playwright browser (w/ MCP)

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.

Playwright browser on Railway

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

  1. In your service's Variables, add PLAYWRIGHT_WS_ENDPOINT = ${{Playwright.PLAYWRIGHT_WS_ENDPOINT}} (the address, token included).
  2. Install playwright-core at the server's version, the value of PLAYWRIGHT_VERSION (1.65.1). A different minor version is refused with "Playwright version mismatch".
  3. 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

  1. Add PLAYWRIGHT_MCP_URL = ${{Playwright.PLAYWRIGHT_MCP_URL}} and PLAYWRIGHT_TOKEN = ${{Playwright.PLAYWRIGHT_TOKEN}} to the agent's service.
  2. 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

  1. Click Playwright, then Settings, Networking, Generate Domain, port 3000.
  2. Connect to wss://YOUR_DOMAIN/playwright?token=YOUR_TOKEN, or MCP at https://YOUR_DOMAIN/mcp with 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

Playwright browser architecture

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

More templates in this category

View Template
N8N Main + Worker
Deploy and Host N8N with Inactive worker.

jakemerson
121
View Template
Evolution API with n8n
Automate WhatsApp workflows with Evolution API, n8n, and Postgres.

codestorm
112
View Template
Postgres Backup
Cron-based PostgreSQL backup to bucket storage

Railway Templates
868