Skip to content

Add Browserbase to MCP auto-start configuration with environment gating#178

Merged
dzp5103 merged 2 commits intomainfrom
copilot/fix-b0600296-566f-4e2d-a379-169a9764f200
Aug 9, 2025
Merged

Add Browserbase to MCP auto-start configuration with environment gating#178
dzp5103 merged 2 commits intomainfrom
copilot/fix-b0600296-566f-4e2d-a379-169a9764f200

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Aug 9, 2025

Implements Browserbase integration into the MCP auto-start system managed by scripts/mcp-manager.js with proper environment variable gating, ensuring the server only starts when required credentials are available.

Problem

The mcp-registry.json already included a Browserbase entry, but it wasn't part of the auto-start set managed by scripts/mcp-manager.js. The MCP manager only controlled servers listed in mcp-server/package.json, which only contained 3 servers (mcpHealth, mcpOrchestrator, mcpWorkflow).

Solution

Enhanced MCP Manager with Environment Gating

Extended scripts/mcp-manager.js to support conditional server startup based on required environment variables:

// New requiredEnv support
"browserbase": {
  "command": "npx",
  "args": ["@browserbasehq/mcp-server-browserbase"],
  "port": 3010,
  "healthPath": "/health",
  "requiredEnv": ["BROWSERBASE_API_KEY", "BROWSERBASE_PROJECT_ID"],
  "env": {
    "NODE_ENV": "production",
    "MCP_SERVER_NAME": "browserbase"
  }
}

Graceful Behavior

Without environment variables (development):

$ node scripts/mcp-manager.js health
→ browserbase @ http://localhost:3010/health
⚠️ browserbase: skipped (missing env vars: BROWSERBASE_API_KEY, BROWSERBASE_PROJECT_ID)

With environment variables (production):

$ BROWSERBASE_API_KEY=xxx BROWSERBASE_PROJECT_ID=yyy node scripts/mcp-manager.js health
→ browserbase @ http://localhost:3010/health
[browserbase] Starting Browserbase MCP server...
✅ browserbase: healthy

Visual Status Indicators

The report command now shows clear environment status:

  • 🟢 Green: All required environment variables present
  • 🔴 Red: Missing required environment variables
  • White: No environment requirements
$ node scripts/mcp-manager.js report
📋 Configured servers:
  ⚪ mcpHealth: node health.js (port 3001)
  ⚪ mcpOrchestrator: node enhanced-mcp-orchestrator.js (port 3002) 
  ⚪ mcpWorkflow: node workflow-manager.js (port 3003)
  🔴 browserbase: npx @browserbasehq/mcp-server-browserbase (port 3010) (requires: BROWSERBASE_API_KEY, BROWSERBASE_PROJECT_ID)

CI/CD Integration

Updated .github/workflows/agent-mcp-automation.yml to:

  • Inject Browserbase secrets from repository configuration
  • Include MCP manager validation in the comprehensive test suite
  • Ensure proper environment variable handling without secret leakage

Testing

Comprehensive validation confirms:

  • ✅ Graceful skip when environment variables missing
  • ✅ Proper startup attempt when environment variables present
  • ✅ Visual status indicators work correctly
  • ✅ All existing MCP servers continue functioning
  • ✅ Full validation pipeline (npm run mcp:validate) passes
  • ✅ CI workflow properly configured with secrets

Benefits

  • Development-friendly: Developers can work without Browserbase secrets
  • Production-ready: Browserbase starts automatically when properly configured
  • CI integration: Automated testing validates Browserbase when secrets available
  • Clear visibility: Status reports show exactly what's missing or ready
  • Security: No secrets exposed in logs or error messages

The system now properly manages Browserbase as part of the auto-start set with appropriate environment gating, ready for CI integration and production deployment.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Summary by Bito

This pull request integrates Browserbase into the MCP auto-start configuration, allowing conditional server startup based on environment variables. It updates the GitHub Actions workflow for secure deployment and enhances server status visibility while maintaining existing functionality.

@bito-code-review
Copy link
Copy Markdown

Bito Automatic Review Skipped - Draft PR

Bito didn't auto-review because this pull request is in draft status.
No action is needed if you didn't intend for the agent to review it. Otherwise, to manually trigger a review, type /review in a comment and save.
You can change draft PR review settings here, or contact your Bito workspace admin at dxp51037@hawkmail.hacc.edu.

Co-authored-by: dzp5103 <214723817+dzp5103@users.noreply.github.com>
@dzp5103 dzp5103 marked this pull request as ready for review August 9, 2025 17:27
@dzp5103 dzp5103 merged commit 5e48147 into main Aug 9, 2025
2 checks passed
Copilot AI changed the title [WIP] Current status (from your repo) - Registry reflects Browserbase: mcp-registry.json already includes a browserbase entry using npx @browserbasehq/mcp-server-browserbase with required envs BROWSERBASE_API_KEY and BROWSERBASE_PROJECT_ID, and activeServers... Add Browserbase to MCP auto-start configuration with environment gating Aug 9, 2025
Copilot AI requested a review from dzp5103 August 9, 2025 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants