OpenAI Ads MCP
Provides tools for interacting with OpenAI's ChatGPT Ads platform, enabling reading of campaigns, ad groups, and ads, pulling insights, drafting optimization plans, and applying approval-gated live mutations.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@OpenAI Ads MCPlist my campaigns"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
OpenAI Ads MCP
A Model Context Protocol server for OpenAI's ChatGPT Ads platform — read campaigns/ad groups/ads, pull insights, draft optimization plans, and apply approval-gated live mutations. Built for use from Claude, OpenClaw, Hermes, or any MCP-compatible agent.
You need OpenAI Ads API access to actually run this against live data.
The server talks to https://api.ads.openai.com/v1 with a Bearer key. As of
mid-2026, OpenAI's ChatGPT Ads is an invite/beta program — there is no
public self-serve Ads API, only a web Ads Manager and a measurement
pixel/Conversions API. Without a key for that endpoint, the network-backed
tools fail fast with a Missing OPENAI_ADS_<ACCOUNT>_API_KEY error before
making any network call.
So treat this repo as a reference / template MCP: a working blueprint for wrapping OpenAI Ads as an agent tool, ready to use the moment you have API access. The draft/report/validation tools that don't hit the network work standalone, and the test suite runs fully offline against a mocked client.
Safety model
API keys come from environment variables only — never hardcoded, never in source. A key pasted into a chat or log should be considered compromised; rotate it.
Read / report / draft tools are available by default and are non-destructive.
Live mutations are double-gated. A write executes only when both are true:
OPENAI_ADS_ENABLE_WRITES=1, anda matching approval artifact exists at
tasks/openai-ads/approvals/<id>.jsoninside this repo (shape below) whose declared budget/countries/destructiveness bound the operation.
Every mutation is audit-logged to
tasks/openai-ads/audit.jsonl(gitignored).
Approval/audit paths resolve relative to this package's directory by default;
override with OPENAI_ADS_REPO_ROOT, OPENAI_ADS_APPROVAL_DIR, or
OPENAI_ADS_AUDIT_LOG.
Related MCP server: facebook-business-mcp
Quick start
Requires Bun (curl -fsSL https://bun.sh/install | bash).
git clone https://github.com/adityash8/openai-ads-mcp.git
cd openai-ads-mcp
bun installClaude Code — one command, done:
claude mcp add openai-ads -e OPENAI_ADS_PRIMARY_API_KEY=YOUR_KEY -- bun "$PWD/index.ts"Claude Desktop / other MCP clients — add to your config
(.mcp.json, claude_desktop_config.json, etc.):
{
"mcpServers": {
"openai-ads": {
"command": "bun",
"args": ["/absolute/path/to/openai-ads-mcp/index.ts"],
"env": {
"OPENAI_ADS_PRIMARY_API_KEY": "YOUR_KEY"
}
}
}
}That's it — one env var. No key yet? Skip it: the server starts fine and the four offline tools work; only network-backed tools need the key.
Configuration details
Multiple ad accounts: each account is an uppercase account key; its key is read from
OPENAI_ADS_<ACCOUNT_KEY>_API_KEY(e.g. addOPENAI_ADS_BRANDX_API_KEYand passaccount_key: "BRANDX"in tool calls). The default account key isPRIMARY; change it withOPENAI_ADS_DEFAULT_ACCOUNT.Writes are off by default. Set
OPENAI_ADS_ENABLE_WRITES=1and supply an approval artifact (below) to enable mutations.Pass env vars through your MCP client config (the
envblock /-eflag), as shown above. A local.envworks too, but only when running under Bun from this directory —node dist/index.jsand MCP clients launched from other working directories won't read it.Prefer a Node runtime?
bun run buildonce, then point your client atnode /absolute/path/to/openai-ads-mcp/dist/index.js(Node 18+). Bun is still required for build/test — plain Node can't run the TypeScript source.
Tools
Tool | Network | Purpose |
| ✓ | Fetch the resolved ad account |
| ✓ | List campaigns |
| ✓ | List ad groups |
| ✓ | List ads |
| ✓ | Account / campaign / ad-group / ad insights |
| ✓ | Summarize insights into an optimization read |
| ✓ | Upload a creative image |
| — | Build a campaign→ad-group→ads operation set (no writes) |
| — | Draft an ad-update operation (no writes) |
| — | Validate a conversion event against the supported schema |
| ✓ | Execute an approved, gated set of mutations |
Approval artifact shape
operations must contain at least one entry. Valid operation types:
create_campaign, update_campaign, campaign_state, create_ad_group,
update_ad_group, ad_group_state, create_ad, update_ad, ad_state.
State operations take { "id": "...", "action": "activate" | "pause" | "archive" }.
{
"id": "example-approval",
"account_key": "PRIMARY",
"approved_by": "you",
"approved_at": "2026-06-02T00:00:00.000Z",
"max_budget_micros": 10000000,
"approved_countries": ["US"],
"allow_destructive": false,
"operations": [
{ "type": "ad_state", "id": "ad_123", "action": "pause" }
]
}Conversion event shape
openai_ads_validate_conversion_event expects:
{
"type": "order_created",
"timestamp_ms": 1764547200000,
"data": {}
}type must be one of: appointment_scheduled, checkout_started,
contents_viewed, custom, items_added, lead_created, order_created,
page_viewed, registration_completed, subscription_created,
trial_started. id, timestamp_ms, and metadata are optional.
Develop
bun test # offline — uses a mocked Ads client
bun run build # bundle index.ts -> dist/ (Node target)Live read-only probe
After setting a real key, verify connectivity without changing anything:
bun run probe:live -- --account PRIMARYChecks the ad account, campaign listing, and account insights. For insights,
time_granularity is none or daily (all / day are accepted aliases and
normalized). Metric arrays encode as fields[]=impressions&fields[]=clicks.
License
MIT © 2026 Aditya Sheth. See LICENSE.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/adityash8/openai-ads-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server