CNAPS Studio exposes its entire platform as an MCP server. Point an n8n AI Agent at it and the agent can pick models, upload files, build flows, and run them — all from a single chat message, with no glue code.
This tutorial builds a working example end to end. When you finish, you'll be able to type this into an n8n chat window:
Upscale this image 4x: https://picsum.photos/id/237/320/240.jpgand get back a finished, upscaled image.
Time required: about 10 minutes.
What you'll build
Four nodes:
Node | Role |
When chat message received | Chat trigger — gives you a test chat window inside n8n |
AI Agent | Decides what to do and which tools to call |
Anthropic Chat Model (or OpenAI) | The reasoning model behind the agent |
MCP Client Tool | The connection to CNAPS.ai MCP Server |
Before you start
1. A CNAPS Studio API key. Create one at cnaps.ai under API Key.
2. An LLM API key for the agent's reasoning model — an Anthropic key for Claude, or an OpenAI key.
n8n's free trial AI credits only cover OpenAI (they appear as a separate n8n free OpenAI credits credential type). To use Claude, bring your own Anthropic key.3. n8n 1.104.0 or later. The MCP Client Tool node needs a Server Transport parameter, which arrived in that release. Open the node and look: if you only see a field named SSE Endpoint and no transport selector, your n8n is too old to connect — upgrade first. The CNAPS.ai MCP server speaks streamable HTTP only and has no SSE endpoint, so there is nothing for an SSE-only node to connect to.
We tested this tutorial on n8n Cloud 2.34.4.
Step 1 — Create the workflow and add a chat trigger
Create a new workflow, then click Add first step.
Search for chat.
Search forchat, notchat message. Searchingchat messagereturns only community nodes and you'll think the trigger is missing.
Pick Chat ("Runs the workflow when an n8n generated webchat is submitted"), then On new Chat event.
The node lands on the canvas labelled When chat message received, and a Chat panel opens at the bottom of the screen. That panel is how you'll test.
Step 2 — Add the AI Agent
Click the + on the right edge of the trigger, search AI Agent, and add the first result.
The agent node has three sub-connectors underneath it: Chat Model, Memory, and Tool. You'll use the first and the third.
Step 3 — Connect a chat model
Click the + under Chat Model.
Using Claude
Search Anthropic and add Anthropic Chat Model. The default model works well for this — leave it as is.
Click Set up credential and paste your Anthropic API key.
Set Allowed HTTP Request Domains to api.anthropic.com. It defaults to All, which lets any node using this credential send your key to any domain. Then save.
Using OpenAI
Click the + under Chat Model, choose OpenAI, and either use n8n's free trial credits or your own key.
Step 4 — Add the MCP Client Tool
Click the + under Tool, search MCP Client, and add MCP Client Tool.
Configure it exactly like this:
Endpoint: https://mcp.cnaps.ai/mcp
Server Transport: HTTP Streamable
Authentication: Header Auth
Tools to Include: SelectedTwo things people get wrong here:
- The field is just
Endpoint. There's only one URL field.Server Transportshould already readHTTP Streamable— confirm it does before moving on. - Use
Header Auth, notBearer Auth. The dropdown offers five options. CNAPS Studio API keys authenticate through a header. If you put your key in Bearer Auth you get401 invalid token, because Bearer is reserved for OAuth tokens.
Create the credential
Click Set up credential and fill in:
Field | Value |
Name | x-api-key |
Value | your CNAPS Studio API key ( cnaps_...) |
Allowed HTTP Request Domains | mcp.cnaps.ai |
Save. Again — narrow Allowed HTTP Request Domains from its All default. It costs one click and limits where this key can ever be sent.
Step 5 — Select your tools
Setting Tools to Include to Selected reveals a second Tools to Include dropdown. Click it.
If the tool list loads, you're connected. You'll see every CNAPS.ai tool in alphabetical order, from cancel_flow to upload_file. See the MCP Server guide for what each one does.
For this tutorial, check four:
suggest_flow— recommends which model(s) fit a requestupload_file— registers an image, video, or audio filecreate_flow— builds the flowget_flow— reads status and results
Clear the search box between selections. The filter text stays in the box after you pick a tool. If you type the next tool name without clearing it you end up searching for get_flowupload_file and get "No matching data" — which looks like a connection failure but isn't.Your node should now look like this:
Step 6 — Test it
Save the workflow. In the Chat panel at the bottom, send:
Upscale this image 4x: https://picsum.photos/id/237/320/240.jpgUse an image host that allows hotlinking. Some hosts — Wikimedia Commons among them — block non-browser user agents and returnHTTP 403, which surfaces as anupload_filefailure.
Watch the Logs panel. You should see the agent loop: a model call, then MCP tool calls, then more model calls. Ours made four tool calls and finished in about 40 seconds using roughly 17k tokens.
The reply includes a download URL and a link to open the generated flow in CNAPS Studio:
Input (320x240)
Output (1280x960)
What just happened
The agent wasn't following a script. Given one sentence, it worked out the whole sequence itself:
suggest_flow— asked CNAPS Studio which model suits "upscale 4x" and got back PiSA-SR, a super-resolution model
upload_file— registered the image URL with CNAPS Studiocreate_flow— built a three-node flow: Image Loader → PiSA-SR (ratio 4) → Image Viewerget_flow— polled until the run completed, then returned the output URL
Open the Studio link from the reply and you can see, edit, and re-run that flow like any other:
This is the point of the integration. You don't wire up a node per model. You describe the outcome, and the agent assembles the pipeline from the CNAPS Studio catalog.
One caveat before you point the agent at the whole catalog. External models — Gemini, GPT, Claude — run on your own provider key, not on CNAPS Studio's compute. Add the key in CNAPS Studio under your avatar → Workspace Settings → Integrations before asking for a flow that uses one, or the run is rejected before it starts.
Keep Tools to Include on Selected
An AI Agent calls tools based on text it reads. If that text can come from anywhere you don't fully control — a user message, a fetched web page, a file, an email body — then any tool you expose is a tool an attacker can try to trigger.
Setting Tools to Include to All puts every tool in that blast radius, including destructive ones like delete_flow and cancel_flow. Dozens of tool descriptions is a lot of context to weigh for a task that needs four.
Grant only the tools the workflow actually needs. For the workflow in this tutorial, that's four.
Troubleshooting
Symptom | Cause | Fix |
Tool list is empty, or the node won't connect | Server Transport set to SSE | Change it to HTTP Streamable |
401 invalid token | API key entered under Bearer Auth | Use Header Auth with header name x-api-key |
No Server Transport parameter on the node | n8n too old | Upgrade to n8n 1.104.0 or later |
"No matching data" when searching tools | Leftover filter text in the search box | Clear the box, then type the next tool name |
No results when searching for the chat trigger | Searched chat message | Search chat |
upload_file fails with HTTP 403 | Image host blocks bot user agents | Use a host that permits hotlinking |
Invalid session ID | Client isn't preserving the MCP session header | Use the official MCP Client Tool node; a hand-rolled HTTP Request node must echo Mcp-Session-Id |
Community MCP node not selectable as an agent tool | Self-hosted environment variable | Set N8N_COMMUNITY_PACKAGES_ALLOW_TOOL_USAGE=true |
Server reference
Endpoint | https://mcp.cnaps.ai/mcp |
Transport | Streamable HTTP (there is no SSE endpoint) |
Auth | x-api-key header, or OAuth 2.1 via the node's MCP OAuth2 option |
Sessions | Stateful — the MCP Client Tool node preserves Mcp-Session-Id for you |
The Tools to Include dropdown always shows the current tool list. For what each tool does, its parameters, OAuth scopes, and example recipes, see the CNAPS.ai MCP Server — User Guide.
Next steps
- Swap
suggest_flowforlist_modelsorfind_compatible_modelsif you want the agent choosing from a narrower set - Add
run_batchandget_batch_statusto process many files in one run - Replace the chat trigger with a webhook, schedule, or form trigger to run the same pipeline unattended
- Add a Memory node to the agent so it can refine results across turns ("now sharpen it a bit more")
For the full tool reference and example recipes, see the CNAPS.ai MCP Server — User Guide — or connect the same server to Claude directly.