n8n MCP + Claude Code: Setup, Prompts, Guardrails

Create a key under Settings > n8n API, then run claude mcp add n8n-mcp with N8N_API_URL, N8N_API_KEY and MCP_MODE=stdio among its -e flags and npx -y n8n-mcp after the --. Confirm with claude mcp list. Or enable n8n's built-in server under Settings > Instance-level MCP and run claude mcp add --transport http n8n https://your-domain/mcp-server/http. Build on an unpublished copy.

I set up self-hosted n8n for clients, on Oracle Cloud's free tier and on Hostinger VPS servers, and I build with Claude Code every day (one recent client project, brand-locked listing documents, ships with a Claude Code handover). Put them together and you can describe a workflow in plain English while Claude looks up the nodes, builds it, checks it and runs it on your own instance.

The setup takes a few commands. The sharp edges are what the guides I read skip: four different things are called "n8n MCP", the project's own Claude Code doc gets scopes wrong, n8n-mcp now blocks localhost by default, its default test needs a live workflow, and its telemetry is on out of the box. One published guide even tells you to install @n8n/mcp-server, a package the npm registry returns a 404 for. Every command, version and limit below links to the official docs, the n8n blog or the project's GitHub as of 19 September 2026. Where the docs leave a gap, I say so.

Four things called "n8n MCP", and which ones build workflows

1. n8n-mcp, the community server. czlonkowski/n8n-mcp is an MIT-licensed MCP server built by Romuald Członkowski (AiAdvisors, Poland), not by n8n. It gives Claude documentation for n8n's nodes (the README currently lists 2,791), a validator, a template library and, once you add an API key, tools that create, edit, test and delete workflows on your instance. At the time of writing it is on v2.87.0 (16 September 2026), with over 22,000 GitHub stars. The project also offers a hosted version with a free tier of 100 tool calls a day. For client instances I'd run it locally with npx, so the n8n API key stays in your own Claude Code config.

2. n8n's built-in MCP server. Every n8n edition, Cloud and the free self-hosted Community Edition included, now ships its own instance-level MCP server. n8n's docs say building and editing workflows arrived in 2.13.0, and n8n announced it on 29 April 2026 as a public preview, recommending version 2.18.4 or later.

3. The MCP Server Trigger and MCP Client nodes. These build nothing. The MCP Server Trigger turns a single workflow into an MCP server so AI clients can call that workflow's tools. The MCP Client nodes go the other way and let a workflow call external MCP servers. If the protocol is new to you, start with what MCP is and how it works.

4. n8n's docs MCP servers. n8n also publishes two knowledge servers: a GitBook server that searches the docs, and a Kapa.ai server that also draws on the community forum and blog (it asks you to sign in). They answer questions and never touch your instance. The docs one is a single line: claude mcp add --transport http n8n-docs https://docs.n8n.io/~gitbook/mcp.

Only the first two build workflows, and both work in other MCP clients too (n8n-mcp's repo names Claude Desktop, Windsurf and Cursor). Running Claude Code from inside an n8n workflow is a different setup this post doesn't cover.

Which one should you use with Claude Code?

Feature n8n-mcp (community) n8n built-in server
Runs as A local npx process (or Docker) Part of your n8n instance, over HTTP
n8n version Uses the public REST API; some tools list their own minimum Builds and edits from 2.13.0; n8n recommends 2.18.4 or later
n8n Cloud Yes, but the API isn't available during the free trial Yes, in every edition
Auth n8n API key; without one you still get node docs and validation OAuth or an MCP access token, once an owner or admin enables it
Limiting Claude Remove tools or single operations with environment variables Permissions you grant each OAuth client when it connects
Credentials Can list, create, update and delete Can only list; auto-assigns existing ones
Publishing Through the same partial-update tool it edits with Separate publish_workflow, unpublish_workflow and archive_workflow tools
Test runs Default method fires the workflow over HTTP and needs it published Pins triggers, credentialed and HTTP Request nodes to simulated data
Extras Template search and deploy, autofix, instance audit Builds workflows as TypeScript, not raw JSON

My take: pick the built-in server on a current n8n version if you want nothing to install, no credential creation and simulated test data. It isn't read-only, though. It can publish, unpublish and archive workflows and run the published version, so it needs guardrails too. Pick n8n-mcp for node docs and validation without an API key, template deploy, or tool filtering set in its environment. You can connect both under different names.

Step 1: create an n8n API key

n8n-mcp's management tools talk to n8n's public REST API. That needs a key. From n8n's API docs:

  1. Log in to n8n and go to Settings > n8n API.
  2. Select Create an API key.
  3. Give it a label and set an expiration time.
  4. On an Enterprise plan, choose the scopes.
  5. Copy the key.

Three things to know before you paste it anywhere:

Step 2: add n8n-mcp to Claude Code

You need Claude Code installed (see how to install Claude Code and Claude Code pricing) and Node.js 20 or later, which the published n8n-mcp package requires. Claude Code's syntax for a stdio server, one that runs on your machine, is claude mcp add [options] <name> -- <command> [args...]. Everything after the -- goes to the server untouched.

Turn off telemetry before the first run

n8n-mcp's privacy policy says telemetry is on by default. It collects sanitized copies of workflows you create, update or validate, plus the short "intent" text sent with each edit, partly to build workflow-generation datasets and models. Keys, credentials, your instance URL and execution data are excluded, but the policy says its pattern-based sanitization can't guarantee it catches every piece of sensitive data (a second, stricter pass runs server-side). Leaving it on also grants the maintainer a perpetual licence to what you submit, including the right to sublicense anonymized datasets to third parties.

Turning it off doesn't delete anything already sent, so I'd do it before Claude Code ever starts the server. The setting lives in a .n8n-mcp folder in your home directory, not on the n8n instance:

npx -y n8n-mcp telemetry disable
npx -y n8n-mcp telemetry status

Add the server

This is the command I'd start from for an instance on a public HTTPS domain:

claude mcp add n8n-mcp --scope user \
  -e MCP_MODE=stdio \
  -e LOG_LEVEL=error \
  -e DISABLE_CONSOLE_OUTPUT=true \
  -e N8N_API_URL=https://n8n.yourdomain.com \
  -e N8N_API_KEY=your-api-key \
  -e N8N_MCP_TELEMETRY_DISABLED=true \
  -e DISABLED_TOOLS=n8n_delete_workflow,n8n_manage_credentials \
  -- npx -y n8n-mcp

The first five -e lines come from the project's Claude Code setup doc. The rest are mine. N8N_MCP_TELEMETRY_DISABLED is documented for Docker, but n8n-mcp's telemetry code reads it everywhere, so it's a second lock. DISABLED_TOOLS removes the permanent-delete and credential tools. Drop N8N_API_URL and N8N_API_KEY for a docs-and-validation-only setup.

Pick the right scope

n8n-mcp's setup doc describes the default local scope as if it were user scope. It isn't. Claude Code's MCP docs define three:

One instance? Use --scope user. Several client instances? Keep local scope, one server per client folder. Either way the key sits in ~/.claude.json, so treat that file like a secret. Never commit a raw key in .mcp.json; Claude Code expands ${N8N_API_KEY} from your environment there. Scope is fixed at add time: to change it, remove and re-add.

Check the connection

Run claude mcp list to see each server's health status, or /mcp inside a session and select the server to see its tools. The first start can be slow while npx downloads the package, and the default startup timeout is 30 seconds. If it times out, launch with MCP_TIMEOUT=60000 claude, or in PowerShell $env:MCP_TIMEOUT = "60000"; claude.

Before building anything, ask Claude to run n8n_health_check, which checks instance health and API connectivity.

If it won't connect

Or connect n8n's built-in MCP server to Claude Code

An owner or admin turns it on under Settings > Instance-level MCP > Enable MCP access. The shortest official route from there is n8n's skills plugin. In Claude Code, run /plugin marketplace add n8n-io/skills, then /plugin install n8n-skills@n8n-io, enter your instance URL when prompted, and run /reload-plugins. Then open /mcp, select n8n-mcp and choose Authenticate. You get the connection plus skills that teach Claude n8n's conventions for expressions, node configuration and error handling. The plugin lists n8n 2.2.0 as its minimum, but building workflows needs 2.13.0 or later.

To connect by hand instead, n8n's client examples give:

claude mcp add --transport http n8n https://n8n.yourdomain.com/mcp-server/http

Run /mcp, select n8n and finish the OAuth sign-in. There's also an API-key variant that sends an Authorization: Bearer header with an MCP token. n8n's launch post says Claude Code got better results than Claude chat in its internal tests, with the same prompt and models.

For n8n-mcp, the same author's n8n-skills plugin plays that role: 14 skills, installed with /plugin install czlonkowski/n8n-skills.

Watch the names. n8n's docs call the API-key connection n8n-mcp, the same name as the community package, and Claude Code matches servers you add by name, so two called n8n-mcp collide. Give each a distinct name. The skills plugin adds its own n8n-mcp connection too (Claude Code files it under a plugin: prefix), so if you end up with the built-in server twice, disable one in /mcp.

Know what it can reach. Per the setup docs and tools reference, visibility isn't per client: every connected client sees every workflow enabled for MCP, search_workflows lists previews of every workflow your user can access whatever its MCP setting, and workflows the server creates are enabled automatically. Actions are per client: an OAuth client gets the permissions you grant when it connects (n8n's example is reading workflows without creating or running them), reviewable under Connected clients from n8n 2.33. API-key clients don't appear there.

Step 3: build n8n workflows with Claude Code (plan, copy, validate, test)

Near the top of its README, n8n-mcp puts it bluntly: "NEVER edit your production workflows directly with AI!" The loop below is built around that.

Give Claude house rules first

The project suggests pasting the README's "Claude Project Setup" instructions into a CLAUDE.md in your project folder. Its staged validation and "Never Trust Defaults" sections are worth keeping. Other parts pull against a plan-first, copy-only loop: "Execute tools without commentary", "Templates First", and a deployment step that creates a workflow and then tests it. I'd start from something like this:

# n8n rules for this project
- Plan first. Show me the trigger, every node, the credentials each one needs
  and what happens on failure, then wait for my OK.
- Only work in the workflow ID I give you. Never create, delete or archive workflows.
- Never publish, unpublish, activate or deactivate a workflow. If a test needs
  the workflow published, stop and tell me.
- Never create or change credentials. Tell me which ones to add in the n8n UI.
- Look up each node with get_node before configuring it, and set every
  parameter explicitly.
- Validate each node, then the whole workflow, before saving. Ask before any test run.

These are instructions, not locks. The guardrails section below covers the locks.

The loop, step by step

1. Work on a copy. For an existing workflow, Download it as JSON in the n8n editor, create a new empty workflow, use Import from File there, and give it a DEV prefix. For a new build, create an empty DEV workflow. Leave it unpublished either way. n8n's export docs warn that the JSON includes credential names and IDs, and HTTP Request nodes imported from cURL may carry auth headers, so mind where the file goes. Give Claude the DEV workflow's ID and tell it to touch nothing else. That's an instruction, not a permission: the key still reaches every workflow on the instance.

2. Plan before anything gets built.

Plan only, don't build yet. I want an n8n workflow that runs when a form is
submitted, checks the email domain, adds qualified leads to a Google Sheet and
posts a summary to Slack. List the trigger, every node in order, the credential
each node needs, and what happens when a step fails. Flag any place where two
nodes could do the job, and say which you'd pick and why.

The last line is there because n8n's April launch post listed wrong node picks when options overlap, and small unmentioned design decisions, among its own builder's rough edges. For AI agent workflows, the patterns in how to build an AI agent in n8n still apply.

3. Build with explicit parameters.

Build it in workflow <DEV workflow ID> only. Look up each node with get_node
before configuring it, and set every parameter explicitly instead of relying on
defaults. Don't create credentials. Tell me which ones to add in the n8n UI.

The README calls default parameter values "the #1 source of runtime failures".

4. Validate in stages. The README's pattern is validate_node in minimal mode, then full mode, then validate_workflow, and n8n_validate_workflow once it's on your instance. n8n_autofix_workflow only previews its fixes by default. Read the preview before you let Claude apply them.

5. Test on safe data, and know what "test" means. By default, n8n-mcp's n8n_test_workflow fires the workflow over HTTP through its webhook, form or chat trigger, and its tool docs say that path needs the workflow active. They also tell the model to activate workflows before testing, which your house rules forbid, so expect Claude to stop and ask here. That's intended. Then pick one:

6. Review, then publish yourself. Compare before and after with n8n_get_workflow, or the local snapshots n8n-mcp takes before each change (n8n_workflow_versions). Those are a convenience, not a backup: n8n-mcp keeps the 10 most recent per workflow, and they miss edits made in the n8n UI. Then make the same change to the production workflow yourself and publish it in the UI.

One rule throughout: don't edit the workflow in the n8n UI while Claude is working on it. n8n-mcp's docs say every update writes the whole workflow back and n8n's public API has no conditional write, so UI changes made between Claude's read and its write get overwritten. If you do touch it, tell Claude to re-read. And iterate rather than restart, which is n8n's advice too.

Fixing a workflow that already fails

The same loop works for repairs. Give Claude the failed execution's ID and ask it to pull the details (n8n_executions with action: 'get', or get_workflow_execution on the built-in server), explain the cause in plain words, and propose a fix before touching anything. Apply it on the DEV copy, validate and test the same way, then carry it over yourself. Repairing failing workflows is the "Audits and fixes" part of my n8n consulting work.

Guardrails before you point it at a real instance

DISABLED_TOOLS=n8n_create_workflow,n8n_update_full_workflow,n8n_update_partial_workflow,n8n_delete_workflow,n8n_autofix_workflow,n8n_deploy_template,n8n_test_workflow,n8n_manage_credentials,n8n_manage_datatable

Copy its matching DISABLED_TOOL_OPERATIONS line too. It names every write operation of every tool that has one; without it, execution deletes, folder changes and version rollbacks stay available.

-e 'DISABLED_TOOL_OPERATIONS=n8n_executions:delete;n8n_workflow_versions:delete,rollback,prune;n8n_manage_folders:delete;n8n_manage_datatable:deleteTable,deleteRows,deleteColumn'
{
  "permissions": {
    "deny": [
      "mcp__n8n__publish_workflow",
      "mcp__n8n__unpublish_workflow",
      "mcp__n8n__archive_workflow"
    ]
  }
}

Limitations to expect

When to hire help instead

Claude Code with n8n-mcp is a good way to get a first draft onto the canvas and iterate on it. It doesn't replace knowing why a workflow should be built a certain way, or owning it when it breaks. Bring in help when:

See how I work as an n8n consultant, check how to hire an AI automation consultant for what to ask anyone, or book a 30-minute call and bring the workflow Claude drafted, so we can go through it before it goes live.

Sources

Checked on 19 September 2026 against n8n-mcp v2.87.0 and the n8n and Claude Code docs as published that day. Both projects change quickly, so re-check the linked docs before you rely on a specific flag.

Frequently asked questions

What is n8n-mcp, and is it made by n8n?

n8n-mcp (github.com/czlonkowski/n8n-mcp) is an MIT-licensed community MCP server by Romuald Członkowski, not an n8n product. It gives AI clients such as Claude Code n8n node documentation, a workflow validator and templates, plus tools that create, edit and test workflows once you add an n8n API key. It's free to run yourself with npx, and a hosted version has a free tier of 100 tool calls a day.

Should I use n8n-mcp or n8n's built-in MCP server with Claude Code?

Use n8n's built-in server (n8n recommends version 2.18.4 or later) if you want nothing to install; n8n's official skills plugin sets it up for you. It can't create credentials and its test tool pins triggers, credentialed and HTTP Request nodes, but it can publish and archive workflows. Pick n8n-mcp for node docs without an API key, template deploy or DISABLED_TOOLS filtering. It can also create credentials (v2.47.0+).

Do I need an n8n API key to use n8n-mcp?

Only for the management tools that create, edit, test or delete workflows on your instance. Without N8N_API_URL and N8N_API_KEY you still get the seven core tools for node documentation, validation and templates. Create the key under Settings > n8n API. The n8n API isn't available during the free trial, and non-Enterprise keys have full access to your account.

Does Claude Code work with n8n Cloud?

Yes. n8n's built-in MCP server ships in every edition, including Cloud: an owner or admin enables it under Settings > Instance-level MCP, and you connect Claude Code to your instance's /mcp-server/http address. n8n-mcp reaches Cloud through n8n's public API, which n8n's docs say isn't available during the free trial, so upgrade and create a key under Settings > n8n API first.

Why won't n8n-mcp connect to n8n on localhost:5678?

Since v2.50.2, n8n-mcp checks N8N_API_URL against an SSRF filter whose default strict mode blocks loopback addresses. Add WEBHOOK_SECURITY_MODE=moderate to the server's environment when N8N_API_URL points at localhost. A private IP or a Tailscale address needs permissive mode, which the project's security doc calls suitable only for a shared private Docker or Kubernetes network or a CGNAT overlay such as Tailscale.

Does n8n-mcp send my workflow data anywhere?

Its telemetry is on by default. Per its privacy policy, it collects sanitized copies of workflows you create, update or validate, plus the intent text sent with each edit, and leaving it on grants the maintainer a perpetual licence to that data. API keys, credentials, your instance URL and execution data are excluded. Run npx n8n-mcp telemetry disable before first use and npx n8n-mcp telemetry status to confirm.