# Letting Agents Drive the Browser

> Source: https://agilitycms.com/docs/developers/letting-agents-drive-the-browser

MCP servers don't cover everything. Some jobs only exist in a web UI, and some MCP calls report success without doing anything. For those, an AI agent with a browser MCP (Claude in Chrome, Chrome DevTools or Playwright) can **open the app and click through it the way you would**.

**A person decides what the agent may do in the browser. The agent never decides that itself.**

This article is part of the [Vibe Coding with Agility](/docs/developers/vibe-coding-with-agility) section.

## What it's good for in Agility

In our builds, these jobs were done in the Agility app because the MCP server couldn't do them, or reported success without effect (see [MCP and Agility Gotchas](/docs/developers/vibe-coding-gotchas)):

- Reordering components on a page
- **Initialize Pages** for a new locale
- Creating single-item containers and sitemaps
- Turning approval on or off for a container
- Setting the preview and production deployment URLs, webhooks, roles and users

The same applies to any dashboard without an API: a hosting console, a DNS panel, a third-party app's settings.

The browser is also the best way to **verify**: open the live page in a fresh session, check that each component renders, check preview and Web Studio.

## Set the scope first

A browser session can do anything the logged-in account can. Some browser tools ask before certain sites or actions, but don't rely on that. Before you hand an agent a browser job, write the scope in the brief or in `AGENTS.md`:

- **Which sites.** For example, only `app.agilitycms.com` and the project's preview URL.
- **Which account.** Sign the browser in as a user with only the rights the job needs. An Editor-level user can't publish, and that is often the point. See [Governing AI Access to Agility CMS](/docs/owners-admins/governing-ai-access).
- **Which actions.** Name them: "reorder the components on these three pages", "initialize pages for `fr-ca`".
- **What always needs a person.** Publish, unpublish, delete, user and role changes, billing, entering credentials, accepting terms.
- **When to stop and ask.** Anything outside the list, and any confirmation dialog it didn't expect.

An example brief:

```
Use the browser to reorder the components on the Home page in the Agility app
(instance <GUID>, en-us) to: Hero, Stats, Testimonials, Contact.
Only use app.agilitycms.com. Save the page; do not publish it.
Stop and ask me if anything other than the page editor opens, or if any dialog
asks you to confirm something other than Save.
When you're done, read the page back with the Agility MCP get_page tool and
show me the component order.
```

## Make it reliable

- **Watch the first few runs.** Clicking through an admin app is slower and more fragile than an API call.
- **Expect a throwaway first click.** The Agility app is a single-page app, and the first click after a page load often doesn't register.
- **Read the result back through the MCP.** The browser did the clicking; the MCP or the Fetch API proves it worked.
- **Keep it for the gaps.** If an MCP tool or the CLI can do the job, use that. It's faster, cheaper and repeatable.

## Related

- [Managing a Team of Coding Agents](/docs/developers/managing-a-team-of-coding-agents)
- [Agility CMS MCP Server](/docs/developers/agility-cms-mcp-server)
- [MCP and Agility Gotchas to Know Before You Build](/docs/developers/vibe-coding-gotchas)

---

## Related pages

- [Building an Agility Site with AI Coding Tools](https://agilitycms.com/docs/developers/building-sites-with-ai-coding-tools.md)
- [Vibe Coding with Agility](https://agilitycms.com/docs/developers/vibe-coding-with-agility.md)
- [From Brief to Working Site: The Vibe Coding Workflow](https://agilitycms.com/docs/developers/vibe-coding-workflow.md)
- [Writing an AGENTS.md for Agility Projects](https://agilitycms.com/docs/developers/agents-md-for-agility.md)
- [MCP and Agility Gotchas to Know Before You Build](https://agilitycms.com/docs/developers/vibe-coding-gotchas.md)
- [Vibe Coding Playbooks by Use Case](https://agilitycms.com/docs/developers/vibe-coding-playbooks.md)
- [From Proof of Concept to Production](https://agilitycms.com/docs/developers/vibe-coding-to-production.md)
- [Agility Skills for Your Coding Agent](https://agilitycms.com/docs/developers/agility-skills-for-coding-agents.md)
- [Managing a Team of Coding Agents](https://agilitycms.com/docs/developers/managing-a-team-of-coding-agents.md)
- [Running Agility Work from an Ops Repo](https://agilitycms.com/docs/developers/running-agility-work-from-an-ops-repo.md)
- [Training Your Team to Build with Agents](https://agilitycms.com/docs/developers/training-your-team-to-build-with-agents.md)

Index of every docs page: https://agilitycms.com/docs/llms.txt
