MCP Server: Invalid request - Malformed JSON-RPC request #8635
-
What happened?I am attempting to configure the AWS Knowledge MCP Server as a streamable-http MCP Server in LibreChat. The aws-knowledge-mcp-server repeatedly fails to initialize with errors related to:
While it is possible that this could be a bug in the MCP Server, I don't believe it is because it seems to work fine with:
However, if you do feel this is a bug in the MCP Server please let me know ASAP and I will take this report elsewhere. Version Informationghcr.io/danny-avila/librechat-dev latest 5e7920e4ba74 18 hours ago 1.13GB Steps to Reproduce
What browsers are you seeing the problem on?Firefox Relevant log output{"level":"error","message":"[MCP][aws-knowledge-mcp-server] Transport error: Error POSTing to endpoint (HTTP 400): {\"jsonrpc\":\"2.0\",\"id\":\"1.0\",\"error\":{\"code\":-32600,\"message\":\"Invalid request - Malformed JSON-RPC request\"}}","stack":"Error: Error POSTing to endpoint (HTTP 400): {\"jsonrpc\":\"2.0\",\"id\":\"1.0\",\"error\":{\"code\":-32600,\"message\":\"Invalid request - Malformed JSON-RPC request\"}}\n at StreamableHTTPClientTransport.send (/app/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/streamableHttp.js:288:23)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)"}
I am happy to provide additional error/debug logs via private communication upon request if you are unable to reproduce. ScreenshotsNo response Code of Conduct
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
I'm seeing some errors with the inspector as well: danny:~/LibreChat$ npx @modelcontextprotocol/inspector
Starting MCP inspector...
⚙️ Proxy server listening on 127.0.0.1:6277
🔑 Session token: a74f2e6785a51df11415c4a8f90c0b90923aa1d7a9f683988369e3d699170217
Use this token to authenticate requests or set DANGEROUSLY_OMIT_AUTH=true to disable auth
🔗 Open inspector with token pre-filled:
http://localhost:6274/?MCP_PROXY_AUTH_TOKEN=a74f2e6785a51df11415c4a8f90c0b90923aa1d7a9f683988369e3d699170217
🔍 MCP Inspector is up and running at http://127.0.0.1:6274 🚀
New StreamableHttp connection request
Query parameters: {"url":"https://knowledge-mcp.global.api.aws","transportType":"streamable-http"}
Created StreamableHttp server transport
Created StreamableHttp client transport
Client <-> Proxy sessionId: 4d4293a5-e470-44ba-b1df-879542c239cf
Received POST message for sessionId 4d4293a5-e470-44ba-b1df-879542c239cf
Received GET message for sessionId 4d4293a5-e470-44ba-b1df-879542c239cf
Error from MCP server: StreamableHTTPError: Streamable HTTP error: Failed to open SSE stream: Not Found
at StreamableHTTPClientTransport._startOrAuthSse (file:///home/danny/.npm/_npx/5a9d879542beca3a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/streamableHttp.js:94:23)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
code: 404
}
Error from MCP server: StreamableHTTPError: Streamable HTTP error: Failed to open SSE stream: Not Found
at StreamableHTTPClientTransport._startOrAuthSse (file:///home/danny/.npm/_npx/5a9d879542beca3a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/streamableHttp.js:94:23)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
code: 404
} however it seems to connect anyway despite the errors with inspector, so I will take a further look. thanks |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Thanks @danny-avila ! I will raise this issue with the MCP Server maintainer. One additional observation I noticed during testing was that Librechat didn’t seem to ever “give up” when the initialization repeatedly failed. Eventually, this led to throttling (Too Many Requests) by the MCP Server. This Librechat behavior may be intentional, I’m not sure if there is a way to know whether an error returned by an MCP would indicate that the connection should not be retried. |
Beta Was this translation helpful? Give feedback.
Moving this to "Troubleshooting" as this MCP server presents a couple of edge cases with initial connections that presents itself in all MCP client apps. It also errors with simple ping messages which is what you see as "Malformed JSON-RPC request", which is also present in the inspector:
In any case, this is a good opportunity to improve connection resiliency, which the inspector is definitely exemplary of, testing with this specific server, but the main issues stem from the server itself.