MCP Server executeTools debugging

Problem

Hi. I just started seeing errors now when running executeTools for the Gitlab MCP server in n8n. I get a “unauthorized” error, even though I know the personal access token is fine. I only see this when running from n8n. I get this 90% of the time, sometimes if I restart the n8n container or restart the whole stack via docker compose I can get it to work for a short amount of time.

Error

## Problem in node ‘Gitlab search_repos‘
Failed to execute operation: Failed to execute tool 'search_repositories': MCP error -32603: GitLab API error: Unauthorized

Troubleshooting Steps

  1. if I run the MCP server outside n8n via docker, login, I can see the proper environmental variables set. I do a curl from the container with the token, I get a success. Verified via packet capture.

  2. If I run the MCP server outside n8n via npx, I get a success. Verified via packet capture.

  3. If I use mcp-inspector, I get a success. Verified via packet capture.

  4. If I run curl on the host itself, I get a success. Verified via packet capture.

  5. If I run OpenwebUI with the MCP server attached as a tool, I get a success.

So it seems to either be the n8n-node-mcp or n8n itself. If I do a packet capture on the Gitlab server itself, I never see the packet when n8n tries to run the MCP server. So it seems to be failing between n8n and the MCP server. Not sure if n8n is not passing the ENV variables properly, at all or something else.

How can I debug this further ? Anyway to see the messaging being exchanged from n8n to the container ?

Node

Screenshots



Note = Internal Gitlab instance

Information on your n8n setup

  • n8n version: Tried 1.92.2, 1.93.0 1.94.0
  • n8n-nodes-mcp (MCP Client Tool) version: 1.0.28
  • Database: Default
  • Running n8n via: Docker
  • Operating system: Alma 9.5 VM