Skip to main content
Glama
mcp-browser-automation

mcp-browser-automation

by ritesh-jain

mcp-browser-automation

An MCP (Model Context Protocol) server for generic browser automation using Playwright. Exposes a headless Chromium instance as a set of callable tools so that MCP clients — such as AI coding assistants — can navigate pages, inspect elements, execute JavaScript, capture screenshots, and monitor console logs and network traffic.

Requirements

  • Node.js 18+

  • npm

Related MCP server: Playwright MCP

Installation

npm install
npx playwright install chromium

Usage

npm run build
npm start

Or for development with hot reload:

npm run dev

The server listens on stdin/stdout using the MCP stdio transport. Configure your MCP client to launch it as a subprocess.

Claude Desktop:

{
  "mcpServers": {
    "browser-automation": {
      "command": "npx",
      "args": ["github:ritesh-jain/MCP-Browser-Automation"]
    }
  }
}

Opencode:

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "mcp-browser-automation": {
      "type": "local",
      "enabled": true,
      "command": [
        "npx",
        "github:ritesh-jain/MCP-Browser-Automation"
      ]
    }
  }
}

Tools

Tool

Description

navigate

Navigate to a URL. Supports custom viewport and mobile emulation.

capture_screenshot

Take a full-page screenshot (saved to screenshots/).

get_console_logs

Retrieve browser console logs. Optionally clear after read.

get_network_traffic

Retrieve network requests and responses. Optionally clear after read.

execute_js

Execute arbitrary JavaScript in the page context.

interact

Click, type, fill, or select on a CSS selector.

inspect_element

Return tag name, id, class, inner text, outer HTML, and computed styles for an element.

Project Structure

src/
  types.ts           Shared type definitions
  McpServer.ts       MCP protocol layer — tool registration and dispatch
  BrowserManager.ts  Playwright orchestration — browser lifecycle and page interactions
index.ts             Entry point

How It Works

  1. index.ts creates an McpBrowserServer and connects via StdioServerTransport.

  2. An MCP client discovers tools via the ListTools request and calls them via CallToolRequest.

  3. McpBrowserServer lazily initializes the browser on the first tool call and delegates to BrowserManager.

  4. The browser stays open across calls, enabling multi-step interactions on the same page.

License

ISC

Available Tools

7 tools
capture_screenshotB

Take a screenshot of the current page

Inputs: name.

execute_jsB

Execute arbitrary JavaScript in the browser context

Inputs: script (required).

get_console_logsB

Get browser console logs

Inputs: clear.

get_network_trafficB

Get network requests and responses

Inputs: clear.

inspect_elementC

Get details of a specific element

Inputs: selector (required).

interactC

Interact with a page element

Inputs: type (required), selector (required), value.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 7 tools

    Disambiguation5/5

    Each tool targets a distinct browser capability: navigation, screenshot, console logs, network traffic, JS execution, element interaction, and element inspection. There is no meaningful overlap between them; even interact and inspect_element are clearly differentiated as action vs. introspection.

    Naming Consistency4/5

    Tool names are predominantly snake_case with a verb-first pattern (navigate, interact, inspect_element, execute_js). Minor inconsistency exists in the prefix: get_console_logs and get_network_traffic use 'get_', while capture_screenshot uses 'capture_' instead of 'get_'. Overall the pattern is readable and predictable.

    Tool Count5/5

    Seven tools is a well-scoped set for browser automation, covering essential operations without excess. This is within the ideal 3-15 range and each tool serves a distinct purpose.

    Completeness4/5

    The tool surface covers core browser automation needs: navigation, screenshots, logs, network, JavaScript execution, and element interactions/inspection. Some advanced features like tab management, cookie handling, or explicit waiting are missing, but execute_js can compensate, and the common workflows are complete.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      Not graded
      maintenance
      A MCP server that provides browser automation tools, allowing users to navigate websites, take screenshots, click elements, fill forms, and execute JavaScript through Playwright.
      8
      2
      Apache 2.0
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables browser automation and web scraping by exposing Playwright tools through an HTTP-based MCP server. Users can navigate pages, interact with web elements, capture screenshots, and extract structured content using a persistent Chromium instance.
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      A comprehensive browser automation MCP server using Playwright, offering 50+ tools for page control, element interaction, content extraction, and more across multiple browser engines.
      35 npm
      1
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      Stateful MCP server wrapping Playwright for browser automation. Provides tools to navigate, interact, and extract data from web pages via a persistent browser session.
      19
      1,175 npm
      MIT