Better Playwright MCP Server
A comprehensive Model Context Protocol (MCP) server that provides browser automation capabilities using Playwright. This server enables AI assistants to interact with web pages through actions like navigation, element interaction, form filling, and page analysis.
Features
- Browser lifecycle management with Chrome DevTools Protocol (CDP) connection support
- Element interaction - click, type, extract text/links from web elements
- Navigation and history management - go to URLs, back/forward, refresh
- Form input handling with multiple selector types (ID, class, text, placeholder, label)
- Page snapshots - accessibility tree analysis and visual screenshots
- Automatic browser cleanup and comprehensive error handling
Installation
Install the package using uv:
uv tool install mudae
Usage
Run the MCP server:
uvx mudae
The server will start and be available for MCP client connections.
Browser Connection
By default, the server attempts to connect to an existing browser instance via Chrome DevTools Protocol (CDP). You can control this behavior with the LOCAL_CDP_URL environment variable:
# Connect to browser running on custom port
LOCAL_CDP_URL=http://localhost:9223 uvx mudae
# Connect to default CDP endpoint (localhost:9222)
uvx mudae
If no existing browser is found at the CDP URL, the server will automatically launch a new browser instance at localhost:9222 by default
Starting a Browser with CDP
To start Chrome/Chromium with CDP enabled for persistent browser sessions:
# Chrome
google-chrome --remote-debugging-port=9222 --user-data-dir=/tmp/chrome-debug
# Chromium
chromium --remote-debugging-port=9222 --user-data-dir=/tmp/chrome-debug
Available Tools
The MCP server provides these tools for browser automation:
Navigation
- navigate - Go to URLs, navigate browser history (back/forward), refresh pages
Element Interaction
- getElement - Find and interact with page elements (click, get text, extract links, type text)
- fillInput - Fill form input fields with proper event handling
Page Analysis
- getSnapshot - Capture page state as accessibility trees or visual screenshots
- exploreByRole - Explore page sections by ARIA landmark roles
When to Use
This MCP server is ideal when you need an AI assistant to:
- Automate web workflows - Fill forms, click buttons, navigate between pages
- Extract web content - Get text, links, and structured data from websites
- Test web applications - Verify page content and functionality
- Analyze page accessibility - Understand page structure and interactive elements
- Take visual snapshots - Capture screenshots for documentation or verification
The server is particularly useful for tasks requiring persistent browser sessions, complex web interactions, or detailed page analysis that goes beyond simple HTTP requests.
Environment Variables
LOCAL_CDP_URL- Chrome DevTools Protocol endpoint (default:http://localhost:9222)
Requirements
- Python 3.8+
- Playwright (automatically installed with dependencies)
The server handles Playwright browser installation automatically on first run.
Release files for mudae 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mudae-0.1.2.tar.gz | 7.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mudae-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.9 kB
Release files / mudae-0.1.2.tar.gz
| Download URL | mudae-0.1.2.tar.gz |
|---|---|
| Size | 7.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4e3586d41d437874c1352a4ed6c567d22c4d31449b2d4d079c8386f6ceb47fe4
|
|
BLAKE2b-256 checksum How to use checksums |
c0c1d48067a30ccb69a8a57370d154596086429f9625cdb177c98c96da4c22d5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 1, 2025.
Transparency logRelease files / mudae-0.1.2-py3-none-any.whl
| Download URL | mudae-0.1.2-py3-none-any.whl |
|---|---|
| Size | 8.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
81ec2d778929030b94659dd6b719e5bca0a3205d75e6d4724ac029092acffb86
|
|
BLAKE2b-256 checksum How to use checksums |
25b951ecd553c0a96f9c7e8996a7b16ed0f7e8b07931597423f6369ab175471b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 1, 2025.
Transparency log