Disconnect MCP and rotate its credential

Revoke an MCP OAuth grant from Connected AI apps, allow its brief validation-cache window to close, then reconnect with a fresh grant safely.

Last reviewed

An MCP connection is an OAuth grant, not an API key. Removing a local client entry does not revoke Dosya access; use Connected AI apps to invalidate the server-side grant, then reconnect if the integration must continue.

Four panels show locating the exact Connected AI apps row, disconnecting its OAuth grant, waiting for the validation cache, and reconnecting with fresh consent.
Four panels show locating the exact Connected AI apps row, disconnecting its OAuth grant, waiting for the validation cache, and reconnecting with fresh consent. Open full-size screenshot.

Steps

  1. Open Settings → Connected AI apps in an interactive browser session. API keys and connected AI apps cannot list or manage these grants on your behalf.
  2. Match the row by client name, workspace name, connection age, and scope chips such as Read files or Plan and storage. Each row represents one grant pinned to one workspace.
  3. Stop current work in that AI client, then select Disconnect on the exact row. Dosya revokes the grant and reports App disconnected with _client_ can no longer read _workspace_.
  4. Allow up to 60 seconds before testing the retired token. A worker that validated it recently may serve that cached validation until the one-minute entry expires; after that, a tool call returns This connection is not authenticated. Sign in to dosya again to reconnect.
  5. If continued access is required, start a new connection from the MCP client using https://mcp.dosya.dev/mcp. Choose the intended workspace and optional account scope again; there is no in-place rotate operation.
  6. Run list_workspaces through the new connection, then retry the old one after the cache window. The new grant should list its selected workspace while the revoked grant remains unauthenticated.

Disconnect is reversible only by creating fresh consent. It does not delete files or change unrelated API keys, but the old OAuth grant itself cannot be restored.

Reference for “Disconnect MCP and rotate its credential”: Dosya REST API overview page with Get API Key and View SDKs links.
Reference for “Disconnect MCP and rotate its credential”: Dosya REST API overview page with Get API Key and View SDKs links. Open full-size screenshot.

Expected result

The selected grant disappears from Connected AI apps and stops authorizing MCP calls no later than the validation-cache window. A replacement connection has a distinct grant with newly chosen workspace and scopes.

Disconnect failed means Dosya could not revoke the grant at that moment. Leave the client stopped, reload Connected AI apps, and retry only while the row is still present.

The old client works briefly. Wait the full 60 seconds before treating that as a failed revocation; the implementation deliberately caches successful token validation for one minute.

Was this helpful?

Loading helpfulness results…

Voting saves a necessary ballot cookie for up to 180 days so you can change your answer.

Questions and replies

Ask about the steps in this guide. Questions are reviewed before publication.

Keep account details, credentials and private files out of public questions. Use private support for those.

Loading questions…

    Sign in to your Dosya account to ask a question.

    Check the outcome before you retry

    Use these shared checks when a task needs a second look.