Labsco
jomon003 logo

PlayMCP Browser Automation Server

β˜… 15

from jomon003

A server for browser automation using Playwright, providing powerful tools for web scraping, testing, and automation.

πŸ”₯πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedFreeAdvanced setup

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.

<a href="https://glama.ai/mcp/servers/@jomon003/PlayMCP"> <img width="380" height="200" src="https://glama.ai/mcp/servers/@jomon003/PlayMCP/badge" alt="PlayBrowser Automation Server MCP server" /> </a>

Features

πŸš€ Core Browser Automation (21 tools)

  • Navigation: navigate, goForward, goBack (via scroll)
  • Interaction: click, type, hover, dragAndDrop, selectOption
  • Mouse Control: moveMouse, mouseMove, mouseClick, mouseDrag
  • Keyboard: pressKey
  • Waiting: waitForText, waitForSelector
  • Screenshots: screenshot, takeScreenshot (enhanced)
  • Page Info: getPageSource, getPageText, getPageTitle, getPageUrl
  • Element Analysis: getElementContent, getElementHierarchy
  • Scripts & Styles: getScripts, getStylesheets, getMetaTags

πŸ” Advanced Data Extraction (7 tools)

  • Links & Images: getLinks, getImages
  • Forms: getForms
  • Console Monitoring: getConsoleMessages
  • Network Monitoring: getNetworkRequests
  • JavaScript Execution: executeJavaScript, evaluateWithReturn

πŸ“ File Operations (2 tools)

  • File Upload: uploadFiles
  • Dialog Handling: handleDialog

βš™οΈ Browser Management (8 tools)

  • Browser Control: openBrowser, closeBrowser
  • Viewport Management: resize
  • Page Manipulation: scroll (enhanced with feedback)
  • Element Hierarchy: Deep DOM analysis with configurable depth
  • Enhanced Screenshots: Full page, element-specific, custom paths
  • Mouse Coordinates: Pixel-perfect mouse control
  • Wait Conditions: Smart waiting for elements and text

Tool Categories

🎯 Navigation & Interaction

  • navigate: Go to any URL
  • goForward: Navigate forward in browser history
  • click: Click elements with smart selector resolution
  • type: Type text with realistic keyboard simulation
  • hover: Hover over elements for tooltips and interactions
  • dragAndDrop: Drag elements between locations
  • selectOption: Choose options from dropdowns and multi-selects
  • pressKey: Send specific keyboard keys (Enter, Escape, etc.)

⏱️ Smart Waiting

  • waitForText: Wait for specific text to appear
  • waitForSelector: Wait for elements to load
  • Built-in timeouts and error handling

πŸ–±οΈ Precise Mouse Control

  • mouseMove: Move to exact coordinates
  • mouseClick: Click at specific pixels
  • mouseDrag: Drag between coordinate points
  • moveMouse: Enhanced mouse positioning

πŸ“Š Data Extraction

  • getElementHierarchy: Deep DOM structure analysis
  • getConsoleMessages: Monitor browser console output
  • getNetworkRequests: Track HTTP requests and responses
  • getLinks: Extract all page links with metadata
  • getImages: Get all images with attributes
  • getForms: Analyze form structures and fields

🎬 Visual & Media

  • screenshot: Basic screenshot capture
  • takeScreenshot: Advanced screenshots (full page, elements, custom paths)
  • resize: Control viewport dimensions

πŸ“ File & Dialog Operations

  • uploadFiles: Handle file input uploads
  • handleDialog: Manage alerts, confirms, and prompts

βš™οΈ JavaScript Execution

  • executeJavaScript: Run JavaScript code
  • evaluateWithReturn: Execute JS with return values

Core Browser Controls

  • openBrowser - Launch a new browser instance with optional headless mode
  • navigate - Navigate to any URL
  • click - Click elements using CSS selectors
  • type - Type text into input fields
  • moveMouse - Move mouse to specific coordinates
  • scroll - Scroll the page by specified amounts with enhanced feedback and smooth scrolling support
  • screenshot - Take screenshots of the page, viewport, or specific elements
  • closeBrowser - Close the browser instance

Page Content Extraction

  • getPageSource - Get the complete HTML source code
  • getPageText - Get the text content (stripped of HTML)
  • getPageTitle - Get the page title
  • getPageUrl - Get the current URL
  • getScripts - Extract all JavaScript code from the page
  • getStylesheets - Extract all CSS stylesheets
  • getMetaTags - Get all meta tags with their attributes
  • getLinks - Get all links with href, text, and title
  • getImages - Get all images with src, alt, and dimensions
  • getForms - Get all forms with their fields and attributes
  • getElementContent - Get HTML and text content of specific elements
  • getElementHierarchy - Get the hierarchical DOM structure with parent-child relationships

Advanced Capabilities

  • executeJavaScript - Execute arbitrary JavaScript code on the page and return results

Available Tools Reference

ToolDescriptionRequired Parameters
openBrowserLaunch browser instanceheadless?: boolean, debug?: boolean
navigateNavigate to URLurl: string
clickClick elementselector: string
typeType text into elementselector: string, text: string
moveMouseMove mouse to coordinatesx: number, y: number
scrollScroll page with feedbackx: number, y: number, smooth?: boolean
screenshotTake screenshotpath: string, type?: string, selector?: string
getPageSourceGet HTML sourceNone
getPageTextGet text contentNone
getPageTitleGet page titleNone
getPageUrlGet current URLNone
getScriptsGet JavaScript codeNone
getStylesheetsGet CSS stylesheetsNone
getMetaTagsGet meta tagsNone
getLinksGet all linksNone
getImagesGet all imagesNone
getFormsGet all formsNone
getElementContentGet element contentselector: string
getElementHierarchyGet DOM hierarchyselector?: string, maxDepth?: number, includeText?: boolean, includeAttributes?: boolean
executeJavaScriptRun JavaScriptscript: string
closeBrowserClose browserNone

Development

  • src/server.ts - Main MCP server implementation
  • src/controllers/playwright.ts - Playwright browser controller
  • src/mcp/ - MCP protocol implementation
  • src/types/ - TypeScript type definitions

License

MIT License