Connect Playwright to Codex
Navigate and automate websites in a browser sandbox. Add Toolspoke to Codex once and it can use 9 Playwright actions. Your Playwright credential stays in Toolspoke, and you choose which actions Codex may call.
Set it up in Codex
Three steps, the first one once for every toolkit you will ever add.
Add Toolspoke to Codex
~/.codex/config.toml
[mcp_servers.toolspoke] url = "https://toolspoke.com/mcp"Codex signs in to Toolspoke on its own the first time it connects, so there is no key to paste.
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 Codex may do
All 9 actions start on. Switch off any of the 3 actions that change something in Playwright, and Codex gets a refusal if it tries.
What you can ask Codex 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 Codex 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 Codex: questions
Does Codex see my Playwright credential?
No. The credential is stored encrypted in Toolspoke, and the gateway adds it to each call. Codex only ever talks to Toolspoke, and the dashboard shows the last four characters of the credential and nothing more.
Can I stop Codex 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 Codex can only read.
Will 9 actions crowd Codex's context?
No. Toolspoke shows Codex five bridge tools, plus a guide where a toolkit has one, and Codex searches for the Playwright action it needs when it needs it. Adding more toolkits does not add more tools to its list.
Does the same work in ChatGPT?
ChatGPT and Codex share one OpenAI account. In ChatGPT, add a custom MCP connector in its settings and paste the same address.
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 Codex
Free to start, and tool calls cost nothing on any plan.