How to Set Up n8n MCP Server (2026)
Connect n8n automation workflows to AI agents via MCP
Hypereal로 구축 시작하기
단일 API를 통해 Kling, Flux, Sora, Veo 등에 액세스하세요. 무료 크레딧으로 시작하고 수백만으로 확장하세요.
신용카드 불필요 • 10만 명 이상의 개발자 • 엔터프라이즈 지원
How to Set Up n8n MCP Server (2026)
The Model Context Protocol (MCP) allows AI agents like Claude Code, Cursor, and Cline to connect to external tools and services. By setting up n8n as an MCP server, you can give your AI assistant access to hundreds of integrations -- from Slack and Google Sheets to databases and custom APIs -- all through n8n's visual workflow builder.
This guide walks you through setting up an n8n MCP server from scratch, connecting it to AI tools, and building practical automation workflows.
What Is MCP and Why n8n?
Model Context Protocol (MCP)
MCP is an open standard (created by Anthropic) that defines how AI models connect to external tools. Instead of hardcoding integrations, MCP lets you expose tools as a standardized interface that any compatible AI agent can use.
Why n8n for MCP?
n8n is a workflow automation platform (similar to Zapier but self-hostable and open source) with 400+ built-in integrations. By exposing n8n workflows as MCP tools, your AI agent gains access to:
| Category | Example Integrations |
|---|---|
| Communication | Slack, Discord, Email, Telegram |
| Productivity | Google Sheets, Notion, Airtable, Todoist |
| Development | GitHub, GitLab, Jira, Linear |
| Databases | PostgreSQL, MySQL, MongoDB, Supabase |
| Cloud | AWS, GCP, Azure, Cloudflare |
| Finance | Stripe, QuickBooks, PayPal |
| CRM | Salesforce, HubSpot, Pipedrive |
| Custom | Any REST API, webhooks, scripts |
Prerequisites
- Docker and Docker Compose installed
- Node.js 18+ for the MCP bridge
- An AI tool that supports MCP (Claude Code, Cursor, Cline, etc.)
- Basic familiarity with n8n (optional, we cover the basics)
Step 1: Deploy n8n
The easiest way to run n8n is with Docker:
# Create a directory for n8n data
mkdir -p ~/n8n-data
# Run n8n with Docker
docker run -d \
--name n8n \
-p 5678:5678 \
-v ~/n8n-data:/home/node/.n8n \
-e N8N_SECURE_COOKIE=false \
-e WEBHOOK_URL=http://localhost:5678/ \
n8nio/n8n:latest
Or use Docker Compose for a more robust setup:
# docker-compose.yml
version: '3.8'
services:
n8n:
image: n8nio/n8n:latest
ports:
- "5678:5678"
environment:
- N8N_SECURE_COOKIE=false
- WEBHOOK_URL=http://localhost:5678/
- N8N_BASIC_AUTH_ACTIVE=true
- N8N_BASIC_AUTH_USER=admin
- N8N_BASIC_AUTH_PASSWORD=changeme
volumes:
- n8n_data:/home/node/.n8n
restart: unless-stopped
volumes:
n8n_data:
docker compose up -d
Open http://localhost:5678 to access the n8n editor.
Step 2: Create n8n Workflows for MCP
Each n8n workflow that you want to expose as an MCP tool needs a Webhook trigger. This is how the MCP bridge will invoke the workflow.
Example 1: Slack Message Sender
- In n8n, click Add Workflow
- Add a Webhook node as the trigger:
- Method: POST
- Path:
/mcp/send-slack-message
- Add a Slack node:
- Action: Send Message
- Channel:
{{ $json.channel }} - Message:
{{ $json.message }}
- Activate the workflow
Test it with curl:
curl -X POST http://localhost:5678/webhook/mcp/send-slack-message \
-H "Content-Type: application/json" \
-d '{"channel": "#general", "message": "Hello from MCP!"}'
Example 2: Google Sheets Lookup
- Create a new workflow with a Webhook trigger:
- Method: POST
- Path:
/mcp/lookup-spreadsheet
- Add a Google Sheets node:
- Action: Read Rows
- Spreadsheet ID: your-spreadsheet-id
- Range:
Sheet1!A:Z
- Add a Filter node to match the query
- Add a Respond to Webhook node to return results
- Activate the workflow
Example 3: Database Query
Webhook (POST /mcp/query-database)
→ PostgreSQL (Execute Query)
→ Respond to Webhook (Return Results)
Step 3: Install the n8n MCP Bridge
The MCP bridge translates between the MCP protocol and n8n webhook calls. Install the community bridge package:
npm install -g @anthropic-ai/mcp-server-n8n
Or use the community package:
npm install -g n8n-mcp-server
Step 4: Configure the MCP Server
Create a configuration file that maps n8n workflows to MCP tools:
{
"n8n_base_url": "http://localhost:5678",
"n8n_api_key": "your-n8n-api-key",
"tools": [
{
"name": "send_slack_message",
"description": "Send a message to a Slack channel",
"webhook_path": "/webhook/mcp/send-slack-message",
"parameters": {
"channel": {
"type": "string",
"description": "Slack channel name (e.g., #general)",
"required": true
},
"message": {
"type": "string",
"description": "Message text to send",
"required": true
}
}
},
{
"name": "lookup_spreadsheet",
"description": "Look up data in the team Google Spreadsheet",
"webhook_path": "/webhook/mcp/lookup-spreadsheet",
"parameters": {
"query": {
"type": "string",
"description": "Search term to look up",
"required": true
}
}
},
{
"name": "query_database",
"description": "Run a read-only SQL query against the project database",
"webhook_path": "/webhook/mcp/query-database",
"parameters": {
"sql": {
"type": "string",
"description": "SQL SELECT query to execute",
"required": true
}
}
},
{
"name": "create_github_issue",
"description": "Create a GitHub issue in the project repository",
"webhook_path": "/webhook/mcp/create-github-issue",
"parameters": {
"title": {
"type": "string",
"description": "Issue title",
"required": true
},
"body": {
"type": "string",
"description": "Issue description in markdown",
"required": true
},
"labels": {
"type": "string",
"description": "Comma-separated labels",
"required": false
}
}
}
]
}
Save this as ~/.config/n8n-mcp/config.json.
Step 5: Connect to Claude Code
Add the n8n MCP server to Claude Code's MCP configuration.
Edit ~/.claude/mcp_servers.json:
{
"mcpServers": {
"n8n": {
"command": "n8n-mcp-server",
"args": ["--config", "/Users/yourname/.config/n8n-mcp/config.json"]
}
}
}
Restart Claude Code:
claude
Claude Code now has access to your n8n tools. Test it:
You: Send a Slack message to #dev-updates saying "Deployment complete for v2.1.0"
Claude Code will call the send_slack_message tool, which triggers the n8n workflow, which sends the Slack message.
Step 6: Connect to Cursor or Cline
Cursor MCP Configuration
In Cursor, go to Settings > MCP Servers and add:
{
"n8n": {
"command": "n8n-mcp-server",
"args": ["--config", "/Users/yourname/.config/n8n-mcp/config.json"]
}
}
Cline MCP Configuration
In Cline's settings panel, add the MCP server:
{
"mcpServers": {
"n8n": {
"command": "n8n-mcp-server",
"args": ["--config", "/Users/yourname/.config/n8n-mcp/config.json"]
}
}
}
Practical Use Cases
Use Case 1: AI-Powered Deployment Notifications
When Claude Code finishes a task, it can notify your team:
You: Fix the pagination bug in src/api/users.ts, commit the fix,
and send a Slack message to #dev-updates with a summary.
Claude Code will:
- Fix the code
- Create a Git commit
- Call the
send_slack_messageMCP tool to notify the team
Use Case 2: Data-Driven Development
You: Look up the top 10 customers by revenue in the spreadsheet
and create a dashboard component that displays them.
Claude Code will:
- Call
lookup_spreadsheetto get the data - Generate a React component using the real data structure
Use Case 3: Issue Triage Automation
You: Review the error logs, identify the root cause, fix it,
and create a GitHub issue documenting what happened.
Use Case 4: Database-Informed Coding
You: Query the database for the schema of the users table
and generate a TypeScript interface that matches it.
Building More Complex n8n Workflows
Multi-Step Workflow: Bug Report Pipeline
Webhook (POST /mcp/report-bug)
→ Create GitHub Issue
→ Create Jira Ticket
→ Send Slack Notification to #bugs
→ Log to Google Sheet
→ Respond to Webhook (Return Issue URL)
This single MCP tool triggers a complete bug reporting pipeline across four services.
Scheduled Workflows with MCP Triggers
Combine MCP-triggered workflows with n8n's scheduling:
n8n Cron (Daily at 9am)
→ Query Database for Errors
→ If errors > threshold
→ Send Alert via Slack
→ Create Summary Report
Security Best Practices
| Practice | Implementation |
|---|---|
| Use API keys | Set N8N_BASIC_AUTH_ACTIVE=true and use credentials |
| Limit SQL queries | Only allow SELECT statements in database tools |
| Validate inputs | Add validation nodes in n8n workflows |
| Use HTTPS | Put n8n behind a reverse proxy with TLS |
| Restrict network | Run n8n on an internal network, not publicly exposed |
| Audit logging | Enable n8n execution logging for all MCP-triggered workflows |
Troubleshooting
| Issue | Solution |
|---|---|
| "MCP server not found" | Verify the server is installed: which n8n-mcp-server |
| "Connection refused" | Check that n8n is running: docker ps |
| "Webhook not found" | Ensure the workflow is activated in n8n |
| "Authentication failed" | Verify API key in the MCP config matches n8n |
| Tool not appearing | Restart Claude Code / Cursor after config changes |
| Timeout errors | Increase timeout in n8n webhook node settings |
Conclusion
Setting up n8n as an MCP server transforms your AI coding assistant into a powerful automation hub. Instead of manually switching between tools, your AI agent can send Slack messages, query databases, create issues, and trigger complex workflows -- all from natural language commands.
If your n8n automation workflows involve AI media generation tasks like creating images, videos, or audio, Hypereal AI provides REST APIs that integrate perfectly with n8n's HTTP request nodes. Build end-to-end AI media pipelines that trigger from your MCP-connected AI assistant.
