Skip to content

Commit

Permalink
add comment about the getDefaultCwd logic
Browse files Browse the repository at this point in the history
  • Loading branch information
gusbicalho committed Feb 18, 2025
1 parent a3339e0 commit 56c8619
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/services/mcp/McpHub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,11 @@ export class McpHub {
private getDefaultCwd() {
const paths = vscode.workspace.workspaceFolders
if (paths?.length === 1) {
// In workspaces with a single folder, we can safely use it as the default CWD for MCP servers
return paths[0].uri.fsPath
}
// Otherwise we return undefined, which means the MCP process will be spawned with
// NodeJS default CWD, i.e. process.cwd()
return undefined
}

Expand Down

0 comments on commit 56c8619

Please sign in to comment.