Skip to content

feat(mcp): support bot-signed jwt-bearer auth for MCP plugins - #1767

Open
mchen-sentry wants to merge 1 commit into
mainfrom
gocd-mcp-jwt-bearer-auth
Open

feat(mcp): support bot-signed jwt-bearer auth for MCP plugins#1767
mchen-sentry wants to merge 1 commit into
mainfrom
gocd-mcp-jwt-bearer-auth

Conversation

@mchen-sentry

@mchen-sentry mchen-sentry commented Sep 2, 2026

Copy link
Copy Markdown
Member

Junior can only authenticate to an MCP server with static headers or per-actor OAuth, but gocd-mcp now accepts short-lived signed JWTs from bots instead of a shared API key (server half in https://github.com/getsentry/gocd-mcp/pull/5).

Let's add an optional mcp.auth block to plugin manifests: when set, the MCP client signs a 5-minute jwt-bearer assertion with a private key from an env var and the SDK exchanges it for an access token, re-minting on the next 401. Without the block, behavior is unchanged.

We use the SDK's prepareTokenRequest hook instead of its built-in PrivateKeyJwtProvider, since that one sends the client_credentials grant and python MCP servers don't accept it yet.

Tested the assertion shape against the deployed gocd-mcp server.

@vercel

vercel Bot commented Sep 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
junior-docs Ready Ready Preview Sep 10, 2026 9:21pm UTC

Request Review

Comment thread packages/junior/src/chat/plugins/types.ts Outdated
@mchen-sentry mchen-sentry reopened this Sep 10, 2026
@mchen-sentry
mchen-sentry force-pushed the gocd-mcp-jwt-bearer-auth branch from 84dcdb5 to 0c06ebf Compare September 10, 2026 20:12
@mchen-sentry
mchen-sentry marked this pull request as ready for review September 10, 2026 20:30
@github-actions github-actions Bot added the risk: high PR risk score: high label Sep 10, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread packages/junior/src/chat/mcp/jwt-bearer-provider.ts Outdated
Comment thread packages/junior-plugin-api/src/manifest.ts

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread packages/junior/src/chat/services/mcp-auth-orchestration.ts
Comment thread packages/junior/src/chat/mcp/jwt-bearer-provider.ts
@mchen-sentry
mchen-sentry force-pushed the gocd-mcp-jwt-bearer-auth branch from 20b3e85 to e6590d4 Compare September 10, 2026 21:20

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit ebd54f7. Configure here.

Comment thread packages/junior/src/chat/mcp/jwt-bearer-provider.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: high PR risk score: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant