MCP in n8n: MCP Server Trigger and Client for Claude
How n8n uses the MCP Server Trigger and MCP Client to provide workflows as tools for Claude or to use external MCP servers.
How to set up Anthropic and OpenAI credentials in n8n, choose the right model for each task, and keep token costs under control.
Anyone working with Anthropic's (Claude) or OpenAI's AI nodes in n8n first sets up a credential with an API key, then selects a model in the respective chat model node, and controls how expensive and how capable a single workflow run becomes through node options such as the maximum number of tokens. Both providers offer several model tiers that differ in speed, price per million tokens, and capabilities, so cheaper models are suitable for simple tasks like classification or text snippets, while more capable models make sense for complex steps such as multi-step agentic behavior or deep reasoning. As of: July 2026.
For the Anthropic credential, you need an account in the Anthropic Console with access to Claude. There, under Settings > API Keys, you create a new key, give it a descriptive name such as "n8n-integration", and copy the value into the API Key field of the n8n credential. Optionally, a custom header can be added. n8n documents the exact steps in the Anthropic Credential Reference. This credential authenticates both the Anthropic node and the Anthropic Chat Model node.
For OpenAI, create a new secret key in the OpenAI account under API Keys and enter it as the API key in n8n as well. An organization ID is only needed if you belong to multiple organizations; if it is set, usage runs against that organization's quota instead of your personal account. n8n describes the details in the OpenAI Credential Reference. The OpenAI credential covers several nodes: the OpenAI node, Chat OpenAI, Embeddings OpenAI, and LM OpenAI.
With Claude Haiku 4.5, Claude Sonnet 5, Claude Opus 4.8, and Claude Fable 5, Anthropic offers several current model tiers, and OpenAI offers comparable tiers with GPT-5.6 Luna, GPT-5.6 Terra, and GPT-5.6 Sol. In both cases: fast, inexpensive models like Claude Haiku or GPT-5.6 Luna are suitable for high-volume, simple tasks in a workflow, such as classifying incoming emails, extracting fields from structured texts, or short summaries. Balanced models like Claude Sonnet 5 or GPT-5.6 Terra combine speed and contextual understanding and fit most automation steps that need somewhat more judgment. The most capable tiers, Claude Opus 4.8 and Fable 5 respectively, as well as GPT-5.6 Sol, are, according to the manufacturers, intended for complex, multi-step agentic behavior, extensive reasoning, or demanding coding tasks. Which tier fits in a given case depends on the respective workflow step, not on a general ranking of the models. In the Anthropic Chat Model node, you select the model directly; since model names change regularly with both providers, it is worth checking the provider's current model overview before going into production. The OpenAI Chat Model node loads the models dynamically from your account and shows only the options enabled for you.
The most important lever directly in the workflow is the Maximum Number of Tokens node option, which limits the length of the model's response and thus the output costs, since output tokens cost significantly more than input tokens with both providers. According to the current Anthropic pricing overview, the output price per model is five times the input price; for the current GPT-5.6 models, according to the OpenAI pricing page, it is roughly six times. For recurring workflows with unchanging system prompts, prompt caching is worthwhile: Anthropic offers reduced read prices for cached prompt portions, while OpenAI provides the Prompt Cache Key option for this in the Responses API mode of the OpenAI Chat Model node. For non-time-critical batch processing, both providers reduce costs via their own batch APIs by roughly half compared to standard prices.
Actual cost control does not take place in n8n itself, but in the providers' consoles: both the Anthropic Console and the OpenAI dashboard show usage per period and allow setting spending limits or alerts. This is important because a faulty workflow, such as a loop without a termination condition, can cause substantial costs in a short time without n8n itself warning about it. It therefore makes sense to set a token limit in every production workflow, to use the most expensive model only where the task genuinely requires it, and to regularly check usage in the respective provider console instead of relying solely on the bill at the end of the month.
Anyone combining multiple AI providers in a workflow, or unsure which model tier makes economic sense for which step, can roughly estimate the effort with an ROI Calculator or get support in the design of AI Agents. NordFlux typically implements such integrations at a fixed price, including documentation of the chosen model and cost logic.
Yes. Both providers use their own API keys and their own credential types in n8n. The Anthropic credential authenticates the Anthropic node and the Anthropic Chat Model node, while the OpenAI credential covers the OpenAI node, Chat OpenAI, Embeddings OpenAI, and LM OpenAI.
For classification, extraction, or short text snippets, the fastest and cheapest model tiers, such as Claude Haiku 4.5 or GPT-5.6 Luna, are usually sufficient. More complex steps involving multi-step reasoning benefit more from Sonnet 5, Opus 4.8, GPT-5.6 Terra, or Sol.
Set a token limit in the respective chat model node option, avoid unchecked loops, and regularly check usage in the provider's dashboard. Spending limits or alerts can be configured directly there, not in n8n itself.
Yes, n8n allows you to use multiple chat model nodes with different credentials in one workflow, for example an inexpensive model for preprocessing and a more capable model for the decisive step.
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 n8n uses the MCP Server Trigger and MCP Client to provide workflows as tools for Claude or to use external MCP servers.
If you lose the n8n encryption key, all stored credentials become unusable. Here is how to back up workflows, credentials, and keys correctly.
How to connect n8n to local AI models via the Ollama credential, including a Docker pitfall and tool-calling limits.
Setting up credentials is the easy part, the model choice per task and cost control through token limits determine what you actually pay at month's end. NordFlux advises you vendor-neutral on the right model strategy for your n8n workflows and sets up monitoring that prevents surprises.