Loomal

Playwright MCP server in n8n.

n8n speaks MCP over HTTP, not stdio — so you run playwright-mcp as a small service and point an MCP Client Tool node at it. Here's the exact setup.

n8n's MCP integration is a workflow node, not a config file: the MCP Client Tool node attaches to an AI Agent node and talks to an MCP server over SSE or streamable HTTP. That means playwright-mcp can't be spawned by n8n the way an editor spawns it — you run it as a standing HTTP service and give n8n the endpoint.

It's a different shape of setup than the editor clients, but it buys you something: one browser server can serve every workflow, and it can live on a different machine than n8n itself. The server is Microsoft's playwright-mcp (npm, 33.7k stars), which conveniently has HTTP mode built in.

Run playwright-mcp as an HTTP service

On a machine with Node 18+ (the n8n host is the natural choice for self-hosted n8n), start the server with a port. Headless is effectively mandatory here since this is a service, not a desktop session:

start-playwright-mcp.sh
npx @playwright/mcp@latest --port 8931 --headless
# MCP endpoint (streamable HTTP): http://localhost:8931/mcp

Add the MCP Client Tool node

In your workflow, add an AI Agent node if you don't have one, then attach an MCP Client Tool node to its tools slot. Set the node's endpoint to the server URL — http://localhost:8931/mcp for a server on the same host — and choose the streamable HTTP transport (or use the /sse path with the SSE option on older setups). playwright-mcp needs no credentials, so the auth fields stay empty.

The node will list the server's tools — browser_navigate, browser_click, browser_snapshot, browser_take_screenshot, and the rest. You can expose all of them to the agent or whitelist a subset; for most workflows, navigation plus snapshot covers the read-and-report cases.

A workflow that earns its keep

Try a monitoring flow: a Schedule Trigger fires hourly, the AI Agent is prompted to open a target page, snapshot it, and report whether a key element is present, and an IF node routes failures to Slack or email. Because playwright-mcp renders real pages, this catches the JavaScript-app breakage that plain HTTP-request checks sail past.

Keep one habit from the start: prompt the agent to snapshot before interacting. The snapshot's element references are how click and type calls are targeted.

Troubleshooting in n8n

Node can't connect: check reachability from n8n's perspective, not your laptop's. If n8n runs in Docker, localhost is the container — use host.docker.internal:8931 or put both services on one Docker network. If you're on n8n Cloud, localhost is meaningless entirely; the MCP server must be on a publicly reachable URL (put a reverse proxy with auth in front of it).

Tools list is empty: confirm the path. The streamable HTTP endpoint is /mcp; hitting the bare port root returns nothing useful. Mismatched transport selection (SSE vs streamable HTTP) produces the same symptom.

Calls time out: cold page loads plus headless Chromium can exceed default timeouts — raise the timeout on the MCP Client Tool node, and make sure the host has the browser installed (npx playwright install chromium) so first call isn't also a download.

Server dies when you log out: npx in a terminal stops with the session. Run it under systemd, pm2, or a Docker container with a restart policy.

On the index

The server's live listing sits at https://loomal.ai/marketplace/playwright-mcp in Loomal's Browser Automation category, tool list included. If you build n8n workflows around paid tools, the same index carries x402-priced listings agents can pay per call — no key provisioning step in the middle of a workflow.

FAQ

How do I connect Playwright MCP to n8n?

Start the server in HTTP mode — npx @playwright/mcp@latest --port 8931 --headless — then add an MCP Client Tool node to your workflow, attach it to an AI Agent node, and set the endpoint to http://your-host:8931/mcp with streamable HTTP transport. The browser tools then appear in the agent's tool set.

Why can't n8n just launch the server like Cursor does?

n8n's MCP Client Tool node only speaks network transports (SSE and streamable HTTP); it doesn't spawn stdio processes. playwright-mcp supports HTTP natively via the --port flag, so the gap is closed by running it as a service rather than a child process.

My n8n runs in Docker and can't reach the server — why?

Inside the n8n container, localhost refers to the container itself. Point the node at host.docker.internal:8931 (Docker Desktop) or run playwright-mcp as another container on the same Docker network and use its service name. For n8n Cloud the server must be exposed on a public URL, ideally behind authentication.

How do I keep the browser server running permanently?

Treat it like any service: a systemd unit, pm2 process, or container with restart: always. A terminal-launched npx process ends with your SSH session, which presents as workflows that worked yesterday failing today.

Browse more MCP servers for n8n.

Find HTTP-ready MCP servers on the Loomal index.

Explore the marketplace