Enables browser automation with CSS selector-based element targeting for web scraping, form automation, and page interaction workflows.
Provides multi-browser support including Firefox for web automation tasks through Playwright's browser automation capabilities.
Enables web automation interactions with GitHub through browser navigation, form filling, and page interaction capabilities.
Allows execution of custom JavaScript code within browser contexts for advanced web automation and data extraction tasks.
Supports taking screenshots in JPEG format for visual page capture and documentation of web automation workflows.
Provides multi-browser support including Safari for web automation tasks through Playwright's browser automation capabilities.
MCP Macaco Playwright
Enhanced Playwright Tools for Model Context Protocol (MCP) with Chrome DevTools Protocol (CDP) Support
Overview
MCP Macaco Playwright is a comprehensive browser automation server that provides AI agents with powerful web interaction capabilities through the Model Context Protocol. It combines Playwright's robust browser automation with CDP integration for advanced debugging and control scenarios.
Features
Complete Browser Automation: Navigate, interact, and extract data from web pages
Chrome DevTools Protocol (CDP) Support: Connect to existing browser instances
AI-Optimized: Designed specifically for AI agents and automated workflows
Comprehensive Tool Set: 50+ specialized functions for web automation
Multi-Browser Support: Chrome, Firefox, Safari, and Edge
Screenshot & Snapshot Capabilities: Visual and accessibility-based page capture
Form Automation: Complete form filling and submission workflows
Network Monitoring: Track requests, responses, and console messages
Installation
Quick Start
Function Reference
Navigation Functions
browser_navigate
Navigate to a specific URL.
Parameters:
url
(string, required): The URL to navigate to
Example:
browser_navigate_back
Go back to the previous page in browser history.
Parameters: None
Example:
browser_navigate_forward
Go forward to the next page in browser history.
Parameters: None
Example:
Page Analysis Functions
browser_snapshot
Capture an accessibility snapshot of the current page for analysis and interaction.
Parameters: None
Example:
browser_take_screenshot
Take a visual screenshot of the page or specific element.
Parameters:
type
(string, optional): Image format ('png' or 'jpeg', default: 'png')filename
(string, optional): Custom filename for the screenshotelement
(string, optional): Human-readable element descriptionref
(string, optional): Element reference from snapshotfullPage
(boolean, optional): Capture full scrollable page
Example:
Element Interaction Functions
browser_click
Click on a specific element on the page.
Parameters:
element
(string, required): Human-readable element descriptionref
(string, required): Element reference from page snapshot
Example:
browser_double_click
Perform a double-click on an element.
Parameters:
element
(string, required): Human-readable element descriptionref
(string, required): Element reference from page snapshot
Example:
browser_right_click
Perform a right-click to open context menu.
Parameters:
element
(string, required): Human-readable element descriptionref
(string, required): Element reference from page snapshot
Example:
Text Input Functions
browser_type
Type text into an editable element.
Parameters:
element
(string, required): Human-readable element descriptionref
(string, required): Element reference from page snapshottext
(string, required): Text to typesubmit
(boolean, optional): Press Enter after typingslowly
(boolean, optional): Type character by character
Example:
browser_press_key
Press a specific key on the keyboard.
Parameters:
key
(string, required): Key name (e.g., 'Enter', 'ArrowLeft', 'a')
Example:
Form Functions
browser_select_option
Select options in a dropdown menu.
Parameters:
element
(string, required): Human-readable element descriptionref
(string, required): Element reference from page snapshotvalues
(array, required): Array of values to select
Example:
browser_check_checkbox
Check or uncheck a checkbox element.
Parameters:
element
(string, required): Human-readable element descriptionref
(string, required): Element reference from page snapshotchecked
(boolean, required): Whether to check (true) or uncheck (false)
Example:
browser_select_radio
Select a radio button.
Parameters:
element
(string, required): Human-readable element descriptionref
(string, required): Element reference from page snapshot
Example:
browser_clear_input
Clear the content of an input field.
Parameters:
element
(string, required): Human-readable element descriptionref
(string, required): Element reference from page snapshot
Example:
Data Extraction Functions
browser_get_text
Extract text content or attribute values from elements.
Parameters:
element
(string, required): Human-readable element descriptionref
(string, required): Element reference from page snapshotattribute
(string, optional): Specific attribute to extract (e.g., 'href', 'src')
Example:
browser_get_elements
Get multiple elements matching a selector.
Parameters:
selector
(string, required): CSS selector to find elementsattribute
(string, optional): Attribute to extract from each element
Example:
Scrolling and Focus Functions
browser_scroll_to
Scroll to a specific element or coordinate position.
Parameters:
element
(string, optional): Human-readable element descriptionref
(string, optional): Element reference from page snapshotx
(number, optional): X coordinate to scroll toy
(number, optional): Y coordinate to scroll tobehavior
(string, optional): Scroll behavior ('auto' or 'smooth')
Example:
browser_get_scroll_position
Get the current scroll position of the page.
Parameters: None
Example:
browser_focus_element
Set focus on a specific element.
Parameters:
element
(string, required): Human-readable element descriptionref
(string, required): Element reference from page snapshot
Example:
browser_blur_element
Remove focus from a specific element.
Parameters:
element
(string, required): Human-readable element descriptionref
(string, required): Element reference from page snapshot
Example:
Wait Functions
browser_wait_for
Wait for specific conditions to be met.
Parameters:
time
(number, optional): Time to wait in secondstext
(string, optional): Text to wait for to appeartextGone
(string, optional): Text to wait for to disappear
Example:
Tab Management Functions
browser_tab_list
List all open browser tabs.
Parameters: None
Example:
browser_tab_new
Open a new browser tab.
Parameters:
url
(string, optional): URL to navigate to in the new tab
Example:
browser_tab_close
Close a browser tab.
Parameters:
index
(number, optional): Index of tab to close (closes current if not specified)
Example:
browser_tab_select
Switch to a specific tab by index.
Parameters:
index
(number, required): Index of the tab to select
Example:
Network and Console Functions
browser_network_requests
Get all network requests made since page load.
Parameters: None
Example:
browser_console_messages
Get all console messages from the page.
Parameters: None
Example:
Chrome DevTools Protocol (CDP) Functions
browser_connect_cdp
Connect to an existing browser instance via CDP.
Parameters:
endpoint
(string, required): CDP endpoint URLtimeout
(number, optional): Connection timeout in milliseconds (default: 30000)
Example:
browser_get_cdp_endpoints
Discover available CDP endpoints from running browsers.
Parameters:
port
(number, optional): CDP port to check (default: 9222)host
(string, optional): Host to check (default: 'localhost')
Example:
browser_disconnect_cdp
Disconnect from the current CDP connection.
Parameters: None
Example:
JavaScript Evaluation Functions
browser_evaluate
Execute JavaScript code in the browser context.
Parameters:
script
(string, required): JavaScript code to execute
Example:
Dialog Handling Functions
browser_handle_dialog
Handle browser dialogs (alert, confirm, prompt).
Parameters:
action
(string, required): Action to take ('accept' or 'dismiss')text
(string, optional): Text to enter for prompt dialogs
Example:
File Functions
browser_upload_file
Upload files to file input elements.
Parameters:
element
(string, required): Human-readable element descriptionref
(string, required): Element reference from page snapshotfiles
(array, required): Array of file paths to upload
Example:
PDF Functions
browser_save_pdf
Save the current page as a PDF.
Parameters:
filename
(string, optional): Custom filename for the PDFformat
(string, optional): Page format (e.g., 'A4', 'Letter')landscape
(boolean, optional): Use landscape orientation
Example:
Configuration
The MCP server can be configured with various options:
Common Usage Patterns
Web Scraping Workflow
Form Automation Workflow
CDP Integration Workflow
Troubleshooting
CDP Connection Issues
If you encounter CDP connection problems:
Start Chrome with debugging enabled:
google-chrome --remote-debugging-port=9222 --remote-debugging-address=0.0.0.0Verify the endpoint is accessible:
curl http://localhost:9222/json/versionCheck for firewall or network restrictions
Browser Launch Issues
Ensure Playwright browsers are installed:
npx playwright install
Check system dependencies:
npx playwright install-deps
Verify sufficient system resources for browser instances
License
MIT License - see LICENSE file for details.
Contributing
Contributions are welcome! Please see the contributing guidelines for more information.
Support
For issues and questions:
GitHub Issues: https://github.com/macacoai/mcp-playwright/issues
Email: gaston@macaco.ai
This server cannot be installed
local-only server
The server can only run on the client's local machine because it depends on local resources.
Enables comprehensive browser automation and web interaction through Playwright with 50+ specialized functions for navigation, form filling, data extraction, and Chrome DevTools Protocol support. Designed specifically for AI agents to perform complex web workflows including scraping, testing, and automated browsing tasks.
- Overview
- Features
- Installation
- Quick Start
- Function Reference
- Navigation Functions
- Page Analysis Functions
- Element Interaction Functions
- Text Input Functions
- Form Functions
- Data Extraction Functions
- Scrolling and Focus Functions
- Wait Functions
- Tab Management Functions
- Network and Console Functions
- Chrome DevTools Protocol (CDP) Functions
- JavaScript Evaluation Functions
- Dialog Handling Functions
- File Functions
- PDF Functions
- Configuration
- Common Usage Patterns
- Troubleshooting
- License
- Contributing
- Support