rouse-context/core
Jason Monk e9a7ff582f Fix #105: Audit all MCP JSON-RPC methods, not just tool calls
Previously, only `tools/call` invocations were surfaced to the audit
listener, so a connected client could enumerate the full tool menu
(`tools/list`, `resources/read`, etc.) without leaving any user-visible
trace.

Changes:
- Extend `AuditListener` with a generic `onRequest(event: McpRequestEvent)`
  that fires for every JSON-RPC method. `onToolCall` remains the
  specialized path for `tools/call` so the existing tool-call UI stays
  intact.
- `McpRouting.emitAuditEvent` now fires `onRequest` for every dispatched
  method, and additionally fires `onToolCall` for `tools/call` (helpers
  split for detekt complexity).
- Add Room `McpRequestEntry` entity + `McpRequestDao` parallel to the
  existing `AuditEntry`. DB version 2 -> 3 with a migration that creates
  the new `mcp_request_entries` table without touching existing data.
- `RoomAuditListener` accepts an optional `McpRequestDao` and persists
  every request when supplied, encrypting `paramsJson` at rest via the
  existing `FieldEncryptor` (covers `prompts/get` / `resources/read`
  which may carry user data).
- `NotificationSettingsProvider` + DataStore gain
  `showAllMcpMessages` (default false) so the UI can later gate
  visibility behind a user opt-in.

Tests:
- `McpProtocolTest`: `onRequest` fires for every method; `tools/call`
  fires both callbacks; params/duration/resultBytes captured;
  onToolCall does not fire for non-tool methods.
- `RoomAuditListenerTest`: `onRequest` persists to the request DAO;
  is a no-op when the DAO is absent.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 22:51:13 -04:00
..
bridge Fix #8: Reimplement ClientPassthroughTest 2026-04-11 11:42:59 -04:00
mcp Fix #105: Audit all MCP JSON-RPC methods, not just tool calls 2026-04-13 22:51:13 -04:00
tunnel Fix #87: Implement FirebaseRenewalAuthProvider with AndroidKeystore EC signing 2026-04-13 22:42:22 -04:00