+
Codex + Wayfern
Codex works in your repo and runs your tests. Its sandbox can block network calls, and what it knows about a library can be older than the version you use.
Add Wayfern to config.toml, and Codex calls scrape_page, search_web and crawl_site as MCP tools, with the sandbox left closed. The Codex CLI, the IDE extension and the ChatGPT desktop app read the same file.
~/.codex/config.toml saved
1[mcp_servers.wayfern]
2url = "https://api.wayfern.com/mcp"
$ codex mcp login wayfern
Opening wayfern.com in your browser… ✓ Logged in to MCP server 'wayfern'
$ codex exec "Read the Driftwood ORM v7
migration guide. Fix what breaks in src/db"
• Called wayfern.scrape_page(driftwood.dev/docs/v7/migrate)
└ 1 page as markdown · credits_charged: 1
• Edited 3 files +11 -7
└ src/db/client.ts +4 -3 ++++---
src/db/schema.ts +5 -2 +++++--
src/db/query.ts +2 -2 ++--
src/db/client.ts
- const db = driftwood.connect(url)
+ const db = createClient({ url })
wayfern.com/oauth/authorize
Allow Codex to use Wayfern?
Calls spend your credits.
Setup
Or run codex mcp add wayfern --url https://api.wayfern.com/mcp, which writes the same lines.
~/.codex/config.toml
[mcp_servers.wayfern]
url = "https://api.wayfern.com/mcp"A browser opens on wayfern.com. Sign in and click Allow.
bash
codex mcp login wayfernStart codex and type /mcp. It lists wayfern and its tools.
bash
codex exec "With the Wayfern tools, read the migration guide of our ORM, version 7, and list each change that breaks src/db"Cron cannot open a browser for OAuth. Put a wf_ token with the mcp scope in a variable, and Codex sends it as a Bearer token.
~/.codex/config.toml
[mcp_servers.wayfern]
url = "https://api.wayfern.com/mcp"
bearer_token_env_var = "WAYFERN_API_TOKEN"Codex loads skills from ~/.agents/skills, or .agents/skills in the repo. The skill runs curl, so the sandbox must allow network access, and it needs WAYFERN_API_TOKEN.
bash
mkdir -p ~/.agents/skills/wayfern
curl -fsSL https://wayfern.com/skills/wayfern/SKILL.md -o ~/.agents/skills/wayfern/SKILL.mdRoute
Codex makes MCP calls itself, so the shell sandbox can stay closed. The same config.toml serves the CLI, the IDE extension and the ChatGPT desktop app.
codex mcp login wayfern signs you in on wayfern.com.bearer_token_env_var reads a wf_ token from a variable. Good for cron and CI.~/.agents/skills/wayfern. curl needs network access in the sandbox.api.wayfern.com/api/v1 directly.Example tasks
01
“Read the migration guide of the ORM we use, version 7, and change our models in src/db to match.”
scrape_page returns markdown for 1 credit.
02
“Search Bing and Google for this error from the CI log, read the two best answers and apply the fix.”
search_web bills 2 credits for each provider page. scrape_page is 1 credit a page.
03
“Crawl the REST reference of our SMS provider, 30 pages at most, and write a typed client in src/sms from it.”
crawl_site bills 1 credit for each page. crawl_status is free.
04
“Capture the home, pricing and sign-up pages of staging at 1440 pixels wide and list anything that looks broken.”
capture_screenshot costs 5 credits a capture.
Tools
The same tools on every route, at the REST API rates. Every result reports credits_charged.
extract_data run, raise tool_timeout_sec under [mcp_servers.wayfern].codex exec runs read-only by default. Add --sandbox workspace-write when the job writes files.config.toml. The ChatGPT page has the plugin steps.Sign in once and the tools appear. Tool calls use the credits of your Wayfern plan, at the same rates as the API.