SuperAPIAI Directory

playwright-plus-python-mcp

github.com · AI agents

Browser automation using Playwright, tailored for LLMs.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)
PlatformsmacOS

About this tool

Purpose

playwright-plus-python-mcp is an MCP (Model Context Protocol) server that wraps Playwright's browser automation capabilities into a toolset that can be called by LLMs. Its goal is to enable large language models to directly control the browser and complete web interaction tasks such as navigation, screenshots, clicks, form filling, and script execution.

Main Capabilities

The server implements the following tools:

  • playwright_navigate: Navigate to a specified URL. If there is currently no active session, a new session will be created automatically. Requires the url parameter (string).
  • playwright_screenshot: Take a screenshot of the current page or a specific element. Requires the name parameter (string) as the screenshot file name; the optional selector parameter (string) specifies the CSS selector of the element to screenshot. If not provided, the entire page is captured.
  • playwright_click: Click a page element using a CSS selector. Requires the selector parameter (string).
  • playwright_fill: Fill in an input field. Requires the selector parameter (string) to specify the CSS selector of the input field, and the value parameter (string) to specify the value to fill in.
  • playwright_evaluate: Execute JavaScript code in the browser console. Requires the script parameter (string).
  • playwright_click_text: Click a page element by text content. Requires the text parameter (string).
  • playwright_get_text_content: Get the text content of all visible elements.
  • playwright_get_html_content: Get the HTML content of the page. Requires the selector parameter (string) to specify the CSS selector of the element.

In addition, the server also implements a simple note storage system:

  • A custom note:// URI scheme for accessing a single note; each note resource contains a name, description, and text/plain MIME type.
  • Provides a prompt summarize-notes: creates a summary for all stored notes, with an optional style parameter controlling the level of detail (brief/detailed), generating a prompt that combines all currentnotes with the style preference.

Usage

The project is implemented in Python and can be distributed via PyPI. The build and release process includes: syncing dependencies and updating the lock file, building the package distribution (generating a source package and wheel package in the dist/ directory), and publishing to PyPI (PyPI credentials need to be set via environment variables or command-line flags, such as using --token or UV_PUBLISH_TOKEN for the token, and --username / UV_PUBLISH_USERNAME and --password / UV_PUBLISH_PASSWORD for the username/password).

Regarding configuration, the materials provide the path to the Claude desktop configuration file: on macOS it is ~/Library/Application Support/Claude/claude_desktop_config.json, and on Windows it is %APPDATA%/Claude/claude_desktop_config.json. The materials mark a TODO: add implementation-specific configuration details, so a complete configuration example is not yet provided.

Because the MCP server runs over stdio, debugging can be difficult. The materials recommend using MCP Inspector for the best debugging experience, which can be started via an npm command. After startup, Inspector displays a URL that can be accessed in a browser to begin debugging.

Applicable Scenarios

Suitable for scenarios that require an LLM or AI agent to directly control the browser to complete web tasks, such as automatically navigating web pages, capturing screenshots of pages or elements, clicking buttons or links, filling out forms, executing in-page JavaScript, locating and clicking elements by text, and extracting visible text or HTML content from a page.

Limitations

The materials do not provide specific installation commands, dependency versions, runtime environment requirements, supported browser types, performance or effectiveness descriptions, nor a complete configuration example (marked as TODO). The specific purpose and integration method of the note storage system and the summarize-notes prompt are not further explained in the materials.

Up/Down to navigate · Enter to open · ESC to closeBrowse all tools