MCP and Playwright MCP: what an agent gets
MCP (Model Context Protocol) is an open protocol for connecting AI applications to external tools and data. An MCP server exposes tools, resources and prompts to the agent, and the host creates one client per server. Playwright MCP lets an agent drive a browser through an accessibility tree snapshot rather than screenshots. It is not a security boundary: isolation comes from the environment.
An agent that only reads files cannot check that a button really works. To give it "hands", an application is connected to external systems in a standard way.
MCP (Model Context Protocol) is an open protocol for connecting AI applications to external tools and data. An MCP server exposes tools (calls), resources and prompts to the agent; the host application (an agent or an IDE) creates one MCP client per server. A server is connected by an entry in the configuration.
Playwright MCP is a server that lets an agent drive a browser. It works with a snapshot of the page’s accessibility tree (roles, names, states as text) rather than screenshots: no vision model is needed, the agent refers to elements by ref from the snapshot instead of pixel coordinates, and the output is structured. A screenshot is available as a separate tool.
The example below is from the README; in a team, pin a specific version instead of @latest.
{
"mcpServers": {
"playwright": { "command": "npx", "args": ["@playwright/mcp@latest"] }
}
}
Useful settings: --headless, --isolated (profile in memory, nothing saved to disk), --allowed-origins, --caps for extra capabilities. The documentation states plainly: Playwright MCP is not a security boundary, and neither are the origin lists. Isolation is provided by the environment.
Common mistakes: connecting ten servers when one is needed (each takes context with tool descriptions); treating a site-restriction flag as protection; not pinning the server version.
Short interview answer: "MCP is a standard way to give an agent tools; Playwright MCP reads the accessibility tree, so the agent sees a page as a structure of roles rather than a picture".