Skip to content

Connect an agent

Connect Codex.

Give Codex access to your connected advertising accounts through a remote MCP server.

On this page

Before you begin

Use a current Codex CLI or IDE extension, or Codex in the desktop app, on the host where you want the connection. Local clients on that host share MCP configuration. A remote host needs its own setup; this guide does not configure Codex cloud or a hosted ChatGPT chat.

You need access to Codex, an Ad Superpowers account with an active trial or subscription, and a platform connected in the intended workspace. Create your account or complete the quickstart first. Managed devices may restrict which MCP servers you can add.

1. Add the server

In a terminal on the same host as Codex, run:

codex mcp add ad-superpowers --url https://mcp.adsuperpowers.ai/v1

This adds a Streamable HTTP connection. If sign-in does not open automatically, run:

codex mcp login ad-superpowers

Sign in to Ad Superpowers in the browser. Review the workspace and requested access before approving. This authorizes the assistant connection; advertising platforms are connected separately in Integrations.

2. Check the configuration

The default user configuration is ~/.codex/config.toml. The server entry is:

[mcp_servers.ad-superpowers]
url = "https://mcp.adsuperpowers.ai/v1"

If you edit the file directly, merge this entry with existing settings, then run the login command above. Project configuration in .codex/config.toml applies only in trusted projects and can override user settings. Do not add a second server entry if the connection already exists.

API-key alternative

For a client setup that uses a key, get one from API Keys for the intended workspace. Make it available as ADSUPERPOWERS_API_KEY in the environment of the process that launches Codex, then use this server entry instead of the OAuth-only entry:

[mcp_servers.ad-superpowers]
url = "https://mcp.adsuperpowers.ai/v1"
bearer_token_env_var = "ADSUPERPOWERS_API_KEY"

The variable's name goes in the file; its secret value does not. Set the value through your host's private environment or secret manager, then restart Codex. A variable exported in a terminal is not automatically available to an already-running desktop or IDE process. Do not paste a key into the conversation.

3. Verify a read result

Start a new Codex conversation. In the CLI, use /mcp to inspect the server, or run codex mcp list in the terminal. Then ask:

Use Ad Superpowers skill(action="connection_health") to check my
platform connections. Then list the advertising accounts I can access.
Do not change anything.

A healthy connection is only the first check. Confirm the expected account name and ID, then ask:

For [account name and ID], show campaign spend and conversions
for the last 7 days. Include the date range and currency.
Do not change any campaigns.

Confirm the account, dates and currency against the advertising platform. An empty result is not proof of successful reporting unless the account and period are correct.

If it does not connect

What you seeNext check
Server missingCheck the host and active user/project configuration; restart Codex.
Sign-in required or expiredRun codex mcp login ad-superpowers, complete authorization, then start a new conversation.
API-key authentication failsCheck that the launching process receives the named variable and that the key is valid in the intended workspace.
Tools unavailable on a managed deviceAsk your administrator whether this MCP server and its tools are allowed.
Connected, but an account is missingCheck the workspace and platform connection in Integrations, then repeat the read check.

Switching workspaces in the dashboard alone does not move an existing assistant connection. Reauthorize for the intended workspace or configure its key. For further help, use troubleshooting.

Next steps

Follow the example prompts. Client configuration was checked against OpenAI's MCP documentation and Codex's CLI implementation on 18 September 2026. This guide does not promise a fixed login lifetime; reconnect if the client requests it.

Cookies on this site

We use analytics cookies to see how the site is used. They load only if you accept, and you can change your choice at any time. Read our privacy policy.