diff --git a/src/Config.zig b/src/Config.zig index de413e35..ae5a2667 100644 --- a/src/Config.zig +++ b/src/Config.zig @@ -189,12 +189,6 @@ pub fn webBotAuth(self: *const Config) ?WebBotAuthConfig { }; } -pub fn mcpVersion(self: *const Config) []const u8 { - return switch (self.mode) { - .mcp => |opts| @tagName(opts.version), - else => @tagName(mcp.Version.default), - }; -} pub fn maxConnections(self: *const Config) u16 { return switch (self.mode) { diff --git a/src/mcp/router.zig b/src/mcp/router.zig index e3b08c68..63945947 100644 --- a/src/mcp/router.zig +++ b/src/mcp/router.zig @@ -81,8 +81,12 @@ pub fn handleMessage(server: *Server, arena: std.mem.Allocator, msg: []const u8) fn handleInitialize(server: *Server, req: protocol.Request) !void { const id = req.id orelse return; + const version: protocol.Version = switch (server.app.config.mode) { + .mcp => |opts| opts.version, + else => .default, + }; const result: protocol.InitializeResult = .{ - .protocolVersion = server.app.config.mcpVersion(), + .protocolVersion = @tagName(version), .capabilities = .{ .resources = .{}, .tools = .{},