Browser Automation · MODEL CONTEXT PROTOCOL
MCP Browser
NeoForge Browser MCP server - used to test the frontend
连接能力
MCP Browser 为 AI Agent 提供什么
来源目录未提供结构化功能列表,请在使用前阅读源仓库文档。
安全
MCP 收录不等于安全审核
MCP 服务器可能获得模型上下文、凭据、本地文件或调用外部系统的权限。连接 Agent 前,请检查代码、环境变量、网络行为、软件包来源与维护状态。
README
仓库文档
A headless browser interface for the Model Control Protocol (MCP).
- 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
- Python 3.13+
- uv for dependency management
- Docker (for containerized usage)
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 | bashThis command will download and run the installer with proper line ending handling to avoid common issues.
For manual installation:
- Clone this repository
- Run the installer script:
git clone https://github.com/neoforge-dev/mcp-browser.git
cd mcp-browser
./install.shMCP Browser requires XQuartz (X11) for proper visualization. The installer will:
- Check if XQuartz is already installed and install it if needed
- Attempt to start the X11 server in various ways
- Prompt you to start it manually if automatic methods fail
If you encounter issues, see the Troubleshooting XQuartz Issues section.
# 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 installFor a simple test without Xvfb:
./simple_test.shFor a full test with Xvfb (requires X11):
./test_local.shBuild and run using Docker Compose:
# Set your MCP secret
export MCP_SECRET=your_secret_key
# Build and run
docker-compose up --buildOr use the provided script:
./run.shThe following environment variables can be set:
MCP_SECRET: Secret key for MCP authenticationSERVER_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
GET /: Web UIGET /api/status: Get browser and MCP client statusWebSocket /ws: WebSocket endpoint for real-time communicationWebSocket /ws/browser/events: WebSocket endpoint for browser event subscriptionsGET /api/browser/subscribe: Subscribe to browser eventsGET /api/browser/unsubscribe: Unsubscribe from browser eventsGET /api/browser/subscriptions: List active 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:
MIT
社区