# Playwright MCP

Deploy Playwright MCP on Render for a hosted, headless browser your AI tools drive over HTTP — no local install or npx required.

- Repository: https://github.com/render-examples/playwright-mcp-render
- URL: https://render.com/templates/playwright-mcp

## Why deploy playwright mcp render on Render?

Playwright MCP on Render is a deployment template that runs Microsoft's Playwright MCP server as a hosted Render web service. It is a Model Context Protocol server that lets an LLM drive a headless Chromium browser—navigating, clicking, typing, and reading pages via accessibility snapshots—over an HTTPS endpoint. This removes the need to install a browser locally or run `npx @playwright/mcp` on each machine, giving any MCP client a shared HTTPS URL to connect to.

This template runs the official Playwright MCP image as a single Render web service with the browser-driving flags (`--headless`, `--no-sandbox`, `--host 0.0.0.0`) already wired into the entrypoint, plus `PORT` and `RENDER_EXTERNAL_HOSTNAME` handling pre-configured so the server binds correctly and advertises the right public URL — no Dockerfile tuning or flag debugging required. Instead of running `npx @playwright/mcp` on every developer's machine (and installing headless Chromium on each), the one-click Blueprint deploy gives you a single HTTPS `/mcp` endpoint behind Render's TLS-terminating edge that any MCP client can share. Because the whole setup lives in `render.yaml`, you also get an optional locked-down demo mode via a single env var and repeatable, version-controlled redeploys without touching upstream source.

## Architecture

```mermaid
flowchart LR
    classDef default fill:#1a1a2e,stroke:#a78bfa,color:#fff

    Client([MCP Client]) -->|"Streamable-HTTP /mcp :10000"| MCP[playwright-mcp]
    MCP -->|"headless Chromium"| Web([Target Websites])
```

## What you can build

After you click Deploy, you'll have a hosted Playwright MCP server reachable at an HTTPS `/mcp` URL that any MCP client—Claude, Cursor, or your own—can connect to over the network. Your AI tools can then open a real headless browser to navigate, click, type, and read pages as structured accessibility snapshots, without anyone installing a browser or running `npx` locally. Each request runs in an ephemeral browser context by default, so there's no state to manage, though the endpoint is public and unauthenticated unless you keep the URL private or add your own access controls.

## Key features

- *One-click Blueprint deploy*: The render.yaml Blueprint provisions a single Docker web service on the standard plan directly from the Deploy button with no secrets or API keys required.
- *Thin upstream wrapper*: Wraps the official mcr.microsoft.com/playwright/mcp image without forking, so upgrading Playwright MCP is a one-line base-image tag bump in Dockerfile.render.
- *Streamable HTTP /mcp endpoint*: Exposes a hosted headless-Chromium MCP server over an HTTPS /mcp endpoint that any MCP client (Claude, Cursor) can connect to without local browser installs.
- *Stateless ephemeral sessions*: Each request drives an ephemeral browser context with no database, disk, or persisted profile, though a Render Disk plus --user-data-dir can add persistence.
- *Lockdown demo mode*: Setting DEMO=true starts the server with --isolated sessions, blocked internal origins, disabled service workers, and tight navigation/action timeouts for public exposure.

## Use cases

- QA engineer lets Claude verify staging site's headings after each deploy
- Team shares one hosted browser MCP instead of local npx setups
- Support agent's AI assistant fetches live pricing pages during chats
- Developer runs a locked-down public demo of AI-driven browsing

## What's included

| Service | Type | Purpose |
|---------|------|---------|
| playwright-mcp | Web Service | Application service |

## Next steps

1. Connect your MCP client to the service by running `claude mcp add --transport http playwright https://<your-service>.onrender.com/mcp` — The client should list `playwright` as a connected MCP server, confirming the `/mcp` endpoint accepts Streamable HTTP over Render's TLS edge
2. Test the hosted browser by asking your assistant "Open example.com and give me the page title and the main heading" — It should return the title "Example Domain" and heading text within a few seconds, proving the headless Chromium in the container is driving real navigation and returning accessibility snapshots
3. Configure access control by making the service a private service or adding an auth proxy/IP allow-list in the Render dashboard, since HTTP mode has no built-in authentication — After locking it down, an unauthenticated request to your `/mcp` URL from an outside network should be rejected, confirming nobody with the URL can drive your browser

## Resources

- [Playwright MCP official site](https://github.com/microsoft/playwright-mcp)
