mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-03-29 16:10:04 +00:00
mcp: change default protocol version to 2024-11-05
This commit is contained in:
@@ -192,7 +192,7 @@ pub fn webBotAuth(self: *const Config) ?WebBotAuthConfig {
|
|||||||
pub fn mcpVersion(self: *const Config) []const u8 {
|
pub fn mcpVersion(self: *const Config) []const u8 {
|
||||||
return switch (self.mode) {
|
return switch (self.mode) {
|
||||||
.mcp => |opts| @tagName(opts.version),
|
.mcp => |opts| @tagName(opts.version),
|
||||||
else => @tagName(mcp.Version.latest),
|
else => @tagName(mcp.Version.default),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -230,7 +230,7 @@ pub const Serve = struct {
|
|||||||
|
|
||||||
pub const Mcp = struct {
|
pub const Mcp = struct {
|
||||||
common: Common = .{},
|
common: Common = .{},
|
||||||
version: mcp.Version = .latest,
|
version: mcp.Version = .default,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub const DumpFormat = enum {
|
pub const DumpFormat = enum {
|
||||||
@@ -467,7 +467,7 @@ pub fn printUsageAndExit(self: *const Config, success: bool) void {
|
|||||||
\\ Override the reported MCP version.
|
\\ Override the reported MCP version.
|
||||||
\\ Valid: 2024-11-05, 2025-03-26, 2025-06-18, 2025-11-25.
|
\\ Valid: 2024-11-05, 2025-03-26, 2025-06-18, 2025-11-25.
|
||||||
\\ Can also be set via LIGHTPANDA_MCP_VERSION env var.
|
\\ Can also be set via LIGHTPANDA_MCP_VERSION env var.
|
||||||
\\ Defaults to "2025-11-25".
|
\\ Defaults to "2024-11-05".
|
||||||
\\
|
\\
|
||||||
++ common_options ++
|
++ common_options ++
|
||||||
\\
|
\\
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ test "MCP.Server - Integration: synchronous smoke test" {
|
|||||||
|
|
||||||
try router.processRequests(server, &in_reader);
|
try router.processRequests(server, &in_reader);
|
||||||
|
|
||||||
try testing.expectJson(.{ .jsonrpc = "2.0", .id = 1, .result = .{ .protocolVersion = "2025-11-25" } }, out_alloc.writer.buffered());
|
try testing.expectJson(.{ .jsonrpc = "2.0", .id = 1, .result = .{ .protocolVersion = "2024-11-05" } }, out_alloc.writer.buffered());
|
||||||
}
|
}
|
||||||
|
|
||||||
test "MCP.Server - Integration: ping request returns an empty result" {
|
test "MCP.Server - Integration: ping request returns an empty result" {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ pub const Version = enum {
|
|||||||
@"2025-06-18",
|
@"2025-06-18",
|
||||||
@"2025-11-25",
|
@"2025-11-25",
|
||||||
|
|
||||||
pub const latest: Version = .@"2025-11-25";
|
pub const default: Version = .@"2024-11-05";
|
||||||
};
|
};
|
||||||
|
|
||||||
pub const Request = struct {
|
pub const Request = struct {
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ test "MCP.router - handleMessage - synchronous unit tests" {
|
|||||||
\\{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test-client","version":"1.0.0"}}}
|
\\{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test-client","version":"1.0.0"}}}
|
||||||
);
|
);
|
||||||
try testing.expectJson(
|
try testing.expectJson(
|
||||||
\\{ "jsonrpc": "2.0", "id": 1, "result": { "protocolVersion": "2025-11-25", "capabilities": { "tools": {} } } }
|
\\{ "jsonrpc": "2.0", "id": 1, "result": { "protocolVersion": "2024-11-05", "capabilities": { "tools": {} } } }
|
||||||
, out_alloc.writer.buffered());
|
, out_alloc.writer.buffered());
|
||||||
out_alloc.writer.end = 0;
|
out_alloc.writer.end = 0;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user