-
Notifications
You must be signed in to change notification settings - Fork 150
Small changes to align to the specification. #13
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
Small changes to align to the specification. #13
Conversation
… decode with missing params, as id is required for a Request, but params are not. Ping should return an {}, and ListTools cursor parameter is optional.
| // Ping | ||
| withMethodHandler(Ping.self) { _ in return Empty() } | ||
| // Ping. Specification shows empty dictionary as the response: | ||
| // https://spec.modelcontextprotocol.io/specification/2024-11-05/basic/utilities/ping/ | ||
| withMethodHandler(Ping.self) { params in | ||
| return .object([:]) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty is already encoded as an empty JSON object ({}), so we should be good here.
|
Hey @mattt, #17 gets very close but doesn't quite solve what I was running into. When the Server decodes a request in its read loop, it first decodes to Below is a screenshot in the debugger when this request comes in, fails, and gets marked as a Message. This request is from Cursor 0.47.5. |
|
@adamwulf Thanks for following up. I'll take another look at that today. |
|
@adamwulf I just opened up #22, which should resolve that. I added a test case specifically for the This is now live in 0.5.0, so please give that a try at your convenience. |
|
Thanks! I'll give that a test later today and verify. I think that it might also want to check for |
|
Unfortunately neither of these are working for me. I'm going to see if I can get a unit test to mirror the behavior I'm seeing in my simple mcp command line app. I'll hopefully have time to do that tomorrow afternoon. |
|
I was able to spend some more time tonight, and I added two tests to #24 as well as an explanation of what's happening when i caught it in the debugger. |
|
@adamwulf Brilliant! Moving over to that thread. |

Also allow AnyRequest to decode with missing params, as id is required for a Request, but params are not. Ping should return an {}, and ListTools cursor parameter is optional.