================== /// MCP /// /// PLA /// ================== [server:online] [protocol:ready]
playwright-plus-python-mcp
by blackwhite084
MCP server that exposes a set of Playwright-based browser-automation tools (navigate, click, fill, screenshot, evaluate, etc.) and a simple note:// storage resource, plus a summarisation prompt.
137
20
Open Source01
playwright_navigate
Navigate the browser to a specified URL, creating a new session if none is active
02
playwright_screenshot
Capture a screenshot of the full page or a specific element
03
playwright_click
Click an element identified by a CSS selector
04
playwright_fill
Fill an input field identified by a CSS selector with a given value
05
playwright_evaluate
Execute JavaScript code in the page context
06
playwright_click_text
Click an element on the page by matching its text content
07
playwright_get_text_content
Retrieve the text content of all visible elements on the page
08
playwright_get_html_content
Retrieve the HTML content of an element specified by a CSS selector
Installation
1. Clone the repository
git clone https://github.com/blackwhite084/playwright-plus-python-mcp.git
cd playwright-plus-python-mcp
2. Create and activate a virtual environment (recommended)
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
3. Install Python package requirements
pip install -r requirements.txt
(If requirements.txt is not committed yet, install the key libs manually)
pip install playwright fastapi uvicorn pydantic
4. Install Playwright browsers
playwright install --with-deps # Linux users may need sudo
5. (Optional) Configure environment variables for MCP
Environment | Purpose
----------------------------- | -------------------------------------
MCP_PORT | TCP port to expose (default 8000)
MCP_AUTH_TOKEN | Token required by clients
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD | set to 1 in CI if browsers are pre-installed
6. Run the server in development mode
uvicorn server:app --host 0.0.0.0 --port ${MCP_PORT:-8000}
7. Verify
Open http://localhost:8000/docs to see the auto-generated OpenAPI docs and run a sample `navigate` call.
Docker (optional)
-----------------
docker build -t playwright-mcp .
docker run -p 8000:8000 -e MCP_AUTH_TOKEN=changeme playwright-mcp
Documentation
License: Apache License 2.0
Updated 7/30/2025