File tree Expand file tree Collapse file tree 4 files changed +53
-4
lines changed Expand file tree Collapse file tree 4 files changed +53
-4
lines changed Original file line number Diff line number Diff line change @@ -386,7 +386,6 @@ const Sidebar = ({
386
386
/>
387
387
) : typeof configItem . value === "boolean" ? (
388
388
< Select
389
- data-testid = { `${ configKey } -select` }
390
389
value = { configItem . value . toString ( ) }
391
390
onValueChange = { ( val ) => {
392
391
const newConfig = { ...config } ;
@@ -397,12 +396,25 @@ const Sidebar = ({
397
396
setConfig ( newConfig ) ;
398
397
} }
399
398
>
400
- < SelectTrigger id = { `${ configKey } -input` } >
399
+ < SelectTrigger
400
+ id = { `${ configKey } -input` }
401
+ data-testid = { `${ configKey } -input` }
402
+ >
401
403
< SelectValue />
402
404
</ SelectTrigger >
403
405
< SelectContent >
404
- < SelectItem value = "true" > True</ SelectItem >
405
- < SelectItem value = "false" > False</ SelectItem >
406
+ < SelectItem
407
+ data-testid = { `${ configKey } -input-true` }
408
+ value = "true"
409
+ >
410
+ True
411
+ </ SelectItem >
412
+ < SelectItem
413
+ data-testid = { `${ configKey } -input-false` }
414
+ value = "false"
415
+ >
416
+ False
417
+ </ SelectItem >
406
418
</ SelectContent >
407
419
</ Select >
408
420
) : (
Original file line number Diff line number Diff line change @@ -423,6 +423,33 @@ describe("Sidebar Environment Variables", () => {
423
423
) ;
424
424
} ) ;
425
425
426
+ it ( "should update auto browser open disabled" , ( ) => {
427
+ const setConfig = jest . fn ( ) ;
428
+ renderSidebar ( { config : DEFAULT_INSPECTOR_CONFIG , setConfig } ) ;
429
+
430
+ openConfigSection ( ) ;
431
+
432
+ const autoOpenDisabledInput = screen . getByTestId (
433
+ "MCP_AUTO_OPEN_DISABLED-input" ,
434
+ ) ;
435
+ fireEvent . click ( autoOpenDisabledInput ) ;
436
+ const trueOption = screen . getByTestId (
437
+ "MCP_AUTO_OPEN_DISABLED-input-true" ,
438
+ ) ;
439
+ fireEvent . click ( trueOption ) ;
440
+
441
+ expect ( setConfig ) . toHaveBeenCalledWith (
442
+ expect . objectContaining ( {
443
+ MCP_AUTO_OPEN_DISABLED : {
444
+ label : "Auto Browser Open Disabled" ,
445
+ description :
446
+ "Disable automatic browser opening when inspector starts" ,
447
+ value : true ,
448
+ } ,
449
+ } ) ,
450
+ ) ;
451
+ } ) ;
452
+
426
453
it ( "should maintain configuration state after multiple updates" , ( ) => {
427
454
const setConfig = jest . fn ( ) ;
428
455
const { rerender } = renderSidebar ( {
Original file line number Diff line number Diff line change @@ -33,4 +33,9 @@ export type InspectorConfig = {
33
33
* The full address of the MCP Proxy Server, in case it is running on a non-default address. Example: http://10.1.1.22:5577
34
34
*/
35
35
MCP_PROXY_FULL_ADDRESS : ConfigItem ;
36
+
37
+ /**
38
+ * Disable automatic browser opening when inspector starts.
39
+ */
40
+ MCP_AUTO_OPEN_DISABLED : ConfigItem ;
36
41
} ;
Original file line number Diff line number Diff line change @@ -43,4 +43,9 @@ export const DEFAULT_INSPECTOR_CONFIG: InspectorConfig = {
43
43
"Set this if you are running the MCP Inspector Proxy on a non-default address. Example: http://10.1.1.22:5577" ,
44
44
value : "" ,
45
45
} ,
46
+ MCP_AUTO_OPEN_DISABLED : {
47
+ label : "Auto Browser Open Disabled" ,
48
+ description : "Disable automatic browser opening when inspector starts" ,
49
+ value : false ,
50
+ } ,
46
51
} as const ;
You can’t perform that action at this time.
0 commit comments