Playwright MCP: control a browser with your IA

Playwright MCP is Microsoft's open-source MCP server (Apache 2.0 license, version v0.0.85 from November 9, 2026) that lets an AI assistant open pages, click, and fill out forms in a real browser. It describes pages through an accessibility snapshot, not screenshots: a local model with tool calling, in LM Studio or Goose, is enough. It requires Node.js 20 or newer.
Giving your AI a browser lets you hand it concrete tasks: reading a page, extracting a table, testing a form. This guide explains what Playwright MCP does, how to install it in LM Studio, Goose, VS Code, or Claude Code, which local model to use, and which settings protect your sessions. You'll also learn when to choose Playwright CLI instead.
#What exactly is Playwright MCP?
Playwright MCP is an open-source MCP server from Microsoft that gives an AI assistant a real browser. The model doesn't control the mouse. Instead, it calls tools (open a URL, click, type, read the page) that the server translates into actions in Playwright, Microsoft's browser automation library.
MCP, the Model Context Protocol, is an open standard that connects AI applications to external systems: files, databases, tools. An MCP client (LM Studio, Goose, VS Code, Claude Code) launches the Playwright MCP server, passes it the model's requests, and returns the results to the conversation.
According to the README of the microsoft/playwright-mcp repository as of November 18, 2026, Playwright MCP describes each page through a structured accessibility snapshot: buttons, links, fields, and text, each with a reference the model cites to take action. No screenshots or vision model are needed, which opens the door to text-only local models.
- Accessibility snapshot
- A text representation of the page as a screen reader sees it: roles (button, link, field), labels, and element references. This is what the model reads.
#Official Playwright MCP, mcp-playwright, or Playwright CLI?
Benefit from our experience and a guided path to go further with your local agents and your automations.
- Lifetime online access
- PDF + files
- Refunded within 30 days
To drive a browser from a conversation, Microsoft's official @playwright/mcp server is the default choice; Playwright CLI is a better fit for coding agents that watch their token count. ExecuteAutomation's mcp-playwright server, often listed in directories, is a separate community project.
The microsoft/playwright-mcp repository publishes the @playwright/mcp npm package under the Apache 2.0 license; its v0.0.85 release came out on November 9, 2026, according to the GitHub API. The executeautomation/mcp-playwright repository is MIT-licensed, and its most recent push dates from December 13, 2025, according to the same API. Their tools and options differ: a configuration copied from one won't work for the other.
Microsoft also publishes Playwright CLI, a command-line interface that comes with skills and, according to its README, uses fewer tokens for coding agents. The same README reserves MCP for loops that benefit from persistent browser state and repeated reasoning over page structure: exploration, self-healing tests, long-running tasks.
| Tool | Publisher and license | Form | Best use |
|---|---|---|---|
| Playwright MCP (@playwright/mcp) | Microsoft, Apache 2.0 | MCP server, launched via npx | Chat assistants, local models, multi-step browsing tasks |
| Playwright CLI (@playwright/cli) | Microsoft | playwright-cli command and skills | Coding agents (Claude Code, Copilot) that need to conserve their context |
| mcp-playwright | ExecuteAutomation, MIT | Community MCP server | Projects already configured with it; check its activity before adopting it |
#What do you need to use Playwright MCP?
Playwright MCP requires Node.js 20 or later, an MCP client, and a model that can call tools. According to the official documentation, Playwright supports Chromium, WebKit, and Firefox on Windows, macOS, and Linux.
Node.js runs the server: the official configuration uses npx, which downloads and runs the @playwright/mcp package on demand. Without Node.js, the command fails, as the Goose documentation points out.
A model without tool calling won't trigger any actions in the browser. On Ollama, the model pages for Qwen 3.8 (18 GB for the 27B version) and gpt-oss (16 GB of memory is enough for the 20B version) carry the tools tag. These are candidates, not guarantees: reliability depends on the task and the length of the pages.
| Model | Tool calling | Announced size or memory | Who it's for (estimate) |
|---|---|---|---|
| Qwen 3.8 27B | Yes (tools tag on Ollama) | 18 GB file, 256K context | 24 GB graphics card or a Mac with ample unified memory |
| gpt-oss 20B | Yes (tools tag on Ollama) | 16 GB of memory minimum, according to Ollama | Machine with 16 to 24 GB that needs an agent-oriented model |
| Hosted model (Claude, GPT) | Yes | Not applicable | Long tasks on heavy pages, if sending data to the cloud is acceptable |
#How do you install Playwright MCP in your client?
To install Playwright MCP, just add an entry to your MCP client that runs npx @playwright/mcp@latest. The official README provides a standard configuration that works for most clients, plus dedicated commands for Claude Code, VS Code, Codex, and Cline.
- 01Check Node.jsOpen a terminal and check that Node.js 20 or later is installed, since Playwright MCP requires it. Without Node.js, the npx command used by every client fails.
- 02Open the client's MCP configurationIn LM Studio, open the Program tab in the right sidebar, then Install and Edit mcp.json. In Goose Desktop, open Advanced settings, Extensions, then Add custom extension, choose the STDIO type and the command npx @playwright/mcp.
- 03Add the playwright entryAdd the playwright entry, with the npx command and the @playwright/mcp@latest argument, to the file's mcpServers block. In LM Studio, whose mcp.json already contains this block, copy only what sits between "mcpServers": { and the closing brace. Save, then restart the client if the tools don't appear.
- 04Choose a model that supports tool callingLoad a model that supports tool calling, for example Qwen 3.8 27B or gpt-oss 20B locally, then check in the client that the Playwright tools, such as browser_navigate and browser_snapshot, are enabled for the conversation.
- 05Run a simple first testAsk the model to open a public page and tell you its title. A browser window should open, since headed mode is the default, and the model should then answer based on the page snapshot.
#How do you check that Playwright MCP is working?
The most telling test is the tool call trace: the client shows browser_navigate to open the URL, then browser_snapshot to read the page. If the model answers without any tool call, it's making things up: check that the Playwright MCP server is running and that the model supports tools. If the call fails, read the client's error message.
#How do you use Playwright MCP with a local AI?
Playwright MCP works with a local model as long as the MCP client can talk to that model. LM Studio is the shortest path, since it serves the model and launches the MCP server in the same application; Goose and Cline go through Ollama.
LM Studio has acted as an MCP host since version 0.3.17, according to its official documentation, and follows Cursor's mcp.json notation: you add the playwright entry from the standard configuration to its mcp.json file. The model, server, and browser then all run on the same machine; only the pages you visit go over the internet.
Goose accepts Playwright MCP as an extension, launched with npx -y @playwright/mcp@latest according to its documentation, and can use a model served by Ollama. Cline, in VS Code, takes an equivalent entry in its cline_mcp_settings.json file, with the stdio type and the -y argument. Ollama on its own doesn't launch an MCP server: it needs one of these clients, or a Python gateway like the one in the MCP and local LLM guide.
With Playwright MCP, a local model is more fragile than a large hosted model, because each page snapshot gets added to the conversation. Give it short tasks: opening a page, extracting a table, filling out a known form.
#What tools does Playwright MCP give the AI?
Playwright MCP gives the model tools for navigation, reading, and interaction. As of November 18, 2026, the README lists 24 of them in its "Core automation" section, plus browser_tabs under tab management. Other tool groups, such as PDF or coordinate-based clicks, are enabled only on request with the --caps option.
- browser_navigate and browser_navigate_back
- Open a URL, go back to the previous page.
- browser_snapshot
- Capture the page's accessibility snapshot; the README considers it better than a screenshot for taking actions.
- browser_click, browser_type, browser_fill_form
- Click an element, type text, fill in multiple form fields at once.
- browser_take_screenshot
- Take a screenshot, useful for a human or for a vision model.
- browser_tabs and browser_wait_for
- Manage tabs, wait for text to appear or disappear.
- browser_run_code_unsafe
- Run arbitrary Playwright code; the README describes this as equivalent to remote code execution.
The --caps option adds optional capabilities: vision for coordinate-based clicks, pdf for saving a page as a PDF, and devtools for tracing and video. The README also lists network, storage, configuration, and test assertion groups. Enable only what the task needs, because each tool adds its description to the model's context.
#Profile, headless mode, extension: configuring the Playwright MCP browser
By default, Playwright MCP uses a persistent profile that keeps cookies and sessions from one conversation to the next. It also offers an isolated mode that leaves no trace on disk, plus an extension for controlling your own Chrome or Edge that's already open. Options go in the args list of the configuration.
| Option | Effect | When to use it |
|---|---|---|
| --isolated | Profile kept in memory, nothing written to disk | Testing, unknown sites, multiple clients in parallel |
| --headless | Headless browser (visible window by default) | Server, repetitive tasks you don't need to watch |
| --browser | Choice of chrome, firefox, webkit, and msedge | Testing a site on a specific engine |
| --extension | Connecting to an already open Chrome or Edge, via the Playwright extension | Reusing logged-in sessions, knowing the risks |
| --caps | Adding vision, pdf, or devtools capabilities | Coordinate-based clicks, PDF export, traces |
| --port | Standalone server accessible over HTTP | Client without display access, such as an editor's background process |
The persistent profile has a limitation that server directories leave out: according to the README, it can only be used by one browser instance at a time, and two MCP clients open on the same project will conflict. The official workaround is to launch additional clients with --isolated or with a separate profile directory, specified with --user-data-dir. The README places this profile in ~/Library/Caches/ms-playwright on macOS, ~/.cache/ms-playwright on Linux, and %USERPROFILE%\AppData\Local\ms-playwright on Windows: deleting it erases saved sessions.
When the client runs without display access, for example in an editor's background process, the README recommends a standalone server launched from a session that has a display: the command below starts Playwright MCP on port 8931, and the client connects to http://localhost:8931/mcp. By default, the server listens only on localhost; setting the --host option to 0.0.0.0 exposes it to the network. The official Docker image supports only headless Chromium.
#Is Playwright MCP safe? The risks you should know about
Playwright MCP is not a security boundary, and the official README says so explicitly. The server executes whatever the model asks for, and the content of the pages the model reads can trick it. Protection depends on the client's permissions and on your settings.
The first risk is indirect prompt injection: according to OWASP, external content read by the model, such as a website, alters its behavior. A page can hide text that instructs the model to visit another address or copy data. With a browser logged in to your accounts, the consequences become very real.
The second risk comes from settings. The persistent profile keeps sessions logged in, and the extension gives access to your personal browser. According to the README, allowed and blocked origin lists are not a security boundary and ignore redirects. Finally, the MCP security documentation points out that a local server is a program you download and run on your machine.
| Usage | Recommended setting | Why |
|---|---|---|
| Reading public pages, extracting data | --isolated, no extension | No session or cookies to expose |
| Test your own site in development | --isolated, optionally --headless | Separate profile for each session, reproducible results |
| Acting on a logged-in account | Dedicated profile, manual approval of every action | A booby-trapped page could hijack the session |
| Shared machine or server | Default --host (localhost) and firewall | 0.0.0.0 makes the server reachable from the network |
Is Playwright MCP free?+
Does Playwright MCP work without a cloud connection?+
What's the difference between MCP and an API?+
Does Playwright MCP replace Selenium or Cypress for testing?+
Why doesn't Playwright MCP open a browser window?+
#Sources and verification as of November 18, 2026
Versions, licenses, commands, options, and security warnings were collected on November 18, 2026 from Microsoft's GitHub repositories, the GitHub API, the npm registry, the LM Studio, Goose, MCP, and OWASP documentation, and the Ollama listings. Five Playwright MCP versions were released between September 14 and November 9, 2026, so options and tools may change.
- Source: Playwright MCP repository (Microsoft)
- Source: Playwright MCP v0.0.85 release (GitHub)
- Source: Playwright CLI (Microsoft)
- Source: MCP servers in LM Studio (official documentation)
- Source: Playwright extension for Goose (official documentation)
- Source: MCP security best practices
- Source: prompt injection, OWASP GenAI
Feedback, an error, or a clarification? Let us know—it improves the guide for everyone.