Repository navigation
fix(auth): accept /mcp alias as OAuth audience - #6078
Conversation
|
Ready to review this PR? Stage has broken it down into 2 individual chapters for you:
Chapters generated by Stage for commit d30fb0b on Jul 31, 2026 10:00pm UTC. |
📝 WalkthroughWalkthroughOAuth audience validation now accepts the API ChangesOAuth MCP audience support
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/api/.vercel/project.json`:
- Around line 1-5: Remove the tracked .vercel/project.json and
.vercel/README.txt files from the PR, and preserve the existing ignore rule for
the .vercel directory so its project metadata remains uncommitted.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: b20db264-b479-4a30-9fa8-8ff3b3dd95b8
📒 Files selected for processing (4)
apps/api/.vercel/README.txtapps/api/.vercel/project.jsonpackages/auth/src/server.tspackages/mcp-v2/src/auth.ts
| { | ||
| "projectId": "prj_YPtna5dYgtR1iSaMhNawb6zs9TN6", | ||
| "orgId": "team_5CLWP9cJw0fMNffIbyM6EVwM", | ||
| "projectName": "api" | ||
| } |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
Do not commit .vercel project metadata.
apps/api/.vercel/README.txt states that .vercel should not be shared and should be ignored. This change commits projectId and orgId anyway. A checked-in project.json can cause Vercel commands from apps/api to target this linked project across all checkouts.
Remove both .vercel files from the PR and keep the directory ignored.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@apps/api/.vercel/project.json` around lines 1 - 5, Remove the tracked
.vercel/project.json and .vercel/README.txt files from the PR, and preserve the
existing ignore rule for the .vercel directory so its project metadata remains
uncommitted.
The /mcp alias serves the v2 MCP handler and is advertised in llms.txt, but was absent from both audience lists — a client that registered with the alias as its resource got working discovery and rejected tokens. Claude-Session: https://claude.ai/code/session_01Kub4p3Eim9pc1qaRRmGea2
6bb00c5 to
d30fb0b
Compare
🧹 Preview Cleanup CompleteThe following preview resources have been cleaned up:
Thank you for your contribution! 🎉 |
First step toward making
api.superset.sh/mcpthe canonical MCP URL (de-versioning the v2 path)./mcpre-exports the v2 MCP handler and marketingllms.txtalready advertises it as an alias — but it was missing fromvalidAudiences(token issuance) and from the mcp-v2 verifier's audience list. An OAuth client that used the alias as its RFC 8707 resource got working discovery, a successful consent flow, and then every token rejected.packages/auth: add${API_URL}/mcptovalidAudiencespackages/mcp-v2: add it to the verification audience listThe remaining canonical-URL flip (docs, .well-known, server card, openapi advertising
/mcpfirst;/api/v2/agent/mcpkept forever as legacy alias) rides with the A3 transport-hygiene PR. Both URLs become declared OAuth resources in the B2 protected-resources migration, which removes these duplicated lists entirely.Note: may need a trivial conflict resolution with #6077, which removes the adjacent v1 audience line.
Verify: OAuth flow with resource
https://api.superset.sh/mcpissues tokens that pass tool calls on both URLs.https://claude.ai/code/session_01Kub4p3Eim9pc1qaRRmGea2
Summary by cubic
Accept
/mcpas a valid OAuth audience so clients using the alias get tokens that verify with the v2 MCP handler. Adds${API_URL}/mcpto both issuance and verification audience lists.packages/auth: add${API_URL}/mcptovalidAudiences.packages/mcp-v2: add${API_URL}/mcpto JWT verification audiences.Written for commit d30fb0b. Summary will update on new commits.
Summary by CodeRabbit