Connecting Claude/OpenAI: Credentials, Model Selection, Cost Control
How to set up Anthropic and OpenAI credentials in n8n, choose the right model for each task, and keep token costs under control.
How n8n uses the MCP Server Trigger and MCP Client to provide workflows as tools for Claude or to use external MCP servers.
n8n offers two nodes for the Model Context Protocol (MCP): the MCP Server Trigger, with which an n8n workflow itself becomes an MCP server and exposes its tools to Claude or other MCP-capable clients, and the MCP Client, with which an n8n workflow conversely uses tools from an external MCP server. Both nodes are based on the official n8n documentation on the LangChain integrations and are aimed at teams who want to make n8n automations controllable directly from an AI chat or agent, without building a dedicated interface for every application. As of: July 2026.
The Model Context Protocol is an open standard through which AI applications like Claude can access external tools, data and services, without an individual integration having to be programmed for every combination. An MCP server provides a list of tools, an MCP client, such as Claude Desktop or another MCP-capable client, queries this list and calls individual tools as needed. According to its own documentation, n8n can take on both roles: as a server that offers its own workflows as tools, and as a client that integrates tools from external MCP servers into a workflow. More about the protocol itself is explained in the official introduction to Model Context Protocol.
According to the n8n documentation, the MCP Server Trigger node, unlike classic triggers, does not react to individual events but instead permanently provides a URL through which MCP clients can list and call available tools. Workflows are connected to the trigger via the "Custom n8n Workflow Tool" node, which then appear as individual, nameable tools. n8n generates a test URL for the manual execution mode and, after publishing, a separate production URL, each under an automatically generated but changeable path. Bearer Auth and Header Auth are available for authentication, the same as known from the regular HTTP Request credentials in n8n.
For the connection to Claude Desktop, the documentation names a gateway that proxies SSE messages to a stdio-based server, for example via the command-line tool mcp-remote with the respective MCP URL and an Authorization header.
Conversely, the MCP Client node, according to the n8n documentation, integrates the tools of an external MCP server into a workflow. Server transport and the MCP endpoint URL of the target server are configured, the available tools are then automatically retrieved from the external server and available for selection. For authentication, the node supports Bearer token, single or multiple headers, as well as OAuth2, a connection without any authentication is also possible. In addition, it can be specified whether return values such as images or audio files are converted into binary data, and how long a tool call may take at most. Important for use with AI agents: the documentation explicitly points out that for agents the specialized MCP Client Tool node should be used, the regular MCP Client node is mainly suited for direct integration into fixed workflow steps.
A typical scenario: an n8n workflow with MCP Server Trigger provides two custom workflow tools, one for creating a CRM contact, one for retrieving open invoices. Claude Desktop is connected as an MCP client via the trigger's production URL and can call both tools as needed in the chat, for example when an employee asks which invoices of a customer are still open. In the other direction, the same n8n workflow can use an MCP Client Tool node to connect an AI agent in n8n to tools of an external MCP server, for example to query data from a specialized system without having to develop a dedicated node for it. Anyone planning such automations with connected AI agents will find background on the topic in the article on AI Agents. Since MCP is still a comparatively young protocol, it is worth taking a look at the current n8n documentation before productive use, as details on authentication and transport may continue to evolve.
The MCP Server Trigger turns an n8n workflow into an MCP server whose tools can be called from outside, for example by Claude. The MCP Client does the opposite: n8n calls tools of an external MCP server and uses them within its own workflow.
Yes. According to the n8n documentation, the production URL of the MCP Server Trigger can be entered into the configuration of Claude Desktop via a gateway such as mcp-remote, so that Claude can directly call the workflow tools provided there.
According to the documentation, the trigger supports Bearer Auth and Header Auth, based on the same credential types also used for regular HTTP Request nodes in n8n.
Yes. For integration into an AI agent in n8n, the documentation recommends the specialized MCP Client Tool node, not the regular MCP Client node, which is more intended for fixed workflow steps.
Founder of NordFlux. Spent four years automating processes at enterprise scale at Dräger, and now brings that depth to the mid-market — pragmatic and with full data sovereignty.
Certifications
How to set up Anthropic and OpenAI credentials in n8n, choose the right model for each task, and keep token costs under control.
n8n keeps binary data in RAM: 100 PDFs can crash the server. Here's how Filesystem or S3 mode helps prevent memory explosion.
How to install n8n with Docker Compose: Postgres instead of SQLite, .env, volumes and updates step by step.
Whether as an MCP Server Trigger that exposes workflows as tools, or as an MCP Client that calls external servers, the setup is technically demanding, and security questions around tool permissions get overlooked quickly. NordFlux plans and builds your MCP integration in n8n, from initial server configuration through to production agent use.