fix: VS Code adapter fails to configure HTTP/SSE remote MCP servers (#654)#656
Open
sergio-sisternes-epam wants to merge 3 commits intomicrosoft:mainfrom
Open
Conversation
…sing transport_type When the MCP registry returns remote endpoints without a transport_type field (or with an empty value), the VS Code adapter now defaults to "http" instead of silently producing an empty config and failing with "Unable to configure server". This aligns with the Copilot adapter behavior which already hardcodes "http" for all remote servers. The fix also: - Validates that at least one remote has a non-empty URL - Raises a clear error for unsupported transport types - Adds 8 new tests covering missing, empty, None, whitespace, unsupported transport types, URL-less remotes, and header preservation Fixes microsoft#654 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes the VS Code MCP client adapter so registry “remote-only” MCP servers are configured correctly even when transport_type is missing/empty, matching the Copilot adapter’s defaulting behavior and avoiding silent empty configs.
Changes:
- Default missing/empty/whitespace
transport_typetohttpfor VS Code remote endpoints and raise on unsupported non-empty transport types. - Select the first remote entry with a usable URL instead of always using
remotes[0]. - Add unit tests covering missing/empty/None/whitespace
transport_type, unsupported transports, URL-less remotes, and header/input-var handling; add a changelog entry.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/apm_cli/adapters/client/vscode.py |
Fixes remote endpoint formatting/selection and adds validation for remote transports. |
tests/unit/test_vscode_adapter.py |
Adds targeted regression tests for VS Code remote formatting behavior. |
CHANGELOG.md |
Records the VS Code remote configuration fix under Unreleased. |
Normalize the URL when building server_config to prevent whitespace- padded registry URLs from breaking VS Code connections. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Description
Fix VS Code adapter failing to configure MCP servers that only have HTTP/SSE remote endpoints (e.g.,
com.atlassian/atlassian-mcp-server). The adapter silently produced an empty config whentransport_typewas missing or empty in registry remote data, while the Copilot adapter handled this correctly by defaulting to"http".Root cause: In
_format_server_config, the remotes code path requiredtransport_typeto exactly match("sse", "http", "streamable-http"). When the registry returned remotes without atransport_typefield, the check failed silently andserver_configstayed empty, triggering the"Unable to configure server"error.Fix:
"http"whentransport_typeis missing, empty, or whitespace-only (matching Copilot adapter behavior)ValueErrorfor unrecognized non-empty transport typesremotes[0]Fixes #654
Type of change
Testing