Claude Code hooks integrating with PoC memory
Find a file
ProofOfConcept 11e2f20820 mcp-server: accept JSON-RPC notifications (no id field)
JSON-RPC 2.0 notifications are fire-and-forget and omit the `id`
field entirely. The server was requiring `id: Value`, so MCP clients
sending `notifications/initialized` after the handshake got a
`parse error: missing field \`id\`` response back. Claude Code then
treated the handshake as broken and never called `tools/list`, so
none of our memory/journal/graph/channel tools showed up in the
client's tool list.

Make `Request.id` an `Option<Value>` with `#[serde(default)]`:
  - Missing id → notification (None) → no response of any kind.
  - Explicit null id → still a request, null response id (legal).
  - Parse errors still respond with id:null per spec.

Update respond() / respond_error() to no-op on None so a
dispatched handler that tries to reply to a notification silently
does nothing instead of violating the spec.

Verified with a manual handshake: initialize → notification →
tools/list now round-trips cleanly.

Co-Authored-By: Proof of Concept <poc@bcachefs.org>
2026-04-16 20:53:50 -04:00
src mcp-server: accept JSON-RPC notifications (no id field) 2026-04-16 20:53:50 -04:00
Cargo.lock hook: log gate decision and agent spawn outcomes 2026-04-16 18:38:50 -04:00
Cargo.toml initial commit 2026-04-09 19:57:50 -04:00