by michaljach
Browser automation plugin for OpenCode AI editor - Control Chrome/Edge with AI, automate web testing, scraping & form filling via MCP integration
# Add to your Claude Code skills
git clone https://github.com/michaljach/opencode-browserGuides for using ai agents skills like opencode-browser.
opencode-browser is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by michaljach. Browser automation plugin for OpenCode AI editor - Control Chrome/Edge with AI, automate web testing, scraping & form filling via MCP integration. It has 124 GitHub stars.
opencode-browser's catalog security scan is still queued. You can run an instant dependency and prompt-injection check now with the "Scan for vulnerabilities" button above.
Clone the repository with "git clone https://github.com/michaljach/opencode-browser" and add it to your Claude Code skills directory (see the Installation section above).
opencode-browser is primarily written in TypeScript. It is open-source under michaljach on GitHub, so you can review or fork the full source.
Yes. AgentsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh opencode-browser against similar tools.
No comments yet. Be the first to share your thoughts!
Unlocks once the catalog security scan passes (runs nightly).
The deep catalog scan for this skill is still queued. Run an instant dependency check now instead.
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.
Works with both OpenCode 1 (1.18.29+) and OpenCode 2.

Before using this plugin, you need:
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
If you prefer to preview the generated config without writing it yet:
npx opencode-browser init --print
Or configure it by hand. Create or update your opencode.json configuration file. You can create this file in one of two locations:
~/.config/opencode/opencode.json./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/[email protected]"],
"enabled": true
}
}
}
This configuration does two things:
opencode-browser from npmThat'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.
The plugin ships a single package that supports both OpenCode 1 and OpenCode 2. OpenCode 2 reads the plugin's V2 definition and registers the same guidance through its session, tool, and event APIs; existing plugin configuration keeps working because OpenCode 2 normalizes V1 configuration.
To use the native V2 configuration shape, move the entry from plugin to plugins and use the V2 MCP shape:
{
"$schema": "https://opencode.ai/config.json",
"plugins": ["opencode-browser"],
"mcp": {
"servers": {
"browsermcp": {
"type": "local",
"command": ["npx", "-y", "@browsermcp/[email protected]"],
"disabled": false
}
}
}
}
No runtime dependencies are required: the plugin's imports of the OpenCode plugin type packages are type-only, so it loads under both APIs without installing @opencode/plugin or @opencode-ai/plugin into the plugin folder.
If OpenCode 2 reports Plugin must export a default definition with an id and an effect or setup function, you are running a version older than 1.3.0. Update the plugin (opencode plugin update, or clear OpenCode's package cache) and restart.
If you want to modify the plugin or test changes:
OpenCode 2: point the config at your clone. The path must be the package directory, not src/index.ts:
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["file:///absolute/path/to/opencode-browser"]
}
OpenCode 1, global installation:
mkdir -p ~/.config/opencode/plugins
cp src/index.ts ~/.config/opencode/plugins/browser-mcp.ts
OpenCode 1, 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.
The minimal configuration requires only the MCP server setup:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"browsermcp": {
"type": "local",
"command": ["npx", "-y", "@browsermcp/[email protected]"],
"enabled": true
}
}
}
For more control, you can disable Browser MCP tools globally and enable them per agent:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"browsermcp": {
"type": "local",
"command": ["npx", "-y", "@browsermcp/[email protected]"],
"enabled": true
}
},
"tools": {
"browsermcp_*": false
},
"agent": {
"browser-agent": {
"tools": {
"browsermcp_*": true
}
}
}
}
The plugin improves Browser MCP speed by shaping how the model uses browser tools:
If you need to pass environment variables to the Browser MCP server:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"browsermcp": {
"type": "local",
"command": ["npx", "-y", "@browsermcp/[email protected]"],
"enabled": true,
"environment": {
"BROWSER_MCP_DEBUG": "true"
}
}
}
}
Once installed and configured, you can use browser automation in your OpenCode prompts:
Navigate to https://github.com and search for "opencode"
Go to the contact form at https://example.com/contact and fill in:
- Name: John Doe
- Email: [email protected]
- Message: Hello from OpenCode!
Then submit the form.
Visit https://news.ycombinator.com and get the titles of the top 5 stories
Go to https://example.com/login, log in with the test credentials,
navigate to the dashboard, and screenshot the main metrics panel
For best results when using browser automation:
You can also add browser automation guidelines to your AGENTS.md file:
## Browser Automation
When performing browser automation tasks:
- Always confirm the page has loaded before interacting
- Use descriptive selectors (prefer text content over CSS selectors)
- Take screenshots when verification is needed
- Handle errors gracefully (page not found, element not visible, etc.)
- Close tabs when the task is complete
The plugin biases the model toward faster browser workflows:
navigate calls when the destination URL is knownsnapshot, screenshot, and wait calls unless they are actually neededThe plugin still detects browser connection issues, but it no longer adds artificial retry sleeps:
The plugin automatically detects when Browser MCP tools are being used and applies browser-specific guidance.
During session compaction, the plugin preserves browser automation context, ensuring the AI remembers:
The plugin annotates Browser MCP tool definitions with performance notes, especially for slower tools like snapshots, screenshots, and waits.
If you see connection errors:
The plugin will display messages li