A Model Context Protocol (MCP) server that provides browser automation capabilities through Playwright.
x-api-key header with your API key.
Add to your .mcp.json file:
{
"mcpServers": {
"playwright": {
"type": "http",
"url": "https://playwright.mcp.majewscy.tech/",
"headers": {
"x-api-key": "YOUR_API_KEY"
}
}
}
}
{
"mcpServers": {
"playwright": {
"type": "http",
"url": "https://playwright.mcp.majewscy.tech/"
}
}
}
With OAuth-style, the server will use dynamic client registration.
Navigate to a URL in the browser
Parameters:url (string, required) - The URL to navigate towaitUntil (string, optional) - When to consider navigation succeeded. Options: "load", "domcontentloaded", "networkidle"{
"url": "https://example.com",
"waitUntil": "networkidle"
}
Click on an element
Parameters:selector (string, required) - CSS selector or text selector for the elementbutton (string, optional) - Mouse button to use: "left", "right", "middle"clickCount (number, optional) - Number of clicks{
"selector": "button[type='submit']",
"button": "left",
"clickCount": 1
}
Type text into an input field
Parameters:selector (string, required) - CSS selector for the input elementtext (string, required) - Text to typedelay (number, optional) - Delay between key presses in milliseconds{
"selector": "input[name='username']",
"text": "john.doe@example.com",
"delay": 50
}
Take a screenshot of the current page
Parameters:fullPage (boolean, optional) - Capture full scrollable pageselector (string, optional) - Capture specific element{
"fullPage": true
}
Extract text content from elements
Parameters:selector (string, required) - CSS selector for elements{
"selector": "h1, .content p"
}
Wait for an element to appear
Parameters:selector (string, required) - CSS selector to wait forstate (string, optional) - State to wait for: "attached", "detached", "visible", "hidden"timeout (number, optional) - Maximum time to wait in milliseconds{
"selector": ".loading-complete",
"state": "visible",
"timeout": 30000
}
Execute JavaScript in the page context
Parameters:expression (string, required) - JavaScript expression to evaluate{
"expression": "document.title"
}
Create a new browser page/tab
Parameters:url (string, optional) - Initial URL to navigate to{
"url": "https://example.com"
}
Close the current page
Parameters: NoneTest with curl:
curl -X POST https://playwright.mcp.majewscy.tech/ \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"jsonrpc": "2.0",
"method": "list_tools",
"params": {},
"id": 1
}'