All How-To Guides

4 Ways to Automate Browser with Claude Code

How to automate browser with Claude Code?

4 MCP servers featured

Browser automation is essential for web scraping, testing, and workflow automation. While Claude Code doesn't have built-in browser control, MCP servers provide powerful browser automation capabilities that let you interact with web pages, take screenshots, fill forms, and more. Here are the best options available.

Recommended MCP Servers

Playwright MCP

microsoft/playwright-mcp

>24k

Official Microsoft Playwright MCP server, enabling LLMs to interact with web pages through structured accessibility snapshots.

Key Features

  • Official Microsoft support and maintenance
  • Structured accessibility snapshots for reliable element targeting
  • Cross-browser support (Chromium, Firefox, WebKit)
  • Headless and headed mode support

Installation

npx @anthropic-ai/playwright-mcp

Playwright MCP is the gold standard for browser automation with Claude. It's officially maintained by Microsoft, provides structured accessibility data that helps Claude understand page content, and supports all major browsers. The reliability and developer experience are unmatched.

Best for: Production automation and testing View on GitHub

Browser MCP (ByteDance)

agent-infra/mcp-server-browser

>19k

Browser automation capabilities using Puppeteer, supporting both local and remote browser connections.

Key Features

  • Built on Puppeteer for Chrome/Chromium
  • Remote browser connection support
  • Local browser automation
  • Part of UI-TARS desktop framework

Installation

npm install @agent-infra/mcp-server-browser

ByteDance's Browser MCP is a solid choice if you're working primarily with Chrome. It leverages Puppeteer's mature ecosystem and adds the ability to connect to remote browser instances, which is useful for testing across different environments.

Best for: Chrome automation and UI testing View on GitHub

BrowserMCP

browsermcp/mcp

>5k

Automate your local Chrome browser with simple commands.

Key Features

  • Simple setup and configuration
  • Works with your existing Chrome profile
  • Lightweight and focused
  • Good for quick automation tasks

Installation

npx browsermcp

BrowserMCP is perfect for developers who want quick browser automation without complex setup. It works with your existing Chrome installation and profile, making it ideal for automating tasks you'd normally do manually in the browser.

Best for: Quick local automation tasks View on GitHub

Playwright MCP Server

executeautomation/mcp-playwright

>5k

An MCP server using Playwright for browser automation and web scraping.

Key Features

  • Full Playwright feature set
  • Web scraping optimized
  • Screenshot and PDF generation
  • Form automation support

Installation

npx @executeautomation/mcp-playwright

This community-maintained Playwright server is tailored for web scraping use cases. It provides convenient methods for extracting data from web pages and handles common scraping patterns well. A good choice if your primary goal is data extraction.

Best for: Web scraping and data extraction View on GitHub

Quick Comparison

MCPStarsBest ForProsCons
Playwright MCP24k+Production automationOfficial Microsoft supportLarger footprint
Browser MCP (ByteDance)19k+Chrome automationRemote browser supportChrome only
BrowserMCP5k+Quick local tasksSimplest setupLimited features
mcp-playwright5k+Web scrapingScraping optimizedCommunity maintained

Getting Started

To get started with browser automation in Claude Code:

  1. Choose your MCP: For most users, Playwright MCP is recommended for its reliability and official support.

  2. Install the server:

    npx @anthropic-ai/playwright-mcp
    
  3. Add to Claude Code config: Add the MCP server to your claude_desktop_config.json

  4. Start automating: Ask Claude to navigate to pages, click buttons, fill forms, or extract data.

Example prompt: "Go to github.com and take a screenshot of the trending repositories page."

Related Guides