Skip to content

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
sergio-sisternes-epam:fix/654-vscode-http-transport
Open

fix: VS Code adapter fails to configure HTTP/SSE remote MCP servers (#654)#656
sergio-sisternes-epam wants to merge 3 commits intomicrosoft:mainfrom
sergio-sisternes-epam:fix/654-vscode-http-transport

Conversation

@sergio-sisternes-epam
Copy link
Copy Markdown
Collaborator

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 when transport_type was 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 required transport_type to exactly match ("sse", "http", "streamable-http"). When the registry returned remotes without a transport_type field, the check failed silently and server_config stayed empty, triggering the "Unable to configure server" error.

Fix:

  • Default to "http" when transport_type is missing, empty, or whitespace-only (matching Copilot adapter behavior)
  • Raise a clear ValueError for unrecognized non-empty transport types
  • Select the first remote with a valid URL instead of blindly using remotes[0]

Fixes #654

Type of change

  • Bug fix
  • New feature
  • Documentation
  • Maintenance / refactor

Testing

  • Tested locally
  • All existing tests pass (3797 passed)
  • Added 8 new tests covering: missing/empty/None/whitespace transport_type, unsupported transport, URL-less remotes, header preservation with default http

…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>
@sergio-sisternes-epam sergio-sisternes-epam marked this pull request as ready for review April 9, 2026 21:12
Copilot AI review requested due to automatic review settings April 9, 2026 21:12
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_type to http for 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.

Sergio Sisternes and others added 2 commits April 9, 2026 23:16
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] "com.atlassian/atlassian-mcp-server installation failed" during apm install

2 participants