Can you build n8n workflows with Claude Code?

Quick Answer: Yes. As of 26 August 2026 n8n ships a built-in instance-level MCP server that Claude Code connects to over streamable HTTP, and n8n's documentation lists Claude Code by name among its supported CLI clients alongside Codex and Gemini CLI. Connect it with `claude mcp add --transport http n8n https://<your-n8n-domain>/mcp-server/http`, then run `/mcp` in Claude Code to complete the OAuth authorisation. Building and editing workflows, as opposed to only running them, requires n8n 2.13.0 or later, and only workflows that are published and contain a webhook, form, schedule or chat trigger can be exposed to MCP clients at all.

What Claude Code can do once connected

n8n's built-in MCP server exposes 46 documented tools plus one reference resource, counted from its tool reference on 26 August 2026, across six groups.

Group Representative tools What it enables
Workflow management search_workflows, get_workflow_details, publish_workflow, get_workflow_versions_diff Reading and releasing workflows
Workflow builder get_workflow_sdk_reference, validate_workflow, create_workflow_from_code, update_workflow Authoring workflows from code
Execution management get_workflow_execution, search_workflow_executions Debugging a failed run
Credential management list_credentials Seeing what a node can bind to
Agent management create_agent, validate_agent, publish_agent Working on n8n agents
Data tables Data table tools Reading and writing n8n Data Tables

The important pair is validate_workflow followed by create_workflow_from_code. n8n documents the second as accepting "Full TypeScript/JavaScript workflow code using the n8n Workflow SDK" and states the code "must be validated first with validate_workflow". Both arrived in n8n 2.12.0. That is the mechanism by which Claude Code writes a workflow as source rather than assembling JSON by hand.

Connecting Claude Code

n8n documents two authentication routes. OAuth is the one it recommends.

  1. Enable the server. In n8n, open Settings > Instance-level MCP and select Enable MCP access. This needs instance owner or admin permissions.
  2. Add the server to Claude Code:
claude mcp add --transport http n8n https://<your-n8n-domain>/mcp-server/http
  1. Run /mcp in Claude Code, select n8n, and approve the OAuth request when n8n redirects you.

The API-key route replaces step 3 with a bearer header:

claude mcp add --transport http n8n-mcp https://<your-n8n-domain>/mcp-server/http \
  --header "Authorization: Bearer <YOUR_N8N_MCP_TOKEN>"

n8n shows the token once. After you leave the tab it displays a redacted value, and recovering it means rotating it, which revokes the previous token and requires updating every connected client.

The eligibility rule that blocks most first attempts

Enabling MCP on the instance does not expose anything. Each workflow is enabled individually, and n8n restricts which ones qualify: only workflows that are published and that contain a webhook, form, schedule or chat trigger node can be enabled for MCP access.

A workflow still in draft, or one whose only entry point is a manual trigger, will not appear. One tool is exempt from the per-workflow gate: search_workflows can see every workflow the current user has permission to view, but returns previews rather than full workflow data.

Limits worth knowing before you grant access

  • Access is not scoped per client. n8n's documentation states instance-level MCP "is not scoped to each MCP client". Every client connected, whether Claude Code, Claude Desktop or ChatGPT, sees every workflow enabled for MCP. Visibility still respects user permissions, but it does not respect client identity.
  • Credential references are stripped from workflow data returned to MCP clients, so a workflow Claude Code creates is structurally complete and not yet runnable until credentials bind. create_workflow_from_code returns an autoAssignedCredentials array listing what it managed to attach automatically.
  • execute_workflow defaults to the published version. It takes an executionMode of production or manual; manual runs the current unpublished version, which is what you usually want while iterating.
  • Text gets truncated silently. Workflow names are capped at 128 characters and descriptions longer than 255 characters are shortened before saving.
  • Bearer-token clients are invisible to the audit view. n8n's Connected clients list shows OAuth clients with their access level and connection time; clients authenticating with an API key do not appear there, because they use a bearer token rather than an OAuth connection.
  • Self-hosted operators have a kill switch. Setting N8N_DISABLED_MODULES=mcp removes the MCP endpoints and hides the related UI.

The alternative if MCP is not available

n8n's public REST API creates and updates workflows directly, authenticated with an X-N8N-API-KEY header, and the n8n CLI imports and exports workflows for scripts and CI pipelines. Claude Code can drive either with ordinary shell commands, which is often the better fit for bulk work across many workflows. One constraint applies: n8n states the API "isn't available during the free trial".

For moving whole sets of workflows between instances, n8n packages bundle workflows and the structure they depend on into a portable .n8np file, available from n8n 2.27.0 through the API or CLI only. n8n labels the format a Preview feature, and credential secrets do not travel inside a package; only the credential ID, name and type do.

Versions to check first

Capability Available from
get_workflow_sdk_reference, validate_workflow, create_workflow_from_code n8n 2.12.0
Building or editing workflows over MCP n8n 2.13.0
Workflows exposed settings page n8n 2.2.0
Per-client connection dialog with Claude Code setup steps n8n 2.33.0

An instance below 2.13.0 will connect and run workflows while refusing to build them, which reads like a permissions problem and is a version problem.

Editor's Note: The step that costs teams an afternoon is not the connection, it is the eligibility rule. Working through n8n's own documentation on 26 August 2026, the requirement that a workflow be published and carry a webhook, form, schedule or chat trigger before it can be exposed means a drafts-heavy instance shows an agent almost nothing, and the symptom looks identical to a broken token. We now check the trigger type before debugging auth. The caveat: we run this against single-tenant instances we administer, and because n8n does not scope MCP access per client, a shared instance needs a policy decision about which workflows any connected assistant may see before the first client is added. — Rafal Fila, ShadowGen

Related Questions

Written & reviewed by Rafal Fila · Last updated:

Related Tools

Related Rankings

Dive Deeper