Chunk 6: Source Connections DB + User Settings UX + Key Encryption

↗ view on GitHub · Gadoes · 2026-05-02 · da870cef

- Add migrations: mcp_servers (seed data for 12 sources), mcp_connections,
  user_profiles column additions (courtlistener_api_key, govinfo_api_key, is_admin)
- Implement AES-256-GCM encryption in backend/src/lib/mcp/encryption.ts
  (encryptApiKey / decryptApiKey, key from MCP_KEY_ENCRYPTION_KEY env var)
- Add REST API: GET/POST/DELETE /user/mcp-connections with key encryption on write
- Extend getUserApiKeys() and add getMcpApiKey() with env fallback pattern
- Add UserApiKeys.courtlistener and .govinfo fields to llm types
- Create LegalSourcesPage frontend settings page (grouped by region, toggle +
  API key input per server, tier-based 'coming soon' badge)
- Add 'Legal Sources' tab to account settings layout
- 13 backend unit tests (encryption round-trip, format, edge cases)
- 13 frontend component tests all passing; tsc --noEmit clean

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Repository Gadoes/dispumike
Author Gadoes <62180984+Gadoes@users.noreply.github.com>
Authored
Parents 4c3d2b52
Stats 12 files changed , +1183 , -1
Part of Source Connections, Picker UI, and Per-Query Scope Toggling

Capture this commit into my fork

Download a Markdown prompt that tells Claude how to port this exact commit into your working tree. Run it via claude -p < capture-commit-da870cef.md from inside the repo you want the change in.

⬇ Download capture-commit-da870cef.md