Skip to content

Commit 11c653e

Browse files
committed
adding keep alive flag to MCP
1 parent 056e479 commit 11c653e

File tree

5 files changed

+14
-2
lines changed

5 files changed

+14
-2
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,9 @@ The Browserbase MCP server accepts the following command-line flags:
140140
| -------------------------- | --------------------------------------------------------------------------- |
141141
| `--proxies` | Enable Browserbase proxies for the session |
142142
| `--advancedStealth` | Enable Browserbase Advanced Stealth (Only for Scale Plan Users) |
143+
| `--keepAlive` | Enable Browserbase Keep Alive Session |
143144
| `--contextId <contextId>` | Specify a Browserbase Context ID to use |
144-
| `--persist [boolean]` | Whether to persist the Browserbase context (default: true) |
145+
| `--persist` | Whether to persist the Browserbase context (default: true) |
145146
| `--port <port>` | Port to listen on for HTTP/SHTTP transport |
146147
| `--host <host>` | Host to bind server to (default: localhost, use 0.0.0.0 for all interfaces) |
147148
| `--cookies [json]` | JSON array of cookies to inject into the browser |

config.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ export type Config = {
2323
* @default false
2424
*/
2525
advancedStealth?: boolean;
26+
/**
27+
* Whether or not to keep the Browserbase session alive
28+
*
29+
* @default false
30+
*/
31+
keepAlive?: boolean;
2632
/**
2733
* Potential Browserbase Context to use
2834
* Would be a context ID

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@browserbasehq/mcp-server-browserbase",
3-
"version": "2.0.0",
3+
"version": "2.0.1",
44
"description": "MCP server for AI web browser automation using Browserbase and Stagehand",
55
"license": "Apache-2.0",
66
"author": "Browserbase, Inc. (https://www.browserbase.com/)",

src/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ export const configSchema = z
4848
.describe(
4949
"Use advanced stealth mode. Only available to Browserbase Scale Plan users",
5050
),
51+
keepAlive: z
52+
.boolean()
53+
.optional()
54+
.describe("Whether or not to keep the Browserbase session alive"),
5155
context: z
5256
.object({
5357
contextId: z

src/stagehandStore.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export const createStagehandInstance = async (
3636
browserbaseSessionCreateParams: {
3737
projectId,
3838
proxies: config.proxies,
39+
keepAlive: config.keepAlive ?? false,
3940
browserSettings: {
4041
viewport: {
4142
width: config.viewPort?.browserWidth ?? 1024,

0 commit comments

Comments
 (0)