vscode mcp: support custom workspace path; enable restart tool#286297
vscode mcp: support custom workspace path; enable restart tool#286297
Conversation
rebornix
commented
Jan 7, 2026
- optional workspace paths through MCP setup/start so the server can open a specific folder or workspace when requested
- enable reload tool to support window reload
There was a problem hiding this comment.
Pull request overview
This PR enables MCP (Model Context Protocol) automation tools to support custom workspace paths and enables the restart tool for VS Code automation testing. The changes make workspace paths optional throughout the automation framework, allowing VS Code to open with the last used workspace or an empty window when no path is specified.
Key Changes:
- Enable the previously commented-out restart tool with support for optional workspace paths and extra CLI arguments
- Add optional
workspacePathparameter to the MCP start tool - Make
workspacePathoptional throughout the automation framework (Application, Code, electron, playwrightBrowser)
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| test/mcp/src/automationTools/core.ts | Uncommented and enabled the restart tool with optional workspace and extra arguments support |
| test/mcp/src/automation.ts | Added optional workspacePath parameter to the start tool with updated description |
| test/mcp/src/application.ts | Propagated workspacePath parameter through getApplication and ApplicationService methods |
| test/automation/src/playwrightBrowser.ts | Modified URL construction to conditionally include workspace path only when provided |
| test/automation/src/electron.ts | Made workspace path optional in electron args, added validation for remote scenarios |
| test/automation/src/code.ts | Changed workspacePath from required to optional in LaunchOptions interface |
| test/automation/src/application.ts | Changed _workspacePathOrFolder and its getter to return optional string |
|
@bpasero it touched smoke test so it would be great if you can also take a look. |
TylerLeonhardt
left a comment
There was a problem hiding this comment.
I'm fine with this from the MCP side
|
Merging it to allow us to continue experimenting with it. if there are feedbacks I can address in followup PRs. |
|
@rebornix why do we have to repeat this code everywhwere? const workspacePathOrFolder = app.workspacePathOrFolder;
if (!workspacePathOrFolder) {
throw new Error('This test requires a workspace to be open');
}Wouldn't it be better to just throw at the getter of |
* vscode mcp: support specifying workspace path; enable restart tool * fix: include workspace path in launch options for browser * fix: ensure workspace path is set for tests requiring a workspace * Address PR review comments: support optional workspace path * fix: standardize workspace path variable naming in tests * fix: fallback to rootPath for workspacePath in CI environments