playwright-toolkit-connector
A specialized MCP service enabling sophisticated web interaction via Playwright, featuring integrated persistent knowledge storage with flexible summarization capabilities.
Author

blackwhite084
Quick Info
Actions
Tags
Playwright Automation & Knowledge Server
\A Bridge for automated web control leveraging Playwright\
Operational Components
Data Repository
This server maintains a rudimentary persistent data mechanism for notes:
- Utilizes a custom note:// Uniform Resource Identifier scheme for individual data item retrieval.
- Each stored note entity comprises a unique identifier, a descriptive summary, and content transmitted with a text/plain MIME type.
Interaction Routines (Prompts)
The service exposes one primary processing endpoint:
- summarize-notes: Triggers the aggregation and condensation of all presently stored knowledge entries.
- Accepts an optional style parameter to modulate the output verbosity (e.g., 'brief' or 'detailed').
- Dynamically constructs a comprehensive prompt that incorporates all notes alongside the specified level of detail.
Utility Functions (Tools)
The server exposes the following granular automation capabilities:
- playwright_navigate: Directs the underlying browser instance to a specified Uniform Resource Locator (URL). A new browsing context is automatically initiated if none is currently active.
- Mandatory parameter: url (string).
- playwright_screenshot: Captures the visual state of the current viewport or a targeted element.
- Mandatory parameter: name (string) for the output file designation.
- Optional parameter: selector (string) identifying a specific Document Object Model (DOM) element via CSS query. Omitting this results in a full-page capture.
- playwright_click: Simulates a user mouse click event upon an element identified by its CSS selector.
- Mandatory parameter: selector (string).
- playwright_fill: Inputs specified data into a designated interactive form field.
- Mandatory parameter: selector (string) locating the input element.
- Mandatory parameter: value (string) representing the data payload to insert.
- playwright_evaluate: Executes arbitrary JavaScript code within the isolated browser execution environment.
- Mandatory parameter: script (string) containing the JavaScript payload.
- playwright_click_text: Locates and interacts (clicks) with an element based on its visible textual content.
- Mandatory parameter: text (string) matching the target element's label.
- playwright_get_text_content: Retrieves the textual data from all currently rendered, visible elements on the page.
- playwright_get_html_content: Fetches the complete HyperText Markup Language structure.
- Optional parameter: selector (string) to retrieve the inner HTML of a specific node rather than the entire document body.
System Configuration
[TODO: Placeholder for environment-specific setup parameters]
Initial Deployment Guide
Installation Procedure
End-User Desktop Integration (Claude)
For macOS environments: ~/Library/Application\ Support/Claude/claude_desktop_config.json
For Windows environments: %APPDATA%/Claude/claude_desktop_config.json
Configuration for Local/Unreleased Instances
"mcpServers": { "playwright-server": { "command": "uv", "args": [ "--directory", "C:\\Users\\xxxxx\\Documents\\project\\python\\mcp\\playwright-server", "run", "playwright-server" ] } }Configuration for Officially Distributed Instances
"mcpServers": { "playwright-server": { "command": "uvx", "args": [ "playwright-server" ] } }Development Workflow
Artifact Generation and Distribution
Steps required to package and deploy the service:
-
Synchronize project dependencies and update the dependency lock file: bash uv sync
-
Compile the distribution artifacts (Source and Wheel formats): bash uv build
-
Push packages to the Python Package Index (PyPI): bash uv publish
Note: Authentication credentials for PyPI must be provided, either via command-line flags (--token, --username/--password) or environment variables (e.g., UV_PUBLISH_TOKEN).
Troubleshooting and Inspection
Debugging interactions over standard input/output (stdio) can be complex. We highly recommend utilizing the official MCP Inspector utility for a superior debugging experience.
You may initialize the Inspector via Node Package Manager (npm):
bash npx @modelcontextprotocol/inspector uv --directory C:\Users\YUNYING\Documents\project\python\mcp\playwright-server run playwright-server
Once active, the Inspector will output a local URL. Accessing this URL in a standard web browser initiates the debugging session.
