File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed
Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -16,10 +16,30 @@ const inspectorClientPath = join(__dirname, "../client/bin/cli.js");
1616
1717console . log ( "Starting MCP inspector..." ) ;
1818
19+ function escapeArg ( arg ) {
20+ if ( arg . includes ( " " ) || arg . includes ( "'" ) || arg . includes ( '"' ) ) {
21+ return `\\"${ arg . replace ( / " / g, '\\\\\\"' ) } \\"` ;
22+ }
23+ return arg ;
24+ }
25+
26+ const serverCommand = [
27+ `node` ,
28+ inspectorServerPath ,
29+ command ? `--env ${ escapeArg ( command ) } ` : "" ,
30+ mcpServerArgs . length
31+ ? `--args="${ mcpServerArgs . map ( escapeArg ) . join ( " " ) } "`
32+ : "" ,
33+ ]
34+ . filter ( Boolean )
35+ . join ( " " ) ;
36+
37+ console . log ( serverCommand ) ;
38+
1939const { result } = concurrently (
2040 [
2141 {
22- command : `node ${ inspectorServerPath } ${ command ? ` --env ${ command } ` : "" } ${ mcpServerArgs . length ? ` --args=" ${ mcpServerArgs . join ( " " ) } "` : "" } ` ,
42+ command : serverCommand ,
2343 name : "server" ,
2444 } ,
2545 {
You can’t perform that action at this time.
0 commit comments