Add a cleanup path for defunct native-MCP connections#128
Merged
Conversation
A native connection to a provider that left the catalog (e.g. the old `tembo` self-key connection after the `tembo-agent-studio` rename) lingers as an orphaned row: it doesn't render on the Connections page, can't be disconnected, keeps a minted tas_ key alive, and (before #126) leaked into CAP's prompt. - The Connections → Native MCP page now shows a "removed provider" banner with a one-click Remove when you hold such connections; removeDefunctNativeConnectionsAction deletes the rows, revokes any self-key key, and drops their cached tools. - Generalized the disconnect key-revocation to fire on any self-key connection (metadata.api_key_id present) instead of matching the current slug, so a renamed provider's leftover key is revoked too. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Follow-up to #126. The orphaned
temboself-key connection (left by thetembo→tembo-agent-studiorename) can't be removed from the UI — it doesn't render as a card (no catalog provider), so it lingers with a still-valid mintedtas_key.removeDefunctNativeConnectionsActiondeletes the rows, revokes any self-keytas_key, drops their cached tools, and audits each.metadata.api_key_id(only self-key connections do) instead of matchingtype === "tembo-agent-studio"— so a renamed provider's leftover key is revoked on disconnect/cleanup too.Scoped to your own connections (the action clears the acting user's rows, so the banner is hidden when an admin is viewing another member).
tsc/ eslint /next buildclean.🤖 Generated with Claude Code