-
Notifications
You must be signed in to change notification settings - Fork 4.7k
playwright mcp in github copilot
Copilot's agent mode can call MCP tools, which means it can drive a browser if you give it one. The setup is short. What is worth reading is the part after the setup, because an editor is a different environment from a chat client and two of the defaults that are fine elsewhere are wrong here.
Copilot reads MCP servers from a workspace file, .vscode/mcp.json, or from
your user settings if you want it in every project. The block is the same shape
every client uses: a command and its arguments.
For Microsoft's server:
{
"servers": {
"playwright": {
"command": "npx",
"args": ["@playwright/mcp@latest", "--isolated"]
}
}
}For this project's server the block is in the MCP server, which also lists the settings and every tool with what it returns.
Then switch Copilot Chat to agent mode. Ask mode does not call tools, and this is the single most common reason people conclude the server is not working when it is registered correctly.
The example above passes --isolated on purpose. In an editor you are very
likely to be the person who also has an MCP browser registered in a terminal
assistant, and two clients on one persistent profile produce
browser is already in use. An editor
is exactly where that collision shows up, because an editor is where people run
two assistants at once without noticing.
If you need to be logged in, prefer --storage-state over a shared persistent
profile, for the same reason.
A browser server adds twenty-odd tool descriptions to the model's context on every turn, and in an editor you probably already have several servers registered. Copilot has a ceiling on how many tools it will offer at once, and crossing it means some of them stop being available without a message that says so.
The size of one browser server, measured on ours on 2026-09-10: 24 tools, 14,064 characters, about 3,500 tokens per turn. Register two browser servers in an editor that already has a file server and a search server and you are spending a meaningful slice of the context window on tool descriptions before your question arrives.
Two habits keep this from biting:
Enable capabilities you use, not all of them. --caps is additive on
Microsoft's server. Vision, pdf and devtools off unless a page forces it.
Do not register two browser servers. Overlapping tool names double the context and make the model's choice worse. Pick one.
In an editor the model has your repository in context, which is powerful and also the source of the main failure mode: it will happily read the code and guess what the page must look like rather than opening it.
- Say "open the page" explicitly when you want it observed rather than inferred. "Check whether the login form submits" reads code. "Open localhost:3000, fill the login form and tell me what happens" uses the browser.
- Give it a stopping condition. Same as anywhere else, and worse here, because an editor session is long and nobody is watching token spend. Playwright MCP best practices has the rest.
- Point it at your dev server, not production. Obvious, routinely ignored, and the reason an agent once filled in a real form.
An editor already has the code. If the question is answerable from the source, the browser is a slow way to answer it, and every browser step costs a round trip. Reach for it when the question is about what the running page does - a layout that breaks, a request that fires, a flow that only fails in a real browser - and not when it is about what the code says.
And if what you want is a repeatable check rather than an answer today, write a Playwright test instead and let the CLI run it. Playwright MCP vs the CLI has the split.
Does Copilot support MCP? Yes, in agent mode. Ask mode does not call tools.
Where does the config go? .vscode/mcp.json for one workspace, user
settings for all of them.
Why does Copilot not use the browser tools? Almost always: not in agent mode, or the tool ceiling is hit because several servers are registered.
Can I use this with a local dev server? Yes, and it is the best use of it in an editor.
Does it work in Cursor, Cline, Windsurf? Yes, with a different top-level key in the config file. The MCP server lists which key each client expects, including the one that is not JSON.
See also: Playwright MCP best practices, running AIHawk with Claude Code, and using an agent to test your own site.
-
microsoft/playwright-mcp, retrieved 2026-09-10, for the package name,
--isolated,--storage-stateand--caps. - GitHub's own documentation for Copilot agent mode and MCP configuration.
Written while maintaining a competing MCP browser server. The example block registers Microsoft's, because in an editor it is the one most readers already have and the advice does not depend on which you chose.
- OpenAI Operator alternatives
- Open-source Operator-style agents
- Is OpenAI Operator still available?
- OpenAI Operator vs Claude computer use
- browser-use alternatives
- Choosing an AI browser agent
- Open-source AI browser agents
- Open-source computer-use agents
- What is an AI web agent?
- AI browser agents vs traditional scraping
- Cloud browser infrastructure for AI agents, explained
- Browserbase alternatives
- Firecrawl vs an AI browser agent
- Skyvern alternatives
- Stagehand vs browser-use
- Project Mariner is gone: what replaced it
- Manus alternatives
- Gemini computer use vs Claude computer use
- AIHawk, reviewed honestly by its own wiki
- AI browser vs AI browser agent: which one do you want?
- AI browser agent vs RPA: which one fits the job
- AI browser agent vs n8n, Zapier and Make
- Vercel agent-browser alternatives, compared honestly
- What is an agentic browser? Definition and the two kinds
- Open-source agentic browsers: the three layers, compared
- Choosing an MCP server for browser automation: four axes
- Stealth MCP servers compared: Camoufox, nodriver, Patchright
- Playwright MCP alternatives, and the three you don't need
- Autonomous browser agents: the four rungs of autonomy
- What is actually free in the AI browser agent stack
- browser-use on GitHub: what the repo actually gives you
- Playwright MCP vs Chrome DevTools MCP: different jobs
- Why does my AI agent get blocked?
- The timing signal AI agents give off
- Agent retry loops trip rate limits, not fingerprints
- Claude computer use detected as a bot
- browser-use getting blocked: what you can and cannot change
- Playwright MCP session blocked: four causes, four fixes
- Playwright MCP and captchas: what actually gets you past
- Cloudflare and a browser MCP server: what is being read
- Can an AI agent solve a captcha? The honest answer
- Getting an AI agent to fill out forms
- Which model to use with AIHawk
- Browser problem or model problem?
- Running AIHawk's browser from Claude Code
- Extracting data to a CSV with an AI agent
- Monitoring a page for changes with an AI agent
- Running AIHawk's browser from Claude Desktop
- Running AIHawk's browser from Cursor
- Using an AI agent to hunt for apartments
- Getting website data into Google Sheets with an AI agent
- Using an AI agent to download invoices from portals
- AI agents for web research
- Using an AI agent to test your own website
- Running AIHawk's browser from Cline
- Posting to social media with an AI agent
- Posting to Facebook with an AI agent
- Posting to Instagram with an AI agent
- Posting to X with an AI agent
- Automating LinkedIn posts: read this first
- Appointment bots: what they are and what an agent can legitimately do
- Track prices across sites with an AI agent
- Build a lead list with an AI browser agent
- Run an AI browser agent on a schedule
- AI browser agent with a local LLM: what changes
- Should you log your AI agent into your accounts?
- How to write a task an AI browser agent can follow
- Move data between two web apps with an AI agent
- The MCP server
- How the tools are shaped, and why
- Playwright MCP vs the Playwright CLI: which fits when
- Playwright MCP: browser is already in use, and the fix
- Playwright MCP best practices: four decisions that matter
- Playwright MCP with a proxy, and the three leaks it leaves
- A browser MCP server in GitHub Copilot: setup and limits
- Using a browser MCP server for web scraping: the pattern
- Which LLM for browser automation: the four properties
- How to build a browser agent, and what to take instead
- Getting an AI agent to log into a website: three routes