Skip to content

Commit 63b14b0

Browse files
Code42Categreptile-apps[bot]Kylejeong2
authored
Add Docker Support (#124)
* add docker support * fix version Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * changesets --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Co-authored-by: Kylejeong2 <kylejeong21@gmail.com>
1 parent 990a8b2 commit 63b14b0

File tree

7 files changed

+204
-11
lines changed

7 files changed

+204
-11
lines changed

.dockerignore

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Dependencies
2+
node_modules/
3+
4+
# Build output
5+
dist/
6+
7+
# Tests
8+
tests/
9+
evals/
10+
11+
# Git
12+
.git/
13+
.gitignore
14+
15+
# Documentation
16+
*.md
17+
!README.md
18+
assets/
19+
20+
# CI/CD
21+
.github/
22+
23+
# IDE
24+
.vscode/
25+
.idea/
26+
27+
# Logs
28+
*.log
29+
npm-debug.log*
30+
31+
# Environment
32+
.env
33+
.env.local
34+
35+
# Misc
36+
.DS_Store
37+
*.swp
38+
*.swo
39+
*~
40+

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @browserbasehq/mcp-server-browserbase
22

3+
## 2.1.3
4+
5+
### Patch Changes
6+
7+
- Adding docker deployment support
8+
39
## 2.1.2
410

511
### Patch Changes

Dockerfile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
FROM node:22-alpine AS builder
2+
3+
RUN corepack enable
4+
5+
WORKDIR /app
6+
7+
COPY package.json pnpm-lock.yaml ./
8+
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
9+
pnpm install --frozen-lockfile --ignore-scripts
10+
11+
COPY . .
12+
RUN pnpm run build && \
13+
pnpm prune --prod --ignore-scripts
14+
15+
FROM gcr.io/distroless/nodejs22-debian12
16+
17+
LABEL io.modelcontextprotocol.server.name="io.github.browserbase/mcp-server-browserbase"
18+
19+
WORKDIR /app
20+
21+
COPY --from=builder /app/package.json ./
22+
COPY --from=builder /app/node_modules ./node_modules
23+
COPY --from=builder /app/dist ./dist
24+
COPY --from=builder /app/cli.js ./cli.js
25+
COPY --from=builder /app/index.js ./index.js
26+
27+
CMD ["cli.js"]

README.md

Lines changed: 89 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ That's it! Reload your MCP client and Claude will be able to use Browserbase.
9999

100100
### To run 100% local:
101101

102+
#### Option 1: Direct installation
103+
102104
```bash
103105
# Clone the Repo
104106
git clone https://github.com/browserbase/mcp-server-browserbase.git
@@ -108,10 +110,23 @@ cd mcp-server-browserbase
108110
npm install && npm run build
109111
```
110112

113+
#### Option 2: Docker
114+
115+
```bash
116+
# Clone the Repo
117+
git clone https://github.com/browserbase/mcp-server-browserbase.git
118+
cd mcp-server-browserbase
119+
120+
# Build the Docker image
121+
docker build -t mcp-browserbase .
122+
```
123+
111124
Then in your MCP Config JSON run the server. To run locally we can use STDIO or self-host SHTTP.
112125

113126
### STDIO:
114127

128+
#### Using Direct Installation
129+
115130
To your MCP Config JSON file add the following:
116131

117132
```json
@@ -130,6 +145,37 @@ To your MCP Config JSON file add the following:
130145
}
131146
```
132147

148+
#### Using Docker
149+
150+
To your MCP Config JSON file add the following:
151+
152+
```json
153+
{
154+
"mcpServers": {
155+
"browserbase": {
156+
"command": "docker",
157+
"args": [
158+
"run",
159+
"--rm",
160+
"-i",
161+
"-e",
162+
"BROWSERBASE_API_KEY",
163+
"-e",
164+
"BROWSERBASE_PROJECT_ID",
165+
"-e",
166+
"GEMINI_API_KEY",
167+
"mcp-browserbase"
168+
],
169+
"env": {
170+
"BROWSERBASE_API_KEY": "",
171+
"BROWSERBASE_PROJECT_ID": "",
172+
"GEMINI_API_KEY": ""
173+
}
174+
}
175+
}
176+
}
177+
```
178+
133179
Then reload your MCP client and you should be good to go!
134180

135181
## Configuration
@@ -156,7 +202,49 @@ These flags can be passed directly to the CLI or configured in your MCP configur
156202

157203
### NOTE:
158204

159-
Currently, these flags can only be used with the local server (npx @browserbasehq/mcp-server-browserbase).
205+
Currently, these flags can only be used with the local server (npx @browserbasehq/mcp-server-browserbase or Docker).
206+
207+
### Using Configuration Flags with Docker
208+
209+
When using Docker, you can pass configuration flags as additional arguments after the image name. Here's an example with the `--proxies` flag:
210+
211+
```json
212+
{
213+
"mcpServers": {
214+
"browserbase": {
215+
"command": "docker",
216+
"args": [
217+
"run",
218+
"--rm",
219+
"-i",
220+
"-e",
221+
"BROWSERBASE_API_KEY",
222+
"-e",
223+
"BROWSERBASE_PROJECT_ID",
224+
"-e",
225+
"GEMINI_API_KEY",
226+
"mcp-browserbase",
227+
"--proxies"
228+
],
229+
"env": {
230+
"BROWSERBASE_API_KEY": "",
231+
"BROWSERBASE_PROJECT_ID": "",
232+
"GEMINI_API_KEY": ""
233+
}
234+
}
235+
}
236+
}
237+
```
238+
239+
You can also run the Docker container directly from the command line:
240+
241+
```bash
242+
docker run --rm -i \
243+
-e BROWSERBASE_API_KEY=your_api_key \
244+
-e BROWSERBASE_PROJECT_ID=your_project_id \
245+
-e GEMINI_API_KEY=your_gemini_key \
246+
mcp-browserbase --proxies
247+
```
160248

161249
## Configuration Examples
162250

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@browserbasehq/mcp-server-browserbase",
3-
"version": "2.1.2",
3+
"version": "2.1.3",
44
"description": "MCP server for AI web browser automation using Browserbase and Stagehand",
55
"mcpName": "io.github.browserbase/mcp-server-browserbase",
66
"license": "Apache-2.0",
@@ -49,22 +49,22 @@
4949
"@browserbasehq/stagehand": "^2.5.0",
5050
"@mcp-ui/server": "^5.10.0",
5151
"@modelcontextprotocol/sdk": "^1.13.1",
52-
"@smithery/cli": "^1.2.15",
5352
"commander": "^14.0.0",
5453
"dotenv": "^16.4.6",
5554
"mcpvals": "^0.0.3",
56-
"playwright-core": "^1.53.2",
5755
"zod": "^3.25.67"
5856
},
5957
"devDependencies": {
6058
"@changesets/cli": "^2.29.6",
6159
"@eslint/js": "^9.29.0",
60+
"@smithery/cli": "^1.2.15",
6261
"chalk": "^5.3.0",
6362
"eslint": "^9.29.0",
6463
"eslint-plugin-react": "^7.37.5",
6564
"globals": "^16.2.0",
6665
"husky": "^9.1.7",
6766
"lint-staged": "^16.1.2",
67+
"playwright-core": "^1.53.2",
6868
"prettier": "^3.6.1",
6969
"shx": "^0.3.4",
7070
"tsx": "^4.20.3",

pnpm-lock.yaml

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

server.json

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"url": "https://github.com/browserbase/mcp-server-browserbase",
88
"source": "github"
99
},
10-
"version": "2.1.1",
10+
"version": "2.1.3",
1111
"packages": [
1212
{
1313
"registry_type": "npm",
@@ -40,6 +40,38 @@
4040
"name": "GEMINI_API_KEY"
4141
}
4242
]
43+
},
44+
{
45+
"registry_type": "oci",
46+
"identifier": "browserbasehq/mcp-server-browserbase",
47+
"version": "2.1.3",
48+
"runtime_hint": "docker",
49+
"environment_variables": [
50+
{
51+
"description": "Your Browserbase API key",
52+
"is_required": true,
53+
"format": "string",
54+
"is_secret": true,
55+
"name": "BROWSERBASE_API_KEY"
56+
},
57+
{
58+
"description": "Your Browserbase Project ID",
59+
"is_required": true,
60+
"format": "string",
61+
"is_secret": false,
62+
"name": "BROWSERBASE_PROJECT_ID"
63+
},
64+
{
65+
"description": "Your Gemini API key (default model)",
66+
"is_required": true,
67+
"format": "string",
68+
"is_secret": true,
69+
"name": "GEMINI_API_KEY"
70+
}
71+
],
72+
"transport": {
73+
"type": "stdio"
74+
}
4375
}
4476
]
4577
}

0 commit comments

Comments
 (0)