$git clone https://github.com/kontext-security/browser-use-mcp-serverAn MCP server that enables AI agents to control web browsers using [browser-use](https://github.com/browser-use/browser-use).
| 1 | # browser-use-mcp-server |
| 2 | |
| 3 | <div align="center"> |
| 4 | |
| 5 | [](https://x.com/cobrowser) |
| 6 | [](https://discord.gg/gw9UpFUhyY) |
| 7 | [](https://badge.fury.io/py/browser-use-mcp-server) |
| 8 | |
| 9 | **An MCP server that enables AI agents to control web browsers using |
| 10 | [browser-use](https://github.com/browser-use/browser-use).** |
| 11 | |
| 12 | > **🌐 Want to Vibe Browse the Web?** Open-source AI-powered web browser - [**Vibe Browser**](https://github.com/co-browser/vibe). |
| 13 | > |
| 14 | > **🔗 Managing multiple MCP servers?** Simplify your development workflow with [agent-browser](https://github.com/co-browser/agent-browser) |
| 15 | |
| 16 | </div> |
| 17 | |
| 18 | ## Prerequisites |
| 19 | |
| 20 | - [uv](https://github.com/astral-sh/uv) - Fast Python package manager |
| 21 | - [Playwright](https://playwright.dev/) - Browser automation |
| 22 | - [mcp-proxy](https://github.com/sparfenyuk/mcp-proxy) - Required for stdio mode |
| 23 | |
| 24 | ```bash |
| 25 | # Install prerequisites |
| 26 | curl -LsSf https://astral.sh/uv/install.sh | sh |
| 27 | uv tool install mcp-proxy |
| 28 | uv tool update-shell |
| 29 | ``` |
| 30 | |
| 31 | ## Environment |
| 32 | |
| 33 | Create a `.env` file: |
| 34 | |
| 35 | ```bash |
| 36 | OPENAI_API_KEY=your-api-key |
| 37 | CHROME_PATH=optional/path/to/chrome |
| 38 | PATIENT=false # Set to true if API calls should wait for task completion |
| 39 | ``` |
| 40 | |
| 41 | ## Installation |
| 42 | |
| 43 | ```bash |
| 44 | # Install dependencies |
| 45 | uv sync |
| 46 | uv pip install playwright |
| 47 | uv run playwright install --with-deps --no-shell chromium |
| 48 | ``` |
| 49 | |
| 50 | ## Usage |
| 51 | |
| 52 | ### SSE Mode |
| 53 | |
| 54 | ```bash |
| 55 | # Run directly from source |
| 56 | uv run server --port 8000 |
| 57 | ``` |
| 58 | |
| 59 | ### stdio Mode |
| 60 | |
| 61 | ```bash |
| 62 | # 1. Build and install globally |
| 63 | uv build |
| 64 | uv tool uninstall browser-use-mcp-server 2>/dev/null || true |
| 65 | uv tool install dist/browser_use_mcp_server-*.whl |
| 66 | |
| 67 | # 2. Run with stdio transport |
| 68 | browser-use-mcp-server run server --port 8000 --stdio --proxy-port 9000 |
| 69 | ``` |
| 70 | |
| 71 | ## Client Configuration |
| 72 | |
| 73 | ### SSE Mode Client Configuration |
| 74 | |
| 75 | ```json |
| 76 | { |
| 77 | "mcpServers": { |
| 78 | "browser-use-mcp-server": { |
| 79 | "url": "http://localhost:8000/sse" |
| 80 | } |
| 81 | } |
| 82 | } |
| 83 | ``` |
| 84 | |
| 85 | ### stdio Mode Client Configuration |
| 86 | |
| 87 | ```json |
| 88 | { |
| 89 | "mcpServers": { |
| 90 | "browser-server": { |
| 91 | "command": "browser-use-mcp-server", |
| 92 | "args": [ |
| 93 | "run", |
| 94 | "server", |
| 95 | "--port", |
| 96 | "8000", |
| 97 | "--stdio", |
| 98 | "--proxy-port", |
| 99 | "9000" |
| 100 | ], |
| 101 | "env": { |
| 102 | "OPENAI_API_KEY": "your-api-key" |
| 103 | } |
| 104 | } |
| 105 | } |
| 106 | } |
| 107 | ``` |
| 108 | |
| 109 | ### Config Locations |
| 110 | |
| 111 | | Client | Configuration Path | |
| 112 | | ---------------- | ----------------------------------------------------------------- | |
| 113 | | Cursor | `./.cursor/mcp.json` | |
| 114 | | Windsurf | `~/.codeium/windsurf/mcp_config.json` | |
| 115 | | Claude (Mac) | `~/Library/Application Support/Claude/claude_desktop_config.json` | |
| 116 | | Claude (Windows) | `%APPDATA%\Claude\claude_desktop_config.json` | |
| 117 | |
| 118 | ## Features |
| 119 | |
| 120 | - [x] **Browser Automation**: Control browsers through AI agents |
| 121 | - [x] **Dual Transport**: Support for both SSE and stdio protocols |
| 122 | - [x] **VNC Streaming**: Watch browser automation in real-time |
| 123 | - [x] **Async Tasks**: Execute browser operations asynchronously |
| 124 | |
| 125 | ## Local Development |
| 126 | |
| 127 | To develop and test the package locally: |
| 128 | |
| 129 | 1. Build a distributable wheel: |
| 130 | |
| 131 | ```bash |
| 132 | # From the project root directory |
| 133 | uv build |
| 134 | ``` |
| 135 | |
| 136 | 2. Install it as a global tool: |
| 137 | |
| 138 | ```bash |
| 139 | uv tool uninstall browser-use-mcp-server 2>/dev/null || true |
| 140 | uv tool install dist/browser_use_mcp_server-*.whl |
| 141 | ``` |
| 142 | |
| 143 | 3. Run from any directory: |
| 144 | |
| 145 | ```bash |
| 146 | # Set your OpenAI API key for the current session |
| 147 | export OPENAI_API_KEY=your-api-key-here |
| 148 | |
| 149 | # Or provide it inline for a one-time run |
| 150 | OPENAI_API_KEY=your-api-key-here browser-use-mcp-server run server --port 8000 --stdio --proxy-port 9000 |
| 151 | ``` |
| 152 | |
| 153 | 4. After making changes, rebuild and rei |