1
- # ➡️ browser-use mcp server
1
+ # browser-use- mcp- server
2
2
3
- [ browser-use] ( https://github.com/browser-use/browser-use ) MCP Server with SSE
4
- transport
3
+ <div align =" center " >
5
4
6
- ### requirements
5
+ [ ![ Twitter URL] ( https://img.shields.io/twitter/url/https/twitter.com/cobrowser.svg?style=social&label=Follow%20%40cobrowser )] ( https://x.com/cobrowser )
6
+ [ ![ PyPI version] ( https://badge.fury.io/py/browser-use-mcp-server.svg )] ( https://pypi.org/project/browser-use-mcp-server/ )
7
7
8
- - uv
8
+ ** An MCP server that enables AI agents to control web browsers using
9
+ [ browser-use] ( https://github.com/browser-use/browser-use ) .**
9
10
10
- ```
11
- curl -LsSf https://astral.sh/uv/install.sh | sh
12
- ```
11
+ </div >
13
12
14
- ### quickstart
13
+ ## Prerequisites
15
14
16
- ```
17
- uv sync
18
- uv pip install playwright
19
- uv run playwright install --with-deps --no-shell chromium
20
- uv run server --port 8000
21
- ```
22
-
23
- - the .env requires the following:
15
+ - [ uv] ( https://github.com/astral-sh/uv ) - Fast Python package manager
16
+ - [ Playwright] ( https://playwright.dev/ ) - Browser automation
17
+ - [ mcp-proxy] ( https://github.com/sparfenyuk/mcp-proxy ) - Required for stdio mode
24
18
25
- ```
26
- OPENAI_API_KEY=[your api key]
27
- CHROME_PATH=[only change this if you have a custom chrome build]
28
- PATIENT=false # Set to true if you want api calls to wait for tasks to complete (default is false)
19
+ ``` bash
20
+ # Install prerequisites
21
+ curl -LsSf https://astral.sh/uv/install.sh | sh
22
+ uv tool install mcp-proxy
23
+ uv tool update-shell
29
24
```
30
25
31
- - we will be adding support for other LLM providers to power browser-use
32
- (claude, grok, bedrock, etc)
26
+ ## Environment
33
27
34
- when building the docker image, you can use Docker secrets for VNC password :
28
+ Create a ` .env ` file :
35
29
36
30
```
37
- # With Docker secrets (recommended for production)
38
- echo "your-secure-password" > vnc_password.txt
39
- docker run -v $(pwd)/vnc_password.txt:/run/secrets/vnc_password your-image-name
40
-
41
- # Or during development with the default password
42
- docker build .
31
+ OPENAI_API_KEY=your-api-key
32
+ CHROME_PATH=optional/path/to/chrome
33
+ PATIENT=false # Set to true if API calls should wait for task completion
43
34
```
44
35
45
- ### tools
36
+ ## Installation
46
37
47
- - [x] SSE transport
48
- - [x] browser_use - Initiates browser tasks with URL and action
49
- - [x] browser_get_result - Retrieves results of async browser tasks
50
- - [x] VNC server - stream the dockerized browser to your client
38
+ ``` bash
39
+ # Install dependencies
40
+ uv sync
41
+ uv pip install playwright
42
+ uv run playwright install --with-deps --no-shell chromium
43
+ ```
51
44
52
- ### VNC
45
+ ## Usage
53
46
54
- the dockerfile has a vnc server with a default password of browser-use. connect
55
- to it:
47
+ ### SSE Mode
56
48
57
- ```
58
- docker build -t browser-use-mcp-server .
59
- docker run --rm -p8000:8000 -p5900:5900 browser-use-mcp-server
60
- git clone https://github.com/novnc/noVNC
61
- cd noVNC
62
- ./utils/novnc_proxy --vnc localhost:5900
49
+ ``` bash
50
+ # Run directly from source
51
+ uv run server --port 8000
63
52
```
64
53
65
- <p align =" center " >
66
- <img width =" 428 " alt =" Screenshot 2025-03-24 at 12 03 15 PM " src =" https://github.com/user-attachments/assets/45bc5bee-418d-4182-94f5-db84b4fc0b3a " />
67
- <br >
68
- <img width =" 428 " alt =" Screenshot 2025-03-24 at 12 11 42 PM " src =" https://github.com/user-attachments/assets/7db53f41-fc00-4e48-8892-f7108096f9c4 " />
69
- </p >
54
+ ### stdio Mode
70
55
71
- ### supported clients
56
+ ``` bash
57
+ # 1. Build and install globally
58
+ uv build
59
+ uv tool uninstall browser-use-mcp-server 2> /dev/null || true
60
+ uv tool install dist/browser_use_mcp_server-* .whl
72
61
73
- - cursor.ai
74
- - claude desktop
75
- - claude code
76
- - <s >windsurf</s > ([ windsurf] ( https://codeium.com/windsurf ) doesn't support SSE
77
- yet)
62
+ # 2. Run with stdio transport
63
+ browser-use-mcp-server run server --port 8000 --stdio --proxy-port 9000
64
+ ```
78
65
79
- ### usage
66
+ ## Client Configuration
80
67
81
- after running the server, add http://localhost:8000/sse to your client UI, or in
82
- a mcp.json file:
68
+ ### SSE Mode
83
69
84
70
``` json
85
71
{
@@ -91,31 +77,130 @@ a mcp.json file:
91
77
}
92
78
```
93
79
94
- #### cursor
80
+ ### stdio Mode
95
81
96
- - ` ./.cursor/mcp.json `
82
+ ``` json
83
+ {
84
+ "mcpServers" : {
85
+ "browser-server" : {
86
+ "command" : " browser-use-mcp-server" ,
87
+ "args" : [
88
+ " run" ,
89
+ " server" ,
90
+ " --port" ,
91
+ " 8000" ,
92
+ " --stdio" ,
93
+ " --proxy-port" ,
94
+ " 9000"
95
+ ],
96
+ "env" : {
97
+ "OPENAI_API_KEY" : " your-api-key"
98
+ }
99
+ }
100
+ }
101
+ }
102
+ ```
103
+
104
+ ### Config Locations
105
+
106
+ | Client | Configuration Path |
107
+ | ---------------- | ----------------------------------------------------------------- |
108
+ | Cursor | ` ./.cursor/mcp.json ` |
109
+ | Windsurf | ` ~/.codeium/windsurf/mcp_config.json ` |
110
+ | Claude (Mac) | ` ~/Library/Application Support/Claude/claude_desktop_config.json ` |
111
+ | Claude (Windows) | ` %APPDATA%\Claude\claude_desktop_config.json ` |
112
+
113
+ ## Features
114
+
115
+ - [x] ** Browser Automation** : Control browsers through AI agents
116
+ - [x] ** Dual Transport** : Support for both SSE and stdio protocols
117
+ - [x] ** VNC Streaming** : Watch browser automation in real-time
118
+ - [x] ** Async Tasks** : Execute browser operations asynchronously
119
+
120
+ ## Local Development
121
+
122
+ To develop and test the package locally:
123
+
124
+ 1 . Build a distributable wheel:
125
+
126
+ ``` bash
127
+ # From the project root directory
128
+ uv build
129
+ ```
130
+
131
+ 2 . Install it as a global tool:
132
+
133
+ ``` bash
134
+ uv tool uninstall browser-use-mcp-server 2> /dev/null || true
135
+ uv tool install dist/browser_use_mcp_server-* .whl
136
+ ```
137
+
138
+ 3 . Run from any directory:
139
+
140
+ ``` bash
141
+ # Set your OpenAI API key for the current session
142
+ export OPENAI_API_KEY=your-api-key-here
97
143
98
- #### windsurf
144
+ # Or provide it inline for a one-time run
145
+ OPENAI_API_KEY=your-api-key-here browser-use-mcp-server run server --port 8000 --stdio --proxy-port 9000
146
+ ```
99
147
100
- - ` ~/.codeium/windsurf/mcp_config.json `
148
+ 4 . After making changes, rebuild and reinstall:
149
+ ``` bash
150
+ uv build
151
+ uv tool uninstall browser-use-mcp-server
152
+ uv tool install dist/browser_use_mcp_server-* .whl
153
+ ```
101
154
102
- #### claude
155
+ ## Docker
103
156
104
- - ` ~/Library/Application Support/Claude/claude_desktop_config.json `
105
- - ` %APPDATA%\Claude\claude_desktop_config.json `
157
+ ``` bash
158
+ # Run with default VNC password
159
+ docker build -t browser-use-mcp-server .
160
+ docker run --rm -p8000:8000 -p5900:5900 browser-use-mcp-server
161
+
162
+ # Use custom VNC password
163
+ echo " your-password" > vnc_password.txt
164
+ docker run --rm -p8000:8000 -p5900:5900 \
165
+ -v $( pwd) /vnc_password.txt:/run/secrets/vnc_password \
166
+ browser-use-mcp-server
167
+ ```
168
+
169
+ ### VNC Viewer
170
+
171
+ ``` bash
172
+ # Browser-based viewer
173
+ git clone https://github.com/novnc/noVNC
174
+ cd noVNC
175
+ ./utils/novnc_proxy --vnc localhost:5900
176
+ ```
177
+
178
+ Default password: ` browser-use `
179
+
180
+ <div align =" center " >
181
+ <img width =" 428 " alt =" VNC Screenshot " src =" https://github.com/user-attachments/assets/45bc5bee-418d-4182-94f5-db84b4fc0b3a " />
182
+ <br ><br >
183
+ <img width =" 428 " alt =" VNC Screenshot " src =" https://github.com/user-attachments/assets/7db53f41-fc00-4e48-8892-f7108096f9c4 " />
184
+ </div >
106
185
107
- then try asking your LLM the following:
186
+ ## Example
108
187
109
- ` open https://news.ycombinator.com and return the top ranked article `
188
+ Try asking your AI:
189
+
190
+ ```
191
+ open https://news.ycombinator.com and return the top ranked article
192
+ ```
110
193
111
- ### help
194
+ ## Support
112
195
113
- for issues or interest reach out @ https://cobrowser.xyz
196
+ For issues or inquiries: [ cobrowser.xyz ] ( https://cobrowser.xyz )
114
197
115
- # stars
198
+ ## Star History
116
199
117
- <picture >
118
- <source media =" (prefers-color-scheme: dark) " srcset =" https://api.star-history.com/svg?repos=co-browser/browser-use-mcp-server&type=Date&theme=dark " />
119
- <source media =" (prefers-color-scheme: light) " srcset =" https://api.star-history.com/svg?repos=co-browser/browser-use-mcp-server&type=Date " />
120
- <img alt =" Star History Chart " src =" https://api.star-history.com/svg?repos=co-browser/browser-use-mcp-server&type=Date " />
121
- </picture >
200
+ <div align =" center " >
201
+ <picture >
202
+ <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=co-browser/browser-use-mcp-server&type=Date&theme=dark" />
203
+ <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=co-browser/browser-use-mcp-server&type=Date" />
204
+ <img alt="Star History Chart" src="https://api.star-history.com/svg?repos=co-browser/browser-use-mcp-server&type=Date" />
205
+ </picture >
206
+ </div >
0 commit comments