Overview
n8n can sit in front of a hosted MCP server as a lightweight workflow layer. A common pattern is:- Trigger the workflow from a Webhook, Manual Trigger, or Schedule Trigger.
- Normalize the incoming JSON, form data, or uploaded CSV in Code nodes.
- Call the MCP endpoint with an n8n MCP Client node or with HTTP Request nodes.
- Resolve stored outputs with
result_getwhen a tool returns aresult_id. - Assemble a JSON, log, email, or chat response from sanitized result fields.
Safe Workflow Exports
Workflow exports can include API keys, credential IDs, email addresses, chat recipients, webhook paths, and delivery-service settings. Do not publish raw n8n workflow JSON unless it has been reviewed and scrubbed. When sharing a workflow:- Keep secrets in n8n Credentials or environment variables.
- Replace webhook paths with examples such as
my-factor-report. - Remove credential
id/nameblocks from exported nodes. - Remove delivery recipients and bot/channel identifiers.
- Keep only endpoint URLs, tool names, request shapes, and routing notes.
Workflow Templates and Webhooks
The workflow JSON files below are sanitized templates: credential blocks, private recipients, private webhook identifiers, and literal secrets have been removed. Import them into your own n8n instance, then attach your own MCP Client credentials and delivery credentials.MCP Client Node Pattern
Use this when your n8n installation has an MCP Client node that supports streamable HTTP.
For example, a Statistical Factor Models workflow can route validated input to
complete-panel-factor-extractor-fit, swfactor-extractor-fit, or bmfactor-extractor-fit through separate MCP Client nodes.
HTTP Request Node Pattern
Use this when you want explicit session control or need to call helper tools such asresult_get.
1. Initialize
mcp-session-id response header.
2. Send Initialized
MCP-Session-Id header.
3. Call a Tool
Content-Type: application/json and Accept: application/json, text/event-stream on every HTTP Request node. If the endpoint is protected, add the Authorization header through n8n Credentials instead of hard-coding it.
Webhook Pattern
For user-facing workflows, configure a Webhook Trigger withPOST and responseMode: responseNode.
Typical body shapes:
{"ok": false, "error": "..."}.
Server Examples
Delivery
Keep delivery separate from MCP calls. The MCP nodes should produce structured JSON; delivery nodes can then send:- webhook JSON response;
- n8n execution logs;
- email report;
- chat or bot notification;
- saved CSV or image artifact.
Checklist
- The MCP URL is the server-specific
/mcp/...URL, not the/healthURL. - Every tool payload is wrapped as
{"request": {...}}. - Direct HTTP Request flows keep and reuse
MCP-Session-Id. - Stored outputs are resolved with
result_getbefore formatting reports. - Workflow exports are scrubbed before they are shared or committed.