Skip to content

MCP: revoke backend access when a trusted server is removed/disabled #4064

Description

@aterga

Context

Follow-up from PR #4052 (per-user trusted MCP server, synced config) and a Copilot review note.

The gap

Removing the trusted MCP server, or turning off the master toggle, in Settings → Trusted MCP server only updates the per-identity config (now stored as synced identity_metadata). It does not revoke the backend authorization established at connect time by mcp_set_access(origin, account, true).

Consequence: a previously-connected MCP server keeps its principal -> anchor binding in the reverse index, so as long as it still holds a valid standing delegation (the user-chosen TTL, up to 30 days) it can keep calling mcp_prepare_account_delegation / mcp_get_account_delegation to mint per-app delegations — even after the user "removes" the server or disables MCP in Settings.

This is pre-existing behaviour (the earlier device-local/localStorage version didn't revoke either); the trusted-server config has always been a pre-gate for new connects, not a kill switch for existing access. PR #4052 keeps that semantics and defers the kill-switch to this issue.

Proposed work

  • On remove (and on disabling the master toggle), revoke the backend binding(s): enumerate the identity's accounts at that origin (get_accounts) plus the default, and call mcp_set_access(origin, account, false) for each, so mcp_prepare/get_account_delegation calls from that server start failing immediately.
  • Consider a dedicated "connected MCP servers / active access" management surface so users can see and revoke active connections independently of the trusted-server allowlist.

Notes

  • Even without explicit revocation, access ends when the standing delegation expires (≤ 30 days).
  • The account number used at connect isn't currently tracked in the trusted-server config, hence the get_accounts enumeration in the proposed FE fix.

🤖 Generated with Claude Code

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions