Problem with AI Agent and MCP Client in n8n

Problem with AI Agent and MCP Client in n8n

Hello n8n community,

I’m experiencing a persistent error in my workflow involving an AI agent and MCP connectivity. I hope you can help me solve it.

The problem

When I try to connect an AI Agent node with an MCP Client node, I constantly receive the error “Problem in node ‘AI Agent’: Provider returned error”. However, when I connect the AI Agent directly to Google Sheets, it works correctly.

My current setup

I’ve created two workflows:

  1. Main flow (with error):
  • A “When chat message received” trigger node
  • An “AI Agent” node configured as an assistant for product availability queries
  • Connections to:
    • “OpenRouter Chat Model” (using gpt-4.1-mini)
    • “Simple Memory”
    • “MCP Client” (this is where the error occurs)
  1. Secondary flow (works correctly):
  • “MCP Server Trigger”
  • “Google Sheets” node to query data

What I’ve tried

  • I’ve verified that when connecting the AI Agent directly to the Google Sheets node (instead of using MCP Client), the flow works correctly
  • I also have a separate flow (“server”) where an MCP Server Trigger connects to the Google Sheets node and works without problems

Questions

  1. Why is the connection between AI Agent and MCP Client specifically failing?
  2. Is there any known compatibility issue between these nodes?
  3. Is there any specific configuration I should make in the MCP Client to work with AI Agent?
  4. Would it be better to use an intermediate node (like Function) to transform the data between these two nodes?

I appreciate any guidance you can provide. If you need additional information, please let me know.

Thanks in advance!

2 Likes

Hi, I have reported the same issue (Problem in node 'AI Agent' Provider returned error using MCP Client / MCP Server Trigger). I think the problem is in the JSON response format that the MCP client send to ‘IA Agent’ (is not able to interpret it).

2 Likes