n8n MCP Server
Provides direct access to the n8n automation platform, enabling AI assistants to manage workflows, variables, credentials, and execution history through comprehensive tools for creation, activation, and monitoring.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@n8n MCP Servershow me the last 5 workflow executions"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
n8n MCP Server
A comprehensive Model Context Protocol (MCP) server that provides AI assistants with direct access to your n8n automation platform. This server enables seamless integration between AI tools (like Claude Desktop) and n8n workflows, variables, credentials, and executions.
๐ Features
Complete n8n Integration (18 Tools)
Workflow Management (7 tools)
list_workflows- List all workflowsget_workflow- Get workflow details by IDcreate_workflow- Create new workflowsupdate_workflow- Update existing workflowsdelete_workflow- Delete workflowsactivate_workflow- Activate workflowsdeactivate_workflow- Deactivate workflows
Variable Management (5 tools)
list_variables- List all variablesget_variable- Get variable by keycreate_variable- Create new variablesupdate_variable- Update existing variablesdelete_variable- Delete variables
Credential Management (3 tools)
list_credentials- List all credentials (sanitized)create_credential- Create new credentialsdelete_credential- Delete credentials
Execution Management (2 tools)
list_executions- List workflow executionsget_execution- Get execution details by ID
System Management (1 tool)
self_test- Test server connectivity and permissions
Hybrid Architecture
MCP Protocol: Full JSON-RPC 2.0 compliance via stdio transport
HTTP Bridge: Health checks and testing endpoints
Auto-detection: Automatically switches between modes
Related MCP server: n8n MCP Server
๐ฆ Installation
Prerequisites
Node.js 18+
n8n instance running and accessible
n8n API key configured
Setup
Clone the repository
git clone <repository-url> cd n8n-mcpInstall dependencies
npm installConfigure environment
cp .env.example .env # Edit .env with your settings: # N8N_API_KEY=your-api-key-here # N8N_BASE_URL=http://localhost:5678 # MCP_PORT=3001Test the installation
# Test HTTP endpoints node index.js & curl http://localhost:3001/health # Test MCP protocol node test-all-tools.js
๐ง Usage
For MCP Clients (Claude Desktop, etc.)
The server runs as a stdio-based MCP server for AI clients:
node index.jsClaude Desktop Configuration (~/.claude_desktop_config.json):
{
"mcpServers": {
"n8n": {
"command": "node",
"args": ["index.js"],
"cwd": "/path/to/n8n-mcp",
"env": {
"N8N_API_KEY": "your-n8n-api-key-here",
"N8N_BASE_URL": "http://localhost:5678"
}
}
}
}For HTTP Monitoring
When run in a terminal (TTY), the server provides HTTP endpoints:
node index.js
# Server starts on http://localhost:3001
# Available endpoints:
# GET /health - Health check
# POST /test - Run self-test
# GET / - Usage instructionsDirect MCP Testing
Test the MCP protocol directly:
# Initialize connection
echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0.0"}}}' | node index.js
# List tools
echo '{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}' | node index.js
# Call a tool
echo '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"self_test","arguments":{}}}' | node index.js๐งช Testing
Comprehensive Test Suite
Run the complete test suite to validate all 18 tools:
node test-all-tools.jsThis will:
Test MCP protocol compliance
Validate all tool definitions
Check n8n API connectivity
Verify error handling
Provide detailed results
Manual Testing
# Health check
curl http://localhost:3001/health
# Quick self-test
curl -POST http://localhost:3001/test
# Individual tool test
echo '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"list_workflows","arguments":{"limit":5}}}' | node index.js๐ Security
API Key Management
Store API keys in environment variables
Use
.envfiles for local developmentNever commit API keys to version control
Credential Sanitization
Credential data is automatically sanitized in responses
Only metadata (ID, name, type) is exposed
Sensitive credential data is never returned
Network Security
HTTP server binds to localhost by default
CORS headers configured for cross-origin requests
No sensitive data exposed via HTTP endpoints
๐ Troubleshooting
Common Issues
1. "N8N_API_TOKEN not configured"
# Solution: Set your API key
export N8N_API_KEY=your-api-key-here
# Or add to .env file2. "Connection refused" errors
# Solution: Check n8n is running
curl http://localhost:5678/api/v1/workflows?limit=1 -H "X-N8N-API-KEY: your-key"3. "License does not allow for feat:variables"
# This is expected for n8n Community Edition
# Variables require n8n Pro/Enterprise license
# The tool will still work but return license errors4. "GET method not allowed" for credentials
# Some n8n configurations restrict credential access
# Check your n8n security settings5. Port already in use (EADDRINUSE)
# Solution: Kill existing process or change port
pkill -f "node index.js"
# Or set different port: MCP_PORT=3002 node index.jsDebug Mode
Enable verbose logging:
DEBUG=1 node index.jsValidate Configuration
# Test n8n connectivity
curl -H "X-N8N-API-KEY: your-key" http://localhost:5678/api/v1/workflows?limit=1
# Test MCP server
node test-all-tools.js๐ Monitoring
Health Checks
# Basic health
curl http://localhost:3001/health
# Detailed system test
curl -X POST http://localhost:3001/test | jq '.result.summary'Performance Monitoring
The server logs all tool executions and provides timing information:
Tool execution time
n8n API response time
Error rates and types
๐ค Contributing
Development Setup
Fork the repository
Create a feature branch
Make your changes
Run tests:
node test-all-tools.jsSubmit a pull request
Adding New Tools
Add tool definition in
setupToolHandlers()Implement the tool method
Add test case in
test-all-tools.jsUpdate documentation
๐ License
MIT License - see LICENSE file for details.
๐ Related Projects
n8n - Workflow automation platform
Model Context Protocol - Protocol specification
Claude Desktop - AI assistant with MCP support
๐ Support
Issues: Use GitHub Issues for bug reports
Discussions: Use GitHub Discussions for questions
Documentation: Check this README and inline code comments
Ready to automate with AI? ๐คโจ
Your n8n workflows are now accessible to AI assistants through the Model Context Protocol!
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityDmaintenanceEnables AI assistants to manage n8n automation workflows through natural language commands, including creating, executing, monitoring, and organizing workflows with full CRUD operations and execution management.Last updated782MIT
- AlicenseBqualityDmaintenanceEnables Large Language Models to interact with n8n automation instances through the Model Context Protocol. Supports workflow management, execution, credentials handling, and security audits through natural language commands.Last updated331163MIT
- AlicenseAqualityDmaintenanceConnects AI assistants to your n8n instance to manage workflows, executions, credentials, and user settings through 31 specialized tools. It enables users to perform n8n operations like workflow creation, activation, and execution history retrieval via natural language.Last updated2712MIT
- AlicenseBqualityFmaintenanceEnables users to manage workflows, monitor executions, and perform administrative tasks in n8n through natural language conversations with Claude. It provides over 40 tools to control self-hosted or cloud n8n instances via the Model Context Protocol.Last updated4286MIT
Related MCP Connectors
Free public MCP for AI agents โ 193 tools, 44 workflows. No API key.
Create, browse, remix, collaborate on, and run durable AI workflow nodes from MCP hosts.
Universal AI API Orchestrator โ 1,554 tools, 96 services. One install.
Appeared in Searches
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/sonnd08/n8n-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server