fix: VS Code adapter fails to configure HTTP/SSE remote MCP servers (#654)#656
Conversation
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. |
…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 <[email protected]>
Normalize the URL when building server_config to prevent whitespace- padded registry URLs from breaking VS Code connections. Co-authored-by: Copilot <[email protected]>
634a9c4 to
353ff23
Compare
APM Review Panel — PR #656[+] Verdict: APPROVE — merge as-is, file follow-ups A tight, focused fix for a real first-impression footgun: installing the official Atlassian MCP server ( What's excellent
Findings
Cross-runtime symmetry — file as follow-upThe DevX agent surfaced an interesting asymmetry that's not introduced by this PR but is exposed by the fix: the Copilot adapter has the inverse bug — it hardcodes
Two more low-priority follow-ups worth tracking:
Merge callShip it. The bug is real and reported by users in the wild, the fix is tight, the tests are thorough, and the contested Growth angle
Thanks @sergio-sisternes-epam — clean, well-tested, scoped fix with a real user-impact story behind it. Reviewed via the apm-review-panel skill: python-architect, cli-logging-expert, devx-ux-expert, supply-chain-security-expert; synthesized by apm-ceo with oss-growth-hacker side-channel. |
danielmeppiel
left a comment
There was a problem hiding this comment.
Approving per the apm-review-panel verdict above (#656 (comment)). Tight, well-tested fix that resolves a real first-impression footgun for the Atlassian MCP server in VS Code.
Filed the symmetric Copilot adapter validation as a good-first-issue follow-up: #791. Other follow-ups (helper deduplication, cleartext URL warning, message polish) tracked in the panel comment.
Thanks @sergio-sisternes-epam — ship it.
Mirror PR #656 in the Copilot adapter. Reject unrecognized remote transports (e.g. 'grpc') with a clear ValueError, default to 'http' when the registry omits transport_type, and skip remote entries without URLs. Copilot CLI still emits 'type': 'http' for every remote per its spec -- only the validation surface changes. Adds a new tests/unit/test_copilot_adapter.py suite parallel to tests/unit/test_vscode_adapter.py, covering missing/empty/whitespace/ None transport, the raise-on-unsupported path, the supported transport set, and the _select_remote_with_url helper. Fixes #791 Co-authored-by: Daniel Meppiel <[email protected]>
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