fix: configure multi-user MCP secrets after create#6483
fix: configure multi-user MCP secrets after create#6483thedadams wants to merge 1 commit intoobot-platform:mainfrom
Conversation
EntelligenceAI PR SummaryIntroduces a one-time MCP server manifest-to-credentials migration and supporting infrastructure, along with a UI fix to prevent secret transmission.
Confidence Score: 3/5 - Review RecommendedLikely safe but review recommended — this PR introduces a thoughtful one-time migration of MCP server credentials with proper gating via a migrations table, but three unresolved concerns from prior reviews warrant attention before merging. Specifically, in Key Findings:
Files requiring special attention
|
There was a problem hiding this comment.
Introduces a one-time migration to move sensitive MCP server manifest config values into GPTScript credentials and prevents secret values from being sent in server creation requests.
pkg/controller/migrate.go: Core migration logic withmigrateMCPServerManifestValuesToCredentialsOnce, guarded by migrations table; helpersmcpServerCredentialContextandextractAndClearMCPServerConfigValuespkg/controller/controller.go: Migration invoked inPreStartbefore admin workspace initpkg/controller/migrate_test.go: Three unit tests covering extraction, no-op, and credential context casespkg/gateway/db/migrations.go+db.go:migrateIfEntryNotFoundInMigrationsTableexported asMigrateIfEntryNotFoundInMigrationsTablepkg/gateway/client/client.go: New exportedMigrateIfEntryNotFoundInMigrationsTablemethod using GORM transactions; typo fixpkg/gateway/client/identity.go: Typo fixemailsWithExplictRoles→emailsWithExplicitRolesui/user/src/lib/components/admin/CatalogServerForm.svelte:omitSecretValuesFromServerManifeststrips secret values from manifest beforecreateServerFncall
There was a problem hiding this comment.
Pull request overview
This PR updates multi-user MCP server creation/configuration to avoid persisting secret values in server manifests, and adds a startup migration to move existing stored manifest values into GPTScript credentials.
Changes:
- UI: Strip
env[].value/remoteConfig.headers[].valuefrom the manifest payload when creating multi-user catalog servers, then configure secrets via the separate configure call. - Gateway DB: Export the “run migration once” helper and add a client wrapper for it.
- Controller: Add a one-time migration at controller startup to extract manifest values from existing multi-user MCP servers and store them in credentials (with unit tests for extraction/context helpers).
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| ui/user/src/lib/components/admin/CatalogServerForm.svelte | Omits secret values from manifest during server creation and continues configuring secrets via /configure. |
| pkg/gateway/db/migrations.go | Exports the migration guard helper (MigrateIfEntryNotFoundInMigrationsTable). |
| pkg/gateway/db/db.go | Updates callers to use exported migration guard helper. |
| pkg/gateway/client/client.go | Fixes typo in explicit-role email map name; adds a gateway-client migration guard wrapper. |
| pkg/gateway/client/identity.go | Fixes typo in explicit-role email map usage. |
| pkg/controller/migrate.go | Adds controller startup migration to move multi-user MCP manifest values into credentials and clear them from specs. |
| pkg/controller/controller.go | Runs the new migration during PreStart. |
| pkg/controller/migrate_test.go | Adds unit tests for manifest value extraction and credential context generation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This change also migrates existing multi-user MCP servers to store their cofiguration in credentials. Signed-off-by: Donnie Adams <donnie@obot.ai>
451ce44 to
10285e8
Compare
This change also migrates existing multi-user MCP servers to store their cofiguration in credentials.
Issue: https://github.com/obot-platform/sensitive-issues/issues/66