Files
BrowserOS/docs/integrations/n8n.mdx
2026-01-06 16:24:19 -08:00

101 lines
2.4 KiB
Plaintext

---
title: "n8n Integration"
description: "Connect BrowserOS MCP to n8n for AI-powered browser automation workflows"
icon: "workflow"
---
Build AI workflows that automate browser tasks using n8n and BrowserOS MCP.
## Prerequisites
- Node.js and npm installed ([nodejs.org](https://nodejs.org))
- BrowserOS running with MCP server enabled
- LLM API key (OpenAI, Claude, etc.)
## Setup
### Step 1: Install and Run n8n
Run n8n locally:
```bash
npx n8n
```
Access n8n at `http://localhost:5678` and complete the initial setup by creating an account.
<Note>
For global installation: `npm install n8n -g`, then run `n8n` anytime.
</Note>
### Step 2: Install MCP Community Node
Go to **Settings → Community Nodes** and install `n8n-nodes-mcp`:
<Frame>
![Install n8n-nodes-mcp community node](/images/n8n-node.png)
</Frame>
### Step 3: Create Workflow
Create a new workflow with:
1. Add a **Chat Trigger** node (this receives user messages)
2. Add an **AI Agent** node and connect it to the trigger
3. Under the AI Agent, click **Chat Model** and add your LLM (e.g., OpenAI Chat Model)
4. Under the AI Agent, click **Tool** → search "mcp" → select **MCP Client Tool**
<Frame>
![Workflow with AI Agent and MCP Client](/images/n8n-step3-workflow.png)
</Frame>
### Step 4: Configure AI Agent Prompt
In the AI Agent node, set **Source for Prompt (User Message)** to **Connected Chat Trigger Node**.
<Frame>
![Configure AI Agent prompt](/images/n8n-step4-agent-prompt.png)
</Frame>
### Step 5: Configure MCP Client
Click on the **MCP Client** node and configure:
1. **Endpoint**: Copy your MCP URL from BrowserOS (e.g., `http://127.0.0.1:9228/mcp`)
2. **Server Transport**: `HTTP Streamable`
<Note>
Find your MCP URL in BrowserOS under **Settings → MCP**.
</Note>
<Frame>
![Configure MCP Client node](/images/n8n-step5-mcp-client.png)
</Frame>
### Step 6: Test Workflow
Save the workflow, click **Open chat**, and send a message:
```
open google.com on browserOS
```
<Frame>
![Test the workflow](/images/n8n-step6-test.png)
</Frame>
## Troubleshooting
<Warning>
Connection issues? Verify:
- BrowserOS is running
- MCP server is enabled in BrowserOS settings
- Port number matches your BrowserOS MCP configuration
</Warning>
## Resources
<Card title="BrowserOS MCP Guide" icon="book" href="/browseros-mcp/how-to-guide">
Learn more about BrowserOS MCP
</Card>