diff --git a/README.md b/README.md index b312f71c..cd13c90d 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,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. diff --git a/client/src/App.tsx b/client/src/App.tsx index 1de79486..ca577d6e 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -244,6 +244,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..1e86c227 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);