A tool for LLMs to use the web with human-in-the-loop assistance.
Humans handle authentications and robot checks while LLMs automate mundane and repeatable tasks.
Real-time browser automation via MCP integration with Claude Code. The human maintains control while Claude assists with web tasks.
Script-based automation using a Domain Specific Language with Selenium.
- Firefox browser
- Python 3.11+
- Claude Code CLI
pip install -r src/requirements.txt- Open Firefox and go to
about:debugging - Click "This Firefox" → "Load Temporary Add-on"
- Select
src/extension-cobrowser/manifest.json
python -m uvicorn src.Library.cobrowser_service:app --host 0.0.0.0 --port 8677- Click the Co-Browser extension icon in Firefox
- Click "Connect" to establish WebSocket connection
- The badge should show "ON" when connected
The .mcp.json file configures Claude Code to use the Co-Browser MCP server automatically. Just start Claude Code in this directory:
claudeOnce connected, Claude Code has access to these browser automation tools:
| Tool | Description |
|---|---|
cobrowser_navigate |
Navigate to a URL |
cobrowser_click |
Click an element by CSS selector |
cobrowser_type |
Type text into an input field |
cobrowser_read |
Read text content from an element |
cobrowser_scroll |
Scroll the page up or down |
cobrowser_get_page_info |
Get current page URL and title |
cobrowser_request_human |
Request human assistance (for CAPTCHAs, logins) |
cobrowser_get_user_requests |
Get pending "Ask Claude..." requests |
cobrowser_clear_user_request |
Clear a handled user request |
Users can right-click on any webpage and select "Ask Claude..." to send natural language requests:
- Right-click on the page
- Select "Ask Claude..." from the context menu
- Type your request (e.g., "Find all links on this page")
- Click Send
Claude Code can retrieve these requests using cobrowser_get_user_requests.
The extension supports three control modes:
- AI (Claude): Claude drives the browser
- YOU (Human): User has control (during handoffs)
- BOTH (Shared): Both can interact
Use keyboard shortcuts to switch modes:
Ctrl+Shift+.- Toggle control modeCtrl+Shift+,- Resume automationF8- Emergency stop
- Claude cannot access password fields
- Claude cannot type into password fields
- Screenshots blur sensitive content
- Human can take control at any time
The original approach uses a Domain Specific Language for scripted automation.
command_structure = {
"NAVIGATE": ["URL"],
"ASK_USER": ["Prompt"],
"CLICK_XPATH": ["XPath"],
"TYPE_XPATH": ["XPath", "Text"],
"SAVE_TO_VARIABLE": ["Variable Name", "Value"],
"READ_XPATH": ["XPath"],
"FIND_AND_SAVE": ["URL", "Query", "Variable Name"],
"KEYBOARD_CLICK": ["Keyboard Button"],
}# Start the browser service
python -m uvicorn src.Library.browser_service:app --host 0.0.0.0 --port 8676
# Start the Streamlit UI
streamlit run src/UI/ui_experiment.py┌─────────────────┐ WebSocket ┌──────────────────┐
│ Claude Code │◄──────────────────►│ Co-Browser │
│ (MCP Client) │ │ Service │
└────────┬────────┘ │ (Port 8677) │
│ └────────┬─────────┘
│ MCP/stdio │ WebSocket
│ │
┌────────┴────────┐ ┌────────┴─────────┐
│ MCP Server │ │ Firefox │
│ (cobrowser_ │ │ Extension │
│ mcp_server.py)│ │ (Content + │
└─────────────────┘ │ Background) │
└──────────────────┘
MIT