Guides3 min read

How to Connect OpenAI Codex to Google Ads (MCP Setup)

Connect the Codex CLI to your Google Ads account through the VibeAds MCP server: a few lines in config.toml and an API key kept in an environment variable. Read performance, find wasted spend and draft campaigns from the terminal.

CN
Chiran Nawalage · @chiran
·

Codex, OpenAI's coding agent, can call MCP servers as tools. Add VibeAds and Codex can read your Google Ads performance, list the search terms wasting money, and draft campaigns, from the same terminal where you keep your scripts and notes. If you use ChatGPT in the browser instead, the ChatGPT guide is quicker: it signs in without a key.

What do I need?

  • The Codex CLI, installed and signed in.
  • A VibeAds account with Google Ads connected in Settings. Reading works on every plan; drafting and publishing need Pro ($20 a month) or Max.
  • A VibeAds API key from Settings, MCP Server Keys, starting with vba_mcp_.

How do I add VibeAds to Codex?

Put the key in an environment variable, for example in your shell profile:

export VIBEADS_API_KEY=vba_mcp_YOUR_KEY_HERE

Then add the hosted server to ~/.codex/config.toml:

[mcp_servers.vibeads]
url = "https://getvibeads.com/api/mcp"
bearer_token_env_var = "VIBEADS_API_KEY"

Codex sends the key as a bearer token, which VibeAds accepts, and the key never sits in the config file. Run codex mcp list to check it, or /mcp inside Codex, then ask: "Show me my Google Ads campaigns in VibeAds."

Prefer to run the npm package locally? This works too:

codex mcp add vibeads --env VIBEADS_API_KEY=vba_mcp_YOUR_KEY_HERE -- npx -y @vibeads/mcp

What can I ask Codex?

  • "Write this week's numbers for each campaign to a CSV and tell me what moved."
  • "Which keywords and search terms cost the most without converting?"
  • "List the optimizer's recommendations with what each would change."
  • "Draft a campaign for a pest control company in Atlanta at $40 a day." (a draft that spends nothing)

Can Codex publish campaigns or raise budgets?

Not by itself. With an API key, publishing always returns an approval link, and so does raising a daily budget, or a bid past double or $50 a click: you approve them in your browser, signed in to VibeAds. Other changes go through VibeAds' safety checks, at up to 60 calls an hour per key. The key never sees your Google login, and you can revoke it any time.

Troubleshooting

  • The server won't start. Check echo $VIBEADS_API_KEY prints your key in the shell that runs Codex.
  • "Missing VibeAds API key". The key must start with vba_mcp_.
  • No live numbers. Connect Google Ads in VibeAds Settings.

The full tool list and limits are in the MCP server docs.

Skip the research

Get your custom Google Ads plan in 5 minutes.

Answer 4 questions about your business and we'll show you exactly what an AI-built campaign looks like for your category, your budget, and your situation, before you spend a dollar on ads.

Build my plan

Free. No credit card. Takes about 5 minutes.

CN

Founder & CEO of VibeAds

Built VibeAds to replace $1,500/mo marketing agencies with a $20/mo AI tool for plumbers, HVAC companies, electricians, dentists, roofers, and 30+ local service categories. Passionate about making Google Ads accessible to every small business owner.

Author page →

Related Articles

#codex#openai#mcp#google-ads-automation#integrations