A Python implementation of the Playwright MCP server.
- 🌐 Navigation: Navigate to URLs, go back/forward
- 🖱️ Interactions: Click, type, fill forms, select options
- 📸 Capture: Take screenshots, extract text/HTML content
- 🔧 Utilities: Wait for elements, scroll, execute JavaScript
- 📑 Tab Management: Open/close/switch between tabs
- 🖥️ Multi-browser: Support for Chromium, Firefox, and WebKit
git clone https://github.com/camillebrl/playwright_mcp_python.git
make install
make testIf all tests passed, you can now use this MCP server.
Add to your MCP client configuration:
{
"mcpServers": {
"playwright-python": {
"command": "playwright-mcp-python",
"args": ["--headless"]
}
}
}Or find root for playwright-mcp-python:
which playwright-mcp-pythonAnd add this root as command directly:
{
"mcpServers": {
"playwright-python": {
"command": "/home/camil/.cache/pypoetry/virtualenvs/playwright-mcp-q9z6m5j4-py3.10/bin/playwright-mcp",
"args": ["--headless"]
}
}
}
{
"mcpServers": {
"playwright-python": {
"command": "uvx",
"args": [
"--python=3.10",
"--from=git+https://github.com/camillebrl/playwright_mcp_python.git",
"playwright_mcp",
"--headless"
]
}
}
}
--browser: Choose browser (chromium, firefox, webkit)--headless: Run in headless mode--viewport-width: Set viewport width (default: 1280)--viewport-height: Set viewport height (default: 720)--timeout: Set default timeout in ms (default: 30000)
browser_navigate: Navigate to a URLbrowser_navigate_back: Go backbrowser_navigate_forward: Go forward
browser_click: Click on elementsbrowser_type: Type text into fieldsbrowser_fill: Fill input fieldsbrowser_select_option: Select from dropdowns
browser_screenshot: Take screenshotsbrowser_get_text: Extract text contentbrowser_get_html: Get HTML contentbrowser_console_messages: Get console logs
browser_wait: Wait for time/elements/textbrowser_reload: Reload pagebrowser_scroll: Scroll pagebrowser_evaluate: Execute JavaScriptbrowser_tab_*: Tab management
MIT License