-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
When running the server, the following happens:
[virtual-71] DEBUG sttp.tapir.server.netty.sync.NettySyncServerOptions$ -- Request: POST /mcp, handled by: POST /mcp, took: 12ms; response: 200
[virtual-72] DEBUG chimp.McpHandler -- Request: {
"method" : "notifications/initialized",
"jsonrpc" : "2.0"
}
[virtual-72] DEBUG chimp.McpHandler -- Protocol error (id=null, code=-32600): Invalid request type
I believe we can resolve this by adding
case Right(notification: JSONRPCMessage.Notification) => notification.unit
on line 137 in chimp.McpHandler
.
I wrote a test case that can be added to McpHandlerSpec
as well which passes after this change and fails before.
it should "accept notifications" in:
// Given
val req: JSONRPCMessage = Notification(method = "notifications/initialized")
val json = req.asJson
// When
val respJson = handler.handleJsonRpc(json)
val resp = respJson.as[JSONRPCMessage].getOrElse(fail("Failed to decode response"))
// Then
resp match
case Notification(_, methodName, _) => methodName shouldBe "notifications/initialized"
case _ => fail("Expected Notification")
I'd be happy to open a PR, but I don't think I have permissions to do so.
Metadata
Metadata
Assignees
Labels
No labels