Give Codex live web data

Add a [mcp_servers.name] table to ~/.codex/config.toml with url set to Apify's MCP URL and bearer_token_env_var set to APIFY_TOKEN. Export the token, start codex and check the tools with /mcp. You can also run codex mcp add with --url and sign in with codex mcp login.

Method

  1. Add the block to ~/.codex/config.toml, or .codex/config.toml in a project.

    Codex CLI config for Google Maps Business Lead Finder with Email & Social Links~/.codex/config.toml

    Actor on Apify
    [mcp_servers.google-maps-business-lead-finder-with-email]
    url = "https://mcp.apify.com/?tools=fetch-actor-details,vexaloom-labs/google-maps-business-lead-finder-with-email"
    bearer_token_env_var = "APIFY_TOKEN"

  2. Export APIFY_TOKEN in the shell that starts Codex. Or skip the token line and run codex mcp login to sign in.

  3. Start codex and type /mcp to check that the tools are listed.

The example uses Google Maps Business Lead Finder with Email & Social Links. Every Actor page and every website page below has the same config, pre-filled.

Apify plugin or a scoped URL?

Apify recommends its own plugin for Codex CLI: one install adds the whole Apify MCP server and five Agent Skills, with a sign-in in your browser. The config above is the other route: a URL scoped to the Actors you pick, so Codex CLI sees only their tools, which keeps the tool list short and the context small. Use the plugin to explore Apify; use a scoped URL when the agent should do one job with known Actors.

  1. In the Codex CLI, run /plugins and open the Add Marketplace tab.
  2. Enter the repository below, open the Apify Plugin tab, select Apify and Install plugin. Codex opens the Apify sign-in the first time a tool needs it.
apify/apify-codex-plugin

From Apify's plugin documentation and Apify's Codex CLI guide, checked 2026-11-12. With the Apify CLI, apify mcp install cursor (or another client name) writes the MCP config for you.

Good to know

  • Project-level settings can live in .codex/config.toml.
  • bearer_token_env_var names the variable; the token itself never goes into the file.
  • Skills for Codex go in ~/.agents/skills or .agents/skills in a project; every Actor page has a SKILL.md.

Codex CLI configs by website

Each page opens on the Codex CLI tab.

When Codex CLI does not connect

Why does the client say Unauthorized or invalid token?

Every Apify Actor tool needs a signed-in Apify account. Reconnect the server so the OAuth sign-in runs again, or switch to the token variant: an Authorization: Bearer header with an API token from Apify Console, Settings, API and integrations. For a local server the token must be in the server's own env block, not only in your shell.

Source: Apify MCP server README

Why did my agent's tool list change after an update?

Without a tools parameter Apify's server loads its default tool set, which changes between releases. The URLs on this site pin the tools with ?tools=, so the agent always gets the same Actor tool plus fetch-actor-details. Apify's README gives the same advice for production.

Source: Apify MCP server README

What happens when the agent sends input the Actor rejects?

The server answers with the Actor's input schema, so the agent can fix the arguments and call again. The fetch-actor-details tool in every scoped URL lets it read that schema before the first call.

Source: Apify MCP server README

Codex gives up on a long Actor run. Why?

Codex waits 60 seconds for a tool call by default. Raise tool_timeout_sec in the server's [mcp_servers.<name>] table, or keep test runs small.

Source: Codex MCP documentation

My old config uses mcp.apify.com/sse and stopped working. Why?

Apify retired the SSE transport on 1 April 2026. Use https://mcp.apify.com with the streamable HTTP transport, as every config on this site does.

Source: Apify changelog: MCP improvements

Questions

Does Codex support OAuth for Apify?

Yes. Add the server with its URL and run codex mcp login with the server name instead of setting a token variable.