Skip to content

fix: set native MCP server cwd to the workspace folder - #251

Merged
SebTardif merged 1 commit into
mainfrom
fix/improve-mpi-20260828-s0800
Aug 28, 2026
Merged

fix: set native MCP server cwd to the workspace folder#251
SebTardif merged 1 commit into
mainfrom
fix/improve-mpi-20260828-s0800

Conversation

@SebTardif

Copy link
Copy Markdown
Contributor

Summary

Native MCP still started in $HOME. VS Code only uses a workspace cwd
when McpStdioServerDefinition.cwd is set. Relative MCP tool paths and
CLI --contain then applied to the home directory, not the project.

Set cwd to the first workspace folder URI after constructing the
definition. The 5th constructor argument is version, not cwd.

Verification

  • Unit test assigns cwd.fsPath on a positional fake ctor
  • npm run check

Checklist

  • All commits in this pull request are signed off with git commit -s
  • I ran npm run check and it passes
  • I updated docs if user-facing behavior changed
  • I am contributing this work under the repository license (MIT)

VS Code starts McpStdioServerDefinition in $HOME unless cwd is set.
Relative MCP paths and --contain then apply to the home directory.
Assign workspaceFolders[0].uri after the positional constructor.

Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
@SebTardif
SebTardif marked this pull request as ready for review August 28, 2026 14:59
@SebTardif
SebTardif enabled auto-merge (squash) August 28, 2026 14:59
@SebTardif
SebTardif merged commit c8ecfa0 into main Aug 28, 2026
22 checks passed
@SebTardif
SebTardif deleted the fix/improve-mpi-20260828-s0800 branch August 28, 2026 15:04
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.

1 participant