-
Notifications
You must be signed in to change notification settings - Fork 62
Fix to return a response code 202 if the server accepts JSON-RPC notifications and responses #114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
On the tests: I don't see anywhere in either the MCP or the JSON-RPC spec where a |
…fications and responses If the server accepts JSON-RPC notifications and responses, it must return an HTTP status code of 202 without a body. refs - https://modelcontextprotocol.io/specification/2025-03-26/basic/transports#sending-messages-to-the-server - https://www.jsonrpc.org/specification Follow up: modelcontextprotocol#111
@atesgoral As you pointed out, it seems I misunderstood. I've deleted the test case I added. Also, I believe this case is already covered by an existing test in Could you please review it again? |
It seems odd that there is no reproduction test. Without a reproduction case for this issue, wouldn't it be difficult to notice if a regression occurs? |
Thanks for your checking! I believe the following three points need to be verified for this requirement:
Regarding the second point, as atesgoral pointed out, since it's a response object, it doesn't get passed as a request in the first place, so I don't believe it needs to be verified in testing. For case 1, see lines ruby-sdk/test/mcp/server/transports/streamable_http_transport_test.rb Lines 596 to 621 in eb0d9c0
ruby-sdk/test/mcp/server/transports/streamable_http_transport_test.rb Lines 20 to 50 in eb0d9c0
I believe these cases is already covered by above test cases, so I don't think we need to write additional tests. |
Motivation and Context
If the server accepts JSON-RPC notifications and responses, it must return an HTTP status code of 202 without a body.
refs
How Has This Been Tested?
Breaking Changes
There is a possibility that, if users depend on status code 200.
Types of changes
Checklist
Additional context
Follow up: #111