DEV Community

Cover image for Getting Started with Browser MCP: Automate Web Browsing with AI and MCP Protocol
Om Shree
Om Shree

Posted on • Originally published at glama.ai

Getting Started with Browser MCP: Automate Web Browsing with AI and MCP Protocol

Browser MCP1 makes it possible for AI applications to control your browser just like we would—navigating websites, filling out forms, clicking buttons, and interacting with dynamic content. It works by connecting your browser to AI tools using the Model Context Protocol (MCP)2, creating a shortcut bridge between AI reasoning and real-world web automation.

Image

Prerequisites

Before starting, ensure Node.js is installed on your machine, as it's required to run the Browser MCP server.

What Happens Behind the Scenes

When you use Browser MCP, several components work together to enable AI-driven browser automation:

Architecture Flow

  1. MCP Client: Tools like Cursor or Claude Desktop send natural language instructions.
  2. MCP Server (Browser MCP): A Node.js-based server that translates instructions into actionable browser commands.
  3. Browser MCP Chrome Extension: Acts as the bridge, receiving commands from the server and executing them inside your actual browser session.
[MCP Client] → [Browser MCP Server] → [Chrome Extension] → [Your Browser]
Enter fullscreen mode Exit fullscreen mode

Image

Execution Pipeline

  1. The MCP client queries the server for available tools and capabilities.
  2. When you send a command like “Go to google.com and search for Browser MCP”, the LLM interprets it and selects relevant tools with parameters.
  3. The Browser MCP server forwards these tool instructions via WebSocket to the Chrome extension.
  4. The extension interacts with the browser's DOM, performs the actions, and collects feedback like:
  • Console logs
  • Network activity
  • Screenshots
  • DOM snapshots
    1. Results are sent back to the server, which relays them to the MCP client for display or further reasoning by the AI.

Image

Key Advantages

  • Uses Your Real Browser: Avoids launching headless sessions, preserving your logged-in state and evading basic bot detection.
  • Persistent Session State: Actions happen within your live session, ensuring continuity.
  • Live Feedback Loop: Console logs, screenshots, and network details help debug or refine actions.
  • Privacy-Preserving: All actions run locally on your machine.

Image

Example Workflow

  1. Prompt: “Navigate to example.com, capture a screenshot, and show console logs.”
  2. Browser MCP Tools Involved:
  • navigate(url)
  • screenshot()
  • getConsoleLogs()

    1. AI Response:
  • Returns the screenshot and lists relevant console log entries.

Image

Setup in Different Clients

For Cursor

  1. Open full Cursor settings.
  2. Navigate to the MCP tab.
  3. Click Add new global MCP server.
  4. Enter the server configuration provided below.
  5. Refresh the "browsermcp" server entry to reload its configuration.

Consult [Cursor’s MCP documentation]3 for detailed guidance.

For VS Code

Refer to [VS Code’s MCP documentation]4 for configuration steps.

For Claude Desktop

Instructions are available in [Claude’s MCP documentation]5.

Note: Claude Desktop currently has a known issue6 where MCP servers may start twice, leading to errors. Despite this, Browser MCP will still function.

For Windsurf Desktop

Setup details are in [Windsurf’s MCP documentation]7.

MCP Server Configuration

{
  "mcpServers": {
    "browsermcp": {
      "command": "npx",
      "args": ["@browsermcp/mcp@latest"]
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

Image

Setting Up the Browser MCP Extension

  1. Install the Browser MCP Chrome extension1.
  2. Pin the extension to the Chrome toolbar for quick access.
  3. Click the extension icon to open it.
  4. Press Connect to link the active browser tab to the MCP server.

This establishes the bridge between the browser and your MCP client.

Automating the Browser

Once the server and extension are configured, you can begin automating tasks.

Example Command

Open your MCP client (e.g., Cursor) and run:

Go to google.com and search for "Browser MCP"
Enter fullscreen mode Exit fullscreen mode

This command instructs the connected browser to navigate and perform a search automatically.

Image

Troubleshooting

If you encounter issues while using Browser MCP, follow these steps to resolve them:

  1. Check if the MCP Server is Running Ensure that the Browser MCP server process is active. If it's not running, start it using the configured command:
   npx @browsermcp/mcp@latest
Enter fullscreen mode Exit fullscreen mode
  1. Verify Browser Extension Connection
  • Make sure the Browser MCP Chrome extension is installed and pinned in your browser toolbar.
  • Open the extension and confirm it shows Connected to the MCP server.
  • If it’s disconnected, click Connect again to re-establish the link.
  1. Restart Both the Server and Extension
    Sometimes restarting both the MCP server and the browser extension resolves transient connectivity issues.

  2. Inspect Console Logs
    Check your MCP client logs or the browser's developer console for error messages. These can provide clues on missing dependencies or misconfigurations.

  3. Check Port Conflicts
    Ensure that the MCP server isn't blocked by firewall rules or conflicting with other services on the same port.

Other Errors
If you encounter other errors, please file an issue on GitHub8.

References


  1. Chrome Browser MCP  

  2. Chrome Browser MCP Documentation  

  3. Use MCP servers in Cursor  

  4. Use MCP servers in VS Code  

  5. Use MCP servers in Claude Desktop  

  6. Claude Desktop Bug  

  7. Use MCP servers in Windsurf 

  8. BrowserMCP MCP Issues Github 

Top comments (3)

Collapse
 
capjud95 profile image
Capin Judicael Akpado

Okay !

Collapse
 
thedeepseeker profile image
Anna kowoski

Intresting Concept, MCP is indeed taking over the whole IT Space!!!

Collapse
 
om_shree_0709 profile image
Om Shree

True 😄