# Public Browser

An MCP server that drives Chrome directly over CDP for Claude Code and Cursor. It gives agents browser control across nested iframes without Playwright.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 19
- Author: Silbercue
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/Silbercue/public-browser
- Updated: 2026-10-22
- HTML: https://affpapa.org/en/nevibecode/mcp/public-browser

## What it does

The server links AI agents directly to Chrome through the Chrome DevTools Protocol. It bypasses Playwright dependencies and browser extension bridges. By grouping multiple actions inside `run_plan`, the tool reduces round-trips and overall token usage. Failures stay loud: ambiguous CSS selectors abort execution, while references from previously closed pages cannot trigger accidental clicks.

The engine traverses open or closed shadow DOM trees and clicks inside nested cross-origin iframes. Chrome launches in a visible window on its first tool invocation. Running the package requires Node 20 or higher. Note that profile logins on macOS do not carry over to the automated session.

## Requirements
- Needs: Node.js (commands run via npx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add public-browser -- npx -y public-browser
```

### Codex

**Platform CLI**
```bash
codex mcp add public-browser -- npx -y public-browser
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "public-browser": {
            "command": "npx",
            "args": [
                "-y",
                "public-browser"
            ]
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "public-browser": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "public-browser"
            ]
        }
    }
}
```

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add public-browser npx -y public-browser
```

## When to use it
- interact with elements inside nested cross-origin iframes
- run multi-step browser flows within a single tool call
- inspect and click controls inside closed shadow roots
- prevent accidental clicks on stale node references

## Example prompts
- Open the sign-in form on the local test server and log in with mock credentials
- Navigate to the settings tab inside the iframe and toggle dark mode
- Fill in all required fields across the multi-step form and submit it

## Similar
- [Scrapling MCP Server](https://affpapa.org/en/nevibecode/mcp/scrapling-mcp-server.md) — MCP server · ★ 89433
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119160
- [AIHawk](https://affpapa.org/en/nevibecode/mcp/aihawk.md) — MCP server · ★ 32221
- [Skyvern](https://affpapa.org/en/nevibecode/mcp/skyvern.md) — MCP server · ★ 23263
- [SeleniumBase MCP](https://affpapa.org/en/nevibecode/mcp/seleniumbase-mcp.md) — MCP server · ★ 13169
- [apify-mcp-server](https://affpapa.org/en/nevibecode/mcp/apify-mcp-server.md) — MCP server · ★ 12927

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
