Repository navigation
Minor Changes
-
4b0a634: Add
@clerk/mcp-tools/create-browser-session, whosecreateBrowserSessionToolgives agents a one-time link that opens your app signed in as the user. The tool sets thescopeChallengeregistration option of MCP SDK 2.1 or later, so on those versions a token without itsrequiredScopesgets the step-up challenge. On earlier SDK versions the tool still works, and an under-scoped token gets the tool's own missing-scope error.isClerkAuthInfofrom@clerk/mcp-tools/serveris now a type guard for the new exportedClerkAuthInfotype, and it also requires a non-emptyextra.userId.submitFeedbackToolnow also checks thatfetchis a function when it is created, so a bad value fails at startup instead of on the first call.submitFeedbacknow checks thatfetchis a function too, and itsapiUrlerror text now readsClerk error: submitFeedback apiUrl must use HTTPS or loopback HTTP.submitFeedbacknow throws aClerk error:message for a blanksecretKeybefore it sends a request, assubmitFeedbackToolalready did.verifyClerkTokennow returns theClerkAuthInfotype.createBrowserSessionToolandcreateBrowserSessiontake a newrestrictedoption,trueby default, that limits the session the link starts. Clerk's Frontend API refuses these writes from that session: touch, switching the active session or organization, sign-out, writes to the user's own profile and organizations, reverification, and OAuth consent and approval. The one exception is refreshing its own session token. Your app's own backend still sees an ordinary signed-in session. Clerk must confirm the restriction in its response: otherwise no link is returned and the error code is the newrestricted_not_applied. When Clerk does not confirm it, the tool also revokes the new session link on a best-effort basis. Passrestricted: falsefor an ordinary session.On MCP SDK 2.0, where a missing scope reaches the tool instead of the step-up challenge, the tool now logs one
Clerk warning:per process that says to upgrade@modelcontextprotocol/serverto 2.1 or later.createBrowserSessiontakes a new optionalorganizationIdin its request, which sets the organization the session starts in. Withrestricted, it is also the only organization the session can use. When it is set, Clerk must confirm that organization in its response: otherwise no link is returned, the new session link is revoked on a best-effort basis, and the error code isrestricted_not_applied. When the user does not belong to the organization, or the instance requires one and none applies, the error code is the neworganization_rejected. -
30ab894:
@clerk/mcp-tools/serverand@clerk/mcp-tools/nextnow exportrequireAdditionalScopes. It builds thescopeChallengeregistration option of MCP SDK 2.1 or later from the scopes a tool needs, passed as separate arguments (requireAdditionalScopes('projects:read', 'projects:write')), so any tool can send the step-up challenge.