Playwright Plus Python MCP is a powerful browser automation server that integrates with the Model Context Protocol. It enables AI assistants to interact with web browsers through a comprehensive set of tools for navigation, element interaction, and content extraction. With capabilities like taking screenshots, clicking elements, filling forms, and executing JavaScript, this MCP server empowers AI systems to perform complex web-based tasks.
Playwright Plus Python MCP provides a set of browser automation tools that allow AI assistants to interact with web pages. This MCP server leverages the Playwright library to enable capabilities like navigating to URLs, taking screenshots, clicking elements, filling forms, and executing JavaScript code.
uv install playwright-plus-python-mcp
After installation, you'll need to install the Playwright browsers:
playwright install
Configure the MCP server in your Claude Desktop configuration file:
On MacOS:
Edit ~/Library/Application\ Support/Claude/claude_desktop_config.json
On Windows:
Edit %APPDATA%/Claude/claude_desktop_config.json
Add the following configuration:
"mcpServers": {
"playwright-server": {
"command": "uvx",
"args": [
"playwright-server"
]
}
}
For development/unpublished servers, use:
"mcpServers": {
"playwright-server": {
"command": "uv",
"args": [
"--directory",
"PATH_TO_YOUR_PROJECT_DIRECTORY",
"run",
"playwright-server"
]
}
}
Navigates to a specified URL. Creates a new session if none exists.
Parameters:
url
(string, required): The URL to navigate toExample:
playwright_navigate(url="https://example.com")
Takes a screenshot of the current page or a specific element.
Parameters:
name
(string, required): Filename for the screenshotselector
(string, optional): CSS selector for a specific element. If omitted, takes a full-page screenshotExample:
playwright_screenshot(name="homepage", selector=".main-content")
Clicks an element on the page using a CSS selector.
Parameters:
selector
(string, required): CSS selector for the element to clickExample:
playwright_click(selector="#submit-button")
Fills out an input field with specified text.
Parameters:
selector
(string, required): CSS selector for the input fieldvalue
(string, required): Text to enter into the fieldExample:
playwright_fill(selector="#search-input", value="search query")
Executes JavaScript code in the browser console.
Parameters:
script
(string, required): JavaScript code to executeExample:
playwright_evaluate(script="document.querySelector('.menu').style.display = 'block';")
Clicks an element on the page by its text content.
Parameters:
text
(string, required): Text content of the element to clickExample:
playwright_click_text(text="Submit")
Gets the text content of all visible elements.
Example:
playwright_get_text_content()
Gets the HTML content of a specific element.
Parameters:
selector
(string, required): CSS selector for the elementExample:
playwright_get_html_content(selector="main")
The server also implements a simple note storage system with:
The server provides a summarize-notes prompt that creates summaries of all stored notes:
For debugging the MCP server, it's recommended to use the MCP Inspector:
npx @modelcontextprotocol/inspector uv --directory PATH_TO_YOUR_PROJECT_DIRECTORY run playwright-server
The Inspector will display a URL that you can access in your browser to begin debugging.