Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ The Browserbase MCP server accepts the following command-line flags:
| `--browserHeight <height>` | Browser viewport height (default: 768) |
| `--modelName <model>` | The model to use for Stagehand (default: google/gemini-2.0-flash) |
| `--modelApiKey <key>` | API key for the custom model provider (required when using custom models) |
| `--experimental` | Enable experimental features (default: false) |

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

Expand Down
6 changes: 6 additions & 0 deletions config.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,10 @@ export type Config = {
* Required when using a model other than the default google/gemini-2.0-flash
*/
modelApiKey?: string;
/**
* Enable experimental features
*
* @default false
*/
experimental?: boolean;
};
824 changes: 414 additions & 410 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
},
"dependencies": {
"@browserbasehq/sdk": "^2.6.0",
"@browserbasehq/stagehand": "^2.4.0",
"@browserbasehq/stagehand": "^2.4.3",
"@modelcontextprotocol/sdk": "^1.13.1",
"@smithery/cli": "^1.2.15",
"commander": "^14.0.0",
Expand Down
4 changes: 4 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ export type CLIOptions = {
browserHeight?: number;
modelName?: typeof AvailableModel;
modelApiKey?: string;
keepAlive?: boolean;
experimental?: boolean;
};

// Default Configuration Values
Expand Down Expand Up @@ -97,6 +99,8 @@ export async function configFromCLIOptions(
cookies: cliOptions.cookies,
modelName: cliOptions.modelName,
modelApiKey: cliOptions.modelApiKey,
keepAlive: cliOptions.keepAlive,
experimental: cliOptions.experimental,
};
}

Expand Down
4 changes: 4 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ export const configSchema = z
.describe(
"API key for the custom model provider. Required when using a model other than the default google/gemini-2.0-flash",
),
experimental: z
.boolean()
.optional()
.describe("Enable experimental Stagehand features"),
})
.refine(
(data) => {
Expand Down
2 changes: 2 additions & 0 deletions src/program.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ program
"--modelApiKey <key>",
"API key for the custom model provider (required when using custom models)",
)
.option("--keepAlive", "Enable Browserbase Keep Alive Session")
.option("--experimental", "Enable experimental features")
.action(async (options) => {
const config = await resolveConfig(options);
const serverList = new ServerList(async () =>
Expand Down
1 change: 1 addition & 0 deletions src/stagehandStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export const createStagehandInstance = async (
...(params.browserbaseSessionID && {
browserbaseSessionID: params.browserbaseSessionID,
}),
experimental: config.experimental ?? false,
browserbaseSessionCreateParams: {
projectId,
proxies: config.proxies,
Expand Down
Loading