Skip to content

Commit 885f64e

Browse files
committed
loom video + readme updates
1 parent feb4e6e commit 885f64e

File tree

2 files changed

+72
-30
lines changed

2 files changed

+72
-30
lines changed

browserbase/README.md

Lines changed: 70 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,72 @@
11
# Playwright Browserbase MCP Server
22

3+
![cover](../assets/browserbase-mcp.png)
4+
35
A Model Context Protocol server that uses Playwright and Browserbase
46
to provide browser automation tools.
57

8+
<div>
9+
<a href="https://www.loom.com/share/d285d6093b2843e98908c65592031218">
10+
<img style="max-width:600px;" src="https://cdn.loom.com/sessions/thumbnails/d285d6093b2843e98908c65592031218-1ab1288912ffd40c-full-play.gif">
11+
</a>
12+
</div>
13+
614
## How to setup in MCP json
715

8-
### Local Dev
16+
You can either use our Server hosted on NPM or run it completely locally by cloning this repo.
17+
18+
#### To run on NPM (Recommended)
19+
20+
Go into your MCP Config JSON and add the Browserbase Server:
21+
22+
```json
23+
{
24+
"mcpServers": {
25+
"browserbase": {
26+
"command": "npx",
27+
"args" : ["@browserbasehq/mcp-server-browserbase"],
28+
"env": {
29+
"BROWSERBASE_API_KEY": "",
30+
"BROWSERBASE_PROJECT_ID": ""
31+
}
32+
}
33+
}
34+
}
35+
```
36+
37+
Thats it! Reload your MCP client and Claude will be able to use Browserbase.
38+
39+
#### To run 100% local:
40+
41+
```bash
42+
# Clone the Repo
43+
git clone https://github.com/browserbase/mcp-server-browserbase.git
44+
45+
# Install the dependencies in the proper directory and build the project
46+
cd browserbase
47+
npm install && npm run build
48+
49+
```
950

10-
To run locally we can use STDIO or self-host over SSE.
51+
Then in your MCP Config JSON run the server. To run locally we can use STDIO or self-host over SSE.
1152

1253
### STDIO:
1354

1455
To your MCP Config JSON file add the following:
1556

1657
```json
17-
{
18-
"mcpServers": {
19-
"playwright": {
20-
"command" : "node",
21-
"args" : ["/path/to/mcp-server-browserbase/browserbase/cli.js"],
22-
"env": {
23-
"BROWSERBASE_API_KEY": "",
24-
"BROWSERBASE_PROJECT_ID": ""
58+
{
59+
"mcpServers": {
60+
"browserbase": {
61+
"command" : "node",
62+
"args" : ["/path/to/mcp-server-browserbase/browserbase/cli.js"],
63+
"env": {
64+
"BROWSERBASE_API_KEY": "",
65+
"BROWSERBASE_PROJECT_ID": ""
66+
}
67+
}
2568
}
26-
}
27-
}
28-
}
69+
}
2970
```
3071

3172
### SSE:
@@ -73,6 +114,8 @@ The Browserbase MCP server accepts the following command-line flags:
73114

74115
These flags can be passed directly to the CLI or configured in your MCP configuration file.
75116

117+
### NOTE:
118+
76119
Currently, these flags can only be used with the local server (npx @browserbasehq/mcp-server-browserbase).
77120

78121
____
@@ -83,12 +126,12 @@ ____
83126

84127
Here are our docs on [Proxies](https://docs.browserbase.com/features/proxies).
85128

86-
To use proxies in STDIO, set the --proxies flag in your MCP Config
129+
To use proxies in STDIO, set the --proxies flag in your MCP Config:
87130

88131
```json
89132
{
90133
"mcpServers": {
91-
"playwright": {
134+
"browserbase": {
92135
"command" : "npx",
93136
"args" : ["@browserbasehq/mcp-server-browserbase", "--proxies"],
94137
"env": {
@@ -105,12 +148,12 @@ To use proxies in STDIO, set the --proxies flag in your MCP Config
105148

106149
Here are our docs on [Contexts](https://docs.browserbase.com/features/contexts)
107150

108-
To use proxies in STDIO, set the --proxies flag in your MCP Config
151+
To use contexts in STDIO, set the --contextId flag in your MCP Config:
109152

110153
```json
111154
{
112155
"mcpServers": {
113-
"playwright": {
156+
"browserbase": {
114157
"command" : "npx",
115158
"args" : ["@browserbasehq/mcp-server-browserbase", "--contextId", "<YOUR_CONTEXT_ID>"],
116159
"env": {
@@ -134,13 +177,13 @@ To use proxies in STDIO, set the --proxies flag in your MCP Config. Your cookies
134177
```json
135178
{
136179
"mcpServers": {
137-
"playwright": {
180+
"browserbase" {
138181
"command" : "npx",
139182
"args" : [
140-
"@browserbasehq/mcp-server-browserbase", "cookies",
141-
"{
142-
COOKIES JSON IN TYPE OF PLAYWRIGHT COOKIES
143-
}"
183+
"@browserbasehq/mcp-server-browserbase", "--cookies",
184+
'{
185+
"cookies": json,
186+
}'
144187
],
145188
"env": {
146189
"BROWSERBASE_API_KEY": "",
@@ -160,12 +203,12 @@ Here's how to use it for custom browser sizing. We recommend to stick with 16:9
160203
```json
161204
{
162205
"mcpServers": {
163-
"playwright": {
206+
"browserbase": {
164207
"command" : "npx",
165208
"args" : [
166209
"@browserbasehq/mcp-server-browserbase",
167-
"--browserHeight" : 1080,
168-
"--browserWidth" : 1920,
210+
"--browserHeight 1080",
211+
"--browserWidth 1920",
169212
],
170213
"env": {
171214
"BROWSERBASE_API_KEY": "",
@@ -243,9 +286,9 @@ These tools are useful for:
243286
- Debugging cookie-related issues
244287
- Manipulating cookie attributes (expiration, security flags, etc.)
245288

246-
## TODO
289+
## TODO/Roadmap
247290

248291
* Implement true `ref`-based interaction logic for click, type, drag, hover, select_option.
249292
* Implement element-specific screenshots using `ref`.
250-
* Add more standard Playwright MCP tools (tabs, navigation, etc.).
293+
* Add more standard MCP tools (tabs, navigation, etc.).
251294
* Add tests.

browserbase/src/tools/common.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,12 @@
1111
export {}; // Ensure file is treated as a module
1212

1313
import { z } from 'zod';
14-
import type { Tool, ToolSchema, ToolContext, ToolResult } from "./tool.js"; // Assuming ToolContext is needed if handle uses context
14+
import type { Tool, ToolSchema, ToolResult } from "./tool.js"; // Assuming ToolContext is needed if handle uses context
1515
import type { Context } from '../context.js'; // Import main Context for handle
1616
import type { ToolActionResult } from '../context.js'; // Import ToolActionResult
1717

1818
// Assuming createSuccessResult/createErrorResult exist in toolUtils.js
19-
import { createSuccessResult, createErrorResult } from './toolUtils.js';
20-
import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
19+
// import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
2120

2221
// --- Tool: Wait ---
2322
const WaitInputSchema = z.object({

0 commit comments

Comments
 (0)