Building an AI startup?
You might be eligible for our Startup Program. Get fully funded access to the infrastructure you’re reading about right now (up to $20K value).
~/.codex/config.toml, which you can edit directly or update with the codex mcp add command.
Prerequisites
- Codex CLI is installed and signed in
- Node.js is installed and up to date (required only for the self-hosted server)
- A Bright Data account (new users get free credit for testing, and then you can pay as you go)
- An API key from the user settings page (new users receive an API key in the welcome email)
Hosted MCP
The hosted server needs no local install. Add the following table to~/.codex/config.toml, replacing <your-api-token> with your Bright Data API key:
[mcp_servers.<id>] table uses url for streamable HTTP servers. The Bright Data hosted MCP accepts the API key as the token query parameter, so no separate authentication header is required.
Self-hosted MCP
The self-hosted server runs locally throughnpx and reads your API key from an environment variable.
Add the server with the CLI
Run the following command in your terminal. The
-- separator tells Codex where the environment flags end and the server command begins:Validation
Verify the integration by listing the configured MCP servers:brightdata in the output, confirming the server is configured. Start a Codex session and ask it to fetch a live web page to confirm the tools respond.