🌐 US-Proxy
class="logged-out env-production page-responsive" style="word-wrap: break-word;" >
Skip to content

feat: add UI option to disconnect OAuth2 MCP credentials - #27299

Merged
ibetitsmike merged 2 commits into
mainfrom
mike/codagt-804-mcp-oauth-disconnect-ui
Jul 16, 2026
Merged

feat: add UI option to disconnect OAuth2 MCP credentials#27299
ibetitsmike merged 2 commits into
mainfrom
mike/codagt-804-mcp-oauth-disconnect-ui

Conversation

@ibetitsmike

Copy link
Copy Markdown
Collaborator

Closes CODAGT-804.

Users could authenticate with an OAuth2 MCP server from the chat input, but there was no UI to disconnect those per-user credentials. The backend endpoint (DELETE /api/experimental/mcp/servers/{id}/oauth2/disconnect) already existed.

Changes

  • Connected OAuth2 MCP rows in the chat input plus menu now show a disconnect icon button next to the enable switch. It opens a confirmation dialog; confirming calls the disconnect endpoint, shows a toast, and refetches MCP configs so the row reverts to the Auth button without a reload.
  • New disconnectMCPServerOAuth2 API client method and react-query mutation that invalidates mcp-server-configs.
  • Storybook interaction tests: control visibility per auth state, cancel makes no API call, confirm calls the endpoint once, failed disconnect keeps the dialog open.
  • Hardened TestMCPServerConfigsOAuth2Disconnect: seeded tokens flip auth_connected, disconnect only removes the calling user's token, and repeat disconnect stays idempotent.

The endpoint removes the token stored in Coder; it does not revoke the upstream OAuth grant, so the UI copy says "disconnect" rather than "revoke".

Validated with the targeted Go test, Storybook tests (51 passed), tsc, biome, the react-compiler check, and a manual dogfood run (seeded token, disconnect/cancel/reconnect flows verified in the UI).

This PR was authored by Mux, an AI coding agent, on Mike's behalf.

@linear-code

linear-code Bot commented Jul 16, 2026

Copy link
Copy Markdown

CODAGT-804

@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@ibetitsmike ibetitsmike changed the title feat(site): add UI option to disconnect OAuth2 MCP credentials feat: add UI option to disconnect OAuth2 MCP credentials Jul 16, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: 9232e5b03a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ibetitsmike
ibetitsmike marked this pull request as ready for review July 16, 2026 16:13
@ibetitsmike
ibetitsmike merged commit 3dd9265 into main Jul 16, 2026
58 of 60 checks passed
@ibetitsmike
ibetitsmike deleted the mike/codagt-804-mcp-oauth-disconnect-ui branch July 16, 2026 16:26
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants