Critical Bug Fix: HTTP MCP Transport JSON-RPC 2.0 Compliance
This patch release fixes a critical bug that made the HTTP MCP transport completely unusable with Claude Code and other strict JSON-RPC 2.0 clients.
What's Fixed
HTTP Transport JSON-RPC 2.0 Compliance (#236)
- Fixed protocol violation where the server included
"error": nullin successful responses - JSON-RPC 2.0 spec requires successful responses to omit the error field entirely (not include it as null)
- This was causing Claude Code to reject all HTTP MCP responses with "Unrecognized key(s) in object: 'error'" errors
Technical Changes
- Added
ConfigDict(exclude_none=True)to MCPResponse Pydantic model to exclude null fields from serialization - Replaced deprecated
.dict()with.model_dump()for Pydantic V2 compatibility - Moved json import to top of file per PEP 8 style guidelines
- Enhanced documentation with JSON-RPC 2.0 spec compliance notes
Impact
Before: HTTP MCP transport was completely unusable - all responses rejected by Claude Code
After: HTTP MCP transport now works correctly with Claude Code and other strict JSON-RPC 2.0 clients
Files Modified
src/mcp_memory_service/web/api/mcp.py- Fixed response serialization and updated to Pydantic V2
Credits
Special thanks to @timkjr for identifying this critical issue and providing the fix!
Installation
pip install --upgrade mcp-memory-serviceOr with uv:
uv pip install --upgrade mcp-memory-serviceFull Changelog
See CHANGELOG.md for detailed information.
What's Changed
Full Changelog: v8.28.0...v8.28.1