DrissionPage BetterMCP
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@DrissionPage BetterMCPOpen a new tab and navigate to https://example.com"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
DrissionPage BetterMCP
A better DrissionPage MCP server — covers most capabilities of the original library, 255 unit tests, 100% service coverage, AI-optimized tool calls and descriptions.
English | 中文
Why BetterMCP
BetterMCP | Note | |
55 Tools | Covers browser, tabs, navigation, elements, forms, screenshots, network, cookies, storage, iframes, files, and more | Most capabilities of the original library, ready out of the box |
255 Unit Tests | 17 test modules + 6 integration test suites | 100% service coverage, verifiable on every commit |
AI-Friendly | Clear tool descriptions, explicit parameter semantics, unified response structure | LLMs understand on first call — fewer retries, less token waste |
Element Cache |
| No repeated lookups, more efficient interactions |
Native Locator Syntax |
| Full DrissionPage syntax support |
Dual Transport |
| Works with all major AI coding tools |
Quick Start
Prerequisites
Python >= 3.10
Chrome / Chromium browser
Install
git clone https://github.com/pureTrue/DrissionPage-BetterMCP.git
cd DrissionPage-BetterMCP
uv syncConfigure Your AI Tool
Claude Code
Project root .mcp.json:
{
"mcpServers": {
"drissionpage": {
"command": "uv",
"args": ["run", "--directory", "/path/to/DrissionPage-BetterMCP", "dp-mcp"]
}
}
}Or via CLI:
claude mcp add drissionpage -- uv run --directory /path/to/DrissionPage-BetterMCP dp-mcpCursor
.cursor/mcp.json (project-level) or ~/.cursor/mcp.json (global):
{
"mcpServers": {
"drissionpage": {
"command": "uv",
"args": ["run", "--directory", "/path/to/DrissionPage-BetterMCP", "dp-mcp"]
}
}
}VS Code (Copilot)
.vscode/mcp.json:
{
"servers": {
"drissionpage": {
"command": "uv",
"args": ["run", "--directory", "/path/to/DrissionPage-BetterMCP", "dp-mcp"]
}
}
}Note: VS Code uses
serversas the top-level key, notmcpServers.
Codex
.codex/config.toml (project-level) or ~/.codex/config.toml (global):
[mcp_servers.drissionpage]
command = "uv"
args = ["run", "--directory", "/path/to/DrissionPage-BetterMCP", "dp-mcp"]Or via CLI:
codex mcp add drissionpage -- uv run --directory /path/to/DrissionPage-BetterMCP dp-mcpReplace /path/to/DrissionPage-BetterMCP with the actual project path.
Environment Variables
Optional, prefixed with DP_MCP_:
Variable | Default | Description |
|
| Default tool timeout (seconds) |
|
| Logging level |
|
| Max network packets to capture |
Copy .env.example to .env and customize as needed.
Tool List
Browser Management
Tool | Description |
| Connect to an existing Chrome or launch a new instance; supports headless, proxy, user_agent |
| Get browser status: address, tab count, process ID |
| Close the browser and release all resources |
Tab Management
Tool | Description |
| Open a new tab, optionally navigate to a URL |
| Close a tab; defaults to the current tab |
| Switch to a specific tab |
| List all open tabs |
| Search tabs by title and/or URL |
| Get tab details |
Page Navigation
Tool | Description |
| Navigate to a URL; returns final URL and page title |
| Go back or forward in history |
| Refresh the page; optionally ignore cache |
| Stop page loading |
Element Interaction
Tool | Description |
| Find an element; returns a cached |
| Find all matching elements |
| Wait for an element state (present / visible / hidden / deleted) |
| Click an element; supports left / right / middle / double click |
| Type text into an input; optionally clear first |
| Clear an input field |
| Hover over an element |
| Drag to a target element or pixel offset |
| Get visible text content |
| Get an HTML attribute value |
| Get full details: tag, text, rect, attrs, HTML, states |
| Select an option in a |
| Get all options of a |
| Scroll until the element is visible |
Screenshots
Tool | Description |
| Screenshot the page; supports full-page capture |
| Screenshot a specific element |
Page Content
Tool | Description |
| Get the page's plain text |
| Get the HTML source |
| Wait for page load / URL change / title change |
| Scroll the page in a direction |
Iframes
Tool | Description |
| List all iframes |
| Switch into an iframe |
| Return to the parent frame |
| Return to the top-level page |
Network Capture
Tool | Description |
| Start listening for requests matching a URL pattern |
| Wait for and retrieve captured network packets |
Cookies & Storage
Tool | Description |
| Get all cookies; optionally filter by domain |
| Set a cookie |
| Remove a cookie or clear all |
| Read from localStorage / sessionStorage |
| Write to localStorage / sessionStorage |
Keyboard & Dialogs
Tool | Description |
| Press a key or combination (Enter, Ctrl+A, etc.) |
| Type text continuously |
| Handle an alert / confirm / prompt dialog |
| Enable or disable automatic dialog handling |
Advanced
Tool | Description |
| Execute an action sequence: move, click, drag, type, wait |
| Execute JavaScript on the page |
| Execute a raw Chrome DevTools Protocol command |
File Operations
Tool | Description |
| Upload a file; supports hidden inputs |
| Download a file via URL or click trigger |
| Save the page as PDF or MHTML |
Developer Guide
Project Structure
src/dp_mcp/
├── server.py # MCP server — 55 tool definitions
├── config.py # Settings (pydantic-settings)
├── models.py # ToolResult, BrowserInfo, TabInfo, etc.
├── core/ # Core services
│ ├── browser.py # Browser lifecycle
│ ├── tab.py # Multi-tab management
│ ├── navigation.py # Page navigation
│ └── element.py # Element finding & interaction
├── services/ # Domain services
│ ├── screenshot.py # Screenshots
│ ├── frame.py # Iframes
│ ├── scroll.py # Scrolling
│ ├── network.py # Network capture
│ ├── cookie.py # Cookies
│ ├── action.py # Action chains
│ ├── dialog.py # Dialogs
│ ├── cdp.py # CDP
│ └── file.py # File operations
└── utils/
└── locator.py # Locator parser + element cacheRunning Tests
# Unit tests (no browser needed)
uv run pytest tests/unit -v
# Integration tests (requires Chrome)
uv run pytest tests/integration -v -m integration
# All tests
uv run pytest -vLocator Syntax
Full DrissionPage locator syntax is supported:
Syntax | Example | Description |
|
| By ID |
|
| By class name |
|
| By attribute |
|
| By visible text |
|
| By tag name |
|
| CSS selector |
|
| XPath |
|
| AND condition |
|
| OR condition |
Use the optional by parameter to disambiguate: css, xpath, text, id, class, attr.
Contributing
Pull requests and issues are welcome.
Fork this repository
Create a feature branch:
git checkout -b feature/my-featureCommit your changes:
git commit -m "feat: add my feature"Push the branch:
git push origin feature/my-featureOpen a Pull Request
Please make sure all tests pass before submitting:
uv run pytest tests/unit -vLicense
This project's code is licensed under BSD 3-Clause.
Note: This project depends on DrissionPage, which uses a custom non-commercial license that prohibits unauthorized commercial use. Users must independently comply with DrissionPage's license terms.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/crmmc/DrissionPage-BetterMCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server