Connect Playwright to VS Code
Navigate and automate websites in a browser sandbox. Add Toolspoke to VS Code once and it can use 9 Playwright actions. Your Playwright credential stays in Toolspoke, and you choose which actions VS Code may call.
Set it up in VS Code
Three steps, the first one once for every toolkit you will ever add.
Add Toolspoke to VS Code
.vscode/mcp.json, or the MCP: Add Server command
{ "servers": { "toolspoke": { "type": "http", "url": "https://toolspoke.com/mcp" } } }Approve the authorization request when VS Code opens it.
Install Playwright and connect it
Add Playwright to a project in your Toolspoke workspace.
Playwright needs no credential. There is nothing to go and fetch: the settings below are optional, and they are configuration rather than secrets.
Choose what VS Code may do
All 9 actions start on. Switch off any of the 3 actions that change something in Playwright, and VS Code gets a refusal if it tries.
What you can ask VS Code for
A few of the Playwright actions that only read, so they are safe to try first.
- Open a URL and return its rendered text content, optionally scoped to one CSS selector
- Open a URL and run a JavaScript function inside the page, returning its result
- Open a URL and return the browser console output it produced, newest last
- Open a URL and list the network requests the page made, with status codes
What VS Code can do in Playwright
6 actions read and 3 write.
Reads
Open page
Open a URL and return the page's accessibility snapshot: headings, links, buttons and form fields with the selectors needed to interact with them. Start here before any click or form action. Pass snapshot_depth on large pages to keep the response small.
Find on page
Open a URL and search its accessibility snapshot for text or a regular expression, returning only the matching nodes with a few lines of context. Much cheaper than open_page when you already know what you are looking for.
Extract text
Open a URL and return its rendered text content, optionally scoped to one CSS selector. Use this to read an article, a rendered price or any content that only exists after JavaScript runs.
Evaluate
Open a URL and run a JavaScript function inside the page, returning its result. Use it to pull structured data out of the DOM, for example "() => [...document.querySelectorAll('h2')].map(node => node.textContent)". The code runs in the page, not on the server.
Console messages
Open a URL and return the browser console output it produced, newest last. Use it to find JavaScript errors on a page you are debugging.
Network requests
Open a URL and list the network requests the page made, with status codes. Static assets are excluded unless you ask for them, so this is a quick way to discover the JSON APIs a page calls.
Writes
Click
Open a URL, click one element and return the resulting page snapshot. The selector is a CSS selector or a ref taken from open_page. Because the browser is recreated per call, this always navigates first, chain further steps with run_flow instead of calling click twice.
Fill form
Open a URL, fill one or more fields and optionally submit, then return the resulting page snapshot. Use it for logins, searches and filter forms. Never send credentials you were not explicitly given.
Run flow
Open a URL and run an ordered sequence of interactions in one browser session, then return the final snapshot. This is the only way to chain steps, because the browser does not survive between calls, use it for multi-step flows such as accept a cookie banner, type a search, click a result.
Playwright in VS Code: questions
Does VS Code see my Playwright credential?
No. The credential is stored encrypted in Toolspoke, and the gateway adds it to each call. VS Code only ever talks to Toolspoke, and the dashboard shows the last four characters of the credential and nothing more.
Can I stop VS Code from changing things in Playwright?
Yes. Each of the 9 actions can be switched off for a project. Turn off the 3 that change something and VS Code can only read.
Will 9 actions crowd VS Code's context?
No. Toolspoke shows VS Code five bridge tools, plus a guide where a toolkit has one, and VS Code searches for the Playwright action it needs when it needs it. Adding more toolkits does not add more tools to its list.
Where do the tools show up in VS Code?
In chat, in agent mode, which is where VS Code uses MCP servers. Add the block to .vscode/mcp.json for one workspace, or use the MCP: Add Server command.
What does it cost?
Tool calls are free on every plan. Playwright runs in a sandbox, so a call bills the sandbox time it uses.
Try Playwright in VS Code
Free to start, and tool calls cost nothing on any plan.