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.
- Enable the server. In n8n, open Settings > Instance-level MCP and select Enable MCP access. This needs instance owner or admin permissions.
- Add the server to Claude Code:
claude mcp add --transport http n8n https://<your-n8n-domain>/mcp-server/http
- Run
/mcpin 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_codereturns anautoAssignedCredentialsarray listing what it managed to attach automatically. execute_workflowdefaults to the published version. It takes anexecutionModeofproductionormanual;manualruns 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=mcpremoves 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
- How much does it cost to give an AI agent access to your automation platform?
- How much do AI coding assistants cost in 2026?
- Claude Code vs Codex vs Cursor for autonomous coding in 2026: which fits best?
- Lovable vs v0: which AI app builder fits your stack in 2026?
- Lovable vs Bolt.new: which AI app builder is better in 2026?
Related Tools
Claude Code
Anthropic's agentic CLI tool for AI-assisted coding and automation development
AI Coding & Development Toolsn8n
Workflow automation for technical teams
Workflow AutomationCursor
AI-powered code editor built on VS Code with native AI pair programming
AI Coding & Development ToolsChatGPT Codex
OpenAI's cloud-based autonomous coding agent integrated into ChatGPT
AI Coding & Development ToolsRelated Rankings
Best AI App Builders in 2026
AI app builders are a 2024-2026 category of products that turn natural-language prompts into deployable web applications. The category emerged from the convergence of frontier LLM capability (Claude, GPT-4o, Gemini) and improved tooling for code generation, in-browser runtimes (WebContainers), and managed application hosting. This ranking evaluates 7 platforms on output quality, deployment options, pricing, stack flexibility, and the underlying AI model quality. The ranked products span dedicated AI app builders (Lovable, Bolt.new, v0, Magic Loops), in-browser agentic IDEs (Cursor, Replit Agent), and autonomous coding agents (Devin). Scores reflect hands-on evaluation of each platform's ability to generate, run, and deploy a real web application from a prompt as of May 2026.
Best AI Coding Tools and Developer Assistants 2026
AI coding tools have become essential for professional developers in 2026, with the category spanning full AI-native editors, IDE plugins, terminal-based assistants, and code generation platforms. This ranking evaluates the leading AI coding tools based on code suggestion quality, IDE integration depth, programming language support, pricing value, and AI model quality. The evaluation focuses on tools that directly assist developers in writing, refactoring, and understanding code. General-purpose AI chatbots that can discuss code but do not integrate into development environments are excluded.
Dive Deeper
Which Automation Platforms Can an AI Coding Agent Actually Edit?
This guide compares the canonical workflow representation of ten business process automation platforms and asks a single practical question of each: can an AI coding agent read that representation, change it, and put it back? It covers what each platform exports, what the export silently drops, which route requires a paid or enterprise tier, and where the round trip breaks. Verified against vendor documentation on 26 August 2026.
AI Coding Agents and Automation Platforms: Three Integration Models
This guide classifies the ways an AI coding agent can connect to a business process automation platform into three integration models: reference servers that teach an agent a platform's schema, control-plane servers that let it read and edit workflows on a live instance, and action-proxy servers that expose the platform's app catalogue as callable tools. It compares what eight platforms shipped as of 26 August 2026, with the documented endpoint, the authentication method, and the billing unit each model consumes.
Claude Code vs ChatGPT Codex vs Cursor 2026: Three-Way Comparison
Claude Code (terminal CLI), ChatGPT Codex (cloud sandbox), and Cursor (VS Code fork) take three different approaches to AI-assisted coding. This three-way comparison covers pricing, autonomy, form factor, context handling, and agentic capabilities as of May 2026 to help engineers pick the right tool for each task class.