Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Dependencies
node_modules/

# Build output
dist/

# Tests
tests/
evals/

# Git
.git/
.gitignore

# Documentation
*.md
!README.md
assets/

# CI/CD
.github/

# IDE
.vscode/
.idea/

# Logs
*.log
npm-debug.log*

# Environment
.env
.env.local

# Misc
.DS_Store
*.swp
*.swo
*~

6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @browserbasehq/mcp-server-browserbase

## 2.1.3

### Patch Changes

- Adding docker deployment support

## 2.1.2

### Patch Changes
Expand Down
27 changes: 27 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM node:22-alpine AS builder

RUN corepack enable

WORKDIR /app

COPY package.json pnpm-lock.yaml ./
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
pnpm install --frozen-lockfile --ignore-scripts

COPY . .
RUN pnpm run build && \
pnpm prune --prod --ignore-scripts

FROM gcr.io/distroless/nodejs22-debian12

LABEL io.modelcontextprotocol.server.name="io.github.browserbase/mcp-server-browserbase"

WORKDIR /app

COPY --from=builder /app/package.json ./
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/cli.js ./cli.js
COPY --from=builder /app/index.js ./index.js

CMD ["cli.js"]
90 changes: 89 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ That's it! Reload your MCP client and Claude will be able to use Browserbase.

### To run 100% local:

#### Option 1: Direct installation

```bash
# Clone the Repo
git clone https://github.com/browserbase/mcp-server-browserbase.git
Expand All @@ -108,10 +110,23 @@ cd mcp-server-browserbase
npm install && npm run build
```

#### Option 2: Docker

```bash
# Clone the Repo
git clone https://github.com/browserbase/mcp-server-browserbase.git
cd mcp-server-browserbase

# Build the Docker image
docker build -t mcp-browserbase .
```

Then in your MCP Config JSON run the server. To run locally we can use STDIO or self-host SHTTP.

### STDIO:

#### Using Direct Installation

To your MCP Config JSON file add the following:

```json
Expand All @@ -130,6 +145,37 @@ To your MCP Config JSON file add the following:
}
```

#### Using Docker

To your MCP Config JSON file add the following:

```json
{
"mcpServers": {
"browserbase": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"-e",
"BROWSERBASE_API_KEY",
"-e",
"BROWSERBASE_PROJECT_ID",
"-e",
"GEMINI_API_KEY",
"mcp-browserbase"
],
"env": {
"BROWSERBASE_API_KEY": "",
"BROWSERBASE_PROJECT_ID": "",
"GEMINI_API_KEY": ""
}
}
}
}
```

Then reload your MCP client and you should be good to go!

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

### NOTE:

Currently, these flags can only be used with the local server (npx @browserbasehq/mcp-server-browserbase).
Currently, these flags can only be used with the local server (npx @browserbasehq/mcp-server-browserbase or Docker).

### Using Configuration Flags with Docker

When using Docker, you can pass configuration flags as additional arguments after the image name. Here's an example with the `--proxies` flag:

```json
{
"mcpServers": {
"browserbase": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"-e",
"BROWSERBASE_API_KEY",
"-e",
"BROWSERBASE_PROJECT_ID",
"-e",
"GEMINI_API_KEY",
"mcp-browserbase",
"--proxies"
],
"env": {
"BROWSERBASE_API_KEY": "",
"BROWSERBASE_PROJECT_ID": "",
"GEMINI_API_KEY": ""
}
}
}
}
```

You can also run the Docker container directly from the command line:

```bash
docker run --rm -i \
-e BROWSERBASE_API_KEY=your_api_key \
-e BROWSERBASE_PROJECT_ID=your_project_id \
-e GEMINI_API_KEY=your_gemini_key \
mcp-browserbase --proxies
```

## Configuration Examples

Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@browserbasehq/mcp-server-browserbase",
"version": "2.1.2",
"version": "2.1.3",
"description": "MCP server for AI web browser automation using Browserbase and Stagehand",
"mcpName": "io.github.browserbase/mcp-server-browserbase",
"license": "Apache-2.0",
Expand Down Expand Up @@ -49,22 +49,22 @@
"@browserbasehq/stagehand": "^2.5.0",
"@mcp-ui/server": "^5.10.0",
"@modelcontextprotocol/sdk": "^1.13.1",
"@smithery/cli": "^1.2.15",
"commander": "^14.0.0",
"dotenv": "^16.4.6",
"mcpvals": "^0.0.3",
"playwright-core": "^1.53.2",
"zod": "^3.25.67"
},
"devDependencies": {
"@changesets/cli": "^2.29.6",
"@eslint/js": "^9.29.0",
"@smithery/cli": "^1.2.15",
"chalk": "^5.3.0",
"eslint": "^9.29.0",
"eslint-plugin-react": "^7.37.5",
"globals": "^16.2.0",
"husky": "^9.1.7",
"lint-staged": "^16.1.2",
"playwright-core": "^1.53.2",
"prettier": "^3.6.1",
"shx": "^0.3.4",
"tsx": "^4.20.3",
Expand Down
12 changes: 6 additions & 6 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 33 additions & 1 deletion server.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/browserbase/mcp-server-browserbase",
"source": "github"
},
"version": "2.1.1",
"version": "2.1.3",
"packages": [
{
"registry_type": "npm",
Expand Down Expand Up @@ -40,6 +40,38 @@
"name": "GEMINI_API_KEY"
}
]
},
{
"registry_type": "oci",
"identifier": "browserbasehq/mcp-server-browserbase",
"version": "2.1.3",
"runtime_hint": "docker",
"environment_variables": [
{
"description": "Your Browserbase API key",
"is_required": true,
"format": "string",
"is_secret": true,
"name": "BROWSERBASE_API_KEY"
},
{
"description": "Your Browserbase Project ID",
"is_required": true,
"format": "string",
"is_secret": false,
"name": "BROWSERBASE_PROJECT_ID"
},
{
"description": "Your Gemini API key (default model)",
"is_required": true,
"format": "string",
"is_secret": true,
"name": "GEMINI_API_KEY"
}
],
"transport": {
"type": "stdio"
}
}
]
}
Loading