fix: skip remote URIs when resolving MCP server cwd#10844
Open
shanevcantwell wants to merge 1 commit intocontinuedev:mainfrom
Open
fix: skip remote URIs when resolving MCP server cwd#10844shanevcantwell wants to merge 1 commit intocontinuedev:mainfrom
shanevcantwell wants to merge 1 commit intocontinuedev:mainfrom
Conversation
When the extension runs in the Local Extension Host on Windows while connected to a remote workspace (SSH, Dev Container, etc.), getWorkspaceDirs() returns vscode-remote:// URIs. These cannot be used as a cwd for child_process.spawn(), causing "spawn cmd.exe ENOENT" when starting MCP stdio servers. Fall back to the user's home directory for non-file:// URIs so the spawn has a valid local working directory. Fixes continuedev#10842 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
5890f53 to
a3d6f96
Compare
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.
Summary
spawn cmd.exe ENOENTwhen VS Code is connected to a remote workspace (SSH, Dev Container, etc.) from a Windows hostresolveWorkspaceCwd()passesvscode-remote://URIs directly ascwdtochild_process.spawn(), which can't resolve them as local filesystem pathsfile://URI schemes and returnundefinedso the spawn uses its default cwd, allowing MCP servers to start on the local hostTest plan
vscode-remote://URI returningundefinedshould resolve relative cwd using IDE workspace) is unchanged — it fails on main due tofileURLToPathrejecting non-Windows pathsFixes #10842
🤖 Generated with Claude Code
Continue Tasks: ❌ 7 failed — View all
Summary by cubic
Fix Windows startup failures for stdio MCP servers when VS Code is connected to a remote workspace by detecting remote URIs and using the user's home directory as the cwd. Ensures spawn has a valid local cwd so MCP servers start. Fixes #10842.
Written for commit a3d6f96. Summary will update on new commits.