Browseagent MCP

Browseagent MCP

Enables AI agents to control web browsers through the Model Context Protocol, supporting navigation, clicking, typing, and screenshots.

Category
Visit Server

README

Browseagent MCP

npm version License: MIT Node.js Version

<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:

  1. Make changes to your code
  2. Test locally: npm test
  3. Test with Claude Desktop: Restart Claude Desktop to reload the linked package
  4. 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

  1. Install Chrome extension
  2. Run interactive tool tester: npm run test:tool
  3. Connect extension via popup
  4. Test specific tools interactively
  5. 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:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Set up development environment: npm install && npm link
  4. Make your changes and test: npm test
  5. Test with Claude Desktop using the development configuration
  6. Commit changes: git commit -m 'Add amazing feature'
  7. Push to branch: git push origin feature/amazing-feature
  8. 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

๐Ÿ“„ 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>

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured