feat(connectors): add Remove button, wiring deleteConnector - #502
Open
kristopolous wants to merge 2 commits into
Open
feat(connectors): add Remove button, wiring deleteConnector#502kristopolous wants to merge 2 commits into
kristopolous wants to merge 2 commits into
Conversation
There was previously no way to permanently remove a configured MCP connector: header-auth connectors had no removal option at all, and DCR connectors' "Disconnect" only cleared the OAuth token, leaving the row (and an auth_required badge) in the Configured list forever. Add IMcpServerStore.deleteServer (Postgres + SQLite), the DELETE route, and its handler. OAuth tokens and pending authorizations cascade-delete via their existing oauth_server_id FK (ON DELETE CASCADE), so no manual cleanup is needed. Idempotent, matching the existing delete-agent route. Backend only: packages/trueforge-sdk is Fern-generated in CI and fork PRs cannot receive that regen commit (see .github/workflows/generate-sdk.yaml). The Connect UI's "Remove" button follows in a fast-follow PR once the SDK regenerates on main after this merges. Fixes truefoundry#494 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MxyEPwQ73B27NTr83U69Ba
Settings > Connectors had no way to fully remove a configured connector of any auth type — DCR's "Disconnect" only clears the OAuth token (row stays, auth_required forever), and header/no-auth connectors had no removal option at all. Wire deleteConnector in the harness adapter (already-optional on the ConnectorCatalogServer port) to the DELETE endpoint from truefoundry#495, and add a "Remove" button to each configured connector row — same pattern as the existing Remove buttons for skills (truefoundry#499) and model providers (truefoundry#501): single click, no confirmation dialog, gated on connectorCatalog.deleteConnector being present. Stacked on truefoundry#495 (needs its DELETE /api/v1/settings/mcp-servers/{name} to function) and includes a regenerated packages/trueforge-sdk so this branch actually builds and its tests actually run — that diff should collapse once truefoundry#495 merges and this rebases onto the post-merge main that already carries the CI-regenerated SDK. Fixes truefoundry#494 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MxyEPwQ73B27NTr83U69Ba
kristopolous
requested review from
bhaveshpatel640,
chiragjn,
debajyoti-truefoundry,
govindavashishtha,
heerambavi1998,
kumarsks619,
qaifi-tf,
sajal-truefoundry,
sayan-truefoundry,
sr07asthana,
thesujai and
vinit-truefoundry
as code owners
August 29, 2026 23:49
🦋 Changeset detectedLatest commit: 8f5487d The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #494. Depends on #495 — needs its
DELETE /api/v1/settings/mcp-servers/{name}to function. GitHub won't let a PR from a fork target another fork branch as base, so this is opened againstmaindirectly; please merge #495 first (this diff includes it, so it'll show as already-applied once #495 lands and this rebases).Settings → Connectors had no way to fully remove a configured connector of any auth type:
auth_requiredbadge forever.This PR wires
deleteConnector(already optional on theConnectorCatalogServerport, just unimplemented — comment inconnectorCatalog.tssaid "Delete omitted; disconnect unsupported") to the endpoint from #495, and adds a "Remove" button to every configured connector row.Same pattern as the Remove buttons already shipped for skills (#499) and model providers (#501): single click, no confirmation dialog, gated on
connectorCatalog.deleteConnectorbeing present so hosts that haven't wired it don't get a dead button.Why this branch includes an SDK regen
packages/trueforge-sdkdoesn't havesettings.mcpServers.delete(...)until #495 merges and CI regenerates it onmain. Since this PR's whole point is calling that method, I regenerated the SDK here so the branch actually builds and its tests actually run — same situation as #495/#499/#501 (Fern-generated in CI, fork PRs can't receive that regen commit). The ~450-file regen diff is not meant to be reviewed here; it should collapse to near-zero once this rebases onto a main that already has it (post-#495-merge).Test plan
ConnectorSettings.test.tsx: Remove is hidden when the host hasn't wireddeleteConnector; shown and calls it with the right id when the host has; doesn't bubble the click into opening the connector details view.pnpm vitest runinpackages/trueforge-ui— 868/868 pass.pnpm tsc --noEmit(src + test) — clean.pnpm eslinton changed files — clean.@truefoundry/trueforge-uipatch).deepwiki(no-auth) connector, clicked Remove, confirmed it moved back from "Configured" to "Available" — screenshots below (cropped to exclude the chat-history sidebar, which had real private session titles).Screenshots (local run against the real app)
1. Every configured connector now has a Remove button, regardless of auth type:

2. A throwaway no-auth connector added for the demo:

3. After clicking Remove — back in "Available", not "Configured":

(Screenshots hosted on an orphan
connector-remove-screenshotsbranch on my fork, not merged into this PR's diff.)🤖 Generated with Claude Code
https://claude.ai/code/session_01MxyEPwQ73B27NTr83U69Ba
Note
Medium Risk
Permanent deletion of MCP configuration and OAuth credentials from admin settings, with no confirmation UI—mitigated by settings-route admin auth and optional catalog wiring.
Overview
Adds
DELETE /api/v1/settings/mcp-servers/{name}so admins can permanently drop a configured MCP server; related OAuth tokens and pending authorizations are removed via DB cascade, and repeat deletes still return 200.Settings → Connectors gets a Remove control on every configured row (all auth types), gated on the host exposing optional
deleteConnector. The TrueFoundry adapter implements that port withsettings.mcpServers.delete, matching the existing skills/providers pattern (single click, no confirm dialog; click does not open connector details).Store
deleteServeris implemented for Postgres and SQLite; contract and API tests cover idempotency, tenant isolation, and token cleanup.Reviewed by Cursor Bugbot for commit 8f5487d. Bugbot is set up for automated code reviews on this repo. Configure here.