File tree Expand file tree Collapse file tree 5 files changed +27
-19
lines changed Expand file tree Collapse file tree 5 files changed +27
-19
lines changed Original file line number Diff line number Diff line change @@ -239,6 +239,7 @@ Example server configuration file:
239
239
The inspector automatically detects the transport type from your config file. You can specify different transport types:
240
240
241
241
** STDIO (default):**
242
+
242
243
``` json
243
244
{
244
245
"mcpServers" : {
@@ -252,6 +253,7 @@ The inspector automatically detects the transport type from your config file. Yo
252
253
```
253
254
254
255
** SSE (Server-Sent Events):**
256
+
255
257
``` json
256
258
{
257
259
"mcpServers" : {
@@ -264,6 +266,7 @@ The inspector automatically detects the transport type from your config file. Yo
264
266
```
265
267
266
268
** Streamable HTTP:**
269
+
267
270
``` json
268
271
{
269
272
"mcpServers" : {
@@ -280,12 +283,14 @@ The inspector automatically detects the transport type from your config file. Yo
280
283
You can launch the inspector without specifying a server name if your config has:
281
284
282
285
1 . ** A single server** - automatically selected:
286
+
283
287
``` bash
284
288
# Automatically uses "my-server" if it's the only one
285
289
npx @modelcontextprotocol/inspector --config config.json
286
290
```
287
291
288
292
2 . ** A server named "default-server"** - automatically selected:
293
+
289
294
``` json
290
295
{
291
296
"mcpServers" : {
Original file line number Diff line number Diff line change @@ -785,7 +785,10 @@ async function runTests() {
785
785
) ;
786
786
787
787
// Create config with single server for auto-selection
788
- const singleServerConfigPath = path . join ( TEMP_DIR , "single-server-config.json" ) ;
788
+ const singleServerConfigPath = path . join (
789
+ TEMP_DIR ,
790
+ "single-server-config.json" ,
791
+ ) ;
789
792
fs . writeFileSync (
790
793
singleServerConfigPath ,
791
794
JSON . stringify (
@@ -803,7 +806,10 @@ async function runTests() {
803
806
) ;
804
807
805
808
// Create config with default-server
806
- const defaultServerConfigPath = path . join ( TEMP_DIR , "default-server-config.json" ) ;
809
+ const defaultServerConfigPath = path . join (
810
+ TEMP_DIR ,
811
+ "default-server-config.json" ,
812
+ ) ;
807
813
fs . writeFileSync (
808
814
defaultServerConfigPath ,
809
815
JSON . stringify (
@@ -831,11 +837,11 @@ async function runTests() {
831
837
JSON . stringify (
832
838
{
833
839
mcpServers : {
834
- " server1" : {
840
+ server1 : {
835
841
command : "npx" ,
836
842
args : [ "@modelcontextprotocol/server-everything" ] ,
837
843
} ,
838
- " server2" : {
844
+ server2 : {
839
845
command : "node" ,
840
846
args : [ "other.js" ] ,
841
847
} ,
Original file line number Diff line number Diff line change @@ -222,9 +222,7 @@ function parseArgs(): Args {
222
222
223
223
// Validate config and server options
224
224
if ( ! options . config && options . server ) {
225
- throw new Error (
226
- "--server requires --config to be specified" ,
227
- ) ;
225
+ throw new Error ( "--server requires --config to be specified" ) ;
228
226
}
229
227
230
228
// If config is provided without server, try to auto-select
@@ -233,11 +231,11 @@ function parseArgs(): Args {
233
231
path . isAbsolute ( options . config )
234
232
? options . config
235
233
: path . resolve ( process . cwd ( ) , options . config ) ,
236
- "utf8"
234
+ "utf8" ,
237
235
) ;
238
236
const parsedConfig = JSON . parse ( configContent ) ;
239
237
const servers = Object . keys ( parsedConfig . mcpServers || { } ) ;
240
-
238
+
241
239
if ( servers . includes ( "default-server" ) ) {
242
240
// Use default-server if it exists
243
241
options . server = "default-server" ;
@@ -249,7 +247,7 @@ function parseArgs(): Args {
249
247
} else {
250
248
// Multiple servers, no default-server
251
249
throw new Error (
252
- `Multiple servers found in config file. Please specify one with --server.\nAvailable servers: ${ servers . join ( ", " ) } `
250
+ `Multiple servers found in config file. Please specify one with --server.\nAvailable servers: ${ servers . join ( ", " ) } ` ,
253
251
) ;
254
252
}
255
253
}
Original file line number Diff line number Diff line change @@ -13,12 +13,7 @@ function delay(ms) {
13
13
return new Promise ( ( resolve ) => setTimeout ( resolve , ms , true ) ) ;
14
14
}
15
15
16
- function getClientUrl (
17
- port ,
18
- authDisabled ,
19
- sessionToken ,
20
- serverPort ,
21
- ) {
16
+ function getClientUrl ( port , authDisabled , sessionToken , serverPort ) {
22
17
const host = process . env . HOST || "localhost" ;
23
18
const baseUrl = `http://${ host } :${ port } ` ;
24
19
Original file line number Diff line number Diff line change @@ -7,7 +7,9 @@ test.describe("CLI Arguments @cli", () => {
7
7
page,
8
8
} ) => {
9
9
// Simulate: npx . --transport sse --server-url http://localhost:3000/sse
10
- await page . goto ( "http://localhost:6274/?transport=sse&serverUrl=http://localhost:3000/sse" ) ;
10
+ await page . goto (
11
+ "http://localhost:6274/?transport=sse&serverUrl=http://localhost:3000/sse" ,
12
+ ) ;
11
13
12
14
// Wait for the Transport Type dropdown to be visible
13
15
const selectTrigger = page . getByLabel ( "Transport Type" ) ;
@@ -26,7 +28,9 @@ test.describe("CLI Arguments @cli", () => {
26
28
page,
27
29
} ) => {
28
30
// Simulate config with streamable-http transport
29
- await page . goto ( "http://localhost:6274/?transport=streamable-http&serverUrl=http://localhost:3000/mcp" ) ;
31
+ await page . goto (
32
+ "http://localhost:6274/?transport=streamable-http&serverUrl=http://localhost:3000/mcp" ,
33
+ ) ;
30
34
31
35
// Wait for the Transport Type dropdown to be visible
32
36
const selectTrigger = page . getByLabel ( "Transport Type" ) ;
@@ -58,4 +62,4 @@ test.describe("CLI Arguments @cli", () => {
58
62
await expect ( page . locator ( "#command-input" ) ) . toBeVisible ( ) ;
59
63
await expect ( page . locator ( "#arguments-input" ) ) . toBeVisible ( ) ;
60
64
} ) ;
61
- } ) ;
65
+ } ) ;
You can’t perform that action at this time.
0 commit comments