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:
- 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)
- 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
- Why is the connection between AI Agent and MCP Client specifically failing?
- Is there any known compatibility issue between these nodes?
- Is there any specific configuration I should make in the MCP Client to work with AI Agent?
- 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!