OpenCode Browser MCP
Enables AI agents to browse and interact with Bilibili, including searching for videos, extracting titles and content, and taking screenshots.
Enables AI agents to navigate GitHub repositories and pages, though may be limited by GitHub's headless browser blocking.
Enables AI agents to browse and interact with Wikipedia, including searching for articles, extracting text, and taking screenshots.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@OpenCode Browser MCPOpen news.ycombinator.com and extract the top 3 stories."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
OpenCode Browser MCP
Give your AI coding agent eyes and hands on the web. Built for OpenCode, works with any MCP-compatible AI agent.
English
A production-ready Model Context Protocol (MCP) server that lets AI agents browse the web, interact with pages, fill forms, and extract data. Built on Playwright for cross-browser reliability.
Why This Exists
OpenCode is growing fast. There are browser MCPs for Claude Code (Chrome DevTools MCP, 44k★) and general-purpose tools (browser-use, 99k★). But nothing was purpose-built for OpenCode's workflow—until now.
Features
Feature | Detail |
30 Tools | 7 categories: Navigation, Automation, Inspection, Debugging, Emulation, Performance, Management |
Snapshot + UIDs | Accessibility-tree snapshot with unique element IDs — inspired by Chrome DevTools MCP |
Multi-Tab | Open, switch, and close multiple browser tabs in one session |
Console & Network | View browser console logs and network requests for full-stack debugging |
Cross-Browser | Chromium, Firefox, WebKit — pick any via Playwright |
Device Emulation | Mobile viewport, dark mode, geolocation spoofing, offline mode |
Headless by Default | No visible window. Runs in the background |
Safety Sandbox | Fresh browser instance per session. No cookies from host machine |
Domain Allowlist | Restrict which sites the agent can access |
Auto-Cleanup | Browser is closed and resources freed after each session |
Graceful Error Handling | Sites blocking headless browsers are handled cleanly |
Quick Start
# 1. Install dependencies
pip install playwright
python -m playwright install chromium
# 2. Add to your OpenCode config (~/.config/opencode/opencode.json){
"mcp": {
"browser": {
"type": "local",
"command": ["python", "path/to/opencode-browser-mcp/browser_mcp.py"],
"enabled": true,
"environment": {
"MCP_BROWSER_HEADLESS": "true",
"MCP_BROWSER_TIMEOUT": "30000"
}
}
}
}# 3. Restart OpenCode and use via @
# Try: "Open https://example.com and tell me what the page says"Tools Reference
Category | Tool | Description |
Navigation |
| Navigate to a URL |
| Open a URL in a new tab | |
| List all open tabs | |
| Switch to a tab by index | |
| Close a tab | |
| Wait for text to appear on the page | |
| Accept or dismiss browser dialogs | |
Automation |
| Accessibility tree snapshot with element UIDs |
| Click element by UID or CSS selector | |
| Fill input field by UID or CSS selector | |
| Batch fill multiple form fields at once | |
| Hover over an element | |
| Drag one element onto another | |
| Press a key or combination (e.g., | |
| Type text using keyboard (emulates real typing) | |
| Upload a file via a file input | |
Inspection |
| Take a screenshot of page or element |
| Extract all visible text | |
| Get full HTML source | |
| List all links on the page | |
| Execute JavaScript and return result | |
Debugging |
| List browser console logs (errors, warnings, info) |
| Get a specific console message | |
| List recent network requests (XHR, fetch, scripts) | |
| Get details of a network request | |
Emulation |
| Emulate device features (viewport, dark mode, geolocation, offline) |
| Resize the page viewport | |
Performance |
| Start measuring page load performance |
| Stop tracing and get Core Web Vitals metrics | |
Management |
| Close browser and clean up all sessions |
30 tools total across 7 categories.
Configuration
Env Variable | Default | Description |
|
| Hide browser window |
|
| Navigation timeout (ms) |
|
| Max page loads per session |
|
| Comma-separated domain allowlist |
Security
No cookies from your main Chrome/Firefox are shared
Each session starts with a fresh browser profile
The agent can only access domains in the allowlist
Set
MCP_BROWSER_ALLOWED_DOMAINS=github.com,localhostfor restricted access
Related MCP server: MCP Macaco Playwright
中文
为 OpenCode 打造的浏览器 MCP 服务器。让 AI 编程助手可以浏览网页、填写表单、提取数据,基于 Playwright 跨浏览器运行。
特性
特性 | 详情 |
30 个工具 | 7 个类别:导航、自动化、检查、调试、模拟、性能、管理 |
快照 + UID | 无障碍树快照 + 唯一元素 ID——借鉴 Chrome DevTools MCP 的设计 |
多标签页 | 同时打开、切换、关闭多个浏览器标签 |
控制台 & 网络 | 查看浏览器 console 日志和网络请求,实现全栈调试 |
跨浏览器 | Chromium / Firefox / WebKit 任选 |
设备模拟 | 移动端视口、暗色模式、GPS 伪装、离线模式 |
无头模式 | 默认不弹窗口,后台静默运行 |
安全沙箱 | 每次启动独立浏览器,不携带宿主机 Cookie |
域名白名单 | 限制 Agent 只能访问指定域名 |
自动清理 | 会话结束自动关闭浏览器释放资源 |
容错处理 | 优雅处理反爬网站 |
快速开始
pip install playwright
python -m playwright install chromium将以下配置添加到 ~/.config/opencode/opencode.json:
{
"mcp": {
"browser": {
"type": "local",
"command": ["python", "path/to/opencode-browser-mcp/browser_mcp.py"],
"enabled": true,
"environment": {
"MCP_BROWSER_HEADLESS": "true"
}
}
}
}使用示例
"打开 Bilibili 搜索 'AI Agent',列出前 5 个视频标题"
"截图我的 portfolio 网站首页"
"在 Wikipedia 搜索 Artificial Intelligence 并摘录第一段"
"检查这个页面上有没有 JS 报错"安全说明
默认不与主浏览器共享任何数据——每次都是新会话
建议设置
MCP_BROWSER_ALLOWED_DOMAINS限制访问范围绝对不要连接已登录网银/邮箱的浏览器
FAQ
Q: Can I use my main Chrome with this tool?
A: Yes—set HEADLESS=false, but we recommend against it for privacy. The default sandbox mode uses Playwright's bundled Chromium, which has zero connection to your personal browser data.
Q: GitHub shows an error?
A: GitHub blocks headless browsers aggressively. This is a GitHub limitation, not ours. We handle the error gracefully.
Q: How is this different from Chrome DevTools MCP?
A: Chrome DevTools MCP is TypeScript-only, Chrome-only, and designed for frontend debugging. Our tool is Python-native, multi-browser, and designed for general web interaction with OpenCode.
Feature | This Project | Chrome DevTools MCP | browser-use |
Language | Python | TypeScript | Python |
Browsers | All | Chrome only | All |
Snapshot + UIDs | — | ||
Multi-tab | — | ||
Console monitoring | — | ||
Network inspection | — | ||
Device emulation | — | ||
Performance tracing | — | ||
Core Web Vitals | — | ||
Heap snapshots | — | — | |
Lighthouse audit | — | — | |
Open source | MIT | Apache 2.0 | MIT |
Install size | ~5KB Python | ~500KB npm | ~25MB pip |
License
MIT © Hogan Dong
Part of the Hogan Dong Agent Stack
This project is the browser layer in a multi-agent platform:
AgentForge orchestrates multi-agent workflows and can use this MCP server as its browser tool.
See also: MCP Toolkit · RAG Agent · Agent Playground
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/HoganDong486/opencode-browser-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server