Avoid double negative

This commit is contained in:
KAWAKAMI Moeki
2025-04-17 18:13:58 +09:00
parent d2dc959307
commit 014acecf77
5 changed files with 15 additions and 15 deletions

View File

@@ -56,7 +56,7 @@ The MCP Inspector supports the following configuration settings. To change them,
| `MCP_REQUEST_TIMEOUT_RESET_ON_PROGRESS` | Reset timeout on progress notifications | true |
| `MCP_REQUEST_MAX_TOTAL_TIMEOUT` | Maximum total timeout for requests sent to the MCP server (ms) (Use with progress notifications) | 60000 |
| `MCP_PROXY_FULL_ADDRESS` | Set this if you are running the MCP Inspector Proxy on a non-default address. Example: http://10.1.1.22:5577 | "" |
| `MCP_AUTO_OPEN_DISABLED` | Disable automatic browser opening when inspector starts | false |
| `MCP_AUTO_OPEN_ENABLED` | Enable automatic browser opening when inspector starts | true |
The inspector also supports configuration files to store settings for different MCP servers. This is useful when working with multiple servers or complex configurations:

View File

@@ -100,7 +100,7 @@ async function main() {
if (serverOk) {
try {
if (process.env.MCP_AUTO_OPEN_DISABLED !== "true") {
if (process.env.MCP_AUTO_OPEN_ENABLED !== "false") {
open(`http://127.0.0.1:${CLIENT_PORT}`);
}
await spawnPromise("node", [inspectorClientPath], {

View File

@@ -583,21 +583,21 @@ describe("Sidebar Environment Variables", () => {
openConfigSection();
const autoOpenDisabledInput = screen.getByTestId(
"MCP_AUTO_OPEN_DISABLED-input",
"MCP_AUTO_OPEN_ENABLED-input",
);
fireEvent.click(autoOpenDisabledInput);
const trueOption = screen.getByTestId(
"MCP_AUTO_OPEN_DISABLED-input-true",
const falseOption = screen.getByTestId(
"MCP_AUTO_OPEN_ENABLED-input-false",
);
fireEvent.click(trueOption);
fireEvent.click(falseOption);
expect(setConfig).toHaveBeenCalledWith(
expect.objectContaining({
MCP_AUTO_OPEN_DISABLED: {
label: "Auto Browser Open Disabled",
MCP_AUTO_OPEN_ENABLED: {
label: "Auto Browser Open Enabled",
description:
"Disable automatic browser opening when inspector starts",
value: true,
"Enable automatic browser opening when inspector starts",
value: false,
},
}),
);

View File

@@ -37,5 +37,5 @@ export type InspectorConfig = {
/**
* Disable automatic browser opening when inspector starts.
*/
MCP_AUTO_OPEN_DISABLED: ConfigItem;
MCP_AUTO_OPEN_ENABLED: ConfigItem;
};

View File

@@ -52,9 +52,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,
MCP_AUTO_OPEN_ENABLED: {
label: "Auto Browser Open Enabled",
description: "Enable automatic browser opening when inspector starts",
value: true,
},
} as const;