File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -172,6 +172,7 @@ export class McpHub {
172172 // ...(process.env.NODE_PATH ? { NODE_PATH: process.env.NODE_PATH } : {}),
173173 } ,
174174 stderr : "pipe" , // necessary for stderr to be available
175+ cwd : config . cwd ?? this . getDefaultCwd ( ) ,
175176 } )
176177
177178 transport . onerror = async ( error ) => {
@@ -266,6 +267,14 @@ export class McpHub {
266267 }
267268 }
268269
270+ private getDefaultCwd ( ) {
271+ const paths = vscode . workspace . workspaceFolders
272+ if ( paths ?. length === 1 ) {
273+ return paths [ 0 ] . uri . fsPath
274+ }
275+ return undefined
276+ }
277+
269278 private appendErrorMessage ( connection : McpConnection , error : string ) {
270279 const newError = connection . server . error ? `${ connection . server . error } \n${ error } ` : error
271280 connection . server . error = newError //.slice(0, 800)
You can’t perform that action at this time.
0 commit comments