Skip to content

feat(connectors): add Remove button, wiring deleteConnector - #502

Open
kristopolous wants to merge 2 commits into
truefoundry:mainfrom
kristopolous:feat/connector-disconnect-ui
Open

feat(connectors): add Remove button, wiring deleteConnector#502
kristopolous wants to merge 2 commits into
truefoundry:mainfrom
kristopolous:feat/connector-disconnect-ui

Conversation

@kristopolous

@kristopolous kristopolous commented Aug 29, 2026

Copy link
Copy Markdown

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 against main directly; 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:

  • DCR connectors' "Disconnect" only clears the OAuth token — the row stays in "Configured" with an auth_required badge forever.
  • Header-auth and no-auth connectors had no removal option at all.

This PR wires deleteConnector (already optional on the ConnectorCatalogServer port, just unimplemented — comment in connectorCatalog.ts said "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.deleteConnector being present so hosts that haven't wired it don't get a dead button.

Why this branch includes an SDK regen

packages/trueforge-sdk doesn't have settings.mcpServers.delete(...) until #495 merges and CI regenerates it on main. 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

  • New tests in ConnectorSettings.test.tsx: Remove is hidden when the host hasn't wired deleteConnector; 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 run in packages/trueforge-ui — 868/868 pass.
  • pnpm tsc --noEmit (src + test) — clean.
  • pnpm eslint on changed files — clean.
  • Added a changeset (@truefoundry/trueforge-ui patch).
  • Verified against the real running app: added a throwaway 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:
Connectors list with Remove

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

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

(Screenshots hosted on an orphan connector-remove-screenshots branch 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 with settings.mcpServers.delete, matching the existing skills/providers pattern (single click, no confirm dialog; click does not open connector details).

Store deleteServer is 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.

kristopolous and others added 2 commits August 29, 2026 14:04
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
@changeset-bot

changeset-bot Bot commented Aug 29, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8f5487d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@truefoundry/trueforge-ui Patch
@truefoundry/trueforge Minor
frontend Patch

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No way to fully remove/delete a configured MCP connector

1 participant