feat(migration): add McpServerMigrator for v2 data migration#13303
feat(migration): add McpServerMigrator for v2 data migration#13303
Conversation
…derer) Add three skills to guide the v2 data layer migration lifecycle: - v2-migrator: Redux/Dexie/ElectronStore → SQLite migration with TDD - v2-data-api: Main-process Handler→Service→Repository architecture - v2-renderer: Renderer hooks (useQuery, usePreference, useCache) Includes cross-domain reference guidance, FK design patterns, cache tier selection, and cross-category migration examples. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Migrate MCP server configurations from Redux (state.mcp.servers) to SQLite mcp_server table. Runtime flags (isUvInstalled, isBunInstalled) are skipped as they are re-detected at startup. - Create mcp_server SQLite schema with Drizzle ORM - Implement McpServerMigrator (prepare/execute/validate) - Add transform functions with full test coverage (17 tests) - Register in migration pipeline (order=2) - Add 'mcp' to ReduxExporter SLICES_TO_EXPORT - Update v2-migrator skill with ReduxExporter step Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Note This issue/comment/review was translated by Claude. The Original Content
|
|
Note This issue/comment/review was translated by Claude. I can't find the relevant code, I have MCP servers pulled from the cloud in this table Original Content我搜不到相关代码,我现在这个表中就有云端拉取的mcp servers
|
|
Note This issue/comment/review was translated by Claude. This data is all in the cloud. We can fetch it again even without migration, so it's not a big issue. Original Content这部分数据都在云端,不迁移也可以再fetch一次,倒是问题不大 |
|
Note This issue/comment/review was translated by Claude. ok, please submit a new pr Original Contentok,重新提个pr吧 |
What this PR does
Before this PR:
MCP server configurations (user-installed and builtin servers) are stored only in Redux (localStorage), with no SQLite migration path for the v2 architecture.
After this PR:
MCP server data is migrated from Redux
state.mcp.serversinto a newmcp_serverSQLite table as part of the v2 migration pipeline. Runtime flags (isUvInstalled,isBunInstalled) are intentionally skipped as they are re-detected at startup.Why we need it and why it was done in this way
This is part of the v2 data layer refactoring that replaces Redux with SQLite. The MCP server configuration is user data that must be preserved across the migration.
The following tradeoffs were made:
text({ mode: 'json' })) are used for complex fields (args, env, headers, tags, etc.) rather than normalized tables, matching the existing data shape.isUvInstalled,isBunInstalled) are excluded since they belong in CacheService.The following alternatives were considered:
Breaking changes
None. This is a migration-only change with no impact on existing functionality.
Special notes for your reviewer
ReduxExporter.SLICES_TO_EXPORTwas missing'mcp', which caused the MCP slice to never be exported to Main process. This was a gap in the existing migration infrastructure that this PR fixes.Checklist
/gh-pr-review,gh pr diff, or GitHub UI) before requesting review from othersRelease note