Add oauth section to mcp.json to allow overriding of client id#308648
Merged
TylerLeonhardt merged 2 commits intomainfrom Apr 9, 2026
Merged
Add oauth section to mcp.json to allow overriding of client id#308648TylerLeonhardt merged 2 commits intomainfrom
oauth section to mcp.json to allow overriding of client id#308648TylerLeonhardt merged 2 commits intomainfrom
Conversation
More properties (like client secret) can come later... but this is the foundation, which is a lot of plumbing... ref #257415
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an oauth block to MCP HTTP server configuration to enable overriding the OAuth client ID used during authentication, plumbing that override through the MCP launch model into dynamic authentication provider/session acquisition.
Changes:
- Extend
mcp.jsonHTTP server schema and MCP launch/types to carry optionaloauth.clientId. - Thread
clientIdthrough MCP auth token acquisition into the authentication service’s dynamic provider creation and session lookups. - Teach
microsoft-authentication(MSAL) provider to honor an explicitclientIdoverride viaScopeData.
Show a summary per file
| File | Description |
|---|---|
| src/vscode-dts/vscode.proposed.authIssuers.d.ts | Adds clientId?: string to proposed auth-issuer session option shapes. |
| src/vs/workbench/services/authentication/common/authentication.ts | Extends dynamic auth provider creation APIs to accept optional clientId. |
| src/vs/workbench/services/authentication/browser/authenticationService.ts | Forwards optional clientId into the host delegate’s dynamic provider creation. |
| src/vs/workbench/contrib/mcp/common/mcpTypes.ts | Adds oauth to HTTP launch types and serialization. |
| src/vs/workbench/contrib/mcp/common/mcpConfiguration.ts | Adds oauth section to the mcp.json schema for HTTP servers. |
| src/vs/workbench/contrib/mcp/common/discovery/pluginMcpDiscovery.ts | Maps discovered plugin MCP HTTP configs to include oauth. |
| src/vs/workbench/contrib/mcp/common/discovery/installedMcpServersDiscovery.ts | Maps installed MCP HTTP configs to include oauth. |
| src/vs/workbench/api/common/extHostMcp.ts | Passes configured oauth.clientId into MCP auth token requests. |
| src/vs/workbench/api/common/extHost.protocol.ts | Extends MCP auth RPC option/details types with optional clientId. |
| src/vs/workbench/api/browser/mainThreadMcp.ts | Forwards clientId into auth session retrieval and dynamic provider creation. |
| src/vs/workbench/api/browser/mainThreadAuthentication.ts | Allows overriding clientId during dynamic auth provider registration (skips stored secret). |
| src/vs/platform/mcp/common/mcpPlatformTypes.ts | Adds oauth to remote MCP server configuration types. |
| extensions/microsoft-authentication/src/node/authProvider.ts | Threads clientId option into ScopeData for MSAL flows. |
| extensions/microsoft-authentication/src/common/scopeData.ts | Adds constructor support for explicit clientId override. |
Copilot's findings
- Files reviewed: 13/14 changed files
- Comments generated: 5
dmitrivMS
approved these changes
Apr 9, 2026
joshspicer
pushed a commit
that referenced
this pull request
Apr 9, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
More properties (like client secret) can come later... but this is the foundation, which is a lot of plumbing...
ref #257415
So an MCP Config now can have:
aligns with what Claude Code does: https://code.claude.com/docs/en/mcp#claude-mcp-add-json