Cover image
Try Now
2025-03-10

为Claude和其他MCP兼容的AI助手提供浏览器自动化功能的模型上下文协议(MCP)服务器

3 years

Works with Finder

1

Github Watches

1

Github Forks

0

Github Stars

Browser Automation MCP Server

A Model Context Protocol (MCP) server that provides browser automation capabilities for Claude and other MCP-compatible AI assistants.

Features

  • Web Automation: Control web browsers programmatically
  • Screenshot Capture: Take screenshots of web pages
  • Element Interaction: Click, type, and interact with web elements
  • Navigation: Navigate between pages and manage browser state
  • Form Filling: Automate form filling and submission
  • Data Extraction: Extract data from web pages

Installation

# Clone the repository
git clone https://github.com/samihalawa/browser-automation-server.git
cd browser-automation-server

# Install dependencies
npm install

# Build the server
npm run build

Usage

Starting the Server

npm start

Configuration

Add the server to your MCP configuration:

{
  "servers": {
    "browser-automation": {
      "command": "/path/to/node",
      "args": ["/path/to/browser-automation-server/build/index.js"],
      "enabled": true,
      "port": 3008,
      "environment": {
        "NODE_PATH": "/path/to/node_modules",
        "PATH": "/usr/local/bin:/usr/bin:/bin"
      }
    }
  }
}

Available Tools

navigate

Navigate to a URL.

Parameters:

  • url (string, required): URL to navigate to
  • waitUntil (string, optional): Navigation wait condition. Options: 'load', 'domcontentloaded', 'networkidle'. Default: 'load'

screenshot

Take a screenshot of the current page.

Parameters:

  • fullPage (boolean, optional): Whether to capture full page or just viewport. Default: false
  • path (string, optional): Path to save the screenshot to. If not provided, returns base64 encoded image

click

Click on an element.

Parameters:

  • selector (string, required): CSS selector of the element to click
  • waitForSelector (boolean, optional): Whether to wait for the selector to appear. Default: true

type

Type text into an input field.

Parameters:

  • selector (string, required): CSS selector of the input element
  • text (string, required): Text to type
  • delay (number, optional): Delay between keystrokes in milliseconds. Default: 0

extract

Extract data from the page.

Parameters:

  • selector (string, required): CSS selector of the elements to extract
  • attribute (string, optional): Attribute to extract. If not provided, extracts text content

evaluate

Evaluate JavaScript in the browser context.

Parameters:

  • script (string, required): JavaScript code to evaluate
  • args (array, optional): Arguments to pass to the script

Example Usage

  1. Navigate to a website:

    navigate(url: "https://example.com")
    
  2. Take a screenshot:

    screenshot(fullPage: true)
    
  3. Click a button:

    click(selector: "#submit-button")
    
  4. Fill a form:

    type(selector: "#username", text: "user123")
    type(selector: "#password", text: "password123")
    click(selector: "#login-button")
    
  5. Extract data:

    extract(selector: ".product-title", attribute: "innerText")
    

Requirements

  • Node.js 14+
  • Playwright for browser automation

License

MIT

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Bora Yalcin
  • Evaluator for marketplace product descriptions, checks for relevancy and keyword stuffing.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Callycode Limited
  • A geek-themed horoscope generator blending Bitcoin prices, tech jargon, and astrological whimsy.

  • Alexandru Strujac
  • Efficient thumbnail creator for YouTube videos

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Khalid kalib
  • Write professional emails

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • Lists Tailwind CSS classes in monospaced font

  • apappascs
  • 发现市场上最全面,最新的MCP服务器集合。该存储库充当集中式枢纽,提供了广泛的开源和专有MCP服务器目录,并提供功能,文档链接和贡献者。

  • ShrimpingIt
  • MCP系列GPIO Expander的基于Micropython I2C的操作,源自ADAFRUIT_MCP230XX

  • OffchainLabs
  • 进行以太坊的实施

  • huahuayu
  • 统一的API网关,用于将多个Etherscan样区块链Explorer API与对AI助手的模型上下文协议(MCP)支持。

  • deemkeen
  • 用电源组合控制您的MBOT2:MQTT+MCP+LLM

    Reviews

    5 (1)
    Avatar
    user_RmlJHcoD
    2025-04-16

    Browser-automation-server by samihalawa is an exceptional tool for anyone needing efficient browser automation. Its clear documentation and robust functionality make it incredibly user-friendly. The flexibility and ease of setting up tasks with this server have significantly improved my workflow. Highly recommend for both beginners and advanced users!