Tip · Last checked
Official sources were checked on 2026-09-04. The MCP mechanism follows the Codex MCP documentation. This case uses microsoft/playwright-mcp. See the Playwright website for browser automation. Tool names, installation, and permissions can change; follow the upstream project.
Codex x Playwright MCP: let AI operate a browser
Playwright MCP exposes browser actions such as opening a page, navigating, clicking, filling fields, reading content, taking screenshots, and checking results as tools an AI agent can call. This lets a coding agent inspect whether a web workflow actually works.
This case uses the command line to install and exercise the server.
1. Install
codex mcp add playwright npx @playwright/mcp@latest

To verify the installation, open Codex and use the /mcp command to list the configured MCP servers.


2. Use it
After confirming the server, try a bounded research task:
- Open a browser and search for "What is MCP?".
- Read two relevant tutorials.
- Save a short summary to a local Markdown file.
For example:
Open a browser, search Baidu for "什么是 MCP", read two useful results, and save a concise Markdown summary in the current directory.

The run may ask for permission to fill a search field, enter text, or open a page. Approve only the actions you understand.

You should be able to observe the browser opening, searching, and visiting the selected pages.

The final result can be summarized and written to the local Markdown file.


References
The operation flow and demonstration scenario were also informed by this Bilibili video: Claude Code crash course with complete documents.
The screenshots are from the author's own operation. The text has been reorganized and rewritten; contact the site owner for removal requests.
