# Agent-first-browse

> Agent-first-browse is an open-source MCP server for browser automation. Token-efficient browser control over MCP for AI agents, with accessibility-tree perception. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, Linux, macOS, Self-hosted
- **Website:** https://xel-studio.vercel.app
- **Repository:** https://github.com/sandeepai369/agent-first-browse
- **MCP Registry name:** io.github.SandeepAi369/agent-first-browse
- **Categories:** [browser automation](https://ai-powered.com/categories/browser-automation)
- **Listing updated:** 2026-11-27

## About

Agent First Browse gives AI assistants a way to operate a real Chromium browser while sending the model far less page data than typical browser agents. Instead of passing raw DOM dumps on every step, it builds a compact list of clickable and typeable elements, hides controls that sit behind modals or overlays, and sends only what changed between consecutive steps. Passwords, OTPs, PINs and card numbers are masked before they reach prompts or logs.

The project ships as a Python package with a stdio MCP server exposing seven browser tools for starting sessions, perceiving pages, acting on elements, taking screenshots, comparing engines and exporting metrics. It also includes a command-line daemon for stepwise control and an autonomous runner built on LangGraph that checks its own actions before moving on. Setup for MCP hosts such as Claude Desktop, Claude Code and Cursor is a single uvx command, and no external LLM API keys are needed for the MCP or CLI paths.

This suits developers building or debugging agents that need reliable browser interaction on live sites, especially single-page apps and pages with pop-ups. It is released under the Apache 2.0 licence and can be run from source for local development.

## Features

- **Accessibility-tree perception:** Pages are read through a compact accessibility-tree view with a DOM fallback for custom ARIA widgets.
- **Occlusion pruning:** Controls hidden behind modals, cookie banners and overlays are removed from the element list before the model sees it.
- **Delta snapshots:** Repeat steps on the same URL send only added, changed and removed controls to reduce prompt size.
- **Stale-reference recovery:** Element handles are rebound when single-page app re-renders move buttons during an action.
- **Secret masking:** Passwords, OTPs, PINs and card fields are redacted before reaching prompts or logs.
- **Seven MCP tools:** Browser start, perceive, act, screenshot, stop, compare and metrics tools are exposed over stdio.

## Good for

- Give a coding assistant in Claude Code or Cursor the ability to open and inspect live web pages
- Automate multi-step form or checkout flows while keeping prompt token usage low
- Compare legacy and accessibility-first perception on the same site to measure speed and token cost
- Run an autonomous browser task from the command line with a verification loop
- Debug agent behaviour on single-page apps where elements move after re-renders

## Install

### Claude Code: Add with the CLI (Terminal)

```sh
claude mcp add agent-first-browse -- uvx agent-first-browse
```

Add --scope user to use it in every project, or --scope project to share it in .mcp.json.

### Claude Code: Or share it with your project (.mcp.json)

```json
{
  "mcpServers": {
    "agent-first-browse": {
      "command": "uvx",
      "args": [
        "agent-first-browse"
      ]
    }
  }
}
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "agent-first-browse": {
      "command": "uvx",
      "args": [
        "agent-first-browse"
      ]
    }
  }
}
```

Settings → Developer → Edit Config, then quit and reopen Claude Desktop.

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "agent-first-browse": {
      "command": "uvx",
      "args": [
        "agent-first-browse"
      ]
    }
  }
}
```

Use .cursor/mcp.json in a project to share it with the project.

### VS Code (~/.copilot/mcp-config.json)

```json
{
  "mcpServers": {
    "agent-first-browse": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "agent-first-browse"
      ]
    }
  }
}
```

Or put the same entry in .mcp.json at your workspace root to share it.

### Codex: Add with the CLI (Terminal)

```sh
codex mcp add agent-first-browse -- uvx agent-first-browse
```

### Codex: Or add to config.toml (~/.codex/config.toml)

```toml
[mcp_servers.agent-first-browse]
command = "uvx"
args = ["agent-first-browse"]
```

### Gemini CLI and Antigravity: Gemini CLI (~/.gemini/settings.json)

```json
{
  "mcpServers": {
    "agent-first-browse": {
      "command": "uvx",
      "args": [
        "agent-first-browse"
      ]
    }
  }
}
```

Or run: gemini mcp add -s user agent-first-browse uvx -- agent-first-browse

### Gemini CLI and Antigravity: Antigravity (~/.gemini/config/mcp_config.json)

```json
{
  "mcpServers": {
    "agent-first-browse": {
      "command": "uvx",
      "args": [
        "agent-first-browse"
      ]
    }
  }
}
```

Use .agents/mcp_config.json to add it to one workspace only.

### Devin Desktop (~/.config/devin/mcp_config.json)

```json
{
  "mcpServers": {
    "agent-first-browse": {
      "command": "uvx",
      "args": [
        "agent-first-browse"
      ]
    }
  }
}
```

On Windows the file is %APPDATA%\\devin\\mcp_config.json. Use .devin/mcp_config.json to share it with a project.

### Cline (cline_mcp_settings.json)

```json
{
  "mcpServers": {
    "agent-first-browse": {
      "command": "uvx",
      "args": [
        "agent-first-browse"
      ]
    }
  }
}
```

Open it from the MCP Servers icon → Configure → Configure MCP Servers.

### Zed (Zed settings.json)

```json
{
  "context_servers": {
    "agent-first-browse": {
      "command": "uvx",
      "args": [
        "agent-first-browse"
      ]
    }
  }
}
```

Open it with zed: open settings file. Merge context_servers into the settings you already have.

### JetBrains AI Assistant and Junie: AI Assistant (Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add)

```json
{
  "mcpServers": {
    "agent-first-browse": {
      "command": "uvx",
      "args": [
        "agent-first-browse"
      ]
    }
  }
}
```

### JetBrains AI Assistant and Junie: Junie (~/.junie/mcp/mcp.json)

```json
{
  "mcpServers": {
    "agent-first-browse": {
      "command": "uvx",
      "args": [
        "agent-first-browse"
      ]
    }
  }
}
```

Use .junie/mcp/mcp.json to share it with a project.

### Kiro (~/.kiro/settings/mcp.json)

```json
{
  "mcpServers": {
    "agent-first-browse": {
      "command": "uvx",
      "args": [
        "agent-first-browse"
      ]
    }
  }
}
```

Use .kiro/settings/mcp.json to add it to one workspace only.

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "agent-first-browse": {
      "command": "uvx",
      "args": [
        "agent-first-browse"
      ]
    }
  }
}
```

## Tools

From the tool list in its README, going by the names, 2 of 7 tools change data; 5 names don't say. From the server's own tool labels and tool names; not verified by us.

- `browser_start` (name suggests: changes): Launch an isolated Chromium session.
- `browser_perceive`: Run accessibility-tree-first perception and return compact ref elements.
- `browser_act`: Execute goto, click, type, hover, select_option, press_enter, press_key, scroll or wait.
- `browser_screenshot`: Save a viewport or full-page PNG screenshot to disk.
- `browser_stop` (name suggests: changes): Close one session or shut down all active sessions.
- `browser_compare`: Diff legacy and v2 sessions side-by-side.
- `browser_metrics`: Export cumulative Markdown or JSON telemetry.

## FAQ

### How do I install Agent-first-browse for Claude Desktop?

Install the agent-first-browse package with pip, run python -m playwright install chromium, then add an mcpServers entry that runs uvx with --from agent-first-browse and agent-browse-mcp.

### Does Agent-first-browse need an LLM API key?

The MCP server and the CLI daemon run with zero external LLM API keys. The autonomous LangGraph runner uses keys configured through a .env file.

### Which licence does Agent-first-browse use?

It is licensed under the Apache License 2.0.

### What Python version is required?

Python 3.11 or newer on Linux, WSL or macOS.

### Is Agent-first-browse free?

Yes. Agent-first-browse is open source, so you can use and self-host it for free.

### How do I add Agent-first-browse to Claude Code?

Run this command in your terminal: claude mcp add agent-first-browse -- uvx agent-first-browse

### What are the best alternatives to Agent-first-browse?

The closest alternatives to Agent-first-browse are Agent Browser, Browser MCP, playwright_mcp, Substrate Browser and CloakMCP.

## Where this comes from

- Description: written from the project's README, the project's website and its MCP Registry entry.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [Agent Browser](https://ai-powered.com/mcp/agent-browser-3): Agent Browser is an open-source MCP server for browser automation.
- [Browser MCP](https://ai-powered.com/mcp/browser-mcp): Browser MCP is an open-source MCP server for browser automation.
- [playwright_mcp](https://ai-powered.com/mcp/playwright-mcp-3): playwright_mcp is an open-source MCP server for browser automation.
- [Substrate Browser](https://ai-powered.com/mcp/substrate-browser): Substrate Browser is an open-source MCP server for browser automation.
- [CloakMCP](https://ai-powered.com/mcp/cloakmcp): CloakMCP is an open-source MCP server for browser automation.
- [Browser Ref MCP](https://ai-powered.com/mcp/browser-ref-mcp): Browser Ref MCP is an open-source MCP server for browser automation.
- [kitewright](https://ai-powered.com/mcp/kitewright): kitewright is an open-source MCP server for browser automation.
- [Chrome DevTools MCP](https://ai-powered.com/mcp/chrome-devtools-mcp-2): Chrome DevTools MCP is an open-source MCP server for browser automation.

---
Source: https://ai-powered.com/mcp/agent-first-browse
