GitHub list of ChatGPT Plugin Directory
MCP server

Playwright MCP

Browser automation for agents via Playwright accessibility snapshots

Playwright MCP gives a coding agent a real browser to work in. The agent reads each page as an accessibility tree rather than a screenshot, so it finds a button by its label and fills a form without a vision model. That makes it good for checking a feature you just built on localhost, reproducing a bug report step by step, collecting console errors from staging, or turning a manual walkthrough into a draft Playwright test.

Because it runs on your own machine, it fits Codex and other local agents far better than ChatGPT on the web.

From the publisher

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.

What you need

  • Node.js 18 or newer. The server is a local (stdio) process started with npx. A Docker image exists but only runs headless Chromium.
  • No account or API key. The server has no sign-in of its own.
  • A client that can start local servers, such as the Codex CLI, the Codex IDE extension or Codex in the ChatGPT desktop app. From code, the OpenAI Agents SDK can launch stdio servers too.
  • For ChatGPT on the web: a public HTTPS endpoint or Secure MCP Tunnel. Playwright MCP can serve HTTP with --port, but exposing it is up to you.

Good to know

  • Headed and persistent by default. It opens a visible browser and keeps a profile per workspace, so logins persist between sessions. Use --isolated for a throwaway profile and --headless to hide the window.
  • It is not a security boundary. Microsoft says so in the README, and its origin allow and block lists don't stop redirects. Treat text on pages it visits as untrusted input.
  • Some tools run code. browser_evaluate runs JavaScript in the page; browser_run_code_unsafe runs code in the server process, which the README calls equivalent to remote code execution. Keep approvals on.
  • Files are fenced in. By default it only reaches files in the workspace root and blocks file:// URLs.
  • Snapshots cost tokens. For coding agents, Microsoft suggests its Playwright CLI with skills as a more token-efficient option.

Connect

  1. 1Add the server to Codex
    codex mcp add playwright -- npx @playwright/mcp@latest

Configs are generated from the publisher's documented endpoint. Check their docs for plan requirements and scopes. New to this? Read the step-by-step tutorial.

Tools 12

browser_navigatebrowser_snapshotbrowser_clickbrowser_typebrowser_fill_formbrowser_select_optionbrowser_take_screenshotbrowser_evaluatebrowser_console_messagesbrowser_network_requestsbrowser_tabsbrowser_wait_for

Things to ask

  • “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”

Remove it

  1. 1In Codex
    codex mcp remove playwright

    Or delete the [mcp_servers.playwright] block from ~/.codex/config.toml.

Playwright MCP: common questions

Can I use the Playwright MCP server in ChatGPT?

Not directly on the web. ChatGPT reaches MCP servers through a public HTTPS endpoint or Secure MCP Tunnel, while Playwright MCP normally runs as a local command. You can run it in HTTP mode with --port and connect it in developer mode through a tunnel, but anyone who can reach that URL can drive the browser. Codex is the simpler route. See Add an MCP server to ChatGPT.

How do I add Playwright MCP to Codex?

Add it as a stdio server that runs npx @playwright/mcp@latest; the install box on this page has the config. The Codex CLI, IDE extension and desktop app share ~/.codex/config.toml. Start a new session and run /mcp to confirm the tools loaded. Use plugins and MCP servers in Codex has the details.

Can the agent use my logged-in accounts?

By default it uses its own profile, separate from your everyday browser, so it only sees sites you sign into during agent sessions. With Microsoft's browser extension it attaches to your existing Chrome or Edge tabs and their sessions, which lets it act as you. For testing, --isolated plus a --storage-state file with test-account cookies is the safer setup.

Should I use Playwright MCP or Chrome DevTools MCP?

Playwright MCP can run Chromium, Firefox or WebKit and is built for clicking through flows reliably. Chrome DevTools MCP officially supports only Chrome but adds DevTools features such as performance traces and Lighthouse audits. Pick Playwright for cross-browser flows and test drafting, Chrome DevTools for performance and debugging.

Learn more

Guide updated Oct 24, 2026. Sources: github.com, learn.chatgpt.com, developers.openai.com, openai.github.io.

Playwright MCP alternatives