ITADN

fix: Correct protocol version negotiation per MCP spec

#20Pull Requestkalidke 创建于 2025-12-14
K
kalidkecommented
## Summary - Fix protocol version negotiation to comply with MCP specification - Server now responds with its supported version instead of erroring on mismatch - Enables compatibility with MCP Inspector and other clients using newer protocol versions ## Problem Per MCP spec, when a client requests an unsupported version, the server **MUST** respond with a version it supports (not error). The client then decides if it can work with that version. Our server was returning an error when clients requested versions other than `2025-06-18` (e.g., MCP Inspector sends `2025-11-25`), breaking compatibility. ## Changes - `handlers.jl`: Remove error response for version mismatch, always respond with server's supported version (`2025-06-18`) - `http.jl`: Remove 400 error for version header mismatch - version negotiation happens at JSON-RPC level - Update tests to verify correct negotiation behavior ## Test plan - [x] All 232 unit tests pass - [x] MCP Inspector CLI works with all examples (`time_server.jl`, `multi_content_tool.jl`, `reg_dir.jl`) - [x] Verified version negotiation: Inspector sends `2025-11-25` → Server responds `2025-06-18` → Inspector accepts 🤖 Generated with [Claude Code](https://claude.com/claude-code)
合并状态:未合并 关闭于 2025-12-14 1 条评论