mcp: support notifications and improve error handling

Make Request id optional for JSON-RPC notifications and handle the
initialized event. Improve thread safety, logging, and error paths.
This commit is contained in:
Adrià Arrufat
2026-02-25 23:14:06 +09:00
parent 9b3fa809bf
commit 34d2fc1503
6 changed files with 76 additions and 50 deletions

View File

@@ -2,7 +2,7 @@ const std = @import("std");
pub const Request = struct {
jsonrpc: []const u8 = "2.0",
id: std.json.Value,
id: ?std.json.Value = null,
method: []const u8,
params: ?std.json.Value = null,
};