PlayMCP Browser Automation Server
A comprehensive MCP (Model Context Protocol) server for browser automation using Playwright. This server provides 38 powerful tools for web scraping, testing, and automation.
Potencialize seu agente
Instalação do publicador. Não é um endpoint do PlugMCP.
Host a copy with our keys and logs.
Ainda não há uma versão empacotada no registro. Siga o README do repositório.
URL remota ou um comando na sua máquina? Como as duas instalações diferem
Rodar no PlugMCP
A new server you create. It is not this listing's official endpoint. Use the publisher install when you want their URL and their credentials.
AbrirDo publicador
A comprehensive MCP (Model Context Protocol) server for browser automation using Playwright. This server provides 38 powerful tools for web scraping, testing, and automation.
MCP server for browser automation with Playwright: navigate, click, type, extract content, run JavaScript and take screenshots from any AI assistant.
navigate, goForward, goBack (via scroll)click, type, hover, dragAndDrop, selectOptionmoveMouse, mouseMove, mouseClick, mouseDragpressKeywaitForText, waitForSelectorscreenshot, takeScreenshot (enhanced)getPageSource, getPageText, getPageTitle, getPageUrlgetElementContent, getElementHierarchygetScripts, getStylesheets, getMetaTagsgetLinks, getImagesgetFormsgetConsoleMessagesgetNetworkRequestsexecuteJavaScript, evaluateWithReturnuploadFileshandleDialogopenBrowser, closeBrowserresizescroll (enhanced with feedback)# Clone the repository
git clone https://github.com/jomon003/PlayMCP.git
cd PlayMCP
# Install dependencies
npm install
# Build the project
npm run build
# Test the server
npm test
// Start the server
node ./dist/server.js
// Send MCP commands via JSON-RPC
{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}
Prerequisites
Clone and Setup
git clone <repository-url>
cd PlayMCP
npm install
npm run build
Install Playwright Browsers
npx playwright install
This downloads the necessary browser binaries (Chromium, Firefox, Safari).
Verify Installation
npm run start
You should see "Browser Automation MCP Server starting..." if everything is working.
git clone <repository-url>
cd PlayMCP
npm install && npm run build && npx playwright install
Add to your MCP configuration file:
Standard MCP Configuration:
{
"servers": {
"playmcp-browser": {
"type": "stdio",
"command": "node",
"args": ["./dist/server.js"],
"cwd": "/path/to/PlayMCP",
"description": "Browser automation server using Playwright"
}
}
}
Alternative Configuration (works with VS Code GitHub Copilot):
{
"servers": {
"playmcp-browser": {
"type": "stdio",
"command": "node",
"args": ["/absolute/path/to/PlayMCP/dist/server.js"]
}
}
}
For Windows users:
{
"servers": {
"playmcp-browser": {
"type": "stdio",
"command": "node",
"args": ["C:\\path\\to\\PlayMCP\\dist\\server.js"]
}
}
}
This MCP server is fully compatible with VS Code GitHub Copilot. After adding the configuration above to your MCP settings, you can use all browser automation tools directly within VS Code.
Claude Desktop (config.json location):
%APPDATA%\Claude\config.json~/Library/Application Support/Claude/config.json~/.config/Claude/config.jsonVS Code MCP Extension: Add to your VS Code settings.json or MCP configuration file.
Example Full Configuration:
{
"mcpServers": {
"playmcp-browser": {
"type": "stdio",
"command": "node",
"args": ["/Users/username/PlayMCP/dist/server.js"],
"description": "Browser automation with Playwright"
}
}
}
Basic Web Scraping:
// Open browser and navigate
await openBrowser({ headless: false, debug: true })
await navigate({ url: "https://example.com" })
// Extract content
const title = await getPageTitle()
const links = await getLinks()
const forms = await getForms()
Form Automation:
// Fill out a form
await click({ selector: "#login-button" })
await type({ selector: "#username", text: "[email protected]" })
await type({ selector: "#password", text: "password123" })
await click({ selector: "#submit" })
Page Interaction:
// Enhanced scrolling with feedback
await scroll({ x: 0, y: 500, smooth: false })
// Returns: { before: {x: 0, y: 0}, after: {x: 0, y: 500}, scrolled: {x: 0, y: 500} }
// Smooth scrolling
await scroll({ x: 0, y: 300, smooth: true })
// Mouse interaction
await moveMouse({ x: 100, y: 200 })
await click({ selector: ".dropdown-menu" })
DOM Structure Analysis:
// Get page hierarchy (3 levels deep)
await getElementHierarchy({ maxDepth: 3 })
// Get detailed hierarchy with text and attributes
await getElementHierarchy({
selector: "#main-content",
maxDepth: -1,
includeText: true,
includeAttributes: true
})
// Get basic structure of a specific section
await getElementHierarchy({ selector: ".sidebar", maxDepth: 2 })
Advanced JavaScript Execution:
// Run custom JavaScript
await executeJavaScript({
script: "document.querySelectorAll('h1').length"
})
// Modify page content
await executeJavaScript({
script: "document.body.style.backgroundColor = 'lightblue'"
})
// Extract complex data
await executeJavaScript({
script: `
Array.from(document.querySelectorAll('article')).map(article => ({
title: article.querySelector('h2')?.textContent,
summary: article.querySelector('p')?.textContent
}))
`
})
Screenshot and Documentation:
// Take screenshots
await screenshot({ path: "./full-page.png", type: "page" })
await screenshot({ path: "./element.png", type: "element", selector: "#main-content" })
Install and setup:
git clone <repo-url> && cd PlayMCP
npm install && npm run build && npx playwright install
Add to your MCP client configuration
Start automating:
await openBrowser({ debug: true })
await navigate({ url: "https://news.ycombinator.com" })
const links = await getLinks()
console.log(`Found ${links.length} links`)
// Analyze page structure
const hierarchy = await getElementHierarchy({ maxDepth: 2 })
console.log('Page structure:', hierarchy)
npx playwright install"Browser not initialized" error
openBrowser before other browser operationsPlaywright installation fails
# Try manual browser installation
npx playwright install chromium
# Or install all browsers
npx playwright install
Permission errors on Linux/macOS
# Make sure the script is executable
chmod +x dist/server.js
Path issues in MCP configuration
C:\\path\\to\\PlayMCP\\dist\\server.jsnode /path/to/PlayMCP/dist/server.jsBrowser crashes or timeouts
headless: false for debugging# Test the server directly
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' | node ./dist/server.js
You should see a JSON response listing all available tools.
MIT License
MCP server for browser automation with Playwright: navigate, click, type, extract content, run JavaScript and take screenshots from any AI assistant.
Ferramentas
Ainda não há lista de ferramentas. Servidores remotos recebem uma após a primeira verificação de saúde.
Perguntas frequentes
Copie nesta página a configuração stdio para Cursor, Claude Desktop, Claude Code ou VS Code. Ela usa a instalação do publicador, não um proxy do PlugMCP.
Este registro não lista nenhuma variável de ambiente obrigatória.
PlayMCP roda localmente via stdio.
Última verificação: 2026-11-12. MCP server for browser automation with Playwright: navigate, click, type, extract content, run JavaScript and take screenshots from any AI assistant.