From 65543a291883d10a60ba8fbc3c9725885260b7b4 Mon Sep 17 00:00:00 2001 From: rinormaloku Date: Wed, 9 Apr 2025 11:55:28 +0200 Subject: [PATCH 1/3] add default MCP server URL --- client/src/App.tsx | 4 ++++ server/src/index.ts | 2 ++ 2 files changed, 6 insertions(+) diff --git a/client/src/App.tsx b/client/src/App.tsx index 4f99ffd4..2ea74649 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -249,6 +249,10 @@ const App = () => { if (data.defaultArgs) { setArgs(data.defaultArgs); } + if (data.defaultMcpServerUrl) { + setSseUrl(data.defaultMcpServerUrl); + setTransportType("sse"); + } }) .catch((error) => console.error("Error fetching default environment:", error), diff --git a/server/src/index.ts b/server/src/index.ts index 0987d996..8c428ed6 100644 --- a/server/src/index.ts +++ b/server/src/index.ts @@ -24,6 +24,7 @@ const defaultEnvironment = { ...getDefaultEnvironment(), ...(process.env.MCP_ENV_VARS ? JSON.parse(process.env.MCP_ENV_VARS) : {}), }; +const defaultMcpServerUrl = process.env.MCP_SERVER_URL; const { values } = parseArgs({ args: process.argv.slice(2), @@ -185,6 +186,7 @@ app.get("/config", (req, res) => { defaultEnvironment, defaultCommand: values.env, defaultArgs: values.args, + defaultMcpServerUrl }); } catch (error) { console.error("Error in /config route:", error); From 75e99f232bf6b6754cbb2908f80c0bf1b7cab4f2 Mon Sep 17 00:00:00 2001 From: rinormaloku Date: Fri, 18 Apr 2025 12:05:17 +0200 Subject: [PATCH 2/3] updated the readme --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0db92bfe..dbdb03e0 100644 --- a/README.md +++ b/README.md @@ -56,6 +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_SERVER_URL` | Set this to configure the default MCP Server to connect to on startup. Example: http://localhost:8080 | "" | These settings can be adjusted in real-time through the UI and will persist across sessions. @@ -69,7 +70,7 @@ Development mode: npm run dev ``` -> **Note for Windows users:** +> **Note for Windows users:** > On Windows, use the following command instead: > > ```bash From 866e0c58191cd575d16f2d2ded37681acfd56212 Mon Sep 17 00:00:00 2001 From: rinormaloku Date: Fri, 18 Apr 2025 21:59:01 +0200 Subject: [PATCH 3/3] fmt --- server/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/index.ts b/server/src/index.ts index 8c428ed6..1e86c227 100644 --- a/server/src/index.ts +++ b/server/src/index.ts @@ -186,7 +186,7 @@ app.get("/config", (req, res) => { defaultEnvironment, defaultCommand: values.env, defaultArgs: values.args, - defaultMcpServerUrl + defaultMcpServerUrl, }); } catch (error) { console.error("Error in /config route:", error);