Skip to content

Opencode Browser

Browser automation plugin for OpenCode AI editor - Control Chrome/Edge with AI, automate web testing, scraping & form filling via MCP integration

Install

$npx opencode-browser init
Claude Code
claude mcp add opencode-browser -- npx opencode-browser init
Cursor / Claude Desktop (mcp.json)
{
  "mcpServers": {
    "opencode-browser": {
      "command": "npx",
      "args": [
        "opencode-browser",
        "init"
      ]
    }
  }
}

Install command taken from the project's README or registry entry. Always review code before running it.

OpenCode Browser MCP Plugin

An OpenCode plugin that integrates Browser MCP to enable browser automation capabilities within OpenCode. This plugin allows the AI to control a browser, navigate websites, fill forms, click elements, and perform other browser automation tasks.

Demo

Features

  • Full browser automation support through Browser MCP
  • Speed-oriented browser guidance injected into the model prompt
  • Tool-specific performance hints for expensive browser actions
  • Fast retry behavior with no artificial reconnect backoff in the plugin
  • Automatic detection of browser-related tasks
  • Context preservation for browser state across session compactions
  • Seamless integration with OpenCode's existing tools

Prerequisites

Before using this plugin, you need:

  1. Node.js installed on your system
  2. OpenCode installed and configured
  3. Browser MCP extension installed in your browser (Chrome/Edge)

Installation

Step 1: Install Browser MCP Extension

  1. Visit https://browsermcp.io/install
  2. Install the Browser MCP extension for your browser (Chrome or Edge)
  3. Follow the extension setup instructions

Step 2: Configure OpenCode

Fastest path:

npx opencode-browser init

This creates or updates ./opencode.json with the required plugin and mcp.browsermcp entries while preserving any unrelated config you already have.

For a global setup instead of a project-local one:

npx opencode-browser init --global

Create or update your opencode.json configuration file. You can create this file in one of two locations:

  • Global configuration (applies to all projects): ~/.config/opencode/opencode.json
  • Project-specific configuration (applies to current project only): ./opencode.json (in your project root)

Learn more about OpenCode configuration at https://opencode.ai/docs/config

Add this configuration to your opencode.json:

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": ["opencode-browser"],
  "mcp": {
    "browsermcp": {
      "type": "local",
      "command": ["npx", "-y", "@browsermcp/mcp@0.1.3"],
      "enabled": true
    }
  }
}

This configuration does two things:

  1. Installs the plugin - OpenCode automatically downloads opencode-browser from npm
  2. Configures Browser MCP - Sets up the MCP server that actually controls the browser

That's it! No manual file copying required. OpenCode handles everything automatically.

The generated command pins the Browser MCP package version to avoid the extra @latest resolution step on startup and keep launches reproducible.

If you prefer to preview the generated config without writing it yet:

npx opencode-browser init --print

Alternative: Install Locally (for development/testing)

If you want to modify the plugin or test changes:

For global installation:

mkdir -p ~/.config/opencode/plugins
cp src/index.ts ~/.config/opencode/plugins/browser-mcp.ts

For project-specific installation:

mkdir -p .opencode/plugins
cp src/index.ts .opencode/plugins/browser-mcp.ts

The plugin will be automatically loaded on OpenCode startup.

Configuration

Basic Configuration

The minimal configuration requires only the MCP server setup:

Similar plugs

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

Java 面试 & 后端通用面试指南,覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype…