File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -61,8 +61,9 @@ async function main() {
61
61
62
62
// Make sure our server/client didn't immediately fail
63
63
await Promise . any ( [ server , client , delay ( 2 * 1000 ) ] ) ;
64
+ const portParam = SERVER_PORT === "3000" ? "" : `?port=${ SERVER_PORT } ` ;
64
65
console . log (
65
- `\n🔍 MCP Inspector is up and running at http://localhost:${ CLIENT_PORT } 🚀` ,
66
+ `\n🔍 MCP Inspector is up and running at http://localhost:${ CLIENT_PORT } ${ portParam } 🚀` ,
66
67
) ;
67
68
68
69
try {
Original file line number Diff line number Diff line change @@ -191,7 +191,10 @@ const App = () => {
191
191
} , [ args ] ) ;
192
192
193
193
useEffect ( ( ) => {
194
- fetch ( "http://localhost:3000/config" )
194
+ const params = new URLSearchParams ( window . location . search ) ;
195
+ const serverPort = params . get ( 'port' ) || '3000' ;
196
+
197
+ fetch ( `http://localhost:${ serverPort } /config` )
195
198
. then ( ( response ) => response . json ( ) )
196
199
. then ( ( data ) => {
197
200
setEnv ( data . defaultEnvironment ) ;
@@ -404,7 +407,9 @@ const App = () => {
404
407
} ,
405
408
) ;
406
409
407
- const backendUrl = new URL ( "http://localhost:3000/sse" ) ;
410
+ const params = new URLSearchParams ( window . location . search ) ;
411
+ const serverPort = params . get ( 'port' ) || '3000' ;
412
+ const backendUrl = new URL ( `http://localhost:${ serverPort } /sse` ) ;
408
413
409
414
backendUrl . searchParams . append ( "transportType" , transportType ) ;
410
415
if ( transportType === "stdio" ) {
You can’t perform that action at this time.
0 commit comments