MCP Client Tool problem when using Webhook Trigger (with Respond Node)

Hello,

I’m facing a blocking issue when using an AI Agent with an MCP tool inside a workflow triggered by a Webhook.

Behavior depends entirely on the webhook response mode:

  • :white_check_mark: Response Mode = Respond Immediately
    → The webhook responds instantly and the AI Agent works correctly.
    → The agent executes normally and returns a result in ~2 seconds.

  • :cross_mark: Response Mode = Using Respond to Webhook node
    OR
    :cross_mark: Response Mode = When last node finishes

    → The workflow star but never finish.
    → The AI Agent start execution but no tool call, no logs, no progress.
    → The execution stays “running” for several minutes until manually stopped.

Important detail:
If I desactivate the MCP Client Tool node, the workflow works normally in synchronous mode.
The issue only appears when AI Agent + MCP + non-immediate response are combined.

So this looks like a deadlock or blocking behavior between:

  • webhook synchronous response handling

  • AI Agent

  • MCP connection

Error message

No error message.
The execution just hangs indefinitely.

Here are the logs of MCP Client Tool node :

{
  "errorMessage": "Error in sub-node ‘MCP Client’",
  "errorDescription": "Could not connect to your MCP server",
  "errorDetails": {},
  "n8nDetails": {
    "nodeName": "MCP Client",
    "nodeType": "@n8n/n8n-nodes-langchain.mcpClientTool",
    "nodeVersion": 1.2,
    "itemIndex": 0,
    "time": "22/01/2026 17:27:29",
    "n8nVersion": "2.4.4 (Cloud)",
    "binaryDataMode": "filesystem",
    "stackTrace": [
      "NodeOperationError: Error in sub-node MCP Client",
      "    at ExecuteContext.getInputConnectionData (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@[email protected]_ec37920eb95917b28efaa783206b20f3/node_modules/n8n-core/src/execution-engine/node-execution-context/utils/get-input-connection-data.ts:376:11)",
      "    at ExecuteContext.getInputConnectionData (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@[email protected]_ec37920eb95917b28efaa783206b20f3/node_modules/n8n-core/src/execution-engine/node-execution-context/execute-context.ts:180:10)",
      "    at getConnectedTools (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/@n8n+n8n-nodes-langchain@file+packages+@n8n+nodes-langchain_5e964642f84eebe7ab5946b9e3444692/node_modules/@n8n/n8n-nodes-langchain/utils/helpers.ts:209:30)",
      "    at getTools (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/@n8n+n8n-nodes-langchain@file+packages+@n8n+nodes-langchain_5e964642f84eebe7ab5946b9e3444692/node_modules/@n8n/n8n-nodes-langchain/nodes/agents/Agent/agents/ToolsAgent/common.ts:395:17)",
      "    at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/@n8n+n8n-nodes-langchain@file+packages+@n8n+nodes-langchain_5e964642f84eebe7ab5946b9e3444692/node_modules/@n8n/n8n-nodes-langchain/nodes/agents/Agent/agents/ToolsAgent/V2/execute.ts:252:18",
      "    at async Promise.allSettled (index 0)",
      "    at ExecuteContext.toolsAgentExecute (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/@n8n+n8n-nodes-langchain@file+packages+@n8n+nodes-langchain_5e964642f84eebe7ab5946b9e3444692/node_modules/@n8n/n8n-nodes-langchain/nodes/agents/Agent/agents/ToolsAgent/V2/execute.ts:326:24)",
      "    at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/@n8n+n8n-nodes-langchain@file+packages+@n8n+nodes-langchain_5e964642f84eebe7ab5946b9e3444692/node_modules/@n8n/n8n-nodes-langchain/nodes/agents/Agent/V2/AgentV2.node.ts:130:10)",
      "    at WorkflowExecute.executeNode (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@[email protected]_ec37920eb95917b28efaa783206b20f3/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1045:8)",
      "    at WorkflowExecute.runNode (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@[email protected]_ec37920eb95917b28efaa783206b20f3/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1226:11)",
      "    at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@[email protected]_ec37920eb95917b28efaa783206b20f3/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1662:27",
      "    at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@[email protected]_ec37920eb95917b28efaa783206b20f3/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:2297:11"
    ]
  }
}

Step to reproduce

Minimal reproducible workflow:

  1. Webhook Trigger

    • Response Mode:

      • :cross_mark: Using Respond to Webhook

      • :cross_mark: When last node finishes

      • :white_check_mark: Respond Immediately (only mode that works)

  2. AI Agent

    • Configured with an MCP tool
  3. Respond to Webhook (or last node output)

With MCP enabled, the agent never starts unless Respond Immediately is used.

Information on n8n setup

  • n8n version: 2.4.4
  • Database (default: SQLite): -
  • n8n EXECUTIONS_PROCESS setting (default: own, main): -
  • Running n8n via (Docker, npm, n8n cloud, desktop app): cloud
  • Operating system: -
1 Like

I imagine there are workarounds that would allow me to build my system while circumventing this problem, but I would like to be sure that I am not overlooking anything in the process.

1 Like

Hey @akecel_bf Welcome to the n8n community!

Sharing your complete workflow would really help us narrow down the issue,

for now this looks like an MCP connection problem that only becomes visible when the webhook is held open.

On n8n Cloud, long‑running webhooks are also limited by Cloudflare: if a webhook doesn’t respond within ~100 seconds, the request can fail, so the docs recommend an async pattern instead of “wait until last node finishes”. Like that might be the probable reason , but for now below are some workaround i suggest:

  1. Keep the Webhook in “Respond immediately” mode.

  2. Let the AI Agent + MCP run in the background.

  3. Return results via:

    • A second webhook the client can poll, or

    • Storing the result (DB/cache) and letting the caller fetch it later.

  4. On your MCP server/proxy, ensure for the MCP endpoint:

    • HTTP compression (gzip) is disabled.

    • No buffering/caching that breaks SSE/streaming.

Let me know if this helps!

1 Like

Okay, my mistake! I was using Ngrok to expose my local MCP for use during testing. And that was the problem: the incompatibility stemmed from the simultaneous use of a Webhook Trigger (with Response node) and an MCP Client Tool connected to Ngrok. Once the MCP was deployed on a pre-production server, everything worked fine!

Thanks for your reply anyway, and sorry about that.

I’m closing this thread.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.