How do I connect n8n to Claude with MCP?

n8n can run your workflows when Claude asks, and Claude can build n8n workflows while you describe them. Both run on MCP, and both take a few minutes to set up. Here is each route, step by step.

The short answer

There are two ways to connect n8n to Claude with MCP. The first is n8n's built-in MCP server: turn on Instance-level MCP in n8n settings, mark the workflows you want available, add the server URL to Claude Code, Claude Desktop or claude.ai, and approve access. The second is the open-source n8n-mcp server, which you add to Claude Code with one command and your n8n API key, so Claude can read node documentation and build, fix and run workflows in your instance.

Key takeaways

  • MCP is an open standard that lets an AI app call tools in other software. n8n speaks it two ways: a built-in server and a community server.
  • n8n's built-in server lets Claude find and run the workflows you expose. Nothing is exposed until you turn each one on.
  • The community n8n-mcp server gives Claude the documentation for every node and, with an API key, the power to create and edit workflows.
  • Use the built-in server to run what you have, n8n-mcp to build what you need, and OAuth over pasted keys wherever you can.

Questions before you start.

Short answers to what people ask before the first command. Anything else, ask below: the answer comes from this guide and the official docs.

What do I need in place before I start?

An n8n instance where you are the owner or an admin, on a recent release, because Instance-level MCP only exists in newer versions. On the Claude side you need Claude Code in a terminal, the Claude Desktop app or a claude.ai account. The n8n-mcp route also needs Node.js on your computer and an n8n API key.

Do I need Node.js and npx for both routes?

No. The built-in server needs nothing on your computer beyond Claude itself. Only n8n-mcp does, because it starts with npx, which comes with Node.js. Run node --version in a terminal; if it prints a version, you are ready, and if it says command not found, install Node.js before the steps in the n8n-mcp setup.

Where do I find the n8n API key?

In n8n, open Settings, then n8n API, then Create an API key. Copy it somewhere private before you close the dialog, along with your instance URL. You only need it for n8n-mcp; the built-in server signs in with OAuth, so no key gets pasted anywhere.

Which route should I set up first?

The built-in server, if your workflows already exist and you want Claude to run them. It takes a few minutes and works from claude.ai as well as Claude Code. Set up n8n-mcp first if you mainly want Claude to build workflows with you. The trade-off is laid out in which route to pick.

How to connect n8n to Claude with MCP, in about a minute A video with no sound. Every word is on screen.
Read the video transcript
  1. SMGP explains. How to connect n8n to Claude with MCP. Two routes, in about a minute.
  2. MCP is an open standard.
  3. It lets an AI app call tools in other software.
  4. Two routes, two jobs.
  5. Route A: n8n's built-in MCP server runs your workflows.
  6. Route B: the community n8n-mcp server builds them.
  7. Turn on the built-in server.
  8. Settings, then Instance-level MCP. Enable MCP access.
  9. Copy the Server URL. It ends in /mcp-server/http.
  10. Mark each workflow Available in MCP.
  11. Add it to Claude Code, Claude Desktop or claude.ai. Approve access.
  12. One command adds n8n-mcp to Claude Code.
  13. With your n8n URL and API key, Claude can create, edit and test workflows.
  14. Then ask in plain English.
  15. Run the weekly report and tell me what changed.
  16. Which workflows failed overnight, and why?
  17. Build a lead intake workflow from this description.
  18. Expose only the workflows you mean to.
  19. Prefer OAuth. Keep keys out of shared files.
  20. This is AI engineering in one afternoon.
  21. The workflows hold the steps. Claude supplies the judgment.
  22. SMGP. Embedded GTM engineering and embedded AI engineering. smgp.co

What is MCP, and why connect n8n to Claude?

MCP stands for Model Context Protocol. It is an open standard that lets an AI app call tools in other software, the way a USB port lets any device plug into any computer. The software runs a small server that lists what it can do, and the AI app calls those tools when a conversation needs them.

n8n is the workflow automation platform we run our own company on. Connect it to Claude through MCP and Claude stops being a chat window and starts being an operator. It can run the report workflow, read what failed overnight, or build a new workflow while you describe it in plain English.

This guide covers Claude Code (the terminal version), Claude Desktop and claude.ai. The steps are short. Most of the time goes into deciding which workflows to expose.

What are the two ways to connect n8n to Claude?

There are two routes, and they do different jobs.

Route A is n8n’s built-in MCP server. It is part of n8n itself. Once you turn it on, a connected client can search your workflows and run the ones you have marked as available, and recent n8n versions let it build and edit workflows and data tables too. You sign in with OAuth, so no key gets pasted anywhere.

Route B is the community n8n-mcp server, an open-source project on GitHub under the MIT license. It runs on your computer and gives Claude Code the documentation for every n8n node, plus tools that validate a workflow before it goes live. Add your n8n API key and it can also create, update, run and inspect workflows through n8n’s REST API.

Use Route A when you want Claude to run what you already have. Use Route B when you want Claude to build and fix workflows with you. We run Route B inside Claude Code every day, against our own self-hosted n8n.

How do you turn on n8n’s built-in MCP server?

  1. Open n8n as an instance owner or admin and go to Settings, then Instance-level MCP. Select Enable MCP access.
  2. Under Connection details, select Connect. The Connect a client dialog shows your Server URL, which ends in /mcp-server/http, and a Your client dropdown with steps for CLI clients (Claude Code, Codex, Gemini CLI), web clients (Claude.ai, ChatGPT) and IDEs (Cursor, VS Code, Windsurf). Copy the URL.
  3. Choose how clients sign in. OAuth is the recommended method: when Claude connects, n8n asks you to approve it. The API key tab generates a personal access token instead. It is shown once, and rotating it revokes the old one.
  4. Expose the workflows you want Claude to use. Open a workflow, select the Workflow menu (the three dots), choose Settings and turn on Available in MCP. You can also do this from the workflows list, or for a whole project or folder.

Nothing is exposed until step four. Claude can search for workflows by name, but it can only run the ones you have marked.

How do you connect the built-in server to Claude Code, Claude Desktop and claude.ai?

Claude Code. One command adds the server, then you authorize it in the browser.

claude mcp add --transport http n8n https://<your-n8n-domain>/mcp-server/http

Replace the domain with yours. Use http:// if your instance serves plain HTTP, such as http://localhost:5678 on your own machine. Start Claude Code, run /mcp, select n8n and approve access when n8n opens in your browser. Then check the connection:

claude mcp list
claude mcp get n8n

If you chose the API key method instead, the server takes a bearer token in a header. This is the shape of the entry:

{
  "mcpServers": {
    "n8n-mcp": {
      "type": "http",
      "url": "https://<your-n8n-domain>/mcp-server/http",
      "headers": {
        "Authorization": "Bearer <YOUR_N8N_MCP_TOKEN>"
      }
    }
  }
}

Put that in .mcp.json only in a project nobody else can see. For a shared repository, add it with claude mcp add-json and --scope user instead, so the token stays in your own settings and never lands in version control.

Claude Desktop and claude.ai. Go to Customize, then Connectors. Select + Add, then Add custom connector. Name it n8n MCP, paste the Server URL, select Continue and approve access when n8n asks. In a chat, use the + button and open Connectors to switch it on. Custom connectors are available on the Free plan (one connector), Pro, Max, Team and Enterprise. On a Team plan only an Owner can add one.

One limit on this route: Anthropic’s cloud makes the connection, so your n8n instance has to be reachable from the internet. An n8n that runs only on your laptop will not work here, though it works fine with Claude Code.

How do you set up the community n8n-mcp server in Claude Code?

Route B needs Node.js on your computer, because the server starts with npx. You also need two things from n8n: your instance URL and an API key, which you create under Settings, then n8n API, then Create an API key.

Then one command in your terminal:

claude mcp add n8n-mcp \
  -e MCP_MODE=stdio \
  -e LOG_LEVEL=error \
  -e DISABLE_CONSOLE_OUTPUT=true \
  -e N8N_API_URL=https://your-n8n-instance.com \
  -e N8N_API_KEY=your-api-key \
  -- npx n8n-mcp

On native Windows, PowerShell needs each setting in quotes and uses the backtick to continue a line:

claude mcp add n8n-mcp `
  '-e MCP_MODE=stdio' `
  '-e LOG_LEVEL=error' `
  '-e DISABLE_CONSOLE_OUTPUT=true' `
  '-e N8N_API_URL=https://your-n8n-instance.com' `
  '-e N8N_API_KEY=your-api-key' `
  -- npx n8n-mcp

What the settings do: MCP_MODE=stdio makes the server talk to Claude Code over its standard input and output, and the two logging settings keep its own messages out of your conversation. The URL and key are optional. Leave them out and you get documentation-only mode, where Claude can search nodes, read their properties and validate a workflow, but cannot touch your instance. For an n8n on your own machine, the URL is http://localhost:5678.

Start Claude Code and run /mcp to see the server and its tools. The core tools are tools_documentation, search_nodes, get_node, validate_node, validate_workflow, search_templates and get_template. With the API key you also get management tools such as n8n_create_workflow, n8n_get_workflow, n8n_update_partial_workflow, n8n_delete_workflow, n8n_test_workflow, n8n_executions and n8n_manage_credentials.

If you would rather not run anything on your computer, the project offers a hosted version at dashboard.n8n-mcp.com with a free tier of 100 tool calls a day. The full setup guide lives in the n8n-mcp repository.

Which route should you pick?

Pick the built-in server when the workflows already exist and you want to run them from a conversation. It is the official feature, it signs in with OAuth, and it works from claude.ai and the Claude Desktop app, not only from a terminal.

Pick n8n-mcp when the job is building. It knows what every node expects, it validates before it saves, and with the API key it creates and edits workflows in your instance while you watch. It lives in Claude Code, so it suits the person who builds the automations rather than the person who only runs them.

Run both if you build and run. They do not conflict, and together they cover the whole loop: describe a workflow, build it, test it, run it, read the result.

If your team works in Codex and the apps it needs already live in Zapier, the guide to connecting Zapier to Codex with MCP covers that setup instead.

What can you do once it is connected?

Run a workflow from a sentence. Ask “Run the weekly client report now and tell me what changed.” Claude calls the workflow through the built-in server and reads the output back to you.

Find out what failed overnight. Ask “Which of my workflows failed in the last day and why?” With the executions tool in n8n-mcp, Claude reads the execution log and points at the node that broke.

Build a lead-intake workflow from a description. Describe the form, the lookup you want on each lead and where the record should land. Claude drafts the workflow with validated nodes and creates it in your instance for you to review.

Add error handling everywhere. Ask Claude to find every workflow with no error handling and add it. One request fixes a backlog that nobody was going to clear by hand.

Turn a Slack message into a CRM update. Expose your CRM update workflow to MCP, then paste the message and ask Claude to log it. The workflow does the writing, so the record looks the same every time.

Replace a failing node. Claude reads the node documentation through search_nodes and get_node, drafts the replacement and validates it before anything touches the live workflow.

Audit the credentials in use. Ask which credentials each workflow uses, through n8n_manage_credentials, to find the old key that is still in play before it expires.

How do you keep it safe?

Expose only what you mean to. Every workflow marked Available in MCP can be run by any connected client, because access is not scoped per client. Treat that list the way you treat admin access.

Prefer OAuth over a pasted token. With OAuth you approve each client in n8n and can see it in the connected clients list. Clients that use an API key do not appear there.

Keep keys out of shared files. In Claude Code, the default scope stores a server in your own settings; do not add n8n-mcp with --scope project to a repository other people pull. If a token leaks, rotate it in n8n, which revokes the old one.

Know the emergency switch. Turning off Instance-level MCP disconnects every client at once. On a self-hosted instance, N8N_DISABLED_MODULES=mcp removes the feature entirely, and a reverse proxy in front of n8n has to pass the MCP-Protocol-Version, Mcp-Method and Mcp-Name headers or the connection fails.

Remember what runs. A workflow run through MCP uses the published version by default, so test changes in n8n before you publish them.

Where does this fit in an AI-run company?

AI engineering is the work of building the software a company runs on, and n8n connected to Claude is one of its most useful building blocks. The workflows hold the steps. Claude supplies the judgment, the plain-English interface and the ability to write new workflows when the business changes. That is how a small team gets the operations of a much larger one without hiring for it. Our embedded AI engineering service puts a person inside your company to build exactly this kind of system.

We run our own company this way, with 455 automations built, 194 running today, most of them in n8n and many of them built from inside Claude Code through the server in this guide. The systems are on the how we run on AI page, with dates. If you want to see what one of them would look like inside your company, the next step is a conversation.

Lucas Mack

Written by Lucas Mack

Lucas is the founder and CEO of SMGP. He has done every job in the company, runs the strategy and the sales, and built every system SMGP runs on, from the outbound engine to the finance software. He writes about what he builds and what he has learned building it.

Share this post on LinkedIn (opens in a new tab)

Questions people ask

Do I need to know how to code to connect n8n to Claude?

No. The built-in route is a settings page in n8n and either one command or one dialog on the Claude side. The n8n-mcp route is one command in a terminal. If you can paste a command and follow a sign-in screen, you can do both.

Can Claude see all of my n8n workflows?

No. Claude can search workflows by name, but it can only run the ones you have marked Available in MCP, one at a time or by project or folder. Nothing is exposed until you turn it on, and switching MCP off in settings disconnects every client at once.

What is the difference between the built-in server and n8n-mcp?

The built-in server is part of n8n and is built to run the workflows you already have, with OAuth sign-in. n8n-mcp is an open-source server that runs on your computer, knows the documentation for every n8n node, and with an API key can create, edit, test and inspect workflows through the n8n API. The first runs, the second builds.

Does this work with n8n Cloud and with a self-hosted n8n?

Both. The built-in MCP server is a feature of recent n8n releases, so on a self-hosted instance update first; if Instance-level MCP is missing from Settings, the version is too old. n8n-mcp works against any instance that gives you an API key, including one on your own laptop.

Can I connect an n8n that only runs on my laptop?

With Claude Code, yes, because Claude Code runs on the same machine and can reach a local address. With Claude Desktop or claude.ai, no: Anthropic's cloud makes the connection, so the n8n instance has to be reachable from the internet.

Talk it through with Lucas

Thirty minutes on your business: where a GTM engineer or an AI engineer would make the biggest difference, and what to build first. You leave with a plan either way.

Book a strategy call Contact our team