# Playwright MCP (MCP Server)

> Browser automation for agents via Playwright accessibility snapshots

- Type: MCP server
- Publisher: Microsoft (official)
- Categories: Development
- Website: https://github.com/microsoft/playwright-mcp
- Source: https://github.com/microsoft/playwright-mcp
- Transport: stdio
- Launch command: npx @playwright/mcp@latest
- Sign-in: none
- GitHub stars: 37739
- Listed: 2025-03-21

## About

Microsoft's Playwright MCP server lets agents drive a real browser using structured accessibility snapshots instead of screenshots. It supports navigation, clicking, typing, form filling, tabs, network inspection and screenshots across Chromium, Firefox and WebKit.

## Install

1. **Add the server to Codex**

   Codex CLI:

   ```bash
   codex mcp add playwright -- npx @playwright/mcp@latest
   ```

   config.toml:

   ```toml
   [mcp_servers.playwright]
   command = "npx"
   args = ["@playwright/mcp@latest"]
   ```

   Agents SDK:

   ```python
   from agents import Agent, Runner
   from agents.mcp import MCPServerStdio
   
   async with MCPServerStdio(
       name="Playwright MCP",
       params={"command": "npx", "args": ["@playwright/mcp@latest"]},
   ) as server:
       agent = Agent(name="Assistant", mcp_servers=[server])
       result = await Runner.run(agent, "Open localhost:3000 and check that the signup form validates emails")
       print(result.final_output)
   ```

## Tools

- `browser_navigate`
- `browser_snapshot`
- `browser_click`
- `browser_type`
- `browser_fill_form`
- `browser_select_option`
- `browser_take_screenshot`
- `browser_evaluate`
- `browser_console_messages`
- `browser_network_requests`
- `browser_tabs`
- `browser_wait_for`

## Example prompts

- "Open localhost:3000 and check that the signup form validates emails"
- "Take a screenshot of the pricing page on mobile viewport"
- "Log in to the staging app and list all console errors"
- "Fill out the contact form on this page and submit it"

## Related

- [Chrome DevTools MCP](https://chatgptplugins.directory/mcp/chrome-devtools.md): Let coding agents control and debug a live Chrome browser
- [GitHub](https://chatgptplugins.directory/mcp/github.md): Manage repos, issues, pull requests and Actions from your AI agent
- [Context7](https://chatgptplugins.directory/mcp/context7.md): Pull up-to-date, version-specific library docs into your coding agent
- [Supabase](https://chatgptplugins.directory/mcp/supabase.md): Manage Supabase databases, migrations, edge functions and logs
- [Stripe](https://chatgptplugins.directory/mcp/stripe.md): Query and act on your Stripe account and search Stripe docs from any agent
- [Atlassian Rovo (Jira & Confluence)](https://chatgptplugins.directory/mcp/atlassian-rovo.md): Work with Jira issues and Confluence pages through Atlassian's hosted MCP

---
Source: https://chatgptplugins.directory/mcp/playwright · Index: https://chatgptplugins.directory/llms.txt · Independent and community-run. Not affiliated with or endorsed by OpenAI. ChatGPT is a trademark of OpenAI.
