TLDR: Enable n8n's built-in MCP server, publish the workflows you want exposed, drop a small .mcp.json into your project, and Claude Code can list, trigger, generate, and debug n8n workflows from chat. Tokens are per-user. Drafts stay invisible. The agent forgets the rules between sessions unless you give it a skill file.
The shift
Claude Code is a coding agent by default. With n8n's MCP server wired in, it is also an n8n operator. Same chat window, two jobs: write the code, run the workflow.
You stop copy-pasting JSON between an LLM and the n8n editor. You stop tabbing into the executions panel to read errors. You describe what you want, the agent picks the workflow, runs it, reads the result, and reports back.
Setup in four steps
The whole thing is about three minutes once you know where the toggles live.
1. Turn MCP on. Open Settings → n8n API as an owner or admin, flip the MCP Server switch, copy the token. The token is scoped to your user, not the workspace, so it does not go anywhere shared.
2. Publish the workflows you want exposed. Open each workflow, mark it available in MCP, and publish it. Drafts stay invisible. This is the single most common reason a fresh connection looks broken.
3. Configure Claude Code. Create .mcp.json at the project root (or ~/.claude/settings.json for global):
{
"mcpServers": {
"n8n": {
"type": "http",
"url": "https://YOUR-SUBDOMAIN.app.n8n.cloud/mcp",
"headers": {
"Authorization": "Bearer YOUR_MCP_ACCESS_TOKEN"
}
}
}
}
Self-hosted? Swap the URL for your domain. Local dev usually runs at http://localhost:5678/mcp. Add .mcp.json to .gitignore before the first commit.
4. Verify. Reload the agent and ask: List my available n8n workflows. You should get names and IDs back. If nothing comes back, jump to the troubleshooting section.
What changes day to day
Three patterns earn the setup back fast.
Trigger-by-name replaces the click-into-workflow-and-hit-Execute habit. You type:
Run the "Send Weekly Report" workflow with week 2026-W18
The agent resolves the name to an ID, fires the run with structured input, and reports the result. For workflows you run on a manual cadence (reports, ad refreshes, lead pulls), this collapses three or four clicks into one sentence.
Prose-to-workflow generation lets you describe what you want and watch the agent build it (n8n 1.88+):
Create an n8n workflow that receives a webhook, looks up the email in HubSpot,
and posts a Slack message with the contact's name.
You get back a workflow ID and a direct link. The output is usually a structurally correct draft you finish by hand. Faster than starting blank, slower than copying an existing pattern.
Execution debugging is the one that actually changes the day. When a scheduled run fails:
Pull the last execution log for the Lead Enrichment workflow.
You get the failed node, the error, and enough context to fix it without leaving chat. The round trip from "Slack notified me a run failed" to "fix deployed" drops from minutes to seconds.
Why a skill file matters
Claude Code does not know n8n's MCP quirks out of the box. It rediscovers them every session: that workflows must be published, that tokens are per-user, that the safe call pattern is list → resolve ID → trigger, that some node types behave differently when invoked through MCP versus through the UI.
Pinning that knowledge once saves the rediscovery cost forever. A short skill file in .claude/skills/ handles it:
git clone https://github.com/arturl95/n8n-agent-skills .claude/skills/n8n
Claude loads it at session start. The same repo also has a workflow-level skill for the per-workflow MCP Server Trigger node, which is the right tool when you want to expose a single automation as a typed agent tool rather than the whole instance.
Tokens, teams, and the shared-account workaround
Each MCP token belongs to one user. No service-account or workspace-level token exists yet. For a team that means three rules: each developer generates their own token, project-level .mcp.json stays out of git, and what gets shared is workflow definitions, never credentials.
If you genuinely need a shared identity (a CI pipeline, a single agent serving multiple humans), the only working pattern today is a dedicated n8n user whose token gets injected as an environment variable. Not elegant. Fine until n8n ships team-scoped tokens.
Troubleshooting
The failure modes are short and predictable. In order of frequency:
A workflow is still in draft. Publish it. This accounts for most "Claude can't see my workflow" reports.
The token belongs to a viewer-role user. Regenerate from an account with at least admin role.
A reverse proxy is stripping the Authorization header or buffering SSE. Nginx and Cloudflare are the usual suspects. Check the proxy config for header pass-through and disable response buffering on the MCP path.
.mcp.json is malformed. JSON syntax errors fail silently in some Claude Code versions. Validate the file before assuming the server side is broken.
FAQ
Does this work with self-hosted n8n?
Yes. Replace the URL in .mcp.json with your instance address. Local development usually uses http://localhost:5678/mcp.
What n8n version do I need? A recent build for the MCP server itself. Prose-to-workflow generation specifically needs n8n 1.88 or newer.
Can I expose only one workflow instead of the whole instance? Yes. Use the per-workflow MCP Server Trigger node and the workflow-level skill in the same repo. The agent sees one typed tool instead of the full list.
Do I need to restart Claude Code after editing .mcp.json?
Yes. Reload the agent window for changes to take effect.
Is there a rate limit on MCP calls? n8n applies the same execution limits to MCP-triggered runs as it does to any other trigger. Heavy agent loops can saturate a small instance fast, so watch the execution queue.
Can I version-control the connection without leaking the token?
Commit a .mcp.example.json with a placeholder, gitignore the real .mcp.json, and load the actual token from an environment variable or local override file.
Building agent-driven automation into a real product? We ship custom n8n and Claude-powered workflows for marketing and recruiting teams across the Nordics and Western Europe.