Repository navigation
List a connection's keys and revoke one without revoking the connection - #53
Merged
Merged
Conversation
Operators rotating a seat's 90-day connection key had no way to retire the old key short of revoking the whole connection, which also killed the current key and burned the connection id. GET .../mcp-connections/<id>/keys lists a connection's keys (id, name, first characters, created, expiry, last use; never the secret) and POST .../mcp-connections/<id>/keys/<key>/revoke deletes one. Both run through new server-only auth endpoints that, like minting, act only on the caller's own standing connection and report any other as ConnectionNotFound; a key that is not bound to that connection is ConnectionKeyNotFound. Admin API credentials follow the mint rules, and every revocation logs an mcp-connection-key audit line. Bearer checks read the key row on every request, so the deleted key is refused at once while the connection and its other keys keep working. The connection's dashboard page lists its keys with a per-key Revoke and a confirm dialog; minting refreshes the list. connection-keys.spec gains connectionKeyRevoke: two keys listed without secrets, admin and org owner get 404 listing/revoking, the key itself is refused by the API, revoking through another connection is ConnectionKeyNotFound, the revoked key gets 401 at the connection URL while the other works and the connection stays, the audit line, and a dashboard revoke.
This was referenced Oct 23, 2026
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.
Post-cutover backlog, item (d): list a connection's keys and revoke one, without revoking the connection.
Rotating a 90-day seat key on the connection page meant revoking the whole connection. That killed the seat's current key too, and today it also burns the connection ID (see the separate ID-reuse fix). The account-wide Tokens page already lists connection keys with their own Revoke button. This PR puts the same control where operators manage the connection.
API (hosted)
GET /api/organizations/:org/mcp-connections/:connection/keysreturns, newest first, each key'sid,name,start(its first characters),createdAt,expiresAtandlastRequest. It never returns key material.POST /api/organizations/:org/mcp-connections/:connection/keys/:key/revokedeletes that one key.ConnectionNotFound. A key that isn't bound to that connection returns 404ConnectionKeyNotFound, which is new.UI
The connection page gets a Connection keys section showing each key's name, first characters, created, expires and last used, with a per-key Revoke and a confirm dialog. Creating a key refreshes the list.
Tests
New
connectionKeyRevokescenario inconnection-keys.spec.ts:With the server-side delete removed, the scenario fails as it should. On self-host, the 9 related scenarios pass (connection-keys, connection-api-keys, mcp-connections), and
bun run checkpasses.