Browseagent MCP
Enables AI agents to control web browsers through the Model Context Protocol, supporting navigation, clicking, typing, and screenshots.
README
Browseagent MCP
<p align="left"> Control web browsers directly through AI applications conversation interface using the Model Context Protocol (MCP). <br /> <a href="https://browseagent.pro"><strong>Website</strong></a> • <a href="https://docs.browseagent.pro"><strong>Documentation</strong></a> • <a href="https://discord.gg/mt8pGkgUZj"><strong>Community</strong></a> </p>
✨ Features
- 🌐 Full Browser Control - Navigate, click, type, and interact with any website
- 📸 Screenshots & Analysis - Capture and analyze web pages visually
- 🎯 Smart Element Detection - AI-powered element identification and interaction
- 🔄 Real-time Automation - Dynamic connection with Chrome extension
🚀 Quick Start
<a href="https://docs.browseagent.pro"><strong>See Documentation</strong></a>
🔒 Security & Privacy
- ✅ Local Communication - All data stays on your machine
- ✅ No Data Collection - We don't store or transmit your browsing data
- ✅ Permission Based - Extension only accesses tabs when explicitly used
- ✅ Open Source - Full transparency in code and operations
🏗️ Development
Local Development Setup
# Clone the repository
git clone https://github.com/browseagent/mcp.git
cd mcp
# Install dependencies
npm install
# Create global symlink for development
npm link
# Test the server
npm run test
Testing with Claude Desktop (Development)
For local development and testing with Claude Desktop:
# 1. Create global link (one time setup)
npm link
# 2. Configure Claude Desktop to use your local version
Add to your Claude Desktop MCP configuration:
{
"mcpServers": {
"browseagent-dev": {
"command": "npx",
"args": ["@browseagent/mcp", "--debug"]
}
}
}
Development Workflow:
- Make changes to your code
- Test locally:
npm test - Test with Claude Desktop: Restart Claude Desktop to reload the linked package
- Iterate and repeat
Alternative: Direct Path Development
For more direct control during development:
{
"mcpServers": {
"browseagent-dev": {
"command": "node",
"args": ["/absolute/path/to/your/project/src/index.js", "--debug"],
"cwd": "/absolute/path/to/your/project"
}
}
}
Running in Development Mode
# Run with debugging enabled
npm run dev
# Run with WebSocket mode for extension testing
npm run dev -- --websocket
# Run with watch mode for auto-restart during development
npm run dev -- --websocket --debug
🧪 Comprehensive Testing Suite
The project includes a full testing suite to validate all components:
Core Test Commands
# Run full test suite
npm test
# Run all manual tests sequentially
npm run test:all
# Watch mode - auto-run tests on file changes
npm run test:watch
Individual Test Suites
1. Connection Tests (test:connection)
npm run test:connection
What it tests:
- ✅ Server startup and initialization
- ✅ WebSocket server creation and binding
- ✅ Extension bridge protocol handshake
- ✅ Architecture validation (STDIO vs WebSocket separation)
- ✅ Port conflict resolution
- ✅ Error handling and timeout scenarios
Use when: Setting up development environment or diagnosing connection issues.
2. Tools Tests (test:tools)
npm run test:tools
What it tests:
- ✅ Tool registry loading and structure validation
- ✅ Tool argument validation (required/optional fields)
- ✅ Schema completeness and type checking
- ✅ Tool categorization (navigation, interaction, utility, inspection)
- ✅ Input constraint validation (min/max values, patterns)
- ✅ Error message accuracy for invalid inputs
Use when: Adding new tools or modifying existing tool schemas.
3. Debug Tests (test:debug)
npm run test:debug
What it tests:
- ✅ Bridge ↔ Server communication flow
- ✅ Extension connection event propagation
- ✅ Tool call request/response cycle
- ✅ Mock extension handshake simulation
- ✅ Event listener setup and cleanup
- ✅ Status synchronization between components
Use when: Debugging communication issues between bridge and server.
4. Interactive Tool Tests (test:tool)
npm run test:tool
What it provides:
- 🎮 Interactive CLI for manual tool testing
- 🔧 Real-time tool execution with live extension
- 📊 Connection status monitoring
- 🎯 Specific tool argument input and validation
- 📝 Step-by-step debugging of tool calls
Use when: Manually testing specific tools with real browser extension.
Test Modes
STDIO Mode Testing (Production)
# Test STDIO mode (what Claude Desktop uses)
node src/index.js --debug
# Send test MCP message
echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0.0"}}}' | node src/index.js
WebSocket Mode Testing (Development)
# Test WebSocket mode (for extension testing)
node src/index.js --websocket --debug
Advanced Testing Scenarios
Integration Testing
# Test with specific port
npm run test:connection -- --port 9999
# Test with timeout scenarios
npm run test:debug -- --timeout 5000
Development Tools
Linting and Code Quality
# Run ESLint
npm run lint
Debugging Tools
# Verbose logging
npm run dev -- --debug
Development Scripts
# Start in development mode
npm run start
# Start with debugging enabled
npm run dev
# Quick development test
npm run dev -- --websocket --debug
Testing Best Practices
Before Committing
# Run full validation suite
npm run test:all
npm run lint
# Test both modes
node src/index.js --debug # STDIO mode
node src/index.js --websocket --debug # WebSocket mode
Continuous Testing During Development
# Watch mode for automatic test runs
npm run test:watch
# Development mode with auto-restart
nodemon src/index.js -- --websocket --debug
Testing with Real Extension
- Install Chrome extension
- Run interactive tool tester:
npm run test:tool - Connect extension via popup
- Test specific tools interactively
- Verify results in browser
Troubleshooting Development Issues
Common Development Problems
| Issue | Test Command | Solution |
|---|---|---|
| Extension not connecting | npm run test:connection |
Check WebSocket port availability |
| Tool validation failing | npm run test:tools |
Review tool schema definitions |
| Bridge communication broken | npm run test:debug |
Verify event listener setup |
| Performance issues | node --inspect src/index.js |
Profile memory/CPU usage |
Debug Logging Levels
# Minimal logging
node src/index.js
# Standard debug logging
node src/index.js --debug
# Verbose component logging
DEBUG=* node src/index.js --debug
# Specific component debugging
DEBUG=ExtensionBridge,MCPServer node src/index.js --debug
Building from Source
# Install from source
npm install -g .
# Or run directly
node src/index.js --debug
# Package for distribution
npm pack
🤝 Contributing
We welcome contributions! Here's how to get started:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Set up development environment:
npm install && npm link - Make your changes and test:
npm test - Test with Claude Desktop using the development configuration
- Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open a Pull Request
Development Setup
# Clone your fork
git clone https://github.com/your-username/browseagent-mcp.git
cd browseagent-mcp
# Install dependencies
npm install
# Create development link
npm link
# Install the Chrome extension in development mode
npm run build:extension
# Test your changes
npm test
Development Tools
- ESLint:
npm run lint - Tests:
npm test - Debug mode:
npm run dev -- --debug - WebSocket mode:
npm run dev -- --websocket
📝 API Reference
MCP Protocol
This server implements the Model Context Protocol specification:
- Protocol Version:
2024-11-05 - Capabilities: Tools
- Transport: stdio
Tool Schemas
All tools follow the MCP tool schema format. See the API documentation for detailed schemas and examples.
🗂️ Project Structure
src/
├── index.js # Main entry point
├── server/ # MCP server implementation
│ ├── MCPServer.js # Core MCP protocol handler
│ └── transports/ # Communication transports
├── bridge/ # Chrome extension bridge
│ └── ExtensionBridge.js
├── tools/ # Tool definitions and registry
│ └── ToolRegistry.js
├── utils/ # Utilities and helpers
│ └── Logger.js
├── config/ # Configuration management
| └── Config.js
└── test/
├── connection.test.js # Test connection script
└── tools.test.js # Test tools script
📚 Documentation
🆘 Support
- 🐛 Bug Reports: GitHub Issues
- 💬 Discussions: GitHub Discussions
- 📧 Email: hello@browseagent.pro
- 🐦 Twitter: @Browseagent
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙏 Acknowledgments
- Anthropic - For MCP protocol
- Chrome Extension API - For enabling secure browser automation
- Open Source Community - For tools and inspiration
<div align="center">
🐦 Follow updates • 📖 Read docs
Made with ❤️ by the <a href="https://boostgpt.co" target="_blank">BoostGPT</a> team
</div>
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。