mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-03-22 04:34:44 +00:00
mcp: refactor for testability and add comprehensive test suite
- Refactor mcp.Server and router to accept injected I/O streams. - Implement McpHarness for high-fidelity MCP integration testing. - Add unit tests for protocol, tools, and resources modules. - Add integration tests covering initialization, tool/resource execution, and error handling. - Improve error reporting for malformed JSON requests.
This commit is contained in:
@@ -136,10 +136,10 @@ fn run(allocator: Allocator, main_arena: Allocator) !void {
|
||||
|
||||
log.opts.format = .logfmt;
|
||||
|
||||
var mcp_server = try lp.mcp.Server.init(allocator, app);
|
||||
var mcp_server = try lp.mcp.Server.init(allocator, app, std.fs.File.stdout());
|
||||
defer mcp_server.deinit();
|
||||
|
||||
try lp.mcp.router.processRequests(mcp_server);
|
||||
try lp.mcp.router.processRequests(mcp_server, std.fs.File.stdin());
|
||||
},
|
||||
else => unreachable,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user