Cette page est affichée en anglais. Une traduction française est en cours.
MCP ConfigsApr 6, 2026·2 min de lecture

Playwright MCP — Browser Automation for AI Agents

Official Playwright MCP server that gives AI agents full browser control — navigate pages, fill forms, click buttons, take screenshots, and run end-to-end tests. 3,000+ stars.

Prêt pour agents

Staging sûr pour cet actif

Cet actif est d'abord staged. Le prompt copié demande à l'agent d'inspecter les fichiers staged avant d'activer scripts, config MCP ou config globale.

Stage only · 17/100Policy : staging
Surface agent
Tout agent MCP/CLI
Type
Mcp Config
Installation
Stage only
Confiance
Confiance : Community
Point d'entrée
Playwright MCP — Browser Automation for AI Agents
Commande de staging sûr
npx -y tokrepo@latest install c07ce036-3fd5-48ae-8a2d-9c0b02201c50 --target codex

Stage les fichiers d'abord; l'activation exige la revue du README et du plan staged.

TL;DR
Official Playwright MCP server that gives AI agents like Claude Code full control over web browsers for testing and automation.
§01

What it is

Playwright MCP is the official Model Context Protocol server for Playwright browser automation. It gives AI agents like Claude Code full control over web browsers: navigate pages, fill forms, click buttons, extract content, take screenshots, and run end-to-end tests. The agent sees the page structure and can interact with any element through natural language commands.

The server is designed for developers who need AI-assisted web testing, scraping, or workflow automation. It works with Claude Code, Cursor, and any MCP-compatible client. Setup takes under one minute.

§02

How it saves time or tokens

Playwright MCP eliminates the need to write Playwright scripts manually for one-off browser tasks. Instead of writing boilerplate code for navigation, form filling, and assertions, you describe the action in plain English and the agent handles the Playwright API calls. For repetitive QA workflows, this reduces test authoring time significantly. The agent also interprets page structure contextually, reducing the back-and-forth of element selection.

§03

How to use

  1. Add the Playwright MCP server to your .mcp.json:
{
  "mcpServers": {
    "playwright": {
      "command": "npx",
      "args": ["-y", "@anthropic/mcp-playwright"]
    }
  }
}
  1. Restart Claude Code to load the new server.
  1. Ask the agent to perform browser tasks in natural language: 'Open https://example.com, take a screenshot, and describe what you see.'
§04

Example

Common interaction patterns with Playwright MCP:

# Navigation
'Open https://github.com/trending'
'Go back to the previous page'
'Wait for the login form to appear'

# Form interaction
'Click the Sign In button'
'Fill the email field with test@example.com'
'Select Monthly from the billing dropdown'

# Content extraction
'Extract all product names and prices from this page'
'Get the text content of the main article'
'List all links on this page'

The agent translates these into Playwright API calls, executes them against the browser, and returns the results.

§05

Related on TokRepo

§06

Common pitfalls

  • The MCP server launches a new browser instance. Websites requiring login will need you to authenticate first or provide session cookies.
  • Dynamic SPAs with heavy JavaScript may require explicit wait commands. Tell the agent to 'wait for the content to load' before extracting data.
  • Screenshot quality depends on viewport size. Specify dimensions if you need consistent visual output across runs.

Questions fréquentes

What browsers does Playwright MCP support?+

Playwright MCP uses Playwright under the hood, which supports Chromium, Firefox, and WebKit. By default it launches Chromium, but you can configure it for other browsers depending on your testing needs.

Can I use Playwright MCP for web scraping?+

Yes. The content extraction tools let you pull text, links, tables, and structured data from any page. The agent navigates JavaScript-heavy SPAs that static scrapers cannot handle, making it effective for modern web applications.

How does Playwright MCP differ from Puppeteer MCP?+

Playwright MCP uses Microsoft Playwright, which supports multiple browsers and has more robust auto-waiting. Puppeteer MCP uses Google Puppeteer, which is Chromium-only. Playwright MCP generally provides better cross-browser testing support.

Is Playwright MCP suitable for production test automation?+

Playwright MCP is best for interactive test exploration and one-off automation tasks. For CI/CD pipelines, you would typically generate Playwright scripts from your MCP session and run them directly without the MCP layer.

Does Playwright MCP work with authentication-protected pages?+

Yes, but you need to handle authentication. You can ask the agent to fill login forms, or provide pre-authenticated session cookies. For SSO or MFA flows, manual intervention may be needed for the initial authentication step.

Sources citées (3)
🙏

Source et remerciements

Built on Playwright by Microsoft. Licensed under Apache 2.0.

playwright — ⭐ 70,000+

Thanks to Microsoft and the MCP community for bridging AI agents and browsers.

Fil de discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.

Actifs similaires