jumodada

DrissionPage MCP Server

Community jumodada
Updated

DrissionPage MCP Server

Professional browser automation for Claude Code and MCP clients powered by DrissionPage

PyPIDownloadsLicensePython VersionStatus

Official Repositories: GitHub | GitCode

English Version | ไธญๆ–‡็‰ˆๆœฌ

๐Ÿš€ What is DrissionPage MCP?

DrissionPage MCP Server is a production-ready Model Context Protocol (MCP) server that brings professional browser automation capabilities to Claude Code, Claude Desktop, and other MCP clients.

Unlike screenshot-based approaches, it provides structured, deterministic web automation through 14 powerful tools that leverage the efficiency of DrissionPage, a high-performance browser automation framework.

๐ŸŒŸ Why Choose DrissionPage MCP?

  • LLM-Optimized: Works with structured data instead of requiring vision models
  • Deterministic: Reliable element selection with CSS and XPath support
  • Fast & Lightweight: Built on DrissionPage's efficient engine with minimal overhead
  • Type-Safe: Full type hints and Pydantic validation for all tools
  • Production Ready: Thoroughly tested and documented, ready for real-world use
  • Easy Integration: Simple pip install + JSON configuration

โšก Quick Install

# Install from PyPI
pip install drissionpage-mcp

# Verify installation
drissionpage-mcp --version

๐Ÿ“ฆ Setup in Claude Code (30 seconds)

  1. Edit MCP configuration:

    • macOS/Linux: ~/.config/claude-code/mcp_settings.json
    • Windows: %APPDATA%\claude-code\mcp_settings.json
  2. Add this configuration:

    {
      "mcpServers": {
        "drissionpage": {
          "command": "drissionpage-mcp"
        }
      }
    }
    
  3. Restart Claude Code and start using!

๐ŸŽฏ Quick Examples

Navigate and Screenshot

"Visit https://example.com and take a screenshot for me"

Search and Extract

"Go to Wikipedia, search for Python, and get the first paragraph"

Form Automation

"Fill out the form at https://httpbin.org/forms/post and submit it"

Data Scraping

"Get the top 10 news headlines from news.ycombinator.com"

๐Ÿ› ๏ธ 14 Powerful Tools

๐ŸŒ Navigation (4 tools)

  • page_navigate - Navigate to any URL
  • page_go_back / page_go_forward - Browser history
  • page_refresh - Reload current page

๐ŸŽฏ Element Interaction (3 tools)

  • element_find - Find elements by CSS selector or XPath
  • element_click - Click any element
  • element_type - Input text into elements

๐Ÿ“ธ Page Operations (5 tools)

  • page_screenshot - Capture full page or viewport
  • page_resize - Adjust browser window
  • page_click_xy - Click by coordinates
  • page_close - Close browser
  • page_get_url - Get current URL

โฑ๏ธ Wait Operations (2 tools)

  • wait_for_element - Wait for element to appear (with timeout)
  • wait_time - Delay execution

๐Ÿ“š Documentation

Guide Description
QUICKSTART.md 5-minute setup guide
USAGE_GUIDE.md Complete usage reference
TESTING_AND_INTEGRATION.md Integration with MCP clients
examples/README.md Configuration examples

๐Ÿ—๏ธ Architecture

Built with clean, modular design:

DrissionMCP/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ cli.py              # Entry point
โ”‚   โ”œโ”€โ”€ server.py           # MCP server
โ”‚   โ”œโ”€โ”€ context.py          # Browser management
โ”‚   โ”œโ”€โ”€ response.py         # Response formatting
โ”‚   โ”œโ”€โ”€ tab.py              # Page operations
โ”‚   โ””โ”€โ”€ tools/              # 14 automation tools
โ”œโ”€โ”€ examples/               # Configuration templates
โ”œโ”€โ”€ tests/                  # Unit tests
โ””โ”€โ”€ playground/             # Testing utilities

Key Principles:

  • โœ… Type-safe Pydantic models for all tools
  • โœ… Async/await throughout
  • โœ… Clean separation of concerns
  • โœ… Comprehensive error handling
  • โœ… Full test coverage

๐Ÿ”ง Configuration

Basic Setup (Recommended)

{
  "mcpServers": {
    "drissionpage": {
      "command": "drissionpage-mcp"
    }
  }
}

Advanced Setup

{
  "mcpServers": {
    "drissionpage": {
      "command": "drissionpage-mcp",
      "args": ["--log-level", "DEBUG"],
      "env": {
        "CHROME_PATH": "/custom/path/to/chrome"
      }
    }
  }
}

See examples/README.md for more configuration options.

๐Ÿ“‹ Requirements

  • Python 3.8+ (3.11+ recommended)
  • Chrome or Chromium browser
  • Any MCP-compatible client: Claude Code, Claude Desktop, Cursor, VS Code, etc.

๐Ÿงช Testing

Verify Installation

# Quick verification
python -c "from DrissionPage import ChromiumPage; p = ChromiumPage(); print('โœ… Ready')"

# Or run tests
pip install -e ".[dev]"
pytest tests/

Try It Out

# Interactive testing
python playground/local_test.py

# Quick start validation
python playground/quick_start.py

๐Ÿš€ Use Cases

โœ… Automated Testing - Test web applicationsโœ… Data Scraping - Extract structured data from websitesโœ… Form Automation - Fill and submit formsโœ… Monitoring - Check for updates or changesโœ… Screenshot Verification - Capture and verify page stateโœ… Content Analysis - Analyze web content programmatically

๐Ÿ› Troubleshooting

Tools Not Loading?

drissionpage-mcp --version

Should output: drissionpage-mcp 0.1.0

Browser Issues?

# Check browser installation
which google-chrome    # Linux
which chromium         # macOS

Claude Code Not Finding Server?

  • Verify config file path
  • Restart Claude Code after changes
  • Check logs: drissionpage-mcp --log-level DEBUG

See TESTING_AND_INTEGRATION.md for complete troubleshooting guide.

๐Ÿ“Š Project Status

Component Status
Core Features โœ… Complete
Testing โœ… 100% Coverage
Documentation โœ… Comprehensive
Production Ready โœ… Yes
PyPI Package โœ… Published

Version: 0.1.0 | License: Apache 2.0 | Maintained: โœ… Active

๐Ÿ—บ๏ธ Roadmap

Current (v0.1.0)

  • 14 core automation tools
  • Full MCP protocol support
  • Production-ready codebase
  • Comprehensive documentation
  • PyPI distribution

Future (v0.2+)

  • Form handling utilities
  • File upload support
  • Shadow DOM selectors
  • Session persistence
  • Proxy support
  • Network interception

๐Ÿ“– Integration Examples

Claude Code

{
  "mcpServers": {
    "drissionpage": {
      "command": "drissionpage-mcp"
    }
  }
}

Claude Desktop

{
  "mcpServers": {
    "drissionpage": {
      "command": "drissionpage-mcp"
    }
  }
}

See examples/ for more client configurations.

๐Ÿค Contributing

Contributions are welcome!

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if needed
  5. Submit a pull request

๐Ÿ”’ Security

  • Does not store or transmit sensitive data
  • Runs locally in your environment
  • No external API calls
  • Respects website terms of service

Best Practices:

  • Don't automate without permission
  • Use on test environments when possible
  • Respect robots.txt
  • Add appropriate delays between actions

๐Ÿ“„ License

Licensed under Apache License 2.0 - see LICENSE

๐Ÿ™ Acknowledgments

๐Ÿ’ฌ Support

๐Ÿ“ˆ Statistics

DownloadsPyPI Version

๐ŸŒŸ Show Your Support

If you find this project useful, please consider:

  • โญ Starring on GitHub
  • ๐Ÿ“ค Sharing with your network
  • ๐Ÿ’ฌ Leaving feedback or suggestions
  • ๐Ÿ› Reporting issues to help improve

Made with โค๏ธ by Wukunyun

Ready to automate your workflows? Install now: pip install drissionpage-mcp

MCP Server ยท Populars

MCP Server ยท New