diff --git a/client/src/components/Sidebar.tsx b/client/src/components/Sidebar.tsx index 2ddb18d..e7d74f9 100644 --- a/client/src/components/Sidebar.tsx +++ b/client/src/components/Sidebar.tsx @@ -386,7 +386,6 @@ const Sidebar = ({ /> ) : typeof configItem.value === "boolean" ? ( ) : ( diff --git a/client/src/components/__tests__/Sidebar.test.tsx b/client/src/components/__tests__/Sidebar.test.tsx index 8e72b00..fad066f 100644 --- a/client/src/components/__tests__/Sidebar.test.tsx +++ b/client/src/components/__tests__/Sidebar.test.tsx @@ -423,6 +423,33 @@ describe("Sidebar Environment Variables", () => { ); }); + it("should update auto browser open disabled", () => { + const setConfig = jest.fn(); + renderSidebar({ config: DEFAULT_INSPECTOR_CONFIG, setConfig }); + + openConfigSection(); + + const autoOpenDisabledInput = screen.getByTestId( + "MCP_AUTO_OPEN_DISABLED-input", + ); + fireEvent.click(autoOpenDisabledInput); + const trueOption = screen.getByTestId( + "MCP_AUTO_OPEN_DISABLED-input-true", + ); + fireEvent.click(trueOption); + + expect(setConfig).toHaveBeenCalledWith( + expect.objectContaining({ + MCP_AUTO_OPEN_DISABLED: { + label: "Auto Browser Open Disabled", + description: + "Disable automatic browser opening when inspector starts", + value: true, + }, + }), + ); + }); + it("should maintain configuration state after multiple updates", () => { const setConfig = jest.fn(); const { rerender } = renderSidebar({ diff --git a/client/src/lib/configurationTypes.ts b/client/src/lib/configurationTypes.ts index 7c74bb7..1b9736f 100644 --- a/client/src/lib/configurationTypes.ts +++ b/client/src/lib/configurationTypes.ts @@ -33,4 +33,9 @@ export type InspectorConfig = { * 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 */ MCP_PROXY_FULL_ADDRESS: ConfigItem; + + /** + * Disable automatic browser opening when inspector starts. + */ + MCP_AUTO_OPEN_DISABLED: ConfigItem; }; diff --git a/client/src/lib/constants.ts b/client/src/lib/constants.ts index e7fa14c..cbfab90 100644 --- a/client/src/lib/constants.ts +++ b/client/src/lib/constants.ts @@ -43,4 +43,9 @@ export const DEFAULT_INSPECTOR_CONFIG: InspectorConfig = { "Set this if you are running the MCP Inspector Proxy on a non-default address. Example: http://10.1.1.22:5577", value: "", }, + MCP_AUTO_OPEN_DISABLED: { + label: "Auto Browser Open Disabled", + description: "Disable automatic browser opening when inspector starts", + value: false, + }, } as const;