Connect n8n and Claude Code: Complete MCP Integration Guide 2026

Complete guide to integrating n8n with Claude Code via the Model Context Protocol (MCP). Learn how to automatically create, validate, and deploy n8n workflows with AI – using just a single prompt.

Connect n8n and Claude Code: Complete MCP Integration Guide 2026

Connect n8n and Claude Code: Complete MCP Integration Guide 2026

Connecting n8n and Claude Code is the focus of this guide. Business process automation has reached a new dimension. With the integration of n8n and Claude Code via the Model Context Protocol (MCP), you can now create complete workflows with a single prompt.

The n8n MCP server is an open-source bridge that gives AI assistants comprehensive access to n8n's 1,084 workflow automation nodes. In this guide, we'll show you how to set up and use this powerful combination.

The Problem: Manual Workflow Creation Is Time-Consuming

Traditionally, creating n8n workflows requires multiple steps:

  • Manual node configuration in the n8n editor
  • Testing and debugging each connection
  • Iteration through trial and error
  • Documentation of created workflows

A typical workflow can take hours of development time — time you could spend on more important tasks.

The Solution: AI-Powered Workflow Automation

With the n8n MCP integration, Claude Code becomes your personal workflow architect:

┌─────────────────┐     ┌─────────────┐     ┌──────────────┐
│   Claude Code   │────▶│  MCP Server │────▶│     n8n      │
│   (AI Agent)    │◀────│  (Bridge)   │◀────│  (Workflows) │
└─────────────────┘     └─────────────┘     └──────────────┘
        │                                           │
        └──────── Natural Language ─────────────────┘

You simply describe what you want to automate, and Claude Code creates, validates, and deploys the workflow automatically.

What Is the Model Context Protocol (MCP)?

The Model Context Protocol (MCP) was introduced by Anthropic in late 2024 and is an open standard that defines how AI models communicate with external systems.

Since January 2026, MCP 1.0 has been the de facto standard for AI tool integration.

MCP Core Concepts

ConceptDescription
HostThe AI application (e.g., Claude Code, Claude Desktop)
ServerProvides tools and resources (e.g., n8n MCP)
ClientConnects host with server
ToolsExecutable functions (e.g., create workflow)
ResourcesData sources and context information

Why MCP Matters

  • Standardization: Unified interface for all AI tools
  • Security: Controlled access to external systems
  • Scalability: Servers developed once work with all MCP-compatible hosts
  • Interoperability: Claude, GPT, and other models can use the same tools

What Is n8n?

n8n (pronounced "n-eight-n") is an open-source platform for workflow automation. It enables visual creation of automations by connecting different nodes.

n8n Core Features

  • 400+ pre-built integrations (Slack, Google, Airtable, etc.)
  • Self-hosted or Cloud: Full control over your data
  • Fair-code license: Free for individual users
  • AI Nodes: Native integration of LLMs in workflows

n8n as MCP Server: Instance-Level MCP Access

Since January 2026, n8n offers a built-in MCP server that gives AI clients like Claude Code or Claude Desktop direct access to your workflows.

What the n8n MCP server can do:

  • Browse workflows enabled for MCP
  • Retrieve metadata and trigger information
  • Execute workflows and receive results

Difference: Instance-Level MCP vs. MCP Server Trigger Node

ApproachDescriptionUse Case
Instance-Level MCPOne connection per n8n instance, centralized authenticationExpose multiple workflows to AI clients
MCP Server Trigger NodeConfigured per workflow, exposes only tools from that workflowSpecific MCP behavior in a single workflow

What Is Claude Code?

Claude Code (Version 2.1, January 2026) is Anthropic's CLI tool for AI-powered software development. It's built on Claude Opus 4.5 and offers advanced features for automation.

Claude Code 2.1 Features

FeatureDescription
MCP IntegrationNative support for MCP servers
Skills SystemExtensible capabilities through plugins
Multi-Agent WorkflowsOrchestration of multiple AI agents
Context ForkParallel exploration of solution approaches
Agentic CodingAutonomous code creation and refactoring

Why Claude Code for n8n?

Claude Code is particularly well suited for n8n integration because:

  • Agentic Workflows: Independent execution of complex tasks
  • Tool Usage: Direct interaction with external APIs
  • Persistent Sessions: Context is preserved across multiple interactions
  • Validation: Automatic verification of created workflows

Activating n8n MCP Access (Built-in Server)

Step 1: Enable MCP in n8n

  1. Navigate to Settings > Instance-level MCP
  2. Enable Enable MCP access (requires admin privileges)

After activation, you'll see:

  • List of workflows enabled for MCP
  • List of connected OAuth clients
  • Master switch for MCP access
  • Button for connection details

Step 2: Set Up Authentication

n8n offers two authentication methods:

  1. Copy your Instance Server URL from the OAuth tab
  2. Configure your MCP client with this URL
  3. On connection, you'll be redirected to n8n for authorization

Managing OAuth clients:

  • Navigate to Settings > Instance-level MCP > Connected clients
  • Revoke access via the action menu on each client
  1. Open Connection details > Access Token Tab
  2. Copy your personal MCP Access Token
  3. Use the token and server URL for client configuration

Important: Copy the token immediately — on later visits, only a masked value will be displayed!

Rotating tokens:

  1. Navigate to Settings > Instance-level MCP
  2. Open Connection details > Access Token Tab
  3. Click Generate new token

The old token is invalidated immediately. Update all connected clients!

Connecting Claude Code with n8n MCP

The n8n MCP server is available on GitHub: github.com/czlonkowski/n8n-mcp

Method 1: CLI Command (Fastest Option)

claude mcp add --transport http n8n-mcp https://your-n8n-domain.com/mcp-server/http \
  --header "Authorization: Bearer YOUR_N8N_MCP_TOKEN"

Replace:

  • your-n8n-domain.com — Your n8n instance URL
  • YOUR_N8N_MCP_TOKEN — Your generated MCP Access Token

Method 2: Configuration File

Add to your claude.json:

{
    "mcpServers": {
        "n8n-local": {
            "type": "http",
            "url": "https://your-n8n-domain.com/mcp-server/http",
            "headers": {
                "Authorization": "Bearer YOUR_N8N_MCP_TOKEN"
            }
        }
    }
}

Method 3: Docker Setup

For isolated execution:

{
  "mcpServers": {
    "n8n-mcp": {
      "command": "docker",
      "args": [
        "run", "-i", "--rm",
        "-e", "MCP_MODE=stdio",
        "-e", "LOG_LEVEL=error",
        "-e", "N8N_API_URL=http://host.docker.internal:5678",
        "-e", "N8N_API_KEY=YOUR_API_KEY",
        "ghcr.io/czlonkowski/n8n-mcp:latest"
      ]
    }
  }
}

Verifying the Setup

# List all MCP servers
claude mcp list

# Details for the n8n server
claude mcp get n8n-mcp

# In Claude Code: show available tools
/mcp

Connecting Claude Desktop with n8n

With OAuth2

  1. Open Settings > Connectors in Claude Desktop
  2. Click Add custom connector
  3. Enter:
    • Name: n8n MCP
    • Remote MCP Server URL: Your n8n base URL
  4. Save and authorize access

With Access Token

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "n8n-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "supergateway",
        "--streamableHttp",
        "https://your-n8n-domain.com/mcp-server/http",
        "--header",
        "authorization:Bearer YOUR_N8N_MCP_TOKEN"
      ]
    }
  }
}

Prerequisite: Current Node.js version installed.

Connecting Other MCP Clients

OpenAI Codex CLI

Add to ~/.codex/config.toml:

[mcp_servers.n8n_mcp]
command = "npx"
args = [
    "-y",
    "supergateway",
    "--streamableHttp",
    "https://your-n8n-domain.com/mcp-server/http",
    "--header",
    "authorization:Bearer YOUR_N8N_MCP_TOKEN"
]

Google ADK Agent

from google.adk.agents import Agent
from google.adk.tools.mcp_tool import McpToolset
from google.adk.tools.mcp_tool.mcp_session_manager import StreamableHTTPServerParams

N8N_INSTANCE_URL = "https://your-n8n-domain.com"
N8N_MCP_TOKEN = "YOUR_N8N_MCP_TOKEN"

root_agent = Agent(
    model="gemini-2.5-pro",
    name="n8n_agent",
    instruction="Help users manage and execute workflows in n8n",
    tools=[
        McpToolset(
            connection_params=StreamableHTTPServerParams(
                url=f"{N8N_INSTANCE_URL}/mcp-server/http",
                headers={
                    "Authorization": f"Bearer {N8N_MCP_TOKEN}",
                },
            ),
        )
    ],
)

Enabling Workflows for MCP

Workflow Requirements

A workflow can only be enabled for MCP if it:

  1. Is published
  2. Contains one of these trigger nodes:
    • Webhook
    • Schedule
    • Chat
    • Form

Unpublished workflows or workflows without a supported trigger won't appear in the MCP list.

Enabling Workflows

Option 1: Via MCP Settings

  1. Click Enable workflows
  2. Search for the desired workflow
  3. Click Enable

Option 2: In the Workflow Editor

  1. Open the workflow
  2. Click ... (Menu) > Settings
  3. Enable Available in MCP

Option 3: From the Workflow List

  1. Open the menu on a workflow card
  2. Select Enable MCP access

Workflow Descriptions

Helpful descriptions make it easier for AI clients to identify workflows:

  1. Navigate to Settings > Instance-level MCP
  2. Click on the description or Edit description
  3. Describe what the workflow does and what inputs are expected

Available MCP Tools

The n8n MCP server provides 20+ tools:

Core Tools (7 Tools — Always Available)

ToolFunction
get_n8n_documentationAccess n8n documentation
search_n8n_nodesSearch available nodes
get_node_detailsDetailed node information
validate_workflow_jsonValidate JSON structure
validate_node_minimalCheck minimal node configuration
validate_workflow_connectionsCheck connections between nodes
validate_workflow_expressionsValidate n8n expressions

Workflow Management (6 Tools — Requires API Key)

ToolFunction
n8n_list_workflowsList all workflows
n8n_get_workflowRetrieve workflow details
n8n_create_workflowCreate new workflow
n8n_update_workflowUpdate existing workflow
n8n_update_partial_workflowPartial workflow updates (diff)
n8n_delete_workflowDelete workflow

Execution Management (4 Tools — Requires API Key)

ToolFunction
n8n_execute_workflowExecute workflow
n8n_get_executionsRetrieve execution history
n8n_get_executionExecution details
n8n_delete_executionDelete execution

System Tools (3 Tools — Requires API Key)

ToolFunction
n8n_validate_workflowValidate deployed workflow
n8n_activate_workflowActivate workflow
n8n_deactivate_workflowDeactivate workflow

Practical Examples

Example 1: Create a Lead Nurturing Workflow

Prompt for Claude Code:

Create an n8n workflow that:
1. Receives new leads from a webhook
2. Validates the email address with Hunter.io
3. For valid emails, generates a personalized message with Claude
4. Sends the message via Instantly.ai
5. Updates the lead status in Airtable

Claude Code will:

  1. Identify the required nodes
  2. Generate the workflow JSON
  3. Validate all connections
  4. Create the workflow in your n8n instance
  5. Optionally activate it

Example 2: Automate a Content Pipeline

Prompt:

Build a workflow for content repurposing:
- Trigger: New YouTube video upload
- Extract transcript with Assembly AI
- Generate blog post with Claude
- Create social media snippets for LinkedIn and X
- Schedule posts with Buffer

Example 3: Monitoring and Alerting

Prompt:

Create a monitoring workflow:
- Check the status of our APIs every 5 minutes
- On errors: Send Slack message to #ops
- Log all checks in Google Sheets
- Create weekly uptime report

Best Practices for n8n + Claude Code

1. Use Structured Prompts

TASK: [What should be automated]
TRIGGER: [What starts the workflow]
STEPS: [Numbered list of actions]
OUTPUT: [Expected result]
ERROR HANDLING: [What should happen on errors]

2. Validate Before Deployment

Claude Code validates workflows automatically, but you should additionally:

  • Have expressions checked for syntax
  • Verify connections between nodes
  • Run test executions with sample data

3. Work Iteratively

Start with a simple workflow and expand step by step:

First iteration: Webhook → Slack message
Second iteration: + Data validation
Third iteration: + Error handling
Fourth iteration: + Logging and monitoring

4. Use Workflow Diff Operations

For smaller changes, use n8n_update_partial_workflow instead of full updates — this saves tokens and reduces errors.

Troubleshooting

Problem: MCP Server Not Reachable

# Check status
claude mcp list

# Re-add server
claude mcp remove n8n-mcp
claude mcp add n8n-mcp [options]

Problem: API Connection Failed

Check:

  1. API URL correct? No trailing slashes
  2. API key valid? In n8n: Settings → API → Create API Key
  3. Firewall/Network? n8n must be reachable from your system
  4. Instance publicly accessible? Required for cloud-based MCP clients

Problem: Workflow Creation Fails

Common causes:

  • Missing credentials in n8n
  • Invalid node configuration
  • Syntax errors in expressions

Solution: Use the validation tools before deployment:

validate_workflow_json → validate_workflow_connections → n8n_create_workflow

Problem: Workflow Timeout

n8n enforces a 5-minute timeout for MCP-triggered workflows. For longer workflows:

  • Split into sub-workflows
  • Use asynchronous processing with queues
  • Use webhook-based callback patterns

Problem: Binary Data Not Supported

MCP clients can only provide text-based inputs. For binary data:

  • Use Base64 encoding
  • Pass a URL to external storage
  • Create a separate upload workflow

The Future: MCP as the Standard for AI Automation

The combination of n8n and Claude Code via MCP is just the beginning. We're already seeing:

  • Multi-agent systems: Multiple AI agents orchestrating workflows together
  • Self-healing workflows: AI detects errors and fixes them automatically
  • Natural language as interface: Workflows created and modified through conversation

n8n hasn't just adopted MCP — it's becoming a core component of the AI automation infrastructure.


Resources


Definition of Done ✅

Your n8n + Claude Code integration is complete when:

  • Claude Code is installed (Version 2.1+)
  • n8n MCP access is enabled (Settings > Instance-level MCP)
  • Authentication is configured (OAuth2 or Access Token)
  • Claude Code is connected with n8n (claude mcp list)
  • At least one workflow is enabled for MCP
  • Test execution was successful

Frequently Asked Questions (FAQ)

What's the difference between n8n as an MCP server and as an MCP client?

As an MCP server, n8n exposes your workflows as tools that can be called by AI agents like Claude.

As an MCP client, n8n itself can integrate external MCP tools into workflows. For integration with Claude Code, you need either the built-in n8n MCP server or a separate MCP server like n8n-mcp, which acts as a bridge between Claude Code and your n8n instance.

Do I need an API key for basic features?

No. Without an API key, you have access to the 7 core tools: documentation, node search, and validation.

However, for actually creating, updating, and executing workflows, you'll need an n8n API key or MCP Access Token.

Does n8n MCP also work with Claude Desktop instead of Claude Code?

Yes. The n8n MCP server supports both Claude Code and Claude Desktop.

Configuration is done via claude_desktop_config.json instead of CLI commands. The available tools and features are identical.

How secure is the MCP connection to my n8n instance?

Security depends on your configuration: the Access Token should never be stored in public repositories.

Use environment variables and restrict API access to necessary operations. For self-hosted n8n instances, we recommend HTTPS and IP whitelisting.

Can I modify existing n8n workflows with Claude Code?

Absolutely. Use n8n_get_workflow to retrieve the current state, describe the desired changes, and Claude Code uses n8n_update_workflow or n8n_update_partial_workflow for the modification.

The diff operation is particularly efficient for small changes.

Conclusion

Integrating n8n and Claude Code via MCP transforms how we create automations. Instead of hours of manual configuration, you simply describe your requirements — and the AI handles the rest.

Ready for the next step? Contact us via email for a personalized consultation on AI automation for your business.


This article was last updated on January 12, 2026 and reflects the current state of Claude Code 2.1, MCP 1.0, and n8n.

Share article

Share: