mcp-web-browser
An advanced web browsing server for the Model Context Protocol (MCP) powered by Playwright, enabling headless browser interactions through a flexible, secure API.
claude mcp add --transport stdio random-robbie-mcp-web-browser python /path/to/your/server.py \ --env PLAYWRIGHT_BROWSERS_PATH="path/to/browser/cache (optional)"
How to use
This MCP server provides a headless web browsing API powered by Playwright. It enables you to programmatically navigate websites, extract full HTML content (including dynamic JavaScript), manage multiple tabs, interact with page elements (text input, clicks), capture screenshots, and retrieve page metadata. The API supports operations such as browse_to, extract_text_content, input_text, click_element, get_page_screenshots, get_page_links, create_new_tab, switch_tab, list_tabs, close_tab, refresh_page, wait_for_navigation, execute_javascript, and get_page_info. It’s designed for automated workflows, data extraction, and browser-based testing within the MCP framework. Use multiple tabs to parallelize tasks or isolate sessions, and leverage the built-in cleanup to release resources after inactivity.
How to install
Prerequisites:
- Python 3.10 or newer
- Network access to install Python packages
- Create and activate a Python virtual environment (recommended):
python -m venv venv
# macOS/Linux
source venv/bin/activate
# Windows
venv\Scripts\activate
- Install the MCP framework and Playwright bindings:
pip install mcp playwright
- Install browser dependencies for Playwright:
playwright install
- Run the MCP Web Browser server (example):
python /path/to/your/server.py
- Optional: Configure your Claude Desktop or other MCP client to point to the server using the provided MCP config format (see mcp_config example).
Additional notes
Tips and common considerations:
- Ensure Python 3.10+ is installed and available in your PATH.
- The server bypasses SSL certificate validation for web browsing; use with awareness of security implications.
- The Playwright browser context can be configured for secure operation; adjust user-agent and timeouts as needed via the API.
- If you encounter slow page loads, tune timeouts in browse_to and related navigation methods.
- Resources are automatically cleaned up after inactivity; if you expect long-running sessions, monitor resource usage.
- When running behind a firewall, ensure that required ports for MCP communication are accessible.
- For troubleshooting, enable verbose logging in your MCP client and review server logs for navigation errors or selector issues.
Related MCP Servers
mcp-vegalite
MCP server from isaacwasserman/mcp-vegalite-server
github-chat
A Model Context Protocol (MCP) for analyzing and querying GitHub repositories using the GitHub Chat API.
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
pagerduty
PagerDuty's official local MCP (Model Context Protocol) server which provides tools to interact with your PagerDuty account directly from your MCP-enabled client.
futu-stock
mcp server for futuniuniu stock
mcp -boilerplate
Boilerplate using one of the 'better' ways to build MCP Servers. Written using FastMCP