Skip to content

Commit 48917ca

Browse files
don't show full config keys
1 parent 779ca20 commit 48917ca

File tree

4 files changed

+23
-15
lines changed

4 files changed

+23
-15
lines changed

client/src/App.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,22 @@ const App = () => {
9595
const [config, setConfig] = useState<InspectorConfig>(() => {
9696
const savedConfig = localStorage.getItem(CONFIG_LOCAL_STORAGE_KEY);
9797
if (savedConfig) {
98-
return {
98+
// merge default config with saved config
99+
const mergedConfig = {
99100
...DEFAULT_INSPECTOR_CONFIG,
100101
...JSON.parse(savedConfig),
101102
} as InspectorConfig;
103+
104+
// update description of keys to match the new description (in case of any updates to the default config description)
105+
Object.entries(mergedConfig).forEach(([key, value]) => {
106+
mergedConfig[key as keyof InspectorConfig] = {
107+
...value,
108+
description:
109+
DEFAULT_INSPECTOR_CONFIG[key as keyof InspectorConfig].description,
110+
};
111+
});
112+
113+
return mergedConfig;
102114
}
103115
return DEFAULT_INSPECTOR_CONFIG;
104116
});

client/src/components/Sidebar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ const Sidebar = ({
326326
<div key={key} className="space-y-2">
327327
<div className="flex items-center gap-1">
328328
<label className="text-sm font-medium text-green-600 break-all">
329-
{configKey}
329+
{configItem.description}
330330
</label>
331331
<Tooltip>
332332
<TooltipTrigger asChild>

client/src/components/__tests__/Sidebar.test.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ describe("Sidebar Environment Variables", () => {
343343
expect(setConfig).toHaveBeenCalledWith(
344344
expect.objectContaining({
345345
MCP_SERVER_REQUEST_TIMEOUT: {
346-
description: "Timeout for requests to the MCP server (ms)",
346+
description: "Request Timeout",
347347
value: 5000,
348348
},
349349
}),
@@ -366,8 +366,7 @@ describe("Sidebar Environment Variables", () => {
366366
expect(setConfig).toHaveBeenCalledWith(
367367
expect.objectContaining({
368368
MCP_PROXY_FULL_ADDRESS: {
369-
description:
370-
"Set this if you are running the MCP Inspector Proxy on a non-default address. Example: http://10.1.1.22:5577",
369+
description: "Inspector Proxy Address",
371370
value: "http://localhost:8080",
372371
},
373372
}),
@@ -390,8 +389,7 @@ describe("Sidebar Environment Variables", () => {
390389
expect(setConfig).toHaveBeenCalledWith(
391390
expect.objectContaining({
392391
MCP_REQUEST_MAX_TOTAL_TIMEOUT: {
393-
description:
394-
"Maximum total timeout for requests sent to the MCP server (ms) (Use with progress notifications)",
392+
description: "Maximum Total Timeout",
395393
value: 10000,
396394
},
397395
}),
@@ -412,7 +410,7 @@ describe("Sidebar Environment Variables", () => {
412410
expect(setConfig).toHaveBeenCalledWith(
413411
expect.objectContaining({
414412
MCP_SERVER_REQUEST_TIMEOUT: {
415-
description: "Timeout for requests to the MCP server (ms)",
413+
description: "Request Timeout",
416414
value: 0,
417415
},
418416
}),
@@ -457,7 +455,7 @@ describe("Sidebar Environment Variables", () => {
457455
expect(setConfig).toHaveBeenLastCalledWith(
458456
expect.objectContaining({
459457
MCP_SERVER_REQUEST_TIMEOUT: {
460-
description: "Timeout for requests to the MCP server (ms)",
458+
description: "Request Timeout",
461459
value: 3000,
462460
},
463461
}),

client/src/lib/constants.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,19 @@ export const DEFAULT_MCP_PROXY_LISTEN_PORT = "6277";
2222
**/
2323
export const DEFAULT_INSPECTOR_CONFIG: InspectorConfig = {
2424
MCP_SERVER_REQUEST_TIMEOUT: {
25-
description: "Timeout for requests to the MCP server (ms)",
25+
description: "Request Timeout",
2626
value: 10000,
2727
},
2828
MCP_REQUEST_TIMEOUT_RESET_ON_PROGRESS: {
29-
description: "Reset timeout on progress notifications",
29+
description: "Reset Timeout on Progress",
3030
value: true,
3131
},
3232
MCP_REQUEST_MAX_TOTAL_TIMEOUT: {
33-
description:
34-
"Maximum total timeout for requests sent to the MCP server (ms) (Use with progress notifications)",
33+
description: "Maximum Total Timeout",
3534
value: 60000,
3635
},
3736
MCP_PROXY_FULL_ADDRESS: {
38-
description:
39-
"Set this if you are running the MCP Inspector Proxy on a non-default address. Example: http://10.1.1.22:5577",
37+
description: "Inspector Proxy Address",
4038
value: "",
4139
},
4240
} as const;

0 commit comments

Comments
 (0)