Skip to content

Commit ad39ec2

Browse files
authored
Merge pull request #276 from kawakamidev/auto_open
Implement auto-open feature for browser launch on server start
2 parents 0014ca5 + f2003b3 commit ad39ec2

File tree

4 files changed

+153
-6
lines changed

4 files changed

+153
-6
lines changed

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,13 @@ The MCP Inspector includes a proxy server that can run and communicate with loca
5454

5555
The MCP Inspector supports the following configuration settings. To change them, click on the `Configuration` button in the MCP Inspector UI:
5656

57-
| Setting | Description | Default |
58-
| --------------------------------------- | ------------------------------------------------------------------------------------------------------------ | ------- |
59-
| `MCP_SERVER_REQUEST_TIMEOUT` | Timeout for requests to the MCP server (ms) | 10000 |
60-
| `MCP_REQUEST_TIMEOUT_RESET_ON_PROGRESS` | Reset timeout on progress notifications | true |
61-
| `MCP_REQUEST_MAX_TOTAL_TIMEOUT` | Maximum total timeout for requests sent to the MCP server (ms) (Use with progress notifications) | 60000 |
62-
| `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 | "" |
57+
| Setting | Description | Default |
58+
| --------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------- |
59+
| `MCP_SERVER_REQUEST_TIMEOUT` | Timeout for requests to the MCP server (ms) | 10000 |
60+
| `MCP_REQUEST_TIMEOUT_RESET_ON_PROGRESS` | Reset timeout on progress notifications | true |
61+
| `MCP_REQUEST_MAX_TOTAL_TIMEOUT` | Maximum total timeout for requests sent to the MCP server (ms) (Use with progress notifications) | 60000 |
62+
| `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 | "" |
63+
| `MCP_AUTO_OPEN_ENABLED` | Enable automatic browser opening when inspector starts. Only as environment var, not configurable in browser. | true |
6364

6465
These settings can be adjusted in real-time through the UI and will persist across sessions.
6566

client/bin/start.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env node
22

3+
import open from "open";
34
import { resolve, dirname } from "path";
45
import { spawnPromise } from "spawn-rx";
56
import { fileURLToPath } from "url";
@@ -99,6 +100,9 @@ async function main() {
99100

100101
if (serverOk) {
101102
try {
103+
if (process.env.MCP_AUTO_OPEN_ENABLED !== "false") {
104+
open(`http://127.0.0.1:${CLIENT_PORT}`);
105+
}
102106
await spawnPromise("node", [inspectorClientPath], {
103107
env: { ...process.env, PORT: CLIENT_PORT },
104108
signal: abort.signal,

package-lock.json

Lines changed: 141 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
"@modelcontextprotocol/inspector-server": "^0.12.0",
4646
"@modelcontextprotocol/sdk": "^1.11.0",
4747
"concurrently": "^9.0.1",
48+
"open": "^10.1.0",
4849
"shell-quote": "^1.8.2",
4950
"spawn-rx": "^5.1.2",
5051
"ts-node": "^10.9.2",

0 commit comments

Comments
 (0)