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
50 changes: 50 additions & 0 deletions .github/workflows/publish-mcp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Publish to MCP Registry

on:
push:
tags: ["v*"]

jobs:
publish:
runs-on: ubuntu-latest
permissions:
id-token: write # Required for OIDC authentication
contents: read

steps:
- name: Checkout code
uses: actions/checkout@v5

- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 10.12.4

- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version: "lts/*"

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Run tests
run: pnpm test --if-present

- name: Build package
run: pnpm build --if-present

- name: Publish to npm
run: pnpm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Install MCP Publisher
run: |
curl -L "https://github.com/modelcontextprotocol/registry/releases/download/latest/mcp-publisher_$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').tar.gz" | tar xz mcp-publisher

- name: Login to MCP Registry
run: ./mcp-publisher login github-oidc

- name: Publish to MCP Registry
run: ./mcp-publisher publish
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.2.0

### Minor Changes

- Remove multisession tools, remove prompts sampling, simplify tool descriptions for better context, add support if google apikey set, latest version of stagehand, remove custom availmodelschema to use stagehand model type instead.

## 2.1.3

### Patch Changes
Expand Down
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![smithery badge](https://smithery.ai/badge/@browserbasehq/mcp-browserbase)](https://smithery.ai/server/@browserbasehq/mcp-browserbase)

![cover](assets/cover-mcp.png)
![cover](assets/cover.png)

[The Model Context Protocol (MCP)](https://modelcontextprotocol.io/introduction) is an open protocol that enables seamless integration between LLM applications and external data sources and tools. Whether you're building an AI-powered IDE, enhancing a chat interface, or creating custom AI workflows, MCP provides a standardized way to connect LLMs with the context they need.

Expand All @@ -19,7 +19,6 @@ This server provides cloud browser automation capabilities using [Browserbase](h
| Model Flexibility | Supports multiple models (OpenAI, Claude, Gemini, and more) |
| Vision Support | Use annotated screenshots for complex DOMs |
| Session Management | Create, manage, and close browser sessions |
| Multi-Session | Run multiple browser sessions in parallel |

## How to Setup

Expand Down Expand Up @@ -194,7 +193,7 @@ The Browserbase MCP server accepts the following command-line flags:
| `--cookies [json]` | JSON array of cookies to inject into the browser |
| `--browserWidth <width>` | Browser viewport width (default: 1024) |
| `--browserHeight <height>` | Browser viewport height (default: 768) |
| `--modelName <model>` | The model to use for Stagehand (default: google/gemini-2.0-flash) |
| `--modelName <model>` | The model to use for Stagehand (default: gemini-2.0-flash) |
| `--modelApiKey <key>` | API key for the custom model provider (required when using custom models) |
| `--experimental` | Enable experimental features (default: false) |

Expand Down Expand Up @@ -386,13 +385,11 @@ The server provides access to screenshot resources:

- **AI-Powered Automation**: Natural language commands for web interactions
- **Multi-Model Support**: Works with OpenAI, Claude, Gemini, and more
- **Advanced Session Management**: Single and multi-session support for parallel browser automation
- **Screenshot Capture**: Full-page and element-specific screenshots
- **Data Extraction**: Intelligent content extraction from web pages
- **Proxy Support**: Enterprise-grade proxy capabilities
- **Stealth Mode**: Advanced anti-detection features
- **Context Persistence**: Maintain authentication and state across sessions
- **Parallel Workflows**: Run multiple browser sessions simultaneously for complex automation tasks

For more information about the Model Context Protocol, visit:

Expand Down
Binary file removed assets/browserbase-demo.png
Binary file not shown.
Binary file removed assets/cover-mcp.png
Binary file not shown.
Binary file removed assets/session.png
Binary file not shown.
8 changes: 4 additions & 4 deletions config.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Cookie } from "playwright-core";
import type { AvailableModelSchema } from "./src/types/models.js";
import type { AvailableModelSchema } from "@browserbasehq/stagehand";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

syntax: type import used where value import needed - AvailableModelSchema is a Zod schema (runtime value), but import type only imports the type, causing line 101 type reference to be incorrect

Suggested change
import type { AvailableModelSchema } from "@browserbasehq/stagehand";
import type { Cookie } from "playwright-core";
import { AvailableModelSchema } from "@browserbasehq/stagehand";
import type { z } from "zod";
Prompt To Fix With AI
This is a comment left during a code review.
Path: config.d.ts
Line: 2:2

Comment:
**syntax:** type import used where value import needed - `AvailableModelSchema` is a Zod schema (runtime value), but `import type` only imports the type, causing line 101 type reference to be incorrect

```suggestion
import type { Cookie } from "playwright-core";
import { AvailableModelSchema } from "@browserbasehq/stagehand";
import type { z } from "zod";
```

How can I resolve this? If you propose a fix, please make it concise.


export type Config = {
/**
Expand Down Expand Up @@ -96,12 +96,12 @@ export type Config = {
* The Model that Stagehand uses
* Available models: OpenAI, Claude, Gemini, Cerebras, Groq, and other providers
*
* @default "google/gemini-2.0-flash"
* @default "gemini-2.0-flash"
*/
modelName?: AvailableModelSchema;
modelName?: z.infer<typeof AvailableModelSchema>;
/**
* API key for the custom model provider
* Required when using a model other than the default google/gemini-2.0-flash
* Required when using a model other than the default gemini-2.0-flash
*/
modelApiKey?: string;
/**
Expand Down
16 changes: 0 additions & 16 deletions evals/mcp-eval-basic.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,22 +76,6 @@
"browserbase_session_close"
]
},
{
"name": "multi-session-test",
"description": "Test multi-session browser management",
"steps": [
{
"user": "Create a multi-session browser named 'test-session', list all sessions, navigate to https://example.com in that session, and close the session",
"expectedState": "closed"
}
],
"expectTools": [
"multi_browserbase_stagehand_session_create",
"multi_browserbase_stagehand_session_list",
"multi_browserbase_stagehand_navigate_session",
"multi_browserbase_stagehand_session_close"
]
},
{
"name": "form-interaction-test",
"description": "Test form filling and submission capabilities",
Expand Down
23 changes: 0 additions & 23 deletions evals/mcp-eval-minimal.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,29 +52,6 @@
"browserbase_session_close"
]
},
{
"name": "smoke-test-multi-session",
"description": "Quick test to verify multi-session functionality",
"steps": [
{
"user": "Create a browser session named 'test-session'",
"expectedState": "session created"
},
{
"user": "List active sessions",
"expectedState": "test-session"
},
{
"user": "Close the test session",
"expectedState": "closed session"
}
],
"expectTools": [
"multi_browserbase_stagehand_session_create",
"multi_browserbase_stagehand_session_list",
"multi_browserbase_stagehand_session_close"
]
},
{
"name": "smoke-test-url-tools",
"description": "Quick test to verify URL retrieval tools work",
Expand Down
32 changes: 0 additions & 32 deletions evals/mcp-eval.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,22 +76,6 @@
"browserbase_session_close"
]
},
{
"name": "multi-session-test",
"description": "Test multi-session browser management",
"steps": [
{
"user": "Create a multi-session browser named 'test-session', list all sessions, navigate to https://example.com in that session, and close the session",
"expectedState": "closed"
}
],
"expectTools": [
"multi_browserbase_stagehand_session_create",
"multi_browserbase_stagehand_session_list",
"multi_browserbase_stagehand_navigate_session",
"multi_browserbase_stagehand_session_close"
]
},
{
"name": "form-interaction-test",
"description": "Test form filling and submission capabilities",
Expand Down Expand Up @@ -121,22 +105,6 @@
"browserbase_session_create",
"browserbase_stagehand_navigate"
]
},
{
"name": "url-retrieval-test",
"description": "Test URL retrieval functionality",
"steps": [
{
"user": "Create a browser session, navigate to https://example.com, get the current URL to verify navigation, and close the session",
"expectedState": "https://example.com"
}
],
"expectTools": [
"browserbase_session_create",
"browserbase_stagehand_navigate",
"browserbase_stagehand_get_url",
"browserbase_session_close"
]
}
]
}
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.3",
"version": "2.2.0",
"description": "MCP server for AI web browser automation using Browserbase and Stagehand",
"mcpName": "io.github.browserbase/mcp-server-browserbase",
"license": "Apache-2.0",
Expand All @@ -24,7 +24,7 @@
],
"scripts": {
"build": "tsc && shx chmod +x dist/*.js",
"prepare": "husky && npm run build",
"prepare": "husky && pnpm build",
"watch": "tsc --watch",
"smithery": "npx @smithery/cli dev src/index.ts",
"inspector": "npx @modelcontextprotocol/inspector build/index.js",
Expand All @@ -46,7 +46,7 @@
},
"dependencies": {
"@browserbasehq/sdk": "^2.6.0",
"@browserbasehq/stagehand": "^2.5.0",
"@browserbasehq/stagehand": "^2.5.2",
"@mcp-ui/server": "^5.10.0",
"@modelcontextprotocol/sdk": "^1.13.1",
"commander": "^14.0.0",
Expand Down
30 changes: 19 additions & 11 deletions pnpm-lock.yaml

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

6 changes: 3 additions & 3 deletions server.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
"url": "https://github.com/browserbase/mcp-server-browserbase",
"source": "github"
},
"version": "2.1.3",
"version": "2.2.0",
"packages": [
{
"registry_type": "npm",
"registry_base_url": "https://registry.npmjs.org",
"identifier": "@browserbasehq/mcp-server-browserbase",
"version": "2.1.1",
"version": "2.2.0",
"transport": {
"type": "stdio"
},
Expand Down Expand Up @@ -44,7 +44,7 @@
{
"registry_type": "oci",
"identifier": "browserbasehq/mcp-server-browserbase",
"version": "2.1.3",
"version": "2.2.0",
"runtime_hint": "docker",
"environment_variables": [
{
Expand Down
10 changes: 6 additions & 4 deletions src/config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { Cookie } from "playwright-core";
import type { Config } from "../config.d.ts";
import type { AvailableModel } from "./types/models.js";
import { z } from "zod";
import { AvailableModelSchema } from "@browserbasehq/stagehand";

export type ToolCapability = "core" | string;

Expand All @@ -15,7 +16,7 @@ export type CLIOptions = {
cookies?: Cookie[];
browserWidth?: number;
browserHeight?: number;
modelName?: typeof AvailableModel;
modelName?: z.infer<typeof AvailableModelSchema>;
modelApiKey?: string;
keepAlive?: boolean;
experimental?: boolean;
Expand All @@ -35,7 +36,7 @@ const defaultConfig: Config = {
browserHeight: 768,
},
cookies: undefined,
modelName: "google/gemini-2.0-flash", // Default Model
modelName: "gemini-2.0-flash", // Default Model
};

// Resolve final configuration by merging defaults, file config, and CLI options
Expand All @@ -46,7 +47,8 @@ export async function resolveConfig(cliOptions: CLIOptions): Promise<Config> {

// --- Add Browserbase Env Vars ---
if (!mergedConfig.modelApiKey) {
mergedConfig.modelApiKey = process.env.GEMINI_API_KEY;
mergedConfig.modelApiKey =
process.env.GEMINI_API_KEY || process.env.GOOGLE_API_KEY;
}

// --------------------------------
Expand Down
Loading