Skip to content

Commit 3255b72

Browse files
authored
docs: add mcp fallback auth flow with client credentials (#8689)
* docs: add mcp fallback auth flow with client credentials * fix: update PR comment * fix: pr feedback
1 parent 56762c7 commit 3255b72

File tree

4 files changed

+29
-3
lines changed

4 files changed

+29
-3
lines changed

api/extension-guides/ai/mcp.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,15 +170,32 @@ When you include a resource type in the prompt response, VS Code attaches that r
170170

171171
VS Code supports MCP servers that require authentication, allowing users to interact with an MCP server that operates on behalf of their user account for that service.
172172

173-
The [authorization specification](https://modelcontextprotocol.io/specification/2025-06-18/basic/authorization) cleanly separates MCP servers as Resource Servers from Authorization Servers, allowing developers to delegate authentication to existing identity providers rather than building their own OAuth implementations from scratch.
173+
The [authorization specification](https://modelcontextprotocol.io/specification/2025-06-18/basic/authorization) cleanly separates MCP servers as Resource Servers from Authorization Servers, allowing developers to delegate authentication to existing identity providers (IdPs) rather than building their own OAuth implementations from scratch.
174174

175175
VS Code has built-in authentication support for GitHub and Microsoft Entra. If your MCP server implements the latest specification and uses GitHub or Microsoft Entra as the authorization server, users can manage which MCP servers have access to their account through the **Accounts menu** > **Manage Trusted MCP Servers** action for that account.
176176

177177
![Screenshot that shows the Accounts menu with the Manage Trusted MCP Servers action.](../images/ai/mcp/manage-trusted-mcp.png)
178178

179-
If your MCP server uses a different authorization server, VS Code also supports [Dynamic Client Registration](https://modelcontextprotocol.io/specification/2025-06-18/basic/authorization#dynamic-client-registration). Users can then view their authentication status also through the **Accounts menu**. To remove dynamic client registrations, users can use the **Authentication: Remove Dynamic Authentication Providers** command in the Command Palette.
179+
VS Code supports authorization using OAuth 2.1 standards and 2.0 standards to other IdPs than GitHub and Microsoft Entra. VS Code first starts with a [Dynamic Client Registration (DCR)](https://modelcontextprotocol.io/specification/2025-06-18/basic/authorization#dynamic-client-registration) handshake and then falls back to a client-credentials workflow if the IdP does not support DCR. This gives more flexibility to the various IdPs to create static client IDs or specific client ID-secret pairs for each MCP server accordingly.
180180

181-
VS Code still supports MCP servers that behave as an authorization server, but it is recommended to use the latest specification for new servers.
181+
Users can then view their authentication status also through the **Accounts menu**. To remove dynamic client registrations, users can use the **Authentication: Remove Dynamic Authentication Providers** command in the Command Palette.
182+
183+
Below is a checklist to ensure your MCP server and VS Code's OAuth workflows will work:
184+
185+
1. The MCP server defines the [MCP authorization specification](https://modelcontextprotocol.io/specification/2025-06-18/basic/authorization).
186+
2. The IdP must support either DCR or client credentials
187+
3. The redirect URL list must include these URLs: `http://127.0.0.1:33418` and `https://vscode.dev/redirect`
188+
189+
When DCR is not supported by the MCP server, users will go through the fallback client-credential flow:
190+
191+
![Screenshot that shows the authorization when DCR is not supported for a MCP server.](../images/ai/mcp/mcp-auth-dynamic-client-required.png)
192+
193+
![Screenshot that shows the authorization when Client ID for a MCP server is requested.](../images/ai/mcp/mcp-auth-client-id.png)
194+
195+
![Screenshot that shows the authorization when Client Secret for a MCP server is requested.](../images/ai/mcp/mcp-auth-client-secret.png)
196+
197+
> [!NOTE]
198+
> VS Code still supports MCP servers that behave as an authorization server, but it is recommended to use the latest specification for new servers.
182199
183200
### Sampling (Preview)
184201

Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)