Cover image
Try Now
2025-04-10

Neoforge浏览器MCP服务器 - 用于测试前端

3 years

Works with Finder

0

Github Watches

1

Github Forks

1

Github Stars

MCP Browser

A headless browser interface for the Model Control Protocol (MCP).

Features

  • Headless browser automation using Playwright
  • Web UI for browser interaction
  • WebSocket communication for real-time updates
  • Real-time browser event subscription system
  • Integration with MCP for AI agents

Prerequisites

  • Python 3.13+
  • uv for dependency management
  • Docker (for containerized usage)

Installation

One-Line Installation

To install MCP Browser on your Mac with one command:

curl -sSL https://raw.githubusercontent.com/neoforge-dev/mcp-browser/main/install_one_line.sh | bash

This command will download and run the installer with proper line ending handling to avoid common issues.

Manual Installation

For manual installation:

  1. Clone this repository
  2. Run the installer script:
git clone https://github.com/neoforge-dev/mcp-browser.git
cd mcp-browser
./install.sh

XQuartz Requirements

MCP Browser requires XQuartz (X11) for proper visualization. The installer will:

  1. Check if XQuartz is already installed and install it if needed
  2. Attempt to start the X11 server in various ways
  3. Prompt you to start it manually if automatic methods fail

If you encounter issues, see the Troubleshooting XQuartz Issues section.

Local Development

Setup with uv

# Clone the repository
git clone https://github.com/yourusername/mcp-browser.git
cd mcp-browser

# Install dependencies
uv venv .venv
source .venv/bin/activate
uv pip install -e .

# Install Playwright browsers
python -m playwright install

Running Locally

For a simple test without Xvfb:

./simple_test.sh

For a full test with Xvfb (requires X11):

./test_local.sh

Docker Deployment

Build and run using Docker Compose:

# Set your MCP secret
export MCP_SECRET=your_secret_key

# Build and run
docker-compose up --build

Or use the provided script:

./run.sh

Configuration

The following environment variables can be set:

  • MCP_SECRET: Secret key for MCP authentication
  • SERVER_PORT: Port to run the server on (default: 7665)
  • PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: Set to 1 to skip browser download and run in headless-only mode

API Endpoints

  • GET /: Web UI
  • GET /api/status: Get browser and MCP client status
  • WebSocket /ws: WebSocket endpoint for real-time communication
  • WebSocket /ws/browser/events: WebSocket endpoint for browser event subscriptions
  • GET /api/browser/subscribe: Subscribe to browser events
  • GET /api/browser/unsubscribe: Unsubscribe from browser events
  • GET /api/browser/subscriptions: List active event subscriptions

Event Subscriptions

The MCP Browser supports real-time event subscriptions via WebSockets. This allows clients to receive browser events as they happen, including:

  • Page events (navigation, load, error)
  • DOM events (mutations, changes)
  • Console events (logs, warnings, errors)
  • Network events (requests, responses, errors)

For detailed documentation and examples of the event subscription system, see:

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.

  • Alexandru Strujac
  • Efficient thumbnail creator for YouTube videos

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

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

  • Beniyam Berhanu
  • Therapist adept at identifying core issues and offering practical advice with images.

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

  • Lists Tailwind CSS classes in monospaced font

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

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

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

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

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

  • jae-jae
  • MCP服务器使用剧作《无头浏览器》获取网页内容。

    Reviews

    2 (1)
    Avatar
    user_i4L226wg
    2025-04-16

    I've been using mcp-browser by neoforge-dev and I must say it's fantastic! This tool simplifies my work by providing a seamless experience for browsing Minecraft code. It’s intuitive, efficient, and constantly updated with great features. Highly recommend for any developer in the Minecraft community! Check it out [here](https://github.com/neoforge-dev/mcp-browser).