Overview
The MCP (Model Context Protocol) Server exposes OpenBrowser’s browser automation as a singleexecute_code tool for AI assistants like Claude Desktop, Claude Code, and other MCP-compatible clients. The LLM writes Python code to navigate, interact with, and extract data from web pages. No external LLM API keys required — the MCP client provides the intelligence.
Quick Start
Start MCP Server
Claude Desktop Integration
Add this configuration to your Claude Desktop config file:macOS
Edit~/Library/Application Support/Claude/claude_desktop_config.json:
Windows
Edit%APPDATA%\Claude\claude_desktop_config.json:
Claude Code
Add to your project’s.mcp.json:
Environment Variables
Optional configuration:The execute_code Tool
The MCP server exposes a single tool that runs Python code in a persistent namespace with browser automation functions. All functions are async — use await.
Available Functions
Pre-imported libraries:
json, csv, re, datetime, asyncio, Path, requests, numpy, pandas, matplotlib, BeautifulSoup
Variables and state persist between execute_code calls within the same session.
Example Usage
Once configured with Claude Desktop or Claude Code, you can ask the AI to perform browser automation tasks:execute_code tool to write Python code that navigates, interacts, and extracts data.
Programmatic Usage
You can also connect to the MCP server programmatically:CLI Execute Mode
For Bash-based workflows without an MCP client, use the CLI Daemon instead. It provides the sameexecute_code functions via openbrowser-ai -c "code" with a persistent browser daemon.
Troubleshooting
Common Issues
“MCP SDK is required” Error MCP is included in the base package since v0.1.30. Update to the latest version:- Check that you have Chrome/Chromium installed
- Try setting
OPENBROWSER_HEADLESS=falseto see browser window - Ensure no other browser instances are using the same profile
- Restart Claude Desktop after config changes
- Check the config file syntax is valid JSON
- Verify the file path is correct for your OS
Debug Mode
Enable debug logging by setting:Security Considerations
- The MCP server has access to your browser and file system
- Only connect trusted MCP clients
- Be cautious with sensitive websites and data
- Use
OPENBROWSER_ALLOWED_DOMAINSto restrict navigation
Next Steps
- Explore the examples directory for more usage patterns
- Check out MCP documentation to learn more about the protocol
- Join our Discord for support and discussions