Skip to content

Add admin/app/proxy cleanup parity tools#113

Open
IlyaasK wants to merge 18 commits into
mainfrom
admin-app-proxy-extension-cleanup-mcp-tool
Open

Add admin/app/proxy cleanup parity tools#113
IlyaasK wants to merge 18 commits into
mainfrom
admin-app-proxy-extension-cleanup-mcp-tool

Conversation

@IlyaasK

@IlyaasK IlyaasK commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds the small MCP parity cleanup slice after browser pools:

  • manage_apps
    • adds delete_deployment
    • passes version through to deployment listing as the SDK's app_version filter
    • exposes app query search on list_apps
    • validates that deployment version filtering includes app_name, matching the SDK/API requirement
  • manage_proxies
    • adds get
    • adds check with optional check_url
    • validates check_url as HTTP(S) at the MCP boundary
  • manage_profiles
    • adds get
    • exposes profile query, limit, and offset for paginated listing instead of forcing agents to enumerate every profile
    • uses profile search during setup's existing-name check
  • manage_projects
    • adds get_limits and update_limits for per-project caps
  • manage_extensions
    • keeps list/delete behavior but moves responses onto the shared response helpers for consistent errors
  • README now reflects the actual 15-tool surface on this stack.

Review Question

The main question for this PR is not whether the SDK calls work; it is whether we want this functionality exposed through MCP at all.

My current read:

  • Yes for proxy get/check, profile get/search pagination, and app deployment list/delete because they map to concrete agent workflows: prepare a browser with a working proxy, reuse the right profile, and clean up an app deployment after testing.
  • manage_projects get_limits/update_limits is the most admin-passthrough-shaped part of this PR. Keep it if we want MCP to support lightweight project administration; split or drop it if we want this MCP to stay strictly browser/workflow-oriented.

If accepted, I would treat this as the last small parity/admin cleanup slice, not as precedent that every SDK endpoint automatically deserves MCP exposure.

Why

These are the remaining small SDK passthroughs that do not belong in the managed-auth PR. They close agent-facing gaps without adding another large workflow surface:

  • agents can clean up deployments after testing an app version
  • agents can filter deployments by app version instead of scanning all deployments
  • agents can verify proxy connectivity against a specific target URL before launching browsers through that proxy
  • agents can search and page through profiles safely in larger orgs
  • admins can inspect and update project resource caps without leaving MCP

Agent Experience / Flow

Typical app cleanup flow:

  1. Agent calls manage_apps { action: "list_apps", query: "..." } to find the app/version.
  2. Agent calls manage_apps { action: "list_deployments", app_name, version } to narrow to the deployment for that app version.
  3. Agent calls manage_apps { action: "get_deployment", deployment_id } before destructive action.
  4. If the deployment is stale or explicitly requested for cleanup, agent calls manage_apps { action: "delete_deployment", deployment_id }.

Typical proxy verification flow:

  1. Agent calls manage_proxies { action: "list" } or get to identify the proxy.
  2. Agent calls manage_proxies { action: "check", proxy_id, check_url: "https://target.example" } when site-specific reachability matters.
  3. Agent only passes that proxy into browser/session creation after the check result looks healthy.

Typical profile discovery flow:

  1. Agent calls manage_profiles { action: "list", query, limit } instead of pulling every profile.
  2. Agent calls manage_profiles { action: "get", profile_name } before reuse or deletion.
  3. Agent uses setup only when the desired profile does not already exist, or with update_existing: true when intentionally refreshing it.

Typical admin limit flow:

  1. Agent calls manage_projects { action: "get", project_id } to confirm the target project.
  2. Agent calls manage_projects { action: "get_limits", project_id } to inspect current caps.
  3. Agent calls update_limits only with the specific cap fields requested by the user; omitted fields are left unchanged.

Implementation Notes

Verification

  • bunx prettier --check README.md src/lib/mcp/tools/apps.ts src/lib/mcp/tools/proxies.ts src/lib/mcp/tools/profiles.ts src/lib/mcp/tools/projects.ts src/lib/mcp/tools/extensions.ts
  • git diff --check
  • bun run build with dummy auth env. Build passes; network access was needed because Next/Turbopack fetches Google Fonts during build.
  • Local MCP smoke against http://localhost:3002/mcp with dummy bearer token:
    • tools/list returned 15 tools
    • verified registration for manage_apps, manage_proxies, manage_profiles, manage_projects, and manage_extensions
    • verified validation responses for deployment version filtering without app_name, deployment delete without deployment_id, proxy check without proxy_id, profile get without profile identifier, project get_limits without project_id, and non-HTTP(S) check_url schema rejection.

Note

Medium Risk
Adds destructive deployment deletion and org-level project limit updates via MCP; changes are thin SDK passthroughs with input validation but affect resource cleanup and capacity controls.

Overview
Extends several manage_* MCP tools with SDK parity actions and tighter validation so agents can complete cleanup and prep workflows without leaving MCP.

manage_apps gains delete_deployment, query on list_apps, and version filtering on list_deployments (mapped to app_version), with a guard that app_name is required when filtering by version. The tool is marked destructive.

manage_proxies adds get and check (optional check_url, validated as HTTP/HTTPS at the schema boundary). manage_profiles adds get and supports search/paginated list via query, limit, and offset; setup scans all profiles for an exact name match to avoid duplicate profiles when list search is fuzzy.

manage_projects adds get_limits and update_limits for concurrent invocations, sessions, and pooled session caps. manage_extensions behavior is unchanged but list/delete/errors use the shared response helpers like the other touched tools. README tool bullets are updated to match.

Reviewed by Cursor Bugbot for commit 2d5bd1f. Bugbot is set up for automated code reviews on this repo. Configure here.

@vercel

vercel Bot commented Jun 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
mcp Ready Ready Preview, Comment Jun 23, 2026 6:34pm

@firetiger-agent

Copy link
Copy Markdown

Firetiger deploy monitoring skipped

This PR didn't match the auto-monitor filter configured on your GitHub connection:

PRs in the kernel, infra, hypeman, and hypeship repos. kernel is a ~mono repo with many logical services underneath, ensure to focus on the implicated service for the PR

Reason: PR is from the browser-pools-parity-mcp-tool branch (not a standard repo) and lacks clear repository context; please confirm this targets one of the monitored repos (kernel, infra, hypeman, hypeship) and opt in manually if needed.

To monitor this PR anyway, reply with @firetiger monitor this.

@IlyaasK IlyaasK requested a review from masnwilliams June 1, 2026 19:08
IlyaasK added 2 commits June 1, 2026 15:10
Keep browser pool create validation strict while allowing update-only fields such as discard_all_idle to be sent without redundantly supplying size.
Expose the remaining small SDK passthroughs for project limits, deployment deletion/version filters, proxy checks, and paginated profile lookup while keeping the handlers on shared response helpers for clearer agent output.
@IlyaasK IlyaasK force-pushed the admin-app-proxy-extension-cleanup-mcp-tool branch from 99bedc0 to 0f021bb Compare June 1, 2026 19:11
Add shared list and pagination response helpers for MCP tool output. Use them across the PR 113 admin parity handlers so the new actions do not keep repeating hand-built JSON/text response boilerplate.
Comment thread src/lib/mcp/tools/profiles.ts Outdated
@IlyaasK IlyaasK force-pushed the browser-pools-parity-mcp-tool branch from c6e6427 to 5d4a8e6 Compare June 2, 2026 20:53
…ension-cleanup-mcp-tool

Resolve conflicts by taking the base branch's evolved copies of the shared
browser/browser-pool/api-key work and re-applying this PR's unique
admin/app/proxy cleanup parity changes on top:

- projects.ts: keep base structure, re-add get_limits/update_limits with
  integer-validated limit params and errorResponse/toolErrorResponse style
- apps.ts: re-add delete_deployment, list_apps query search, and
  list_deployments version filter on base's version
- profiles.ts: re-add the get action and setup-time query narrowing
- extensions.ts/proxies.ts: port to base's responses API (itemsJsonResponse,
  errorResponse, toolErrorResponse)
- responses.ts/browser-config.ts/register.ts/api-keys.ts/browsers.ts/
  browser-pools.ts: take base's versions (PR-side copies were duplicates)
- remove browser-utilities.ts, superseded by base's browser-curl.ts and the
  clipboard actions folded into computer_action
- README: keep base's 16-tool listing, fold in updated action descriptions

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@vercel vercel Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional Suggestion:

The .env.example documentation lists only 12 toolsets but the codebase now has 16 toolsets, causing misleading documentation.

Fix on Vercel

Base automatically changed from browser-pools-parity-mcp-tool to main June 23, 2026 18:14
The merge of main (PR 112) removed the textResponse import as unused,
but this branch's delete_deployment action uses it — restore the import
so the type check passes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 03135c4. Configure here.

Comment thread src/lib/mcp/tools/apps.ts
Comment thread src/lib/mcp/tools/profiles.ts Outdated
- manage_apps now exposes a destructive delete_deployment action, so set
  destructiveHint: true (matching manage_profiles).
- Restore setup's scan-all existence check: the list `query` is a search
  and may not return an exact-named profile, which let setup create a
  duplicate instead of hitting the "already exists" guard.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant