n8n

Connect n8n and Claude Code: Complete MCP Integration Guide 2026

Connect n8n and Claude Code: Complete MCP Integration Guide 2026

Connect n8n and Claude Code: Complete Guide to MCP Integration 2026

Update (October 5, 2026): The n8n-MCP bridge now covers 2,755 workflow automation nodes (832 core + 1,923 community), up from roughly 1,084 when this guide was first edited. Since April 29, 2026, n8n also ships a first-party, instance-level MCP server, in public preview for the Cloud, Enterprise, and Community editions (overview). The current n8n line 2.41.x (September 2026, releases) also enables the Agents node by default.

Automating business processes 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.

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 several steps:

  • Manual node configuration in the n8n editor
  • Testing and debugging each connection
  • Iterating through trial-and-error
  • Documenting the created workflows

A typical workflow can cost hours of development time – time you could be using for more important tasks.

The Solution: AI-Powered Workflow Automation

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

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

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

What is the Model Context Protocol (MCP)?

The Model Context Protocol (MCP) was introduced by Anthropic at the end of 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 to Server
ToolsExecutable functions (e.g. Create Workflow)
ResourcesData sources and context information

Why MCP is Important

  • Standardization: Uniform 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 allows you to visually create 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 and Client

n8n can take on two roles:

  1. MCP Server: Provides your workflows as tools for AI agents
  2. MCP Client: Calls external MCP tools from workflows

What is Claude Code?

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

Claude Code 2.1 Features

FeatureDescription
MCP IntegrationNative support for MCP servers
Skills SystemExtendable 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 suitable for n8n integration because:

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

Step-by-Step: Connect Claude Code with n8n-MCP

Prerequisites

Before you begin, you need:

  • Node.js 18+ installed
  • Claude Code 2.1+ installed (npm install -g @anthropic-ai/claude-code)
  • n8n instance (Cloud or self-hosted)
  • n8n API Key (for workflow management)

Option 1: Basic Setup (Documentation Only)

This setup gives Claude Code access to n8n documentation and validation tools:

Linux/macOS/WSL:

bash
claude mcp add n8n-mcp \
  -e MCP_MODE=stdio \
  -e LOG_LEVEL=error \
  -e DISABLE_CONSOLE_OUTPUT=true \
  -- npx n8n-mcp

Windows PowerShell:

powershell
claude mcp add n8n-mcp `
  '-e MCP_MODE=stdio' `
  '-e LOG_LEVEL=error' `
  '-e DISABLE_CONSOLE_OUTPUT=true' `
  -- npx n8n-mcp

Option 2: Full Setup (with Workflow Management)

For full functionality – create, update, and execute workflows – add your n8n credentials:

Linux/macOS/WSL:

bash
claude mcp add n8n-mcp \
  -e MCP_MODE=stdio \
  -e LOG_LEVEL=error \
  -e DISABLE_CONSOLE_OUTPUT=true \
  -e N8N_API_URL=https://your-n8n-instance.com \
  -e N8N_API_KEY=your-api-key \
  -- npx n8n-mcp

For local n8n instances:

bash
-e N8N_API_URL=http://localhost:5678

Option 3: Docker Setup

For isolated execution with Docker:

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

Verify Setup

After installation, check the status:

bash
# List all MCP servers
claude mcp list

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

# In a Claude Code Session: show available tools
/mcp

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 a new Workflow
n8n_update_workflowUpdate an existing Workflow
n8n_update_partial_workflowPartial Workflow updates (Diff)
n8n_delete_workflowDelete a Workflow

Execution-Management (4 Tools – requires API Key)

ToolFunction
n8n_execute_workflowExecute a Workflow
n8n_get_executionsRetrieve execution history
n8n_get_executionDetails of an execution
n8n_delete_executionDelete an execution

System-Tools (3 Tools – requires API Key)

ToolFunction
n8n_validate_workflowValidate Deployed Workflow
n8n_activate_workflowActivate Workflow
n8n_deactivate_workflowDeactivate Workflow

Practical Application Examples

Example 1: Creating a Lead Nurturing Workflow

Prompt to Claude Code:

text
Create an n8n workflow that:
1. Receives new leads from a webhook
2. Validates the email address with Hunter.io
3. If the email is valid, 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: Automating a Content Pipeline

Prompt:

text
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:

text
Create a monitoring workflow:
- Check the status of our APIs every 5 minutes
- In case of 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

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

2. Validation Before Deployment

Claude Code automatically validates workflows, but you should also:

  • Have Expressions checked for syntax
  • Verify connections between Nodes
  • Perform test execution with sample data

3. Work Iteratively

Start with a simple workflow and expand it gradually:

text
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 complete updates - this saves tokens and reduces errors.

Troubleshooting

Problem: MCP Server unreachable

bash
# 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

Problem: Workflow creation fails

Common causes:

  • Missing Credentials in n8n
  • Invalid Node configuration
  • Syntax errors in Expressions

Solution: Use the validation tools before deployment:

text
validate_workflow_json → validate_workflow_connections → n8n_create_workflow

Future: MCP as the Standard for AI Automation

The combination of n8n and Claude Code via MCP is just the beginning. We are 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 are created and adjusted through conversation

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

Definition of Done ✅

Your n8n + Claude Code Integration is complete when:

  • Claude Code is installed (Version 2.1+)
  • n8n-MCP-Server is added and active (claude mcp list)
  • API Credentials are configured (for Workflow Management)
  • Test Workflow has been created successfully
  • Workflow has been validated and activated

Frequently Asked Questions (FAQ)

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

As an MCP server, n8n provides 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 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 the basic functions?

No. Without an API key, you have access to the 7 Core Tools: Documentation, Node Search, and Validation.

However, to actually create, update, and execute workflows, you need an n8n API key.

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 the claude_desktop_config.json instead of CLI commands. The available tools and functions are identical.

How secure is the MCP connection to my n8n instance?

Security depends on your configuration: The API key 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. With n8n_get_workflow you 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 the way we create automations. Instead of spending hours on manual configuration, you simply describe your requirements – and the AI does the rest.

Ready for the next step? Contact us for a personalized consultation on AI automation in your company.


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

Sources


Automate your workflows with AI

We connect tools like n8n, Claude and your existing systems into automations that run reliably: from the first process map to monitoring in production.

Start with a workshop, then scoping and a fixed-price offer.

Request a workshop →

Relevant for your team? Let's talk for 30 minutes.

We sort out what of this actually works in your company — concrete, no slide marathon.

No commitment · 30 minutes · Proposal within 48 h