Skip to content

[ENG-3258] feat: add providerWorkspaceRef support for multi-workspace providers#85

Merged
dionlow merged 2 commits into
mainfrom
dl-mcp-workspace-feature
Jan 27, 2026
Merged

[ENG-3258] feat: add providerWorkspaceRef support for multi-workspace providers#85
dionlow merged 2 commits into
mainfrom
dl-mcp-workspace-feature

Conversation

@dionlow

@dionlow dionlow commented Jan 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add providerWorkspaceRef support to OAuth flow for multi-workspace providers
  • Implement consistent fallback order prioritizing settings over parameters
  • Add optional workspace reference parameter to MCP tools

Details

Multi-Workspace Provider Support

Some SaaS providers (e.g., Slack, Microsoft Teams) support multiple workspaces per user account. This PR adds support for specifying which workspace to connect to during OAuth:

  • New parameter: providerWorkspaceRef (optional) added to start-oauth tool
  • Settings support: Added to ClientSettings type for configuration
  • Conditional inclusion: Only included in OAuth request when provided

Fallback Order Consistency

Implements a consistent fallback order across both SDK and mcp-server:

// Settings take precedence over parameters
const finalProviderWorkspaceRef = 
  settings?.providerWorkspaceRef || providerWorkspaceRef;

This ensures that:

  1. Configuration settings are always prioritized
  2. Tool parameters serve as runtime overrides when settings are not provided
  3. Behavior is consistent with other configuration values (groupRef, projectId, etc.)

API Changes

MCP Server (mcp-server/src/oauth.ts)

  • Added providerWorkspaceRef parameter to start-oauth tool
  • Implements fallback logic for workspace reference

SDK (sdk/lib/adapters/mcp.ts)

  • Added providerWorkspaceRef?: string to ClientSettings type
  • Updated createStartOAuthTool to handle workspace references
  • Conditionally includes workspace ref in OAuth API requests

Test plan

  • Test OAuth flow without providerWorkspaceRef (existing behavior)
  • Test OAuth flow with providerWorkspaceRef parameter
  • Test OAuth flow with providerWorkspaceRef in settings
  • Verify settings take precedence over parameters
  • Test with multi-workspace providers (e.g., Slack)

🤖 Generated with Claude Code

Dion Low and others added 2 commits January 27, 2026 15:18
Add optional providerWorkspaceRef parameter to OAuth tools to support
multi-workspace providers. This parameter is conditionally included in
the OAuth connect request when provided.

Changes:
- Add providerWorkspaceRef to ClientSettings type in both mcp-server and sdk
- Update createStartOAuthTool to accept optional providerWorkspaceRef parameter
- Include providerWorkspaceRef in OAuth API request when provided
- Maintain backward compatibility (parameter is optional)

This enables OAuth flows for providers that support multiple workspaces
(e.g., Slack, Microsoft Teams) where users need to specify which workspace
to connect to.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Fix fallback order to prioritize settings.providerWorkspaceRef over param
- Make providerWorkspaceRef optional in ClientSettings
- Add conditional inclusion of providerWorkspaceRef in OAuth request

This ensures consistency with SDK behavior where settings take precedence.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@dionlow dionlow changed the title feat: add providerWorkspaceRef support for multi-workspace providers [ENG-3258] feat: add providerWorkspaceRef support for multi-workspace providers Jan 27, 2026
@linear

linear Bot commented Jan 27, 2026

Copy link
Copy Markdown

@abx42 abx42 self-requested a review January 27, 2026 23:25
@dionlow

dionlow commented Jan 27, 2026

Copy link
Copy Markdown
Contributor Author

split this branch from the logger one that was reverted. merging to test build

@dionlow dionlow merged commit 19e82e7 into main Jan 27, 2026
1 check passed
@dionlow dionlow deleted the dl-mcp-workspace-feature branch January 27, 2026 23:26
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.

2 participants