n8n MCP Local Setup
Provides a local MCP server to interact with n8n workflows, allowing AI agents to execute n8n workflows and access n8n resources via the n8n API.
Click on "Deploy 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 Local Setuplist my n8n workflows"
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.
Install
You only need Node.js 18+.
npx -y github:pedrogrigs/n8n-mcp-local-setup installThe installer asks for three things:
Input | Example |
n8n URL |
|
n8n API key | Your n8n user API key |
Local MCP port |
|
When it finishes, your local MCP endpoint is ready at:
http://127.0.0.1:3007/mcpRestart Codex or Claude Code after install so they reload MCP configuration.
Related MCP server: automatelab-n8n-mcp
Why Use This
The hosted n8n MCP endpoint is convenient, but a local setup is better when you want control.
Hosted bridge | Local bridge with this repo |
API key leaves your machine | API key stays in your user folder |
Depends on a third-party endpoint | Runs on |
Manual client setup | Codex and Claude Code configured automatically |
Remote availability matters | Works while your computer is on |
What It Configures
The installer automatically:
Installs the npm package
n8n-mcpRuns the correct HTTP entrypoint for
n8n-mcpGenerates a strong local bearer token
Starts a local MCP server on
127.0.0.1Enables autostart on login
Configures Codex if installed
Configures Claude Code if installed
Replaces old configs pointing to
https://api.n8n-mcp.comVerifies
/healthVerifies MCP
tools/listwhen possible
Platform Support
System | Autostart method |
Windows | User Scheduled Task |
macOS | User LaunchAgent |
Linux | systemd user service |
Linux fallback | XDG autostart entry |
Common Commands
Check status:
npx -y github:pedrogrigs/n8n-mcp-local-setup statusRun diagnostics:
npx -y github:pedrogrigs/n8n-mcp-local-setup doctorRestart the local server:
npx -y github:pedrogrigs/n8n-mcp-local-setup restartPrint generic MCP client snippets:
npx -y github:pedrogrigs/n8n-mcp-local-setup snippetsNon-Interactive Install
Use this only in a secure shell session.
macOS/Linux:
N8N_API_KEY="your-api-key" npx -y github:pedrogrigs/n8n-mcp-local-setup install --yes --url https://your-n8n.example.com --port 3007Windows PowerShell:
$env:N8N_API_KEY="your-api-key"
npx -y github:pedrogrigs/n8n-mcp-local-setup install --yes --url https://your-n8n.example.com --port 3007Where Secrets Are Stored
The installer creates a local runtime folder:
System | Folder |
Windows |
|
macOS/Linux |
|
That folder contains config.json with your n8n API key and local MCP token.
Do not publish or share that file.
Codex
The installer updates ~/.codex/config.toml and creates a backup before editing.
After installing, restart Codex and run:
/mcpYou should see n8n-mcp pointing to:
http://127.0.0.1:3007/mcpClaude Code
If the claude command exists, the installer uses Claude Code's MCP CLI to add the local HTTP server at user scope.
After installing, restart Claude Code.
You can verify with:
claude mcp listAgent Prompt
If you prefer to let a local coding agent run the setup, send it this prompt:
prompts/AGENT_INSTALL_PROMPT.md
The prompt includes the important implementation detail learned from real setup: for HTTP mode, run node_modules/n8n-mcp/dist/mcp/index.js, not the npm n8n-mcp stdio wrapper.
Generic MCP Config
For clients that support HTTP:
{
"mcpServers": {
"n8n-mcp": {
"type": "http",
"url": "http://127.0.0.1:3007/mcp",
"headers": {
"Authorization": "Bearer <your-local-token>"
}
}
}
}For clients that only support stdio:
{
"mcpServers": {
"n8n-mcp": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"http://127.0.0.1:3007/mcp",
"--header",
"Authorization: Bearer <your-local-token>"
]
}
}
}Troubleshooting
Node.js is missing or too old:
Install Node.js LTS from https://nodejs.org, then run the installer again.Codex or Claude Code does not show the MCP:
npx -y github:pedrogrigs/n8n-mcp-local-setup doctorPort already in use:
npx -y github:pedrogrigs/n8n-mcp-local-setup install --port 3010Rotate the local bearer token:
npx -y github:pedrogrigs/n8n-mcp-local-setup install --rotate-tokenProject Status
This project is intentionally small: a focused installer and supervisor for local n8n-mcp.
Pull requests are welcome for:
More MCP clients
Better Linux desktop fallbacks
Improved diagnostics
Safer migration paths from existing configs
See CONTRIBUTING.md and SECURITY.md.
License
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
One MCP endpoint for Claude, GPT & Gemini: 100+ tools + no-code connectors + agent workers.
n8n MCP — query your own n8n instance (BYO).
- ZapierOAuthcom.zapier
Hosted MCP server connecting AI assistants to 9,000+ apps and 40,000+ actions via Zapier.
Zero-setup MCP gateway securely connecting AI to your tools with authentication and workflows
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables Claude Desktop to integrate with n8n workflow automation platform through a centralized MCP server. Provides seamless connection to n8n instances for workflow management and automation tasks.61 npmMIT
- AlicenseAqualityCmaintenanceAn MCP server for n8n that gives Claude, Cursor, and other AI agents tools for generating workflows, linting, diagnosing failed executions, and driving live n8n instances.12104 npm12MIT
- AlicenseAqualityDmaintenanceAn MCP server for n8n that gives AI agents tools for generating workflows, linting, diagnosing failed executions, and driving live n8n instances.12104 npmMIT
- FlicenseNot gradedqualityDmaintenanceA Model Context Protocol (MCP) server that generates production-ready n8n workflows from natural language prompts. Transform simple descriptions into fully validated, deployable automation workflows using AI-powered code generation.1-