Integration

Use browser.city in Codex (OpenAI Codex CLI) via MCP

Configure browser.city as an MCP server in Codex so your coding agent can open real browsers, navigate, click, and extract markdown on demand.

Codex supports MCP servers configured in ~/.codex/config.toml. browser.city ships a hosted MCP server, so you can give Codex real browser tools without running infrastructure locally.

1) Create an API key

Get a browser.city API key from your dashboard and export it:

Set BROWSERCITY_API_KEY in your environment.

2) Add browser.city to ~/.codex/config.toml

Add an MCP server entry (remote HTTP):

~/.codex/config.toml
[mcp_servers.browsercity]url = "https://mcp.browser.city/mcp"bearer_token_env_var = "BROWSERCITY_API_KEY"

If you prefer explicit headers, Codex also supports http_headers = { Authorization = "Bearer ${BROWSERCITY_API_KEY}" }.

3) Use it inside Codex

Once configured, Codex will discover browser.city tools (for example: browser_open, browser_navigate, browser_snapshot, browser_click, browser_markdown).

Try a prompt like:

Open a browser with browser.city, navigate to https://example.com, and return the page as markdown.

4) Practical patterns (what actually ships)

Fast extraction (best for RAG / pipelines)

Use the Request API when you don’t need interaction:

request.ts
const apiKey = process.env.BROWSERCITY_API_KEY!;const opts = { method: "POST", headers: { Authorization: `Bearer ${apiKey}` } };const res = await fetch("https://api.browser.city/v1/requests", {  ...opts,  body: JSON.stringify({ url: "https://example.com", markdown: true }),}).then((r) => r.json());console.log(res.content);

Long-running workflows (logins, multi-step flows)

Use sessions + Playwright (keep your existing Playwright code):

session.ts
import { chromium } from "playwright";const apiKey = process.env.BROWSERCITY_API_KEY!;const opts = { method: "POST", headers: { Authorization: `Bearer ${apiKey}` } };const session = await fetch("https://api.browser.city/v1/sessions", {  ...opts,  body: JSON.stringify({    browser: "chromium",    egress: { mode: "managed", proxyType: "residential", country: "US" },  }),}).then((r) => r.json());const browser = await chromium.connect(session.endpoint, {  headers: { Authorization: `Bearer ${session.token}` },});
[ 06 / 06 ] — Get Started

Start building in under a minute

Free tier. No credit card. Full stealth from day one.