don't show full config keys

This commit is contained in:
Pulkit Sharma
2025-04-09 01:12:02 +05:30
parent 779ca20568
commit 48917ca4e5
4 changed files with 23 additions and 15 deletions

View File

@@ -95,10 +95,22 @@ const App = () => {
const [config, setConfig] = useState<InspectorConfig>(() => {
const savedConfig = localStorage.getItem(CONFIG_LOCAL_STORAGE_KEY);
if (savedConfig) {
return {
// merge default config with saved config
const mergedConfig = {
...DEFAULT_INSPECTOR_CONFIG,
...JSON.parse(savedConfig),
} as InspectorConfig;
// update description of keys to match the new description (in case of any updates to the default config description)
Object.entries(mergedConfig).forEach(([key, value]) => {
mergedConfig[key as keyof InspectorConfig] = {
...value,
description:
DEFAULT_INSPECTOR_CONFIG[key as keyof InspectorConfig].description,
};
});
return mergedConfig;
}
return DEFAULT_INSPECTOR_CONFIG;
});

View File

@@ -326,7 +326,7 @@ const Sidebar = ({
<div key={key} className="space-y-2">
<div className="flex items-center gap-1">
<label className="text-sm font-medium text-green-600 break-all">
{configKey}
{configItem.description}
</label>
<Tooltip>
<TooltipTrigger asChild>

View File

@@ -343,7 +343,7 @@ describe("Sidebar Environment Variables", () => {
expect(setConfig).toHaveBeenCalledWith(
expect.objectContaining({
MCP_SERVER_REQUEST_TIMEOUT: {
description: "Timeout for requests to the MCP server (ms)",
description: "Request Timeout",
value: 5000,
},
}),
@@ -366,8 +366,7 @@ describe("Sidebar Environment Variables", () => {
expect(setConfig).toHaveBeenCalledWith(
expect.objectContaining({
MCP_PROXY_FULL_ADDRESS: {
description:
"Set this if you are running the MCP Inspector Proxy on a non-default address. Example: http://10.1.1.22:5577",
description: "Inspector Proxy Address",
value: "http://localhost:8080",
},
}),
@@ -390,8 +389,7 @@ describe("Sidebar Environment Variables", () => {
expect(setConfig).toHaveBeenCalledWith(
expect.objectContaining({
MCP_REQUEST_MAX_TOTAL_TIMEOUT: {
description:
"Maximum total timeout for requests sent to the MCP server (ms) (Use with progress notifications)",
description: "Maximum Total Timeout",
value: 10000,
},
}),
@@ -412,7 +410,7 @@ describe("Sidebar Environment Variables", () => {
expect(setConfig).toHaveBeenCalledWith(
expect.objectContaining({
MCP_SERVER_REQUEST_TIMEOUT: {
description: "Timeout for requests to the MCP server (ms)",
description: "Request Timeout",
value: 0,
},
}),
@@ -457,7 +455,7 @@ describe("Sidebar Environment Variables", () => {
expect(setConfig).toHaveBeenLastCalledWith(
expect.objectContaining({
MCP_SERVER_REQUEST_TIMEOUT: {
description: "Timeout for requests to the MCP server (ms)",
description: "Request Timeout",
value: 3000,
},
}),

View File

@@ -22,21 +22,19 @@ export const DEFAULT_MCP_PROXY_LISTEN_PORT = "6277";
**/
export const DEFAULT_INSPECTOR_CONFIG: InspectorConfig = {
MCP_SERVER_REQUEST_TIMEOUT: {
description: "Timeout for requests to the MCP server (ms)",
description: "Request Timeout",
value: 10000,
},
MCP_REQUEST_TIMEOUT_RESET_ON_PROGRESS: {
description: "Reset timeout on progress notifications",
description: "Reset Timeout on Progress",
value: true,
},
MCP_REQUEST_MAX_TOTAL_TIMEOUT: {
description:
"Maximum total timeout for requests sent to the MCP server (ms) (Use with progress notifications)",
description: "Maximum Total Timeout",
value: 60000,
},
MCP_PROXY_FULL_ADDRESS: {
description:
"Set this if you are running the MCP Inspector Proxy on a non-default address. Example: http://10.1.1.22:5577",
description: "Inspector Proxy Address",
value: "",
},
} as const;