You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.
Releases
@clerk/mcp-tools@0.9.0
Minor Changes
4b0a634: Add @clerk/mcp-tools/create-browser-session, whose createBrowserSessionTool gives agents a one-time link that opens your app signed in as the user. The tool sets the scopeChallenge registration option of MCP SDK 2.1 or later, so on those versions a token without its requiredScopes gets 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.
isClerkAuthInfo from @clerk/mcp-tools/server is now a type guard for the new exported ClerkAuthInfo type, and it also requires a non-empty extra.userId.
submitFeedbackTool now also checks that fetch is a function when it is created, so a bad value fails at startup instead of on the first call. submitFeedback now checks that fetch is a function too, and its apiUrl error text now reads Clerk error: submitFeedback apiUrl must use HTTPS or loopback HTTP.
submitFeedback now throws a Clerk error: message for a blank secretKey before it sends a request, as submitFeedbackTool already did. verifyClerkToken now returns the ClerkAuthInfo type.
createBrowserSessionTool and createBrowserSession take a new restricted option, true by 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 new restricted_not_applied. When Clerk does not confirm it, the tool also revokes the new session link on a best-effort basis. Pass restricted: false for 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/server to 2.1 or later.
createBrowserSession takes a new optional organizationId in its request, which sets the organization the session starts in. With restricted, 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 is restricted_not_applied. When the user does not belong to the organization, or the instance requires one and none applies, the error code is the new organization_rejected.
30ab894: @clerk/mcp-tools/server and @clerk/mcp-tools/next now export requireAdditionalScopes. It builds the scopeChallenge registration 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.
No actionable comments were generated in the recent review.
Walkthrough
The package version changes from 0.8.0 to 0.9.0. The changelog adds a 0.9.0 entry describing browser-session, auth-info, feedback-validation, and scope-challenge changes. Two changesets are removed.
clerk/mcp-tools#43: Adds the browser-session tool and the auth-info and feedback-validation changes documented in this release.
clerk/mcp-tools#46: Adds the SDK 2.1+ scope-challenge helper documented in this release.
clerk/mcp-tools#44: Adds request-level missing-scope challenges related to the scope-challenge changes documented in this release.
Suggested reviewers:zertsov
Merge Risk: Minimal · up to b2795
The release metadata is ready to merge based on the available evidence.
Pre-merge checks: 5
Check name
Status
Explanation
Title check
The title describes the package version update.
Description check
The description identifies the 0.9.0 release and its changelog entries.
Docstring Coverage
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage
Explanation
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Warning
Linked repositories: Some configured repositories could not be included in this review. Cross-repository analysis may be incomplete. Please check linked-repository access and settings.
Recent review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: ASSERTIVE
Plan: Advanced
Run ID: 014d4b5e-176b-41f6-893b-290194935818
Commits
Reviewing files that changed from the base of the PR and between fad967b and b2795b6.
Files selected for processing: 2
.changeset/quiet-links-open.md
CHANGELOG.md
Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
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
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.
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.
Releases
@clerk/mcp-tools@0.9.0
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.