Skip to content
Draft
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
4 changes: 2 additions & 2 deletions bun.lock

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"@modelcontextprotocol/core": "2.0.0",
"@modelcontextprotocol/server": "2.0.0",
"@onkernel/managed-auth-react": "0.5.5",
"@onkernel/sdk": "0.121.0",
"@onkernel/sdk": "0.123.0",
"@posthog/mcp": "0.17.0",
"@types/jsonwebtoken": "^9.0.10",
"@types/redis": "^4.0.11",
Expand Down
31 changes: 31 additions & 0 deletions src/lib/mcp/tools/browsers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -748,6 +748,37 @@ describe("manage_browsers region", () => {
});
});

describe("manage_browsers video memory", () => {
test("passes video_memory to create", async () => {
const createCalls: unknown[] = [];
const kernelClient = {
browsers: {
create: async (params: unknown) => {
createCalls.push(params);
return { session_id: "brr_123", video_memory: "4GiB" };
},
},
};
const { client, close } = await connectTestMcp(
registerBrowserCapabilities,
kernelClient,
);

try {
const created = toolResultJSON(
await client.callTool({
name: "manage_browsers",
arguments: { action: "create", gpu: true, video_memory: "4GiB" },
}),
);
expect(createCalls).toEqual([{ gpu: true, video_memory: "4GiB" }]);
expect(created.browser.video_memory).toBe("4GiB");
} finally {
await close();
}
});
});

describe("manage_browsers id or name", () => {
test("passes name and tags through create and update", async () => {
const createCalls: unknown[] = [];
Expand Down
8 changes: 8 additions & 0 deletions src/lib/mcp/tools/browsers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,12 @@ export function registerBrowserCapabilities(
"(create) enable gpu acceleration. requires start-up or enterprise plan and headless=false.",
)
.optional(),
video_memory: z
.enum(["2GiB", "4GiB"])
.describe(
"(create) gpu video memory. requires gpu=true. `2GiB` (default) comes with 4 vcpus and 6 gb of memory; `4GiB` comes with 8 vcpus and 12 gb of memory and bills at twice the gpu rate. `4GiB` returns 529 when at capacity; retry later or omit it for `2GiB`.",
)
.optional(),
stealth: z
.boolean()
.describe(
Expand Down Expand Up @@ -782,6 +788,8 @@ export function registerBrowserCapabilities(
if (params.headless !== undefined)
createParams.headless = params.headless;
if (params.gpu !== undefined) createParams.gpu = params.gpu;
if (params.video_memory !== undefined)
createParams.video_memory = params.video_memory;
if (params.stealth !== undefined)
createParams.stealth = params.stealth;
if (params.region !== undefined)
Expand Down
Loading