Playwright wrapper for MCP that enables LLM-powered clients to control a browser for automation tasks.
Playwright wrapper for MCP (Model Context Protocol). This server enables LLM-powered clients to control a browser for automation tasks.
The server exposes resources for accessing browser screenshots:
screenshot://{page_id}
The server provides a prompt to help clients interpret web pages:
interpret-page
: Analyzes the current web page content and structure
page_id
argument to select which page to interpretfocus
argument to focus on specific aspects (full, forms, navigation, text)The server implements a comprehensive set of browser automation tools:
Browser navigation
navigate
: Go to a specific URLnew_page
: Create a new browser page with a specific IDswitch_page
: Switch to a different browser pageget_pages
: List all available browser pagesPage interaction
click
: Click on an element using CSS selectortype
: Type text into an input elementwait_for_selector
: Wait for an element to appear on the pageContent extraction
get_text
: Get text content from an elementget_page_content
: Get the entire page HTMLtake_screenshot
: Capture visual state of the page or elementuv add playwright playwright install chromium
On MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json
On Windows: %APPDATA%/Claude/claude_desktop_config.json
Development/Unpublished Servers Configuration
"mcpServers": { "playwright-mcp": { "command": "uv", "args": [ "--directory", "/Users/shannon/Workspace/artivus/playwright-mcp", "run", "playwright-mcp" ] } }
Published Servers Configuration
"mcpServers": { "playwright-mcp": { "command": "uvx", "args": [ "playwright-mcp" ] } }
To prepare the package for distribution:
uv sync
uv build
This will create source and wheel distributions in the dist/
directory.
uv publish
Note: You'll need to set PyPI credentials via environment variables or command flags:
--token
or UV_PUBLISH_TOKEN
--username
/UV_PUBLISH_USERNAME
and --password
/UV_PUBLISH_PASSWORD
Since MCP servers run over stdio, debugging can be challenging. For the best debugging experience, we strongly recommend using the MCP Inspector.
You can launch the MCP Inspector via npm
with this command:
npx @modelcontextprotocol/inspector uv --directory /Users/shannon/Workspace/artivus/playwright-mcp run playwright-mcp
Upon launching, the Inspector will display a URL that you can access in your browser to begin debugging.
Discover shared experiences
Shared threads will appear here, showcasing real-world applications and insights from the community. Check back soon for updates!