Skip to content

Commit 56c8619

Browse files
committed
add comment about the getDefaultCwd logic
1 parent a3339e0 commit 56c8619

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
@@ -268,8 +268,11 @@ export class McpHub {
268268
private getDefaultCwd() {
269269
const paths = vscode.workspace.workspaceFolders
270270
if (paths?.length === 1) {
271+
// In workspaces with a single folder, we can safely use it as the default CWD for MCP servers
271272
return paths[0].uri.fsPath
272273
}
274+
// Otherwise we return undefined, which means the MCP process will be spawned with
275+
// NodeJS default CWD, i.e. process.cwd()
273276
return undefined
274277
}
275278

0 commit comments

Comments
 (0)