Repository navigation
[#637] Store MCP activity and expose it through a tRPC router - #668
Conversation
Pre-merge checks:
|
33dccca to
f297090
Compare
Pre-merge checks:
|
33dccca to
f297090
Compare
Why
We need a record of every MCP tool call, allowed, denied or failed, that officers can review and members can check for their own account. #643's SQL tools write to it and #644's logs page reads it.
What
Closes: #637
Part of #634
mcp_activitytable and migration0066_sad_gorgon.sql. Columns are actor, client id and name, tool, procedure path, SQL preview, target, outcome, error code and created atactorUserIdreferences the user table withON DELETE SET NULL, so deleting an account keeps its activity rowsoutcomeis limited toallowed,deniedandfailedby a check constraint(actorUserId, createdAt, id)and(createdAt, id)back the newest-first pagesapi-surface.test.tsand the audit coverage listTest Plan
pnpm format,pnpm lint,pnpm typecheckandpnpm --filter=@forge/api testpass, 1173 testspnpm db:generateand a localpnpm db:migrateran cleanlistMine0.0075 ms with the index and 0.28 ms without,list0.007 ms and 0.56 msMerge Danger
Door: two-way for the code. The table only adds to the schema and can stay if the code is rolled back.
Blast Radius: database. The migration has to be applied before anything calls the writer or the router.
Checklist
pnpm db:generateand committed the generated files inpackages/db/drizzle/