Implement auto-open feature for browser launch on server start
This commit is contained in:
parent
3032a67d4e
commit
a524f17d80
1 changed files with 140 additions and 0 deletions
|
|
@ -1,5 +1,6 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
import open from "open";
|
||||
import { resolve, dirname } from "path";
|
||||
import { spawnPromise } from "spawn-rx";
|
||||
import { fileURLToPath } from "url";
|
||||
|
|
@ -99,6 +100,9 @@ async function main() {
|
|||
|
||||
if (serverOk) {
|
||||
try {
|
||||
if (!process.env.MCP_AUTO_OPEN_DISABLED) {
|
||||
open(`http://localhost:${CLIENT_PORT}`);
|
||||
}
|
||||
await spawnPromise("node", [inspectorClientPath], {
|
||||
env: { ...process.env, PORT: CLIENT_PORT },
|
||||
signal: abort.signal,
|
||||
|
|
|
|||
Loading…
Reference in a new issue