Skip to content

Commit 91e313f

Browse files
committed
better extract + update tool names + add pnpm prettier lint
1 parent f1d7dec commit 91e313f

30 files changed

+5895
-641
lines changed

README.md

Lines changed: 140 additions & 140 deletions
Large diffs are not rendered by default.

cli.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#!/usr/bin/env node
2-
import './dist/program.js';
2+
import "./dist/program.js";

config.d.ts

Lines changed: 65 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -2,80 +2,80 @@ import type { Cookie } from "playwright-core";
22
import type { AvailableModelSchema } from "@browserbasehq/stagehand";
33

44
export type Config = {
5+
/**
6+
* The Browserbase API Key to use
7+
*/
8+
browserbaseApiKey?: string;
9+
/**
10+
* The Browserbase Project ID to use
11+
*/
12+
browserbaseProjectId?: string;
13+
/**
14+
* Whether or not to use Browserbase proxies
15+
* https://docs.browserbase.com/features/proxies
16+
*
17+
* @default false
18+
*/
19+
proxies?: boolean;
20+
/**
21+
* Use advanced stealth mode. Only available to Browserbase Scale Plan users.
22+
*
23+
* @default false
24+
*/
25+
advancedStealth?: boolean;
26+
/**
27+
* Potential Browserbase Context to use
28+
* Would be a context ID
29+
*/
30+
context?: {
531
/**
6-
* The Browserbase API Key to use
32+
* The ID of the context to use
733
*/
8-
browserbaseApiKey?: string;
34+
contextId?: string;
935
/**
10-
* The Browserbase Project ID to use
36+
* Whether or not to persist the context
37+
*
38+
* @default true
1139
*/
12-
browserbaseProjectId?: string;
13-
/**
14-
* Whether or not to use Browserbase proxies
15-
* https://docs.browserbase.com/features/proxies
16-
*
17-
* @default false
18-
*/
19-
proxies?: boolean;
20-
/**
21-
* Use advanced stealth mode. Only available to Browserbase Scale Plan users.
22-
*
23-
* @default false
24-
*/
25-
advancedStealth?: boolean;
26-
/**
27-
* Potential Browserbase Context to use
28-
* Would be a context ID
29-
*/
30-
context?: {
31-
/**
32-
* The ID of the context to use
33-
*/
34-
contextId?: string;
35-
/**
36-
* Whether or not to persist the context
37-
*
38-
* @default true
39-
*/
40-
persist?: boolean;
41-
};
40+
persist?: boolean;
41+
};
42+
/**
43+
*
44+
*/
45+
viewPort?: {
4246
/**
43-
*
47+
* The width of the browser
4448
*/
45-
viewPort?: {
46-
/**
47-
* The width of the browser
48-
*/
49-
browserWidth?: number;
50-
/**
51-
* The height of the browser
52-
*/
53-
browserHeight?: number;
54-
};
49+
browserWidth?: number;
5550
/**
56-
* Cookies to inject into the Browserbase context
57-
* Format: Array of cookie objects with name, value, domain, and optional path, expires, httpOnly, secure, sameSite
51+
* The height of the browser
5852
*/
59-
cookies?: Cookie[];
53+
browserHeight?: number;
54+
};
55+
/**
56+
* Cookies to inject into the Browserbase context
57+
* Format: Array of cookie objects with name, value, domain, and optional path, expires, httpOnly, secure, sameSite
58+
*/
59+
cookies?: Cookie[];
60+
/**
61+
* Whether or not to port to a server
62+
*
63+
*/
64+
server?: {
6065
/**
61-
* Whether or not to port to a server
62-
*
66+
* The port to listen on for SSE or MCP transport.
6367
*/
64-
server?: {
65-
/**
66-
* The port to listen on for SSE or MCP transport.
67-
*/
68-
port?: number;
69-
/**
70-
* The host to bind the server to. Default is localhost. Use 0.0.0.0 to bind to all interfaces.
71-
*/
72-
host?: string;
73-
};
68+
port?: number;
7469
/**
75-
* The Model that Stagehand uses
76-
* Available models: OpenAI, Claude, Gemini, Cerebras, Groq, and other providers
77-
*
78-
* @default "google/gemini-2.0-flash"
70+
* The host to bind the server to. Default is localhost. Use 0.0.0.0 to bind to all interfaces.
7971
*/
80-
modelName?: AvailableModelSchema;
81-
};
72+
host?: string;
73+
};
74+
/**
75+
* The Model that Stagehand uses
76+
* Available models: OpenAI, Claude, Gemini, Cerebras, Groq, and other providers
77+
*
78+
* @default "google/gemini-2.0-flash"
79+
*/
80+
modelName?: AvailableModelSchema;
81+
};

eslint.config.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import js from "@eslint/js";
2+
import globals from "globals";
3+
import tseslint from "typescript-eslint";
4+
import { defineConfig } from "eslint/config";
5+
6+
export default defineConfig([
7+
{
8+
files: ["**/*.{js,mjs,cjs,ts,mts,cts}"],
9+
plugins: { js },
10+
extends: ["js/recommended"],
11+
ignores: ["dist/**/*"],
12+
},
13+
{
14+
files: ["**/*.{js,mjs,cjs,ts,mts,cts}"],
15+
languageOptions: { globals: { ...globals.browser, ...globals.node } },
16+
ignores: ["dist/**/*"],
17+
},
18+
tseslint.configs.recommended,
19+
{
20+
files: ["**/*.{ts,mts,cts}"],
21+
rules: {
22+
"@typescript-eslint/no-explicit-any": "off",
23+
"@typescript-eslint/no-unused-vars": "off",
24+
"@typescript-eslint/ban-ts-comment": "off",
25+
},
26+
ignores: ["dist/**/*"],
27+
},
28+
{
29+
ignores: ["dist/**/*", "node_modules/**/*"],
30+
},
31+
]);

index.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import type { Server } from '@modelcontextprotocol/sdk/server/index.js';
1+
import type { Server } from "@modelcontextprotocol/sdk/server/index.js";
22

3-
import type { Config } from './config';
3+
import type { Config } from "./config";
44

55
export declare function createServer(config?: Config): Promise<Server>;
6-
export {};
6+
export {};

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
import { createServer } from './dist/index.js';
2-
export default { createServer };
1+
import { createServer } from "./dist/index.js";
2+
export default { createServer };

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
"name": "@browserbasehq/mcp",
33
"version": "2.0.0",
44
"description": "MCP server for AI web browser automation using Stagehand",
5-
"license": "MIT",
5+
"license": "Apache-2.0",
66
"author": "Browserbase, Inc. (https://www.browserbase.com/)",
7-
"homepage": "https://modelcontextprotocol.io",
7+
"homepage": "https://www.browserbase.com",
88
"bugs": "https://github.com/modelcontextprotocol/servers/issues",
99
"type": "module",
1010
"main": "./cli.js",
@@ -21,7 +21,10 @@
2121
"scripts": {
2222
"build": "tsc && shx chmod +x dist/*.js",
2323
"prepare": "npm run build",
24-
"watch": "tsc --watch"
24+
"watch": "tsc --watch",
25+
"lint": "eslint . --ext .ts",
26+
"prettier:check": "prettier --check .",
27+
"prettier:fix": "prettier --write ."
2528
},
2629
"dependencies": {
2730
"@browserbasehq/stagehand": "^2.4.0",
@@ -30,7 +33,14 @@
3033
"commander": "^14.0.0"
3134
},
3235
"devDependencies": {
36+
"@eslint/js": "^9.29.0",
37+
"eslint": "^9.29.0",
38+
"eslint-plugin-react": "^7.37.5",
39+
"globals": "^16.2.0",
40+
"prettier": "^3.6.1",
3341
"shx": "^0.3.4",
34-
"typescript": "^5.6.2"
35-
}
42+
"typescript": "^5.6.2",
43+
"typescript-eslint": "^8.35.0"
44+
},
45+
"packageManager": "[email protected]+sha512.d615db246fe70f25dcfea6d8d73dee782ce23e2245e3c4f6f888249fb568149318637dca73c2c5c8ef2a4ca0d5657fb9567188bfab47f566d1ee6ce987815c39"
3646
}

0 commit comments

Comments
 (0)