by jumodada
Provides a local Model Context Protocol (MCP) server that enables AI clients to control real browsers via DrissionPage for web navigation, data extraction, form automation, and monitoring.
Enables AI assistants such as Claude Code, Codex, and other MCP‑compatible clients to perform deterministic, structured browser automation. The server exposes 19 built‑in tools (navigation, element interaction, screenshot, waiting, etc.) through MCP, allowing LLMs to issue precise commands instead of relying on pixel‑based screenshots.
python -m pip install -U drissionpage-mcp
drissionpage-mcp --version
drissionpage-mcp doctor # optional diagnostics
~/.codex/config.toml or a project‑level .codex/config.toml:
[mcp_servers.drissionpage]
command = "drissionpage-mcp"
startup_timeout_sec = 20
tool_timeout_sec = 60
For JSON‑based clients (Claude Code, Claude Desktop, Cursor, etc.) use:
{
"mcpServers": {
"drissionpage": { "command": "drissionpage-mcp" }
}
}
/mcp (Codex) or the client’s MCP UI.Q: Which browsers are supported?
A: Any Chrome or Chromium installation reachable from the host machine. The server launches Chrome in headless mode by default but can be configured via environment variables (e.g., DP_HEADLESS=0).
Q: Do I need a special Python version? A: Python 3.10+ is required; 3.11+ is recommended.
Q: How does the server handle authentication cookies or sessions? A: The server uses a regular Chrome profile, so any cookies or logged‑in sessions present in the profile are available to LLM commands. For security, use a dedicated profile when automating sensitive workflows.
Q: What if a selector fails? A: Tools return a clear error with the original selector and the normalized locator, allowing the LLM to adjust or retry quickly.
Q: Can I run the server inside a container?
A: Yes, as long as Chrome/Chromium is installed in the container and the DISPLAY/headless settings are appropriately configured.
Q: How are errors reported to the LLM client?
A: Responses follow the MCP tool contract, containing status, message, and optional data fields, all validated by Pydantic models.
Professional browser automation for Codex, Claude Code, and MCP clients powered by DrissionPage
Official Repositories: GitHub | GitCode
DrissionPage MCP Server is a local Model Context Protocol (MCP) server that brings DrissionPage browser automation tools to Codex CLI/IDE, Claude Code, Claude Desktop, and other MCP clients.
Unlike screenshot-based approaches, it provides structured, deterministic web automation through 19 tools plus MCP Resources/Prompts that leverage the efficiency of DrissionPage, a high-performance browser automation framework.
pip install + Codex TOML or MCP JSON configuration# Install from PyPI
python -m pip install -U drissionpage-mcp
# Verify package and environment
drissionpage-mcp --version
drissionpage-mcp doctor
Then add the Codex or MCP client configuration below and restart your client.
Codex supports local stdio MCP servers through config.toml; the CLI and IDE extension share the same MCP configuration.
Edit Codex configuration:
~/.codex/config.toml.codex/config.toml inside a trusted projectAdd this configuration:
[mcp_servers.drissionpage]
command = "drissionpage-mcp"
startup_timeout_sec = 20
tool_timeout_sec = 60
Restart Codex. In the TUI, run /mcp; from a shell, run codex mcp list.
For Claude Code, Claude Desktop, and other JSON-based MCP clients, see Integration Examples.
"Visit https://example.com and take a screenshot for me"
"Go to Wikipedia, search for Python, and get the first paragraph"
"Fill out the form at https://httpbin.org/forms/post and submit it"
"Get the top 10 news headlines from news.ycombinator.com"
page_navigate - Navigate to any URLpage_go_back / page_go_forward - Browser historypage_refresh - Reload current pageelement_find - Find elements by CSS selector or XPath; bare selectors like h1 are treated as CSSelement_click - Click any elementelement_type - Input text into elementselement_get_text - Get element or page textelement_get_attribute - Get an HTML attributeelement_get_property - Get a live DOM property such as an input valueelement_get_html - Get element or page HTMLpage_screenshot - Capture full page or viewportpage_resize - Adjust browser windowpage_click_xy - Click by coordinatespage_close - Close browserpage_get_url - Get current URLwait_for_element - Wait for element to appear (with timeout)wait_for_url - Wait until the current URL contains textwait_time - Delay executiondrissionpage://session/summary, drissionpage://page/current, drissionpage://tools/catalog, drissionpage://policy/summarybrowser_navigate_and_summarize, browser_extract_structured_data, browser_fill_form_safely, browser_debug_page_issue| Guide | Description |
|---|---|
| README.md | Installation, tools, and architecture |
| docs/compatibility.md | Supported Python, DrissionPage, MCP, and browser versions |
| docs/tool-contract.md | Public MCP tool names, inputs, annotations, and response shape |
| docs/troubleshooting.md | Doctor command, browser startup, and client setup fixes |
| docs/release-checklist.md | Release validation and publishing checklist |
| examples/README.md | MCP client configuration examples |
| CHANGELOG.md | Release notes |
Built with clean, modular design:
DrissionMCP/
├── drissionpage_mcp/
│ ├── cli.py # Entry point
│ ├── server.py # MCP server
│ ├── context.py # Browser management
│ ├── response.py # Response formatting
│ ├── tab.py # Page operations
│ └── tools/ # 19 automation tools
├── examples/ # Configuration templates
├── tests/ # Unit tests
└── playground/ # Testing utilities
Key Principles:
[mcp_servers.drissionpage]
command = "drissionpage-mcp"
startup_timeout_sec = 20
tool_timeout_sec = 60
# Optional browser/runtime environment variables:
# [mcp_servers.drissionpage.env]
# CHROME_PATH = "/custom/path/to/chrome"
# DP_HEADLESS = "1"
# DP_NO_SANDBOX = "1"
You can also add it with the Codex CLI:
codex mcp add drissionpage -- drissionpage-mcp
{
"mcpServers": {
"drissionpage": {
"command": "drissionpage-mcp"
}
}
}
{
"mcpServers": {
"drissionpage": {
"command": "drissionpage-mcp",
"args": ["--log-level", "DEBUG"],
"env": {
"CHROME_PATH": "/custom/path/to/chrome"
}
}
}
}
See examples/README.md for more configuration options.
# Environment diagnostics; add --launch-browser for a browser startup check
drissionpage-mcp doctor
drissionpage-mcp doctor --launch-browser
# Source checkout tests
python -m pip install -e ".[dev]"
python -m pytest tests/
# Coverage report (CI enforces the current 75% floor and uploads coverage.xml)
python -m pytest tests/ --cov=drissionpage_mcp --cov-report=term-missing --cov-report=xml
GitHub Actions runs lint, unit, protocol, package, browser integration, and
coverage jobs. Codecov is configured through codecov.yml and the CI workflow;
set the CODECOV_TOKEN repository secret so the upload step can publish
coverage.xml reliably from GitHub Actions.
# Interactive testing
python playground/local_test.py
# Quick start validation
python playground/quick_start.py
✅ 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
drissionpage-mcp --version
Should output the installed package version, for example drissionpage-mcp 0.4.1.
# Check browser installation
which google-chrome # Linux
which chromium # macOS
codex mcp list; in the TUI, run /mcpdrissionpage-mcp --log-level DEBUGSee docs/troubleshooting.md for the complete troubleshooting guide.
| Component | Status |
|---|---|
| Core Features | ✅ Complete |
| Testing | ✅ Unit/protocol checks, optional browser smoke |
| Documentation | ✅ Setup, compatibility, troubleshooting, release checklist |
| Package | ✅ PyPI metadata and build checks |
| Status | 🟡 Beta; real browser behavior depends on local Chrome/Chromium and target sites |
Version: 0.4.1 | License: Apache 2.0 | Maintained: ✅ Active
structuredContent, and typed per-tool MCP outputSchema[mcp_servers.drissionpage]
command = "drissionpage-mcp"
startup_timeout_sec = 20
tool_timeout_sec = 60
Verify with:
codex mcp list
{
"mcpServers": {
"drissionpage": {
"command": "drissionpage-mcp"
}
}
}
{
"mcpServers": {
"drissionpage": {
"command": "drissionpage-mcp"
}
}
}
See examples/ for more client configurations.
Contributions are welcome!
See CONTRIBUTING.md for setup, validation, and compatibility expectations.
Best Practices:
Licensed under Apache License 2.0 - see LICENSE
If you find this project useful, please consider:
Made with ❤️ by Wukunyun
Ready to automate your workflows? Install now: python -m pip install -U drissionpage-mcp
Released on 2026-06-26. This release focuses on MCP client reliability and the issues found during real Codex/LLM browser testing:
h1 and input[name=q] are now treated as CSS before calling DrissionPage.tag:h1, text:Submit, xpath://h1, and @name=value.serverInfo.version to report the drissionpage-mcp package version instead of the MCP SDK version.element_get_property input field from property_name to property with no compatibility alias.element_find default timeout to 3 seconds for faster failed-selector feedback.Please log in to share your review and rating for this MCP.
Explore related MCPs that share similar capabilities and solve comparable challenges
by modelcontextprotocol
A Model Context Protocol server for Git repository interaction and automation.
by zed-industries
A high‑performance, multiplayer code editor designed for speed and collaboration.
by modelcontextprotocol
Model Context Protocol Servers
by modelcontextprotocol
A Model Context Protocol server that provides time and timezone conversion capabilities.
by cline
An autonomous coding assistant that can create and edit files, execute terminal commands, and interact with a browser directly from your IDE, operating step‑by‑step with explicit user permission.
by upstash
Provides up-to-date, version‑specific library documentation and code examples directly inside LLM prompts, eliminating outdated information and hallucinated APIs.
by daytonaio
Provides a secure, elastic infrastructure that creates isolated sandboxes for running AI‑generated code with sub‑90 ms startup, unlimited persistence, and OCI/Docker compatibility.
by continuedev
Enables faster shipping of code by integrating continuous AI agents across IDEs, terminals, and CI pipelines, offering chat, edit, autocomplete, and customizable agent workflows.
by github
Connects AI tools directly to GitHub, enabling natural‑language interactions for repository browsing, issue and pull‑request management, CI/CD monitoring, code‑security analysis, and team collaboration.