Get up and running with the OpenCode Browser MCP Plugin in 5 minutes.
- OpenCode installed (
npm install -g opencode-ai) - Node.js v18+ installed
- Chrome or Edge browser
- Visit https://browsermcp.io/install
- Click "Install Extension"
- Add the extension to your browser
- Pin the extension to your browser toolbar
Run the setup helper in your project directory:
npx opencode-browser initThis creates or updates ./opencode.json with the plugin and Browser MCP server entries.
Use the global config instead if you want it available everywhere:
npx opencode-browser init --globalIf you prefer to edit the file manually, create or update opencode.json like this:
cat > opencode.json << 'EOF'
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-browser"],
"mcp": {
"browsermcp": {
"type": "local",
"command": ["npx", "-y", "@browsermcp/mcp@0.1.3"],
"enabled": true
}
}
}
EOFWhat this does:
"plugin": ["opencode-browser"]- Installs the plugin from npm (automatic)"mcp": { "browsermcp": ... }- Configures Browser MCP server (required for browser control)
Both are needed! The plugin enhances the MCP tools, but the MCP server does the actual browser automation.
The pinned Browser MCP version avoids the extra @latest lookup on startup and makes launches more predictable.
If you're testing local changes to the plugin:
# Project-specific
mkdir -p .opencode/plugins
cp src/index.ts .opencode/plugins/browser-mcp.ts
# Or global
mkdir -p ~/.config/opencode/plugins
cp src/index.ts ~/.config/opencode/plugins/browser-mcp.ts- Start OpenCode in your project:
opencode- Try a simple browser automation command:
Navigate to https://github.com and tell me what the featured repository is
For faster browser runs, prefer prompts like:
Navigate directly to https://news.ycombinator.com and extract the titles of the top 5 stories without taking screenshots.
- Watch as OpenCode opens your browser and completes the task!
- Browser MCP extension is installed and visible in browser toolbar
-
opencode.jsoncontains the MCP configuration -
pluginincludesopencode-browser - OpenCode starts without errors
- Browser automation commands work
# Test if npx can run the MCP server
npx -y @browsermcp/mcp@0.1.3 --version# Check if plugin file exists
ls -la .opencode/plugins/browser-mcp.ts
# or for global
ls -la ~/.config/opencode/plugins/browser-mcp.ts- Check if Browser MCP extension is enabled
- Try clicking the extension icon and selecting "Reconnect"
- Restart your browser
Now that you're set up, try these examples:
-
Web Search:
Search Google for "OpenCode AI" and summarize the top result -
Form Filling:
Go to https://example.com and fill out the contact form with test data -
Web Scraping:
Visit Hacker News and list the top 5 stories -
Testing:
Navigate to my app at localhost:3000 and verify the login button exists
See EXAMPLES.md for more usage examples.
- Check the full README.md for detailed documentation
- Visit Browser MCP Docs
- Visit OpenCode Docs
- Report issues on GitHub
Enjoy automating your browser with OpenCode! 🚀