mcp-server
mcp-server copied to clipboard
Handle BrowserStack MCP metadata flags
Summary
- handle --version/-v and --help/-h before credential validation
- keep metadata flags usable without BROWSERSTACK_USERNAME or BROWSERSTACK_ACCESS_KEY
- add a Vitest coverage path for the no-credential metadata flags
Reproduction
npm exec --yes --package=@browserstack/[email protected] -- browserstack-mcp-server --version currently prints a BROWSERSTACK_USERNAME environment variable error instead of version metadata. The same credential check also blocks --help.
Validation
- Red test first: new metadata tests failed because stdout was empty and credential validation ran first
npx vitest run tests/cli-metadata.test.tsnpm test(22 files, 184 tests)npm run lintnpx tsc --noEmitnpm run build- local
npm pack+npm exec --package=<tarball> -- browserstack-mcp-server --versionprints1.2.21 - local
npm pack+npm exec --package=<tarball> -- browserstack-mcp-server --help git diff --check