automation-playwright

n8n nodes for Playwright automation

Package Information

Released: 4 mo ago
Downloads: 29 weekly / 85 monthly
Latest Version: 0.0.9
Author: Ejaz Ullah

Documentation

Browser Tool Node

An n8n node that connects to a Browser MCP (Model Context Protocol) server, enabling AI-driven browser automation from within n8n workflows.


Overview

The Browser Tool node acts as an MCP client. It connects to a running Browser MCP server over HTTP or SSE, optionally attaches a Chrome DevTools Protocol (CDP) session (Chrome, Playwright, etc.), and exposes the full MCP surface — tools, resources and prompts — as n8n operations.

It can be used as a standalone node or as a tool inside an AI Agent node (usableAsTool: true).


Prerequisites

Requirement Details
Running MCP server An MCP-compatible browser automation server (e.g. Playwright MCP)
CDP-enabled browser (optional) Chrome / Chromium launched with --remote-debugging-port=9222, or a Playwright server
API Key (optional) Required only if your MCP server enforces authentication

Configuration

Connection

Field Type Default Description
Base URL string http://localhost:8080 Base URL of the MCP server
API Key password — Sent as X-API-KEY header; leave blank if not required. Get a key
CDP Driver URL string http://localhost:9222 Remote debugging endpoint of a running browser. Used to call browser_connect_cdp automatically before the first Call Tool operation
Connection Type options HTTP HTTP uses Streamable HTTP transport; SSE uses Server-Sent Events transport

Operation

Select what the node should do each time it runs.


Operations

List Tools

Returns every tool registered on the connected MCP server.

Output: array of tool descriptors (name, description, input schema).


Call Tool

Executes a specific tool on the MCP server.

When a CDP Driver URL is set and this is the first callTool call in the execution, the node automatically calls browser_connect_cdp to attach the browser session before running your tool.

Parameter Type Required Description
Tool Name string yes* Name of the MCP tool to invoke (e.g. browser_navigate). Can be omitted if toolName, name, or tool is present inside Tool Arguments
Tool Arguments JSON no Arguments forwarded to the tool as a JSON object, e.g. { "url": "https://example.com" }

*If Tool Name is blank, the node looks for the key toolName, name, or tool inside Tool Arguments and uses that value.

Common browser tools (depends on your MCP server):

Tool Example Arguments
browser_navigate { "url": "https://example.com" }
browser_screenshot {}
browser_click { "selector": "#submit-btn" }
browser_type { "selector": "#search", "text": "hello" }
browser_connect_cdp { "endpoint": "http://localhost:9222" }

List Resources

Returns every resource exposed by the MCP server.

Output: array of resource descriptors (uri, name, mime type, etc.).


Read Resource

Reads the content of a specific MCP resource.

Parameter Type Required Description
Resource URI string yes The URI of the resource to read (obtained from List Resources)

Output: array of resource content objects.


List Prompts

Returns every prompt template registered on the MCP server.

Output: array of prompt descriptors (name, description, arguments).


Get Prompt

Fetches a rendered prompt from the MCP server.

Parameter Type Required Description
Prompt Name string yes Name of the prompt to retrieve
Prompt Arguments JSON no Key/value pairs required by the prompt template

Output: the rendered prompt messages.


Output Schema

Every operation returns items in this shape:

{
  "operation": "callTool",
  "result": { ... },
  "timestamp": "2026-03-12T10:00:00.000Z"
}

On error (when Continue On Fail is enabled):

{
  "error": "Tool not found: browser_navigate",
  "operation": "callTool",
  "timestamp": "2026-03-12T10:00:00.000Z"
}

Connection Caching

Within a single n8n execution the MCP client connection is reused across all items and node invocations (keyed by executionId + connectionType + baseUrl + driverUrl). This avoids redundant handshakes and ensures browser_connect_cdp is only called once per execution.


Example Workflow

[Manual Trigger]
      |
[Browser Tool]  ← Operation: Call Tool
                   Base URL: http://localhost:8080
                   CDP Driver URL: http://localhost:9222
                   Tool Name: browser_navigate
                   Tool Arguments: { "url": "https://example.com" }
      |
[Browser Tool]  ← Operation: Call Tool
                   Tool Name: browser_screenshot
      |
[Write Binary File]

Error Handling

Scenario Behaviour
MCP server unreachable Throws ApplicationError with the connection URL
Invalid JSON in arguments Throws NodeOperationError with parse details
Tool name missing Throws NodeOperationError prompting where to set the name
Unknown operation Throws NodeOperationError
Continue On Fail enabled Errors are captured in the output item and execution continues

References

Discussion