Uh oh!
There was an error while loading. Please reload this page.
Make Kernel own MCP OAuth credentials - #164
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 8cdfc7e. Configure here.
| : {}), | ||
| authorizationContext: persistedAuthorizationContext, | ||
| jwtTtlSeconds: clerkTokens.expires_in, | ||
| resource, |
There was a problem hiding this comment.
Refresh widens resource audience
Medium Severity
Authorization-code exchange enforces the PKCE-bound resource, but refresh never restores or checks that binding. Refresh mappings store only the org/project context, while each refresh takes resource from the current request and defaults omitted values to the origin. Origin-bound tokens are accepted on every path, so a refresh of a /mcp-scoped grant can mint a broader credential.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 8cdfc7e. Configure here.


Summary
issvalueauth.onkernel.comCLI token flow unchangedValidation
bun test(277 tests)Note
High Risk
This rewires the public OAuth token boundary, Redis-backed credential storage, and MCP authentication. Mistakes here can leak Clerk tokens, break existing clients, or weaken redirect/resource binding.
Overview
MCP OAuth now terminates at Kernel: clients receive opaque
kmcp_at_/kmcp_rt_tokens bound to an RFC 8707 resource, while Clerk JWTs and refresh tokens stay encrypted server-side and are never returned as MCP credentials.Authorization is proxied through
/oauth/callbackso the publicissmatches the Kernel issuer (RFC 9207). Dynamic registration advertises themcpscope, stores client redirect URIs, and lazily migrates existing Clerk apps onto the proxy callback. Token and MCP handlers validate resource, registered redirects, and presented Kernel tokens (with JWT/API-key fallback). Theauth.onkernel.comCLI flow still returns Clerk credentials unchanged.Reviewed by Cursor Bugbot for commit 8cdfc7e. Bugbot is set up for automated code reviews on this repo. Configure here.