Skip to content

feat(mcp): personal API key for clients without OAuth login - #94

Merged
buzz-code merged 1 commit into
mainfrom
claude/mcp-api-key
Nov 5, 2026
Merged

buzz-code merged 1 commit into
mainfrom
claude/mcp-api-key

Conversation

@buzz-code

Copy link
Copy Markdown
Owner

Requested by הדסה · project thread

Some MCP clients, for example Antigravity, can't complete the OAuth login for remote servers. They only send a fixed Authorization header.

  • POST /mcp/oauth/api-key requires the site login (JwtAuthGuard) and refuses admins and impersonated sessions. It returns { apiKey }.
  • The key is an MCP access token with clientId: 'api-key', valid for 365 days. verifyAccessToken accepts it unchanged.
  • Revocation works like other MCP tokens. "Disconnect all" bumps mcpTokenVersion, which invalidates the key. A user who later becomes an admin also loses it.
  • There is no per-key listing or revocation. Revoking is all or nothing, the same as other MCP tokens.

Tests: a new case covers that the key runs tools as the user, admins get no key, and disconnect revokes it. jest shared/mcp passes (19 tests), and tsc is clean when run from dnd-management-nra.

Fixes buzz-code/ops#48


Generated by Claude Code

POST /mcp/oauth/api-key (site login, not admin or impersonated) returns a
year-long access token to send as Authorization: Bearer. Disconnect-all
revokes it like every other MCP token.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012GTicqnHNZPYxcmrvzQsZs
@buzz-code buzz-code self-assigned this Nov 5, 2026
@buzz-code
buzz-code merged commit 6caf841 into main Nov 5, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants