Urgent.News

What's breaking now, across hundreds of outlets.

Tech

How to connect Claude Code to self-hosted n8n over MCP

n8n ships with a built-in MCP (Model Context Protocol) server. Once it is on, Claude Code can see your self-hosted instance: it lists workflows, runs the ones you expose, reads the result of each execution and builds new workflows from a plain-text request. In this tutorial you enable the server, connect Claude Code with OAuth or a token, expose a workflow and learn how to cut access when you…

The n8n platform includes a built-in Model Context Protocol (MCP) server. When activated, Claude Code can interact with a self-hosted n8n instance, allowing it to view workflows, execute exposed ones, and generate new workflows from plain-text requests.

To establish this connection, first enable MCP on the n8n instance. Within n8n's Settings, navigate to the Instance-level MCP section and toggle the Enable MCP access option. This action provides the server address, typically your domain followed by /mcp-server/http, such as https://n8n.example.com/mcp-server/http.

Once the MCP server is active, connect Claude Code to the instance. Two options are available: OAuth, the recommended method, or an API key. For OAuth, run the command claude mcp add --transport http n8n https://n8n.example.com/mcp-server/http on your machine. Subsequently, open Claude Code, type /mcp, choose n8n, and finalize the authorization.

Alternatively, generate an access token under the API key tab and store it in an environment variable. Then, execute claude mcp add with the appropriate header for authorization.

After connecting Claude Code, configure it to access the desired workflows. Enable the Available in MCP option for each workflow, ensuring they are also published. Claude Code will recognize exposed workflows and display them in the search_workflows tool. However, inaccessible workflows will return a "Workflow is not available in MCP" message, prompting users to enable MCP access from the workflow card or settings. If a workflow name contains sensitive information, consider renaming it before connecting an agent.

Finally, utilize the workflows from Claude Code with plain text commands. For example, to run a "Order lookup" workflow with an order number, list the workflows, select the desired one, and provide the order number as input. Claude Code will execute the workflow and return the results.

Rewritten by urgent.news; may contain errors — check the original.

Source: dev.to

Read the original at dev.to →

Report a problem with this story

More in Tech

More from Tuesday, 1 December 2026 →