You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
AttributeError: 'JSONRPCMessage' object has no attribute 'message' in MCP 1.4.0 #280
Describe the bug
I encountered an AttributeError when running the example code from MCP Quickstart - Client with MCP version 1.4.0. The error suggests that the JSONRPCMessage object is missing the message attribute. This issue does not occur with MCP 1.3.0.
Activity
jkawamoto commentedon Mar 14, 2025
I encountered the same issue.
Upon further investigation of the error, I discovered that the type of
raw_messageis consistentlymcp.types.JSONRPCMessageat this location:python-sdk/src/mcp/shared/session.py
Line 324 in ebb81d3
This appears to be happening because the server extracts the inner
JSONRPCRequestorJSONRPCResponsefromMessageFrameand sends it at this point:python-sdk/src/mcp/server/stdio.py
Lines 85 to 86 in ebb81d3
chore: restrict MCP dependency version and update logging setup.
Soulter commentedon Mar 14, 2025
Same here
Henry-Jessie commentedon Mar 14, 2025
Same here
Kludex commentedon Mar 14, 2025
Yeah, it seems this line:
python-sdk/src/mcp/server/stdio.py
Lines 85 to 86 in ebb81d3
Should have been
message.messageinstead.I would prefer to revert #239 - not really because of this, but because of the type changes.
xinyang-zhu commentedon Mar 14, 2025
+1 having this issue
ryaningli commentedon Mar 14, 2025
Same here
Kludex commentedon Mar 14, 2025
The fix was released in mcp 1.4.1. FYI
dsp-ant commentedon Mar 14, 2025
Fixed in v1.4.1.
@Kludex we need to revisit this, but we need to have a way for servers to get access to the raw http request, in order to get access to headers ,etc.
Add end-to-end tests for server-client communication