Skip to main content
Use this example when a coding-agent host should delegate a whole browser goal to Webcompute.

What this shows

  • Agent mode exposes run_web_agent as a browser subagent.
  • Runtime mode remains available for exact browser-code follow-up.
  • Debug UI and CDP URLs are inspection capabilities, not default transcript data.

Setup

Ask the host

The host should call run_web_agent with the user goal, startUrl, and allowedDomains when useful.

Expected output

Inspect

  • Tool calls in the host transcript.
  • run_web_agent structured content.
  • Browser status and recordings when enabled.
  • Debug UI only when live review is needed.

Cleanup

Agent-mode runs close browsers they create according to the Webcompute browser-agent harness. If the host later uses runtime tools, ask it to close any browser it creates with manage_browsers.

Advanced runtime loop

Use MCP runtime mode when the host should call manage_browsers and execute_playwright_code directly for each browser step.

Common failures

  • If the host claims it browsed without calling MCP tools, ask it to rerun with tool use visible in the transcript.
  • If the task requires proxy setup, create the browser through SDK, CLI browser creation, REST, or quick actions before MCP reuse.
  • If the page is blocked, report the blocker and next safe action instead of claiming success.