fix(mcp): persist OAuth state across restarts (#1212)
## Description Persist MCP OAuth state so Claude can refresh codemem MCP auth across process restarts and package upgrades instead of silently losing tools. This adds a JSON-backed OAuth state store for dynamic client registrations, access-token hashes, and refresh-token grants/hash history, and wires the HTTP server to use it by default. Tests cover client and refresh continuity after recreating the store/server. ## Type of Change - [ ] ๐ Feature (new functionality) - [x] ๐ Bug fix (fixes an issue) - [ ] ๐ Documentation (docs-only change) - [ ] ๐ง Maintenance (refactor, chore, CI, etc.) - [ ] ๐งช Testing (test-only changes) ## Testing - [x] Relevant checks pass locally (`pnpm run tsc`, `pnpm run lint`, `pnpm run test`) - [x] Added/updated tests for changes - [ ] Manually verified changes work as expected Local checks run: - `pnpm exec vitest run packages/mcp-server/src/provider.test.ts packages/mcp-server/src/http.test.ts` - `pnpm run tsc` - `pnpm run lint` ## Checklist - [x] Code follows project style (`pnpm run lint` passes for touched files) - [x] Self-review completed - [x] Documentation updated (if needed) - [x] No new warnings introduced
A
Adam Kunicki committed
42d22e199ff1d39c5f7d384b0a23b02ffbd25162
Parent: 9e8e619
Committed by GitHub <noreply@github.com>
on 5/28/2026, 10:47:28 PM