microsoft / microsoft/vscode

MCP: the resource metadata URL should be derived from the full MCP server URL, not just the scheme+host.

Open
#330,250 1 comment 0 reactions 1 assignee Claimed by @TylerLeonhardt View on GitHub
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

Does this issue occur when all extensions are disabled?: Yes

- VS Code Version: 1.106.0 (or your current version)
- OS Version: All (OS Independent)

Bug Description:
When VS Code initializes an HTTP-based Model Context Protocol (MCP) server, the built-in MCP client fails to correctly discover metadata/OAuth resources because it forces a request to the server's root domain instead of matching the full configured path.

Specifically, when fetching `.well-known/oauth-protected-resource` or server metadata, VS Code strips the custom endpoint path and incorrectly queries `https://domain.com...` instead of honoring the explicit subpath endpoint layout (e.g., `https://domain.com...`), breaking connectivity for remote HTTP MCP servers hosted under sub-routes.

Steps to Reproduce:

1. Configure an HTTP remote MCP server inside `mcp.json` or `.vscode/mcp.json` using a URL that contains a subpath (e.g., `https://example.com`).
2. Reload the window or trigger an explicit connection/authentication sequence to the configured MCP server.
3. Observe the network or authentication trace logs. VS Code requests the metadata resources directly from the root domain (`https://example.com`) rather than appending it to the full MCP subpath route (`https://example.com`).
4. The connection fails with a 404 or a metadata mismatch error, preventing tools from loading in the chat or terminal.

Expected Behavior:
The VS Code native MCP client should preserve the full server path configuration or fallback sequentially to the precise path location before trying the bare root URL.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.