mcp-n8n — Claude Code MCP server: features and setup
Connect an AI agent to n8n to build and check workflows, inspect executions, and manage an instance. Setup uses your n8n URL and API key.
claude mcp add --env N8N_BASE_URL=<N8N_BASE_URL> --env N8N_API_KEY=<N8N_API_KEY> --env N8N_TOOLSETS=<N8N_TOOLSETS> --transport stdio mcp-n8n -- npx -y mcp-n8nWhat mcp-n8n does
The server gives an agent tools to create and edit workflows, search a catalog of 560 nodes, and check workflow settings before saving. It can repair common issues, inspect data handled by an individual node, and call a webhook workflow to test its response.
Before changes, it saves local snapshots that can be compared with the current workflow or restored later. It also exports workflows as JSON and provides administration tools for users, projects, and permissions. Set N8N_BASE_URL and N8N_API_KEY to connect; without the API key, the server cannot access your n8n instance. It runs locally over stdio or in HTTP mode.
What it helps with
- build an n8n workflow from a description
- check node settings before saving a workflow
- trace the node that failed during execution
- restore a workflow from a snapshot
- export workflows as JSON
Example prompts for the agent
- Create an n8n workflow that accepts a webhook and processes its data.
- Check this workflow for errors and repair the issues you can safely fix.
- Show me which node failed in the most recent errored execution.
How to install mcp-n8n
Platform CLI
claude mcp add --env N8N_BASE_URL=<N8N_BASE_URL> --env N8N_API_KEY=<N8N_API_KEY> --env N8N_TOOLSETS=<N8N_TOOLSETS> --transport stdio mcp-n8n -- npx -y mcp-n8nReplace <…> with your own values
Platform CLI
codex mcp add mcp-n8n --env N8N_BASE_URL=<N8N_BASE_URL> --env N8N_API_KEY=<N8N_API_KEY> --env N8N_TOOLSETS=<N8N_TOOLSETS> -- npx -y mcp-n8nReplace <…> with your own values
Config file
{
"mcpServers": {
"mcp-n8n": {
"command": "npx",
"args": [
"-y",
"mcp-n8n"
],
"env": {
"N8N_BASE_URL": "<N8N_BASE_URL>",
"N8N_API_KEY": "<N8N_API_KEY>",
"N8N_TOOLSETS": "<N8N_TOOLSETS>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"mcp-n8n": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"mcp-n8n"
],
"env": {
"N8N_BASE_URL": "<N8N_BASE_URL>",
"N8N_API_KEY": "<N8N_API_KEY>",
"N8N_TOOLSETS": "<N8N_TOOLSETS>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e N8N_BASE_URL=<N8N_BASE_URL> -e N8N_API_KEY=<N8N_API_KEY> -e N8N_TOOLSETS=<N8N_TOOLSETS> mcp-n8n npx -y mcp-n8nReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about mcp-n8n
How do I install mcp-n8n in Claude Code?
Run claude mcp add mcp-n8n -e N8N_BASE_URL=<N8N_BASE_URL> -e N8N_API_KEY=<N8N_API_KEY> -- npx -y mcp-n8n. Provide your n8n instance URL and API key.
What does mcp-n8n do?
It connects an agent to n8n for workflow creation and management, node validation, and execution monitoring. It also supports snapshots, rollback, and workflow export.
How can mcp-n8n help debug a workflow?
It can show data handled by a particular node and identify the node and message from the latest error. A separate tool runs a webhook workflow and returns its HTTP response.