A professional Model Context Protocol (MCP) server that provides comprehensive browser automation and console log capture through Chrome extension integration. Features automated installation, DOM interaction capabilities, and seamless Claude Code integration.
Get started without reading any documentation:
pip install mcp-browser
mcp-browser extension install
mcp-browser install
mcp-browser start --backgroundLoad the extension in Chrome (one-time):
chrome://extensionsβ enable Developer mode β βLoad unpackedβ β select~/mcp-browser-extensions/chrome/
Prefer an interactive wizard?
mcp-browser quickstartNeed help anytime? The CLI is completely self-documenting:
mcp-browser --help # See all commands
mcp-browser reference # Quick reference card
mcp-browser doctor # Diagnose and fix issues
mcp-browser tutorial # Step-by-step feature tourpip install mcp-browser
mcp-browser extension install
mcp-browser install
mcp-browser start --backgroundgit clone https://github.com/browserpymcp/mcp-browser.git
cd mcp-browser
make install
make ext-deploy
mcp-browser start --background- Chrome:
chrome://extensionsβ βLoad unpackedβ β./mcp-browser-extensions/chrome/
- π― Advanced DOM Interaction: Click elements, fill forms, submit data, select dropdowns, wait for elements
- π Console Log Capture: Real-time capture from all browser tabs with advanced filtering
- π· Screenshots: Extension-backed viewport capture
- π Smart Navigation: Programmatic browser navigation with URL validation
- π Auto-Discovery: Dynamic port allocation (default 8851-8899) with collision avoidance
- π€ AI-Ready: 5 consolidated MCP tools optimized for efficient prompting
- β‘ Service-Oriented Architecture (SOA): Clean separation with dependency injection
- π WebSocket Communication: Real-time bidirectional browser communication
- πΎ JSONL Storage: Automatic log rotation (50MB) with 7-day retention
- π¨ Chrome Extension: Visual connection status with real-time monitoring
- π€ MCP Integration: Consolidated tool surface for AI-driven browser automation
- π¦ PyPI Distribution:
pip install mcp-browserfor instant setup - π― Interactive Setup:
mcp-browser quickstartfor guided configuration - π§ Self-Documenting CLI: Built-in help, tutorials, and troubleshooting
- π₯ Health Monitoring:
mcp-browser doctorfor system diagnostics - βοΈ Smart Configuration: Auto-generated settings with sensible defaults
- π§ͺ Self-Verification: Built-in installation testing and demo capabilities
The project follows a Service-Oriented Architecture (SOA) with dependency injection:
- WebSocket Service: Handles browser connections with port auto-discovery
- Storage Service: Manages JSONL log files with rotation
- Browser Service: Processes console messages and manages browser state
- DOM Interaction: DOM actions, extraction, and screenshots via extension protocol
- MCP Service: Exposes tools to MCP clients (Claude Code/Desktop, etc.)
Supported:
- macOS (recommended - full AppleScript integration)
- Linux (Chrome/Chromium/Firefox support)
Not Supported:
- Windows (incompatible due to AppleScript dependencies)
- Python 3.10+ (with pip)
- Chrome/Chromium browser
- macOS or Linux operating system
pip install mcp-browser
mcp-browser extension install
mcp-browser install
mcp-browser start --backgroundgit clone https://github.com/browserpymcp/mcp-browser.git
cd mcp-browser
make install
make ext-deploy
mcp-browser start --background# Install with pipx for complete isolation
pipx install mcp-browser
mcp-browser extension install
mcp-browser install
mcp-browser start --backgroundPrefer an interactive wizard? Run mcp-browser quickstart.
Need detailed installation help? See INSTALLATION.md for platform-specific instructions, troubleshooting, and alternative methods.
New to MCP Browser? The CLI guides you through everything:
# Interactive setup and feature tour
mcp-browser quickstart # Complete setup guide
mcp-browser tutorial # Step-by-step feature demo
mcp-browser doctor # Diagnose and fix issues
# Get help anytime
mcp-browser --help # See all commands
mcp-browser start --help # Help for specific commands# Server control
mcp-browser start --background # Start daemon in background (recommended)
mcp-browser start # Start in foreground (debugging)
mcp-browser stop # Stop daemon for current project
mcp-browser status # Status for current project
# Installation management
mcp-browser install # Install/configure MCP integration
mcp-browser uninstall # Remove MCP config entry
# MCP integration
mcp-browser mcp # Run in MCP stdio mode (invoked by MCP clients)
# Utilities
mcp-browser version # Show version info
# Extension management
mcp-browser extension install [--local]
mcp-browser extension update [--local]
mcp-browser extension path --check
# Local testing (CLI)
mcp-browser browser logs --limit 20
mcp-browser browser extract contentMCP Browser provides flexible uninstall options from simple MCP config removal to complete cleanup.
# Remove from Claude Code (default)
mcp-browser uninstall
# Remove from Claude Desktop
mcp-browser uninstall --target claude-desktop
# Remove from both
mcp-browser uninstall --target both# Preview what would be removed (recommended first step)
mcp-browser uninstall --clean-all --dry-run
# Remove everything with confirmation
mcp-browser uninstall --clean-all
# Remove everything without confirmation (use with caution)
mcp-browser uninstall --clean-all --yes| Flag | Description | What Gets Removed |
|---|---|---|
--clean-local |
Clean project files | ./mcp-browser-extensions/, ./mcp-browser-extension/ (legacy), ./.mcp-browser/ |
--clean-global |
Clean user data | ~/.mcp-browser/ (data, logs, config) |
--clean-all |
Complete removal | MCP config + local + global data (add --playwright for caches) |
--playwright |
Remove Playwright cache | ~/.cache/ms-playwright/ (or OS equivalent; optional) |
--backup / --no-backup |
Control backup creation | Creates timestamped backup (default: enabled) |
--dry-run |
Preview changes | Shows what would be removed without doing it |
-y, --yes |
Skip confirmations | Removes without prompting (dangerous) |
- Automatic Backups: By default, creates timestamped backups in
~/.mcp-browser-backups/before removing data - Confirmation Prompts: Asks for confirmation before destructive operations (unless
--yesis used) - Preview Mode: Use
--dry-runto see exactly what would be removed - Selective Cleanup: Choose specific cleanup levels based on your needs
# Scenario 1: Remove MCP config only (safest)
mcp-browser uninstall
# Scenario 2: Clean local project files only
mcp-browser uninstall --clean-local
# Scenario 3: Clean global data with backup
mcp-browser uninstall --clean-global
# Scenario 4: Preview complete removal
mcp-browser uninstall --clean-all --dry-run
# Scenario 5: Complete removal with backup
mcp-browser uninstall --clean-all
# Scenario 6: Nuclear option (no backup, no confirmation)
mcp-browser uninstall --clean-all --no-backup --yesFor detailed uninstall instructions and recovery options, see UNINSTALL.md
After removing configurations and data, uninstall the package:
# If installed with pip
pip uninstall mcp-browser
# If installed with pipx
pipx uninstall mcp-browserMCP Browser exposes a consolidated tool surface optimized for AI assistants:
browser_actionβ navigate/click/fill/select/waitbrowser_queryβ logs/element/capabilitiesbrowser_screenshotβ extension-backed screenshot capturebrowser_formβ fill/submit formsbrowser_extractβ readable content or semantic DOM extraction
Tool schemas, examples, and legacy-name mapping: docs/reference/MCP_TOOLS.md.
The Chrome extension provides comprehensive browser integration:
- Multi-tab monitoring: Captures console logs from all active browser tabs
- Real-time buffering: Collects messages every 2.5 seconds for optimal performance
- Level filtering: Supports error, warn, info, and debug message types
- Automatic initialization: Self-starts on page load with verification message
- Status indicator: Toolbar icon shows connection state (green = connected, red = disconnected)
- Port display: Shows active WebSocket port in extension popup
- Auto-reconnection: Automatically reconnects on connection loss
- Connection diagnostics: Real-time connection health monitoring
- Element discovery: Supports CSS selectors, XPath, and text-based element finding
- Form automation: Integrates with form filling and submission tools
- Event handling: Manages click, input, and selection events
- Wait mechanics: Handles dynamic content and AJAX loading
Full Safari support with native macOS app wrapper:
# Automated conversion from Chrome extension
cd /path/to/mcp-browser
bash scripts/create-safari-extension.sh- Safari 17+ Support: Full Manifest V3 compatibility with service workers
- Cross-browser API: Uses both
chrome.*andbrowser.*namespaces - Native App Wrapper: Packaged as macOS application for App Store distribution
- Code Signing Ready: Configured for both development and distribution signing
- Xcode Project: Automatically generated with proper capabilities
- Requires macOS app wrapper (automatically created)
- Uses Apple's
safari-web-extension-convertertool - Needs App Sandbox capabilities for WebSocket connections
- Distribution requires Apple Developer account for signing
π Complete Guide: See docs/guides/SAFARI_EXTENSION.md for:
- Step-by-step setup instructions
- Xcode project configuration
- Code signing and notarization
- App Store and direct distribution
- Testing and debugging guides
- Common issues and solutions
mcp-browser/
βββ src/ # Python package (mcp_browser)
β βββ cli/ # CLI commands and utilities
β βββ services/ # SOA services (WebSocket, MCP, storage, DOM, etc.)
β βββ extension/ # Packaged Chrome extension assets (used by CLI installer)
β βββ extensions/ # Unpacked extension sources (chrome/firefox/safari)
βββ docs/ # Documentation (start at docs/README.md)
βββ scripts/ # Dev + release scripts
βββ tests/ # Tests
βββ mcp-browser-extensions/ # Generated unpacked extensions (gitignored)
~/.mcp-browser/
βββ config/settings.json # Configuration
βββ data/<port>/console.jsonl # Stored console logs (JSONL, rotated)
βββ logs/mcp-browser.log # Main log
βββ server.pid # Daemon registry (per-project entries)
This project follows the "ONE way to do ANYTHING" principle. Use these commands:
# ONE way to install
make install
# ONE way to develop
make dev
# ONE way to test
make test
# ONE way to build
make build
# ONE way to format code
make lint-fix
# See all available commands
make helpmake ext-deploy
mcp-browser start --background
mcp-browser demo# Run all tests with coverage
make test
# Run specific test types
make test-unit
make test-integration
make test-extensionDefault config file:
~/.mcp-browser/config/settings.json
Use a custom config for a single invocation:
mcp-browser --config /path/to/settings.json start --backgroundFull details: docs/guides/INSTALLATION.md.
Start with:
mcp-browser doctorMaintained guide: docs/guides/TROUBLESHOOTING.md.
MIT License - see LICENSE file for details
Start here:
docs/README.md(doc index)docs/guides/INSTALLATION.md(install + first run)docs/reference/MCP_TOOLS.md(authoritative MCP tool surface)docs/reference/CODE_STRUCTURE.md(architecture overview)docs/developer/DEVELOPER.md(maintainer guide)
Project-wide doc standards: docs/STANDARDS.md.
AI agent instructions: CLAUDE.md.
Contributions are welcome! Please follow the single-path development workflow:
- Setup:
make setup(installs deps + pre-commit hooks) - Develop:
make dev(start development server) - Quality:
make quality(run all linting and tests) - Submit: Create feature branch and submit pull request
All code must pass make quality before submission. The pre-commit hooks will automatically format and lint your code.
For issues and questions:
- GitHub Issues: https://github.com/browserpymcp/mcp-browser/issues
- Documentation: Start with
docs/README.md - Architecture Questions: See
docs/reference/CODE_STRUCTURE.md