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:
Adrià Arrufat
2026-03-02 15:50:29 +09:00
parent 8a1795d56f
commit 64107f5957
8 changed files with 371 additions and 6 deletions

View File

@@ -1,3 +1,4 @@
pub const Server = @import("mcp/Server.zig");
pub const protocol = @import("mcp/protocol.zig");
pub const router = @import("mcp/router.zig");
pub const testing = @import("mcp/testing.zig");