tmcp 1.6.0 → 1.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/index.js +5 -1
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
CreateMessageResultSchema,
|
|
18
18
|
GetPromptResultSchema,
|
|
19
19
|
InitializeRequestParamsSchema,
|
|
20
|
+
JSONRPCNotificationSchema,
|
|
20
21
|
JSONRPCRequestSchema,
|
|
21
22
|
JSONRPCResponseSchema,
|
|
22
23
|
McpError,
|
|
@@ -682,7 +683,10 @@ export class McpServer {
|
|
|
682
683
|
*/
|
|
683
684
|
receive(message, session_id) {
|
|
684
685
|
// Validate the message first
|
|
685
|
-
const validated_message = v.safeParse(
|
|
686
|
+
const validated_message = v.safeParse(
|
|
687
|
+
v.union([JSONRPCRequestSchema, JSONRPCNotificationSchema]),
|
|
688
|
+
message,
|
|
689
|
+
);
|
|
686
690
|
|
|
687
691
|
// Check if it's a request or response
|
|
688
692
|
if (validated_message.success) {
|