Workflow Automation · Open Source

Call Browser-Based MCP Tools from n8n Workflows

n8n's AI Agent nodes can call MCP servers to run custom tools inside automated workflows. Agent MCP Studio lets you build those tools visually in your browser — Python scripts, SQL queries, API calls — and expose them to n8n's AI agents without any server infrastructure.

Share:

How n8n Uses MCP

n8n's AI Agent node can be equipped with an MCP Client Tool sub-node. The MCP Client Tool connects to an MCP server over stdio (subprocess) or SSE (HTTP). Agent MCP Studio's bridge.js acts as the stdio server, relaying requests to your browser tab via the cloud relay.

Prerequisites

Step-by-Step Setup

  1. Get your relay URL and run bridge.js

    Open the studio → SettingsMCP Relay Bridge. Copy your session URL, click Connect, then download and start bridge.js on the same machine as n8n:

    curl -O https://agentmcp.studio/bridge.js
    npm install ws
    # Keep this running in a terminal:
    node bridge.js wss://agentmcp.studio/api/relay/YOUR-UUID

    You'll see [bridge] Browser tab connected once the studio connects. Leave this terminal open.

  2. Build an AI Agent workflow in n8n

    In n8n, create a new workflow and add an AI Agent node. Configure it with your preferred LLM (OpenAI, Claude, etc.) via the Chat Model input.

  3. Add an MCP Client Tool node

    Click the + button on the AI Agent's Tools input. Search for MCP Client Tool and add it. Configure:

    • Connection Type: stdio
    • Command: node
    • Arguments: /absolute/path/to/bridge.js wss://agentmcp.studio/api/relay/YOUR-UUID
    Alternatively — keep bridge running separately

    Instead of n8n launching bridge.js, you can keep bridge.js running as a standalone process and connect n8n to it via a wrapper. This is useful for shared team setups where multiple n8n workflows use the same bridge instance.

  4. Test the workflow

    Trigger the AI Agent node with a prompt that would use one of your tools. For example, if you registered a query_database tool: "Query the orders table and return the top 5 customers by revenue."

    The agent will call your browser-based DuckDB tool and return structured results.

Use Case Ideas for n8n + Agent MCP Studio

Frequently Asked Questions

Yes — n8n has a built-in "MCP Client Tool" node in its AI Agent nodes section. Add it to your workflow, point it at your relay URL, and n8n's AI Agent can call all your Agent MCP Studio tools during automation runs.

The MCP Client Tool node in n8n allows an AI Agent node to call tools from any MCP server. It handles the MCP protocol automatically — you just provide the server transport type (stdio or SSE) and connection details.

Yes — since Agent MCP Studio's relay bridge uses an outbound WebSocket connection (no inbound ports needed), it works with n8n Cloud, self-hosted n8n, and n8n Desktop without any firewall configuration.

Yes — connect the MCP Client Tool node as a tool provider to n8n's AI Agent node. The agent can then call your Python functions, SQL queries, and API tools from Agent MCP Studio during workflow execution.

n8n runs bridge.js as a subprocess (stdio transport). bridge.js connects outbound to your relay URL via WebSocket. When n8n's agent needs a tool, it sends a JSON-RPC call through bridge.js → relay → your browser tab → Pyodide/DuckDB executes it.

Related Integrations