Add browser pool parity fields to MCP
Summary
- add
updatesupport to the existingmanage_browser_poolsMCP tool - add browser pool create/update parity fields from the SDK:
start_url,chrome_policy,kiosk_mode, extension selection, profile ID/save settings, and viewport settings - add update-only
discard_all_idlesupport without requiring agents to resend unchanged pool size/config - reuse shared browser config helpers for profile, extension, and viewport request shaping across
manage_browsersandmanage_browser_pools - derive browser config response payload types from SDK method params instead of locally re-declaring SDK-shaped objects
- improve MCP agent ergonomics with compact browser-pool/browser list responses, structured
next_actions, stable pool-ID follow-ups, and structured SSH forwarding guidance - centralize MCP response helpers, pagination response formatting, and pagination schemas so tools do not hand-roll repeated
{ items, has_more, next_offset }payloads - tighten MCP schema validation for integer-valued fields such as pagination, timeouts, viewport dimensions, click counts, and durations
- address review-bot findings by preserving full default profile inventory listing, keeping explicit empty paginated pages as structured JSON, ignoring empty
chrome_policyobjects, and guarding nullish pool list responses - restore the cleaner
computer_actionschema/execution structure from main while keeping clipboard support and integer validation from this stack
Why
- browser pools can now be configured with the same core browser-session options used when warming pool browsers
- MCP clients should be able to create and update pools without dropping to the SDK/CLI for start URLs, Chrome policy, extensions, profiles, or viewport settings
- update-only operations such as
discard_all_idleshould not force agents to resend unchanged pool size/configuration - agents need compact list responses for selection, full
getresponses for inspection, and explicit next-step guidance after create/update/acquire operations - default profile listing should remain a complete inventory for agents, while explicit
limit/offsetstill provides paginated control when requested - explicit empty pages should not read like global inventory absence, because that can make agents run setup or recovery flows unnecessarily
- keeping browser config mapping, response formatting, and pagination behavior in shared helpers avoids drift across stacked project/API-key/browser/app/profile changes
Agent Experience / Flow
This PR gives agents a fast-session workflow for repeated browser work. Instead of creating a fresh browser for every task, an agent can configure a pool once, acquire pre-warmed sessions, use normal browser tools, and release sessions back into the pool.
Typical flow:
- Agent decides a pool is useful when a workflow needs repeated browser sessions with the same profile, viewport, policy, start URL, extension, proxy, or timeout configuration.
- Agent calls
manage_browser_pools create size=<n> name=<name>with the same browser-shaping options it would otherwise pass tomanage_browsers create, such asprofile_id,start_url,chrome_policy,viewport_width, andextension_id. - Agent uses
manage_browser_pools listfor a compact pool inventory andmanage_browser_pools get id_or_name=<pool_id>for full details. - Agent calls
manage_browser_pools acquire id_or_name=<pool_id>to get a browser session. - Agent uses the returned
session_idwithcomputer_action,execute_playwright_code,browser_curl, orexec_command. - Agent calls
manage_browser_pools release id_or_name=<pool_id> session_id=<id> reuse=truewhen the session can return to the pool, orreuse=falsewhen it should be discarded and replaced. - Agent calls
manage_browser_pools update id_or_name=<pool_id>with only the fields it wants to change.sizeis required for create, but update accepts partial bodies such asdiscard_all_idle=true. - Agent uses
flushto remove idle browsers without deleting the pool, anddeleteonly when the pool is no longer needed.
Agent-facing response behavior:
manage_browser_pools create/updatereturns a compactbrowser_poolsummary plusnext_actions.manage_browser_pools acquirereturns a compact browser summary plusnext_actionsfor control/release/get-detail follow-up.manage_browser_pools listreturns compact summaries and points agents togetfor full details.- Pool next-actions use the stable pool
id, not the display name. manage_browsers create/updatereturns structured JSON withbrowserandnext_actions.- SSH forwarding guidance is now structured under
ssh_port_forwardinginstead of appended as mixed JSON + markdown. - Paginated tools share the same response shape through
paginatedJsonResponse(page, { mapItem, note }); paginated empty pages always stay structured JSON withitems,has_more, andnext_offset. manage_profiles listkeeps the old agent-friendly default of returning the full matching inventory unless the caller explicitly asks forlimitoroffset.- Empty full-inventory guidance remains available through
itemsJsonResponse, not through paginated responses.
How
- typed pool create/update request bodies from
KernelClient["browserPools"] - SDK-derived browser config output types from
KernelClient["browsers"]andKernelClient["browserPools"] - shared profile, extension, viewport, and start URL request shaping in
src/lib/mcp/browser-config.ts - shared response helpers in
src/lib/mcp/responses.ts, including separate item and paginated response helpers - shared pagination input schema in
src/lib/mcp/schemas.ts - create requires
size; update allows partial configuration/update-only bodies and rejects only completely empty update requests - empty
chrome_policy: {}is ignored, so it does not count as a real update field or get sent to the API - compact pool/browser summaries intentionally omit routine connection details while keeping full details available through
get computer_actionkeeps a single action schema and prefix executor so clipboard support does not split or duplicate the computer-use surface
Validation
Static and build checks:
bunx prettier --check src/lib/mcp/responses.ts src/lib/mcp/tools/apps.ts src/lib/mcp/tools/browsers.ts src/lib/mcp/tools/profiles.tsgit diff --checkgit diff --cached --checkbunx tsc --noEmit --incremental false- production
bun run buildwith dummy deployment env and network access for Google Fonts
Focused checks from the latest commit:
- Direct response-helper smoke verified unpaginated empty inventories can still show setup guidance through
itemsJsonResponse. - Direct response-helper smoke verified paginated empty pages preserve structured JSON with
items: [],has_more, andnext_offset. - Direct response-helper smoke verified paginated responses stay structured even if
emptyTextis forced through at runtime. - TypeScript verified
emptyTextis no longer part ofpaginatedJsonResponseoptions.
Earlier PR validation retained:
- In-process toolset normalization test verified
manage_computer_action,manage_search_docs, and legacybrowser_utilitiesaliases disable the expected toolsets, and unknown disabled toolsets throw a clear error. - Focused MCP handler smoke verified default profile listing auto-iterates all matching profiles, explicit profile pagination preserves page metadata, empty pool
chrome_policyreturns a clean MCP error instead of sending an empty update, non-emptychrome_policyis still sent and summarized, and nullish pool list responses returnNo browser pools found. - Local MCP HTTP smoke against
http://localhost:3002/mcpverifiedinitialize,OPTIONS /mcp,tools/list,resources/list,prompts/list, schema assertions, andsearch_docsdummy-env behavior. - Live MCP validation checks verified fractional/invalid inputs return
isError: truefor pagination, pool size,browser_curl,computer_action,exec_command, andmanage_browsers updatevalidation paths.
Platform/API smoke context:
- Full localhost browser-pool CRUD against the supplied org/key remains blocked by the platform plan gate:
403 Browser pools require a Start-Up or Enterprise plan. - The latest pass used a dummy opaque Bearer token for MCP transport/schema/validation tests, so it did not perform real Kernel API CRUD.
Notes
bun run format:checkstill fails on pre-existingAGENTS.mdmarkdown table formatting. This PR uses touched-file Prettier checks to avoid unrelated project-instruction churn.
The latest updates on your projects. Learn more about Vercel for GitHub.
| Project | Deployment | Actions | Updated (UTC) |
|---|---|---|---|
| mcp | Preview, Comment | Jun 23, 2026 5:57pm |
Monitoring Plan: Add update action to manage_browser_pools MCP tool
What this PR does: Lets AI agents update existing browser pool configurations (size, profile, extensions, viewport, chrome policy, kiosk mode, etc.) via the MCP tool — previously only create was supported.
Intended effect:
- PATCH
/browser_pools/{id_or_name}volume: baseline 119–169 req/hr; confirmed if requests flow successfully with ≤1% 4xx rate post-deploy - PATCH 5xx rate: baseline 0/hr; confirmed if stays at 0
Risks:
- Field-scope validation regression —
actionFieldError()may block valid fields; alert if PATCH 4xx rate exceeds 5/hr for 2 consecutive hours (baseline: 0–1/hr) sizerequired on update —buildPoolConfigParams()throws ifsizeis omitted; callers intending to patch onlychrome_policyorkiosk_modewill get a silent MCP error; alert if any"size is required"log appears in API logs post-deploydiscard_all_idlepool drain — updating a live pool with this flag destroys idle browsers; alert ifkernel_browser_pool_building_countsustains above 30 for >15 min- Acquire 5xx regression — misconfigured
chrome_policyon a pool could cause new provisions to fail; alert if acquire 5xx exceed 20/hr for 2 consecutive hours (baseline: 0–20/hr isolated)
Status updates will be posted automatically on this PR as monitoring progresses.
Monitoring plan created for browser pool update action and field-scope enforcement in MCP server.
Affected services: kernel-mcp-server (Vercel Preview), api
Key signals to watch (baseline: 24h pre-deploy):
- PATCH
/browser_pools/{id_or_name}error rate (4xx/5xx) — expect stable or slight increase from new update calls kernel_browser_pool_building_count— watch for sustained spike ifdiscard_all_idleis used- POST
/browser_pools/{id_or_name}/acquire5xx rate — baseline has sparse spikes (0–20/hr); sustained elevation would indicate pool configuration regression
Alert thresholds:
- PATCH 4xx rate exceeds 5 errors/hr (baseline: 0–1/hr)
- PATCH 5xx any spike (baseline: 0/hr)
- Acquire 5xx sustained above 20/hr for 2+ hours (post-deploy)
[View monitor]
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
| Diff | Package | Supply Chain Security |
Vulnerability | Quality | Maintenance | License |
|---|---|---|---|---|---|---|
| @onkernel/sdk@0.58.0 ⏵ 0.60.0 |
reviewed the full diff — solid refactor + additive feature. no lost functionality (every tool/action/param preserved; deletions moved into the shared helpers), SDK types are derived everywhere they should be, and tsc --noEmit is clean against sdk 0.60.0. a few small things:
nits
src/lib/mcp/tools/apps.ts:9—textResponseis imported but never used. dead import (tsc misses it sincenoUnusedLocalsisn't set, but lint may flag it).src/lib/mcp/tools/browser-pools.ts:258—fill_rate_per_minuteis the only numeric pool field left as a barez.number(); every sibling got.int().min(). if it's an integer percentage,.int().min(0).max(100)would match the others; if fractional is allowed, at least.min(0).
question
src/lib/mcp/responses.ts:1—PaginatedPage<T>is a hand-written structural type rather than derived from the SDK page type. works fine via structural typing, but it's the one spot that wouldn't fail at compile time if the SDK renamedgetPaginatedItems/next_offset. intentional to decouple from SDK internals, or worth deriving?
behavior changes worth a line in the PR body (not bugs — all defensible)
- pagination now rejects out-of-range
limit/offset(schema.min/.max) instead of relying on the old silent API clamp. - not-found / validation responses in
manage_appsandmanage_profilesnow setisError: true(previously plain content) — arguably a correctness improvement. - empty
chrome_policy: {}is now dropped rather than sent as an update field.
nice work — the net-negative line counts in browsers/profiles/apps are the good kind of churn.
thanks @masnwilliams — addressed in b3b3c74:
nits
apps.ts:9— dropped the unusedtextResponseimport.fill_rate_per_minute— added.min(0). Left it unbounded above and non-integer on purpose: the SDK/OpenAPI type it as a plainnumber("Percentage of the pool to fill per minute. Defaults to 10%") with no int/max, so.int().max(100)would reject inputs the API actually accepts (fractional rates, or >100%/min fast-fill)..min(0)just stops negatives, which is the only bound that's unambiguously safe.
question — PaginatedPage<T>
Keeping it hand-written; intentional. It's a generic helper consumed by every paginated endpoint (profiles/apps/browsers), each a distinct SDK page class, so a structural "anything with getPaginatedItems() / has_more / next_offset" is the right shape — deriving from a concrete page type would either pin it to one endpoint or need a hand-maintained union.
Worth noting the exposure is narrower than it looks: getPaginatedItems() is required, so a real SDK page stops being assignable the moment the SDK renames it → the call site breaks at compile time. Only the two optional fields (has_more/next_offset) can silently drift to undefined on a field rename — and deriving wouldn't fix that either, since the SDK types those optional too, so any supertype inherits the optionality. So the structural type isn't actually giving up compile-time safety a derived one would buy.
(No test for that optional-field drift since there's no test runner in the repo yet — didn't want to pull a framework into this PR. Happy to add one separately if we want the insurance.)
behavior changes
Documented in the PR body now under a new "Behavior changes" section (out-of-range pagination rejection, isError: true on not-found/validation, empty chrome_policy dropped).