Skip to content

Add OAuth team selection for multi-team accounts (MCP)#10

Merged
rajat1saxena merged 1 commit into
mainfrom
worktree-mcp-team-select
Jul 17, 2026
Merged

Add OAuth team selection for multi-team accounts (MCP)#10
rajat1saxena merged 1 commit into
mainfrom
worktree-mcp-team-select

Conversation

@rajat1saxena

Copy link
Copy Markdown
Member

Multi-team accounts connecting an OAuth/MCP client (e.g. Claude) had no way to specify a team: the only mechanism was the X-Sendlit-Team-Id header, which generic OAuth clients never send, so every /mcp call hit require-team.ts's 409 team_required response right after authorizing.

Adds a "select a team" step to the OAuth flow via oauth-provider's postLogin hook, shown only for multi-team accounts (mirrors Notion's workspace picker) — the choice is threaded through as the OAuth referenceId and lands on the minted access token as a team_id claim, which resolve-auth.ts now re-validates as live membership before trusting. Single-team accounts are unaffected.

Multi-team accounts connecting an OAuth/MCP client (e.g. Claude) had no
way to specify a team: the only mechanism was the X-Sendlit-Team-Id
header, which generic OAuth clients never send, so every /mcp call hit
require-team.ts's 409 team_required response right after authorizing.

Adds a "select a team" step to the OAuth flow via oauth-provider's
postLogin hook, shown only for multi-team accounts (mirrors Notion's
workspace picker) — the choice is threaded through as the OAuth
referenceId and lands on the minted access token as a team_id claim,
which resolve-auth.ts now re-validates as live membership before
trusting. Single-team accounts are unaffected.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@rajat1saxena
rajat1saxena merged commit c985190 into main Jul 17, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant