Skip to content

RFC: CLI wrapper to enable agent-authored browser scripting #797

@natorion

Description

@natorion

Is your feature request related to a problem? Please describe.

The current MCP interaction model requires an agent to perform a full read/think/act loop for every single browser action. For complex tasks—like scraping multiple pages or conditional navigation—this is inefficient, slow, and consumes excessive tokens.

Agents currently lack the ability to "batch" actions or apply simple logic (like loops or retries) without re-prompting the LLM for every step.

Describe the solution you'd like

I would like to explore and understand interest in chrome-devtools-cli: a command-line interface wrapper for the Chrome DevTools MCP server.

By exposing MCP capabilities via a CLI, agents can write and execute bash scripts to control the browser. This unlocks powerful workflows:

  • Batching & latency reduction: Instead of 10 separate HTTP round-trips, an agent can generate a single script to perform a sequence of actions immediately.
  • Logic & control flow: Agents can utilize standard bash logic (loops, conditionals) to handle tasks without constant re-prompting.

Example agent-authored script:

#!/bin/bash
urls=("https://example.com/page1" "https://example.com/page2")

for url in "${urls[@]}"; do
  chrome-devtools-cli navigate_page --url "$url"
  chrome-devtools-cli wait_for --text "Success" --timeout 2000
  chrome-devtools-cli take_screenshot --filePath "results/$(basename $url).png"
done

Describe alternatives you've considered

  • Status quo (single tool calls): We could continue relying on individual tool calls, but this prevents optimization of latency and token usage for repetitive tasks.
  • Generating Puppeteer/Playwright scripts: Agents could write raw Node.js scripts, but this requires a heavier runtime environment, and more complex code generation compared to a simple, pre-installed CLI wrapper.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions