NodeOperationError: Error in sub-node MCP Client1 at ExecuteContext.getInputConnectionData

Hey everyone!!!

Currently I’m facing an “Error in sub-node ‘MCP Client Could not connect to your MCP server“ error by trying to use an MPC Client node :smiling_face_with_tear: ! The whole traceback looks as follows:

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]_5aee33ef851c7de341eb325c6a25e0ff/node_modules/n8n-core/src/execution-engine/node-execution-context/utils/get-input-connection-data.ts:302:11) at processTicksAndRejections (node:internal/process/task_queues:105:5) at ExecuteContext.getInputConnectionData (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@[email protected]_5aee33ef851c7de341eb325c6a25e0ff/node_modules/n8n-core/src/execution-engine/node-execution-context/execute-context.ts:203:10) at getConnectedTools (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/@n8n+n8n-nodes-langchain@file+packages+@n8n+nodes-langchain_6a42402e1b434941076375196b5319e5/node_modules/@n8n/n8n-nodes-langchain/utils/helpers.ts:208:5) at getTools (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/@n8n+n8n-nodes-langchain@file+packages+@n8n+nodes-langchain_6a42402e1b434941076375196b5319e5/node_modules/@n8n/n8n-nodes-langchain/nodes/agents/Agent/agents/ToolsAgent/common.ts:319:17) at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/@n8n+n8n-nodes-langchain@file+packages+@n8n+nodes-langchain_6a42402e1b434941076375196b5319e5/node_modules/@n8n/n8n-nodes-langchain/nodes/agents/Agent/agents/ToolsAgent/V2/execute.ts:222: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_6a42402e1b434941076375196b5319e5/node_modules/@n8n/n8n-nodes-langchain/nodes/agents/Agent/agents/ToolsAgent/V2/execute.ts:290:24) at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/@n8n+n8n-nodes-langchain@file+packages+@n8n+nodes-langchain_6a42402e1b434941076375196b5319e5/node_modules/@n8n/n8n-nodes-langchain/nodes/agents/Agent/V2/AgentV2.node.ts:131:10) at WorkflowExecute.runNode (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@[email protected]_5aee33ef851c7de341eb325c6a25e0ff/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1212:9)

My current workflow looks like this:

And my MCP configuration here:

Where my endpoint url is the same that I got from my MCP trigger node. I think its important to mention that I already tried everything that I could find from similar MCP error cases but nothing works for me. Currently I’m using ECS self-hosted installation and 1.108.2(latest so far) version.

Any help will be really appreciated!!

Hey @Gonzalo_Romero_Herna maybe you could share more of your setup/code/mcp… it is not broken in general, something in your setup could be causing this. Just tried a simple setup and it works for me.

Server

client:

The chat:

One thing to be very careful about is whether the workflow with MCP trigger is ACTIVE. Since you are using the production URL, the workflow needs to be active and url accessible.

Hey @jabbson Thank you so much for your valuable insights here!

My current web environment variables are as follows:

environment = [
    {
      "name"  = "N8N_LOG_LEVEL",
      "value" = "debug"
    },
    {
      "name"  = "N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS",
      "value" = "false"
    },
    {
      "name"  = "N8N_HOST",
      "value" = "whatever.com"
    },
    {
      "name"  = "N8N_EDITOR_BASE_URL",
      "value" = "https://whatever.com"
    },
    {
      "name"  = "WEBHOOK_URL",
      "value" = "https://whatever.com"
    },
    {
      "name"  = "EXECUTIONS_MODE",
      "value" = "queue"
    },
    {
      "name"  = "N8N_RUNNERS_ENABLED",
      "value" = "true"
    },
    {
      "name"  = "OFFLOAD_MANUAL_EXECUTIONS_TO_WORKERS",
      "value" = "true"
    },
    {
      "name"  = "QUEUE_HEALTH_CHECK_ACTIVE",
      "value" = "true"
    },
    {
      "name"  = "QUEUE_BULL_REDIS_HOST",
      "value" = "whatever.com"
    },
    {
      "name"  = "QUEUE_BULL_REDIS_PORT",
      "value" = "6379"
    },
    {
      "name"  = "QUEUE_BULL_REDIS_TLS",
      "value" = "true"
    },
    {
      "name"  = "DB_TYPE",
      "value" = "postgresdb"
    },
    {
      "name"  = "DB_POSTGRESDB_LOG_LEVEL",
      "value" = "verbose"
    },
  ]

My current worker environment variables looks like these:

environment = [
    {
      "name"  = "N8N_LOG_LEVEL",
      "value" = "debug"
    },
    {
      "name"  = "N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS",
      "value" = "false"
    },
    {
      "name"  = "N8N_RUNNERS_ENABLED",
      "value" = "true"
    },
    {
      "name"  = "N8N_DISABLE_ACTIVE_WORKFLOWS",
      "value" = "true"
    },
    {
      "name"  = "N8N_SKIP_WEBHOOK_REGISTRATION_ON_STARTUP",
      "value" = "true"
    },
    {
      "name"  = "EXECUTIONS_MODE",
      "value" = "queue"
    },
    {
      "name"  = "OFFLOAD_MANUAL_EXECUTIONS_TO_WORKERS",
      "value" = "true"
    },
    {
      "name"  = "QUEUE_HEALTH_CHECK_ACTIVE",
      "value" = "true"
    },
    {
      "name"  = "QUEUE_BULL_REDIS_HOST",
      "value" = "whatever.com"
    },
    {
      "name"  = "QUEUE_BULL_REDIS_PORT",
      "value" = "6379"
    },
    {
      "name"  = "QUEUE_BULL_REDIS_TLS",
      "value" = "true"
    },
    {
      "name"  = "DB_TYPE",
      "value" = "postgresdb"
    },
    {
      "name"  = "DB_POSTGRESDB_LOG_LEVEL",
      "value" = "verbose"
    },
  ]

Since all my resources lives in private subnets I wonder if it could be related within the network layer :thinking: . BTW I found something interesting, I noticed that it worked by using just 1 web instance instead of 2 as I used to have in my configuration

1 Like

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