For the complete documentation index, see llms.txt. This page is also available as Markdown.

MCP client connection examples

These examples show the exact commands and configuration for connecting specific clients to n8n's MCP server. Before using them, enable MCP access on your instance and choose an authentication method, see Connecting MCP clients.

The Connect a client dialog (available from n8n 2.33.0) provides one-click setup to connect Claude.ai, Cursor, and VS Code. It also provides interactive setup steps for Claude Code, Codex, Gemini CLI, ChatGPT, and Windsurf. See Using OAuth (recommended) for how to open the dialog and pick your client.

The examples below are useful if interactive steps aren't shown in n8n for your chosen client, for reference purposes, or for manual configuration.

The examples below all use https://. If your instance serves plain HTTP, such as a local install at http://localhost:5678, use http:// instead. Copying the full Server URL from n8n gives you the right prefix either way.

Connecting Lovable to n8n MCP server

  1. Configure MCP Server in Lovable (OAuth).

    • Navigate to your workspace Settings > Integrations.

    • In the MCP Servers section, find n8n and click Connect.

    • Enter your n8n server URL: the Server URL value shown in the Connect a client dialog.

    • Save the connection. If successful, n8n redirects you to approve access for Lovable.

  2. Verify connectivity.

    • Once connected, Lovable can query for workflows with MCP access enabled.

    • Example: Asking Lovable to build a workflow UI that lists users and allows deleting them.

Connecting Claude Desktop to n8n MCP server

Using OAuth (recommended)

  1. Navigate to Settings > Connectors in Claude Desktop.

  2. Click on Add custom connector.

  3. Enter the following details:

    • Name: n8n MCP

    • Remote MCP Server URL: the Server URL value shown in the Connect a client dialog. It ends in /mcp-server/http, so it looks like https://<your-n8n-domain>/mcp-server/http. This isn't the address of your n8n editor. Don't paste the URL from your browser's address bar.

  4. Save the connector.

  5. When prompted, approve access for Claude Desktop.

Using API key

Add the following entry to your claude_desktop_config.json file:

Here, replace:

  • <your-n8n-domain>: Your n8n domain, without the https:// prefix. On n8n Cloud this is your-instance.app.n8n.cloud. When self-hosted, it's the domain that serves your n8n editor, for example n8n.example.com. You can find your full server URL in n8n under Settings > Instance-level MCP > Connect a client > Server URL.

Connecting Claude Code to n8n MCP server

Option 1: Authenticate using OAuth (recommended)

Use the following CLI command:

Or add the following entry to your claude.json file:

Here, replace:

  • <your-n8n-domain>: Your n8n domain, without the https:// prefix. On n8n Cloud this is your-instance.app.n8n.cloud. When self-hosted, it's the domain that serves your n8n editor, for example n8n.example.com. You can find your full server URL in n8n under Settings > Instance-level MCP > Connect a client > Server URL.

Run /mcp in Claude Code and select n8n to complete the OAuth authorization.

Option 2: Authenticate using API key

Use the following CLI command:

Or add the following entry to your claude.json file:

Here, replace:

  • <your-n8n-domain>: Your n8n domain, without the https:// prefix. On n8n Cloud this is your-instance.app.n8n.cloud. When self-hosted, it's the domain that serves your n8n editor, for example n8n.example.com. You can find your full server URL in n8n under Settings > Instance-level MCP > Connect a client > Server URL.

  • <YOUR_N8N_MCP_TOKEN>: Your generated token

Connecting Codex CLI to n8n MCP server

Option 1: Authenticate using OAuth (recommended)

Use the following CLI command:

Or add the following entry to your ~/.codex/config.toml file:

The [features] block enables Codex's HTTP MCP client. Older Codex builds require it; newer builds ignore it.

Here, replace:

  • <your-n8n-domain>: Your n8n domain, without the https:// prefix. On n8n Cloud this is your-instance.app.n8n.cloud. When self-hosted, it's the domain that serves your n8n editor, for example n8n.example.com. You can find your full server URL in n8n under Settings > Instance-level MCP > Connect a client > Server URL.

Run codex mcp login n8n to complete the OAuth authorization.

Option 2: Authenticate using API key

Add the following entry to your ~/.codex/config.toml file:

Here, replace:

  • <your-n8n-domain>: Your n8n domain, without the https:// prefix. On n8n Cloud this is your-instance.app.n8n.cloud. When self-hosted, it's the domain that serves your n8n editor, for example n8n.example.com. You can find your full server URL in n8n under Settings > Instance-level MCP > Connect a client > Server URL.

  • <YOUR_N8N_MCP_TOKEN>: Your generated token

Connecting Gemini CLI to n8n MCP server

Use the following CLI command:

Or add the following entry to your ~/.gemini/settings.json file:

Here, replace:

  • <your-n8n-domain>: Your n8n domain, without the https:// prefix. On n8n Cloud this is your-instance.app.n8n.cloud. When self-hosted, it's the domain that serves your n8n editor, for example n8n.example.com. You can find your full server URL in n8n under Settings > Instance-level MCP > Connect a client > Server URL.

Run /mcp in Gemini CLI and select n8n to complete the OAuth authorization.

Connecting Cursor to n8n MCP server

In the Connect a client dialog, select Cursor from Your client, then select One-click setup to open Cursor and add the n8n server automatically. Approve access when Cursor redirects you back to n8n.

Or add the following entry to your ~/.cursor/mcp.json file (or the project's .cursor/mcp.json):

Here, replace:

  • <your-n8n-domain>: Your n8n domain, without the https:// prefix. On n8n Cloud this is your-instance.app.n8n.cloud. When self-hosted, it's the domain that serves your n8n editor, for example n8n.example.com. You can find your full server URL in n8n under Settings > Instance-level MCP > Connect a client > Server URL.

Connecting VS Code to n8n MCP server

In the Connect a client dialog, select VS Code from Your client, then select One-click setup to open VS Code and add the n8n server automatically. Approve access when VS Code redirects you back to n8n.

Or add the following entry to your workspace's .vscode/mcp.json file:

Here, replace:

  • <your-n8n-domain>: Your n8n domain, without the https:// prefix. On n8n Cloud this is your-instance.app.n8n.cloud. When self-hosted, it's the domain that serves your n8n editor, for example n8n.example.com. You can find your full server URL in n8n under Settings > Instance-level MCP > Connect a client > Server URL.

Connecting Windsurf to n8n MCP server

Add the following entry to your ~/.codeium/windsurf/mcp_config.json file:

Here, replace:

  • <your-n8n-domain>: Your n8n domain, without the https:// prefix. On n8n Cloud this is your-instance.app.n8n.cloud. When self-hosted, it's the domain that serves your n8n editor, for example n8n.example.com. You can find your full server URL in n8n under Settings > Instance-level MCP > Connect a client > Server URL.

Approve access when Windsurf redirects you to n8n on its first connection attempt.

Connecting Google ADK agent to n8n MCP server

Here's sample code to create an agent that connects to a remote n8n MCP server:

Here, replace:

  • N8N_INSTANCE_URL: The base URL of your n8n instance. On n8n Cloud this is https://your-instance.app.n8n.cloud. When self-hosted, it's your own URL, for example https://n8n.example.com. You can find your full server URL in n8n under Settings > Instance-level MCP > Connect a client > Server URL.

  • YOUR_N8N_MCP_TOKEN: Your generated access token

For more details, see Connect ADK agent to n8n.

Troubleshooting

If a client doesn't connect using the steps above, see Troubleshooting on the main MCP server page.

Last updated

Was this helpful?