Skip to content

Conversation

@Agastya18
Copy link
Contributor

Summary

Automatically opens the user's default browser when running npx @mcpjam/inspector, eliminating the manual step of copying and pasting the localhost URL.

Fix: #610

1. Binary Configuration (package.json)

  • Added "inspector" binary entry to support npx @mcpjam/inspector command
  • Kept "inspector-vite" for backward compatibility
  • Added open@^10.2.0 dependency for cross-platform browser launching

2. Startup Script (bin/start.js)

  • Import: Added open package for browser automation
  • Process Spawning: Changed from blocking spawnPromise() to non-blocking spawn() to allow browser opening while server runs
  • Browser Launch: Automatically opens browser after 2-second server startup delay
  • Error Handling: Gracefully falls back to manual URL message if browser can't be opened

Demo

Screen.Recording.2025-10-09.at.10.47.25.PM.mov

@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. enhancement New feature or request labels Oct 9, 2025
@Agastya18
Copy link
Contributor Author

@chelojimenez

@Agastya18 Agastya18 force-pushed the feat/auto-open-browser branch from a594392 to 64540b2 Compare October 9, 2025 18:02
@Agastya18 Agastya18 requested a review from matteo8p October 10, 2025 15:05
- Add HOST and BASE_URL env variable overrides
@Agastya18 Agastya18 force-pushed the feat/auto-open-browser branch from e8da787 to bec8221 Compare October 10, 2025 15:24
Copy link
Collaborator

@matteo8p matteo8p left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ship!

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Oct 12, 2025
@matteo8p matteo8p merged commit 68d08bf into MCPJam:main Oct 12, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request lgtm This PR has been approved by a maintainer size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Spin up the inspector when the command runs

2 participants