首页 AI Codex config.toml for the Google Ads MCP Server (2026): stdio Setup, Read-Only Tools, Approval Modes and Remote OAuth

Codex config.toml for the Google Ads MCP Server (2026): stdio Setup, Read-Only Tools, Approval Modes and Remote OAuth

Configure Codex for Google’s Google Ads MCP server: codex mcp add, config.toml env, enabled_tools, approval modes, read-only tools_config and OAuth.

Last updated: 16 November 2026. Google Ads API (v26.2), Anthropic and OpenAI documentation checked that day.

Codex can talk to Google’s open-source Google Ads MCP server in two ways: as a local stdio process, or as a shared Streamable HTTP service your team deploys (for example on Cloud Run). This guide is the configuration reference we use, with the guardrails turned on.

Add the server

# Codex CLI: add the Google Ads MCP server as a local stdio server
codex mcp add google-ads \
  --env GOOGLE_CLOUD_PROJECT=my-gcp-project \
  --env GOOGLE_ADS_LOGIN_CUSTOMER_ID=1234567890 \
  -- pipx run --spec google-ads-mcp==0.0.6 google-ads-mcp
# or, if your team runs it as a shared Streamable HTTP service:
codex mcp add google_ads --url http://localhost:8080/mcp
codex mcp login google_ads
codex mcp list

The codex mcp add … -- command form and the --url + codex mcp login form both come from the official docs (Codex MCP, google-ads-mcp README). Locally, generate ADC with the adwords scope first:

# 1) Google Cloud project: enable the Google Ads API (grants Test access),
#    then apply for Explorer access on the "Google Ads API Overview" page.
# 2) Local ADC with the adwords scope (OAuth client JSON from the same project)
gcloud auth application-default login \
  --scopes https://www.googleapis.com/auth/adwords,https://www.googleapis.com/auth/cloud-platform \
  --client-id-file=client_secret.json

The full config.toml

# ~/.codex/config.toml (or a trusted project's .codex/config.toml)
[mcp_servers.google-ads]
command = "pipx"
args = ["run", "--spec", "google-ads-mcp==0.0.6", "google-ads-mcp"]
startup_timeout_sec = 60
enabled_tools = [
  "customers_list_accessible_customers",
  "search_search",
  "metadata_get_resource_metadata",
  "assets_create_asset",
]
disabled_tools = ["assets_upload_video_asset", "labels_manage_labels",
                  "labels_manage_label_associations"]
default_tools_approval_mode = "prompt"

[mcp_servers.google-ads.env]
GOOGLE_CLOUD_PROJECT = "my-gcp-project"
GOOGLE_ADS_LOGIN_CUSTOMER_ID = "1234567890"
GOOGLE_ADS_MCP_TOOLS_CONFIG = "/etc/pandawm/tools_config.readonly.yaml"

[mcp_servers.google-ads.tools.search_search]
approval_mode = "approve"          # read tool: no prompt
SettingWhereEffect
command / args[mcp_servers.google-ads]Starts the server via pipx (stdio)
env table[mcp_servers.google-ads.env]GOOGLE_CLOUD_PROJECT, login customer, tools config path
enabled_toolsserver tableAllow list of tools Codex can see
disabled_toolsserver tableDeny list, applied after enabled_tools
default_tools_approval_modeserver tableprompt / approve / … for all tools
tools..approval_modeper-tool tableOverride, e.g. approve for read tools
startup_timeout_secserver tablepipx cold start can exceed the 10 s default
Codex config.toml settings for the Google Ads MCP server

Tool names are namespaced since v0.0.6 (search_search, assets_create_asset and so on), so update allowlists you copied from older examples (Google’s guide).

Make it read-only on the server too

Client config lives on a laptop and can be edited. The stronger lock is the server’s tools_config.yaml: set labels and assets to false and those tools are never registered.

# tools_config.yaml - strictly read-only deployment
# (point GOOGLE_ADS_MCP_TOOLS_CONFIG at this file)
namespaces:
  customers: true
  search: true
  metadata: true
  labels: false
  assets: false
ControlCodex sideServer side
Hide write toolsdisabled_toolstools_config.yaml: labels/assets false
Ask before writesapproval_mode = “prompt”Propose & confirm (validate_only + checksum)
Limit accountsAGENTS.md allowlistCredentials only for authorised accounts
Production access—Cloud project access level (Explorer+)
Codex-side versus server-side controls for Google Ads MCP

Remote server: what Codex needs

For a remote deployment, Google’s README notes that Codex only needs the MCP endpoint and its own OAuth authorisation; it does not need the server’s OAuth client secret or signing and storage keys. The Cloud Run setup itself is covered in Connect Claude.ai to Google Ads with a remote MCP server on Cloud Run.

Using it

  • Interactive: codex, then ask “list accessible customers, then show yesterday’s cost by campaign for 1234567890”.
  • Non-interactive: codex exec runs in a read-only sandbox by default, good for scheduled summaries (
  • codex exec
  • ).
  • Rules: put account allowlists, PAUSED-only and micros conventions in AGENTS.md so every run follows them.
# AGENTS.md (repo root) - rules Codex reads before every task
## Google Ads automation rules
- Only touch customer IDs listed in accounts.allowlist (our own / client-authorised).
- Credentials come from ADC or a secret manager. Never print, log, commit or paste
  client secrets or refresh tokens. No developer token is needed (sunset 2026-09-09).
- Every new campaign is created with status=PAUSED. Never enable campaigns or raise
  budgets; output a change list for a human instead.
- Money fields are micros (1 unit = 1,000,000). Budget change > 20% needs a human.
- Run every mutate with validate_only=True first; commit only with --commit.
- Stay within our access level quota (Explorer: 2,880 ops/day on production).
- Ad text must follow Google Ads policies; flag health, finance, gambling,
  employment, housing and political content for human review.
- Run `pytest -q` before proposing changes.

Common errors

  • Server does not start in time: raise startup_timeout_sec, or install once with pipx install google-ads-mcp and use google-ads-mcp as the command.
  • CLOUD_PROJECT_NOT_APPROVED_FOR_PRODUCTION: your project has Test access; apply for Explorer in the Google Ads API Overview page (
  • developer token sunset
  • ).
  • Permission denied on a client account: set GOOGLE_ADS_LOGIN_CUSTOMER_ID to the manager account (10 digits, no hyphens) or pass login_customer_id per call.

How PandaWM uses Claude, Codex and Google Ads accounts to speed up client ad delivery

This guide focuses on Codex, but in day-to-day client work PandaWM combines Claude, Codex and Google Ads accounts to help companies going global move faster through the repetitive loop of account and conversion setup → campaign builds → ad copy and assets → reports and search terms → budget and negative-keyword changes, so media buyers spend their time on strategy, bidding judgement and creative.

  • Ad accounts: the client’s own Google Ads account, or one opened compliantly through PandaWM’s account-opening service. The account belongs to the client and is never rented or shared; multi-account access goes through the client’s own manager account.
  • Claude: natural-language reporting (GAQL) through Google’s open-source Google Ads MCP server, impression-share and search-term diagnosis, RSA headline/description and asset drafts, and asset or label creation in propose-and-confirm mode.
  • Codex: writing and maintaining google-ads Python scripts (daily reports, search-term clean-up, paused campaign builds, validate_only pre-checks) that run in a sandbox, on a schedule or in CI.
  • Human sign-off: a media buyer approves enabling campaigns, budget increases and bid-strategy changes, and a person makes the final call on Google Ads policy and landing-page compliance.

This describes a service capability only. There are no prices or rebates here, and PandaWM is not an official partner of Google, Anthropic or OpenAI. See Google Ads account opening & management (PandaWM service page) for account opening and management.

FAQ

Can Codex change budgets through this server?

No. The server cannot change campaigns, budgets or bids; use reviewed API scripts for that (Codex + Google Ads API Python campaign pipeline).

Should I use approve or prompt for asset creation?

Prompt. The server’s propose step already shows change_items, and a human should confirm the commit.

Do I need a developer token in config.toml?

No. Developer tokens were sunset on 9 September 2026.

Is this server hosted by Google?

No. It is Google’s open-source project that you run yourself, locally or on your own Cloud Run.

Compliance note: Use every workflow in this guide only on Google Ads accounts (including client accounts under a manager account) that your company owns or is formally authorised to manage, through Google’s official Google Ads API, Google’s open-source Google Ads MCP server or official tools such as Google Ads Editor. Follow the Google Ads API Terms and Conditions, API quotas and Google Ads policies, and keep a human review step before anything that can spend money. PandaWM does not sell, rent, share or transfer ad accounts, manager accounts or API credentials, does not help anyone bypass ad review, regional restrictions, identity verification or payment controls, and is not an official partner of Google, Anthropic or OpenAI. Claude and OpenAI services are only offered in their supported countries and regions; the account holder should be an entity legitimately established and operating in a supported region.

Related guides

Talk to PandaWM: Google Ads accounts + AI-assisted delivery

Tell us where your company is registered, your industry, target countries, landing page and expected monthly budget, and which part you want to automate first (reporting, search terms, assets or campaign builds). We pre-check eligibility and landing pages, help you open your own Google Ads account compliantly, and wire Claude / Codex into your workflow.

WhatsApp: +852 5904 8602Telegram: @PANDA0134WeChat: szcwh99

PandaWM WeChat QR code szcwh99

Official sources

All official pages checked on 2026-11-16. API versions, tool names and permission requirements change; the official pages prevail.

本文来自网络,不代表熊猫出海立场。转载请注明出处: https://www.pandawm.com/blog/codex-google-ads-mcp-config-toml-read-only-guardrails-en.html
上一篇
下一篇

作者: 熊猫出海编辑团队

熊猫出海(PandaWM)编辑团队,来自香港出海服务商熊猫出海,专注 Facebook、TikTok、Google 等海外广告开户与代投,以及 GEO/AI 搜索优化、多语言独立站建设。有Facebook白名单牌照户、TikTok加白户、Google G2认证户等核心资源 。

为您推荐

发表回复

联系我们

联系我们

工作时间:周一至周五,9:00-17:30,节假日休息

关注微信
微信扫一扫关注我们

微信扫一扫关注我们

关注微博
返回顶部