Hi n8n community,
I’m experiencing a consistent error when trying to use the MCP Client node to connect to my custom MCP server built with the ModelContextProtocol SDK.
The Error
When attempting to connect to my MCP server, I receive the following error:
“Failed to execute operation: Failed to connect to MCP server: Error POSTing to endpoint (HTTP 400): InternalServerError: stream is not readable”
My Setup
-
n8n version: 1.86.1 (Self Hosted)
-
MCP Client node configuration:
- SSE URL: https://my-mcp-server.railway.app/sse
- Messages Post Endpoint: messages
- Operation: List Tools
-
Server Implementation:
- Built with ModelContextProtocol SDK
- Express server with SSE transport
- Correctly registers tools using the MCP SDK
- Server is accessible and responds to direct curl requests to the SSE endpoint
What I’ve Tried
- Verified the server is working correctly with direct curl requests
- Made various modifications to the server’s SSE implementation
- Attempted to prevent the stream from closing during message handling
- Ensured proper CORS configuration
Server Logs
When n8n attempts to connect, I see the following in my server logs:
[Include relevant logs showing SSE connection and any errors]
Has anyone encountered similar issues with the MCP Client node? Are there any known workarounds or fixes for the “stream is not readable” error?
Any assistance would be greatly appreciated!