@@ -63,6 +63,7 @@ const createServerTypeSchema = () => {
6363 type : z . enum ( [ "stdio" ] ) . optional ( ) ,
6464 command : z . string ( ) . min ( 1 , "Command cannot be empty" ) ,
6565 args : z . array ( z . string ( ) ) . optional ( ) ,
66+ cwd : z . string ( ) . default ( vscode . workspace . workspaceFolders ?. at ( 0 ) ?. uri . fsPath ?? process . cwd ( ) ) ,
6667 env : z . record ( z . string ( ) ) . optional ( ) ,
6768 // Ensure no SSE fields are present
6869 url : z . undefined ( ) . optional ( ) ,
@@ -79,7 +80,7 @@ const createServerTypeSchema = () => {
7980 url : z . string ( ) . url ( "URL must be a valid URL format" ) ,
8081 headers : z . record ( z . string ( ) ) . optional ( ) ,
8182 // Ensure no stdio fields are present
82- command : z . undefined ( ) . optional ( ) ,
83+ command : z . undefined ( ) ,
8384 args : z . undefined ( ) . optional ( ) ,
8485 env : z . undefined ( ) . optional ( ) ,
8586 } )
@@ -314,7 +315,7 @@ export class McpHub {
314315 mcpSettingsFilePath ,
315316 `{
316317 "mcpServers": {
317-
318+
318319 }
319320}` ,
320321 )
@@ -427,6 +428,7 @@ export class McpHub {
427428 transport = new StdioClientTransport ( {
428429 command : config . command ,
429430 args : config . args ,
431+ cwd : config . cwd ,
430432 env : {
431433 ...config . env ,
432434 ...( process . env . PATH ? { PATH : process . env . PATH } : { } ) ,
0 commit comments