Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Comment |
🦋 Changeset detectedLatest commit: a2f9837 The changes in this PR will be included in the next version bump. This PR includes changesets to release 0 packagesWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/electron
@clerk/electron-passkeys
@clerk/eslint-plugin
@clerk/expo
@clerk/expo-google-signin
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/hono
@clerk/localizations
@clerk/mcp-tools
@clerk/mosaic
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
Package manifest, build, test and TypeScript configuration. The package is listed in the changeset ignore list, so nothing publishes yet. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Reads the tools/call messages of a request through the SDK's classifyInboundRequest, resolves per-tool scopes from a Map, and orders scopes by the configured catalog. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
An MCP SDK token verifier backed by @clerk/backend. It reports the token's single audience as AuthInfo.resource and enforces its own resource option. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ation server metadata RFC 9728 document with only the fields the RFC defines. The RFC 8414 document is relayed from the authorization server and cached, so it cannot drift from the instance's settings. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Cached per subject, resource and scope set, with a scope-escalation check and stable error codes. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The 401 and 403 challenges, audience binding, the per-tool scope gate, withScopes(), mcpHandler() and exchangeToken(). Keys and credentials are read on first use. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Each returns the same object with handlers in the framework's shape. mcpHandler() authorizes in every binding, and the Express binding parses JSON itself so the scope gate always sees the body. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Usage per runtime, how requests are authorized, troubleshooting, and the migration table. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
a394e4f to
af7fec9
Compare
…en endpoint errors Clerk matches the token exchange resource against the registered URI exactly, so serializing a bare origin added a trailing slash that failed with invalid_target. Error messages now name the OAuth error, and a 401 from the token endpoint maps to configuration.
|
Hello 👋 We currently close PRs after 60 days of inactivity. It's been 50 days since the last update here. If we missed this PR, please reply here. Otherwise, we'll close this PR in 10 days. Thanks for being a part of the Clerk community! 🙏 |
Description
Adds
@clerk/mcp-toolsto the monorepo as a rewrite around the MCP TypeScript SDK v2 (@modelcontextprotocol/server), replacing the standalone clerk/mcp-tools package and the resource-server code the Clerk remote MCP worker hand-rolls today.createClerkMcpAuth()is the single entry point. Framework subpaths (/hono,/express,/next) return the same object with handlers in that framework's shape; the root export is the plainfetchbinding for Cloudflare Workers, Deno and Bun.401withresource_metadataand a catalog-orderedscopelist of the baseline plus the requested tools' scopes, and403 insufficient_scopefor step-up, or a tool error withinsufficientScope: 'tool-error'. Tool calls are read from the body via the SDK'sclassifyInboundRequest, so routing headers cannot bypass the check.@clerk/backend'sverifyMachineAuthToken. Tokens must be issued forresource, which can be a function of the request. Opaque tokens bind through theaudthat@clerk/backendreports since fix(backend)!: require matching OAuth token audiences #9724; with an older@clerk/backendthey need JWT access tokens.mcpHandler()authorizes every request in every binding, then dispatches to a fresh server.withScopes()checks again at call time and records telemetry.baselineScopes, and a relay of the authorization server's RFC 8414 document for clients that look for it on the MCP server's origin.exchangeToken(): an RFC 8693 client cached per subject, resource and scope set, with a scope-escalation check and stableClerkMcpErrorcodes. A stringresourceis sent as written, because Clerk matches it exactly against the registered URI. Errors name the token endpoint's OAuth error, and invalid client credentials fail withconfiguration.Review by commit: one per module, then a fix that aligns the exchange client with Clerk's token endpoint. Each typechecks and passes its tests.
Out of scope: the MCP client helpers and stores, migrating the remote MCP worker (demo in clerk/cloudflare-workers#2811), and resource registration in Clerk, which happens through the Dashboard API (clerk/clerk_go#22308).
Release notes: the package is listed in
.changeset/config.jsonignore, following the@clerk/honoprecedent, so nothing publishes until the standalone repo's publish workflow is retired. The version base is the published 0.6.0.Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change
🤖 Generated with Claude Code