mirror of
https://github.com/Monkopedia/rouse-context.git
synced 2026-12-02 09:43:13 +00:00
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> |
||
|---|---|---|
| .. | ||
| bridge | ||
| mcp | ||
| tunnel | ||