Playwright MCP

Playwright MCP

Enables browser automation and web scraping by exposing Playwright tools through an HTTP-based MCP server. Users can navigate pages, interact with web elements, capture screenshots, and extract structured content using a persistent Chromium instance.

Category
Visit Server

README

Playwright MCP

FastMCP server with Playwright for browser automation and web scraping. Exposes tools over HTTP for use with MCP clients (e.g. GPT-based agents).

Features

  • HTTP transport – Server runs as an HTTP service; clients connect via URL.
  • Long-lived browser – One Chromium instance started at server startup (Option A).
  • Structured logging – Structlog with configurable level and JSON output.
  • Modular layout – Config, logging, browser, tools, and server are separate; state is injected via lifespan context.

Tools

Tool Description
browser_navigate Navigate to a URL
browser_snapshot Get HTML/text snapshot of the current page
browser_tabs List open tabs (pages)
browser_click Click an element by CSS selector
browser_type Type text into an element
browser_fill_form Fill multiple form fields (selector → value map)
browser_scrape Extract content (text, HTML, or links) from current page or URL
browser_screenshot Take a PNG screenshot (base64) of page or element

Requirements

  • Python 3.10+
  • Playwright browsers (install after pip install)

Setup

# From project root
pip install -e .
python -m playwright install chromium

Optional: copy .env.example to .env and adjust MCP_HOST, MCP_PORT, HEADLESS, LOG_LEVEL, LOG_JSON.

Run

# After pip install -e .
playwright-mcp

# Or
python -m playwright_mcp.main

Server listens at http://127.0.0.1:8000 by default. MCP endpoint is typically at http://127.0.0.1:8000/mcp (see FastMCP HTTP deployment docs).

Project layout

src/playwright_mcp/
├── main.py           # Entrypoint
├── config/           # Env-based settings
├── logging_/          # Structlog setup and get_logger
├── browser/          # Lifecycle and BrowserState
├── tools/            # Navigation, interaction, scraping, screenshot
└── server/           # FastMCP app and dependency registration

Configuration

Env var Default Description
MCP_HOST 127.0.0.1 HTTP bind host
MCP_PORT 8000 HTTP bind port
HEADLESS true Run browser headless
LOG_LEVEL INFO Log level (DEBUG, INFO, WARNING, ERROR)
LOG_JSON false Output logs as JSON

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured