Skip to content

Commit bb04dde

Browse files
author
Gustavo Bicalho
committed
add comment about the getDefaultCwd logic
1 parent 32f2432 commit bb04dde

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/services/mcp/McpHub.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,11 @@ export class McpHub {
270270
private getDefaultCwd() {
271271
const paths = vscode.workspace.workspaceFolders
272272
if (paths?.length === 1) {
273+
// In workspaces with a single folder, we can safely use it as the default CWD for MCP servers
273274
return paths[0].uri.fsPath
274275
}
276+
// Otherwise we return undefined, which means the MCP process will be spawned with
277+
// NodeJS default CWD, i.e. process.cwd()
275278
return undefined
276279
}
277280

0 commit comments

Comments
 (0)