Compatibility fix for stricter JSON-RPC clients, plus a spec cleanup CodeRabbit caught during review.
Fixed
- MCP server works with Codex CLI and any strict JSON-RPC 2.0 client (#129) — the stdio transport was responding to JSON-RPC notifications (messages without an
idfield, e.g.notifications/initialized), which violates JSON-RPC 2.0 §4.1 and caused stricter clients like Codex CLI v0.120.0 to close the transport with "Transport closed". Notifications are now detected by the missing/nullidfield, the handler still runs for side effects, but no response is written. Handler errors on notifications are logged to stderr instead of sent back to the client. Claude Code and other tolerant clients continue to work unchanged. - Request
idtype validation per JSON-RPC 2.0 §4 — the transport previously only checkedid != null, so a malformed request withid: {}orid: [1,2]could get echoed back with that non-primitive id, and valid-shape requests with bad id types fell through to the handler and produced a response carrying a bogus non-JSON-RPC id.isValidId()now enforcesstring | number | null | undefined, and bad-id requests get-32600 Invalid Requestwithid: nullbefore the handler runs. Caught by CodeRabbit on PR #131.
Infrastructure
- 14 tests in
test/mcp-transport.test.tscovering the request path, notification path (#129), malformed input, and id-type validation (object/array/boolean). Full suite: 698 passing.
Upgrade
npm install @agentmemory/agentmemory@0.8.5Codex CLI users: this release unblocks npx agentmemory-mcp with Codex CLI v0.120.0+. Please re-test and report back on #129.
Full changelog: v0.8.4...v0.8.5