JSPM

browser-mcp-native-host

3.0.4
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 80
  • Score
    100M100P100Q52051F
  • License MIT

Native Messaging Host for Browser MCP - Bridges AI assistants (Claude/Cursor) to Chrome extension

Package Exports

  • browser-mcp-native-host
  • browser-mcp-native-host/host.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (browser-mcp-native-host) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@browser-mcp/native-host

Native Messaging Host for Browser MCP

Bridges AI assistants (Claude Desktop, Cursor, Windsurf) to the Browser MCP Chrome extension via Native Messaging protocol.

Version License


πŸš€ Quick Install

One-Line Installation

npm install -g @browser-mcp/native-host

The installation will:

  1. βœ… Install the native messaging host globally
  2. βœ… Auto-detect your Browser MCP extension ID
  3. βœ… Create native messaging manifest
  4. βœ… Configure for your platform (Mac/Linux/Windows)

πŸ“¦ What's Included

  • browser-mcp-host - Native messaging host binary
  • browser-mcp-setup - Configuration CLI tool
  • Automatic manifest setup - Works on Mac, Linux, Windows

πŸ”§ Usage

After installation, the host is automatically configured. Just add to your IDE config:

Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "browser-mcp": {
      "command": "browser-mcp-host"
    }
  }
}

Cursor (~/.cursor/mcp.json):

{
  "mcpServers": {
    "browser-mcp": {
      "command": "browser-mcp-host"
    }
  }
}

Windsurf (~/.codeium/windsurf/mcp_config.json):

{
  "mcpServers": {
    "browser-mcp": {
      "command": "browser-mcp-host"
    }
  }
}

Manual Configuration

If auto-detection fails, run the setup wizard:

browser-mcp-setup

Or provide extension ID directly:

browser-mcp-setup YOUR_EXTENSION_ID_HERE

Check Configuration Status

browser-mcp-setup --status

Reconfigure

browser-mcp-setup

πŸ“ File Locations

macOS

  • Host: /usr/local/lib/node_modules/@browser-mcp/native-host/host.js
  • Manifest: ~/Library/Application Support/Google/Chrome/NativeMessagingHosts/com.browsermcp.native.json

Linux

  • Host: /usr/local/lib/node_modules/@browser-mcp/native-host/host.js
  • Manifest: ~/.config/google-chrome/NativeMessagingHosts/com.browsermcp.native.json

Windows

  • Host: %APPDATA%\npm\node_modules\@browser-mcp\native-host\host.js
  • Manifest: %APPDATA%\Google\Chrome\NativeMessagingHosts\com.browsermcp.native.json

πŸ” How It Works

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Claude/Cursor │◄───────►│  Native Host     │◄───────►│ Chrome Extensionβ”‚
β”‚   (AI Assistant)β”‚  stdio  β”‚  (This Package)  β”‚ Native  β”‚   Browser MCP   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ Message β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  1. AI Assistant sends MCP requests via stdio
  2. Native Host (this package) forwards to Chrome extension
  3. Chrome Extension executes browser debugging commands
  4. Native Host returns results to AI assistant

πŸ› οΈ Development

Local Testing

# Clone repository
git clone https://github.com/YOLOVibeCode/browser-mcp.git
cd browser-mcp/native-messaging-host

# Install locally
npm install -g .

# Test
echo '{"jsonrpc":"2.0","id":1,"method":"initialize"}' | browser-mcp-host

Uninstall

npm uninstall -g @browser-mcp/native-host

This will remove:

  • The host binary
  • The manifest file (automatically)

πŸ› Troubleshooting

"Extension ID not found"

  1. Load the Browser MCP extension in Chrome first
  2. Run browser-mcp-setup manually
  3. Copy extension ID from chrome://extensions/

"Command not found: browser-mcp-host"

  1. Check npm global bin is in PATH: npm bin -g
  2. Add to PATH if needed: export PATH="$(npm bin -g):$PATH"
  3. Restart terminal

"Native host has exited"

  1. Check manifest exists: browser-mcp-setup --status
  2. Verify extension ID matches
  3. Check logs: Host writes to stderr

Test Connection

# Send test message
echo '{"jsonrpc":"2.0","id":1,"method":"test"}' | browser-mcp-host

πŸ“š API

Command Line

browser-mcp-host              # Run the native messaging host
browser-mcp-setup             # Interactive setup wizard
browser-mcp-setup [id]        # Setup with specific extension ID
browser-mcp-setup --status    # Show current configuration
browser-mcp-setup --version   # Show version
browser-mcp-setup --help      # Show help

Protocol

The host uses the Chrome Native Messaging Protocol:

  • Input: JSON-RPC 2.0 messages via stdin (4-byte length prefix)
  • Output: JSON-RPC 2.0 responses via stdout (4-byte length prefix)
  • Logs: Written to stderr

🀝 Contributing

Contributions welcome!

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test locally with npm install -g .
  5. Submit a pull request

πŸ“„ License

MIT License - see LICENSE



Made with ❀️ by YOLOVibeCode