get_account
Get the authenticated OpenAI Ads account. Use this first to verify that OPENAI_ADS_API_KEY works and to read account id, name, timezone, currency, and settings.
Takes no parameters.

io.github.trakkr-aisearchPublished by GitHub account trakkr-aisearchv0.1.7Updated Nov 1, 2026
OpenAI Ads MCP for ChatGPT Ads campaigns, creatives, audiences, insights, and conversions.
MCP server for OpenAI Ads (ChatGPT Ads) that lets an assistant inspect ad accounts, read insights, and build paused campaigns, creatives, audiences and…
Web executable via Streamable HTTP. Remote servers run from the web runtime once configured in a workspace.
Paste this prompt into Claude Code, Codex, Cursor or another agent — or into SourceWeft chat. The agent reads this server's install guide, shows you its publisher, endpoint and sign-in, and adds it to your client once you agree. Keys never go into a command.
Read https://sourceweft.com/mcp/io.github.trakkr-aisearch%2Fopenai-ads-mcp/install.md and connect the MCP server it describes to my client. Before changing any config, show me its publisher, endpoint and sign-in method and wait for my OK. Never put an API key in a command or in a file I would commit; ask me where it should come from.Add this to your client's mcpServers config.
{
"mcpServers": {
"openai-ads": {
"type": "http",
"url": "https://openai-ads-mcp.trakkr.ai/mcp"
}
}
}Trakkr tracks the full AI-visibility funnel, organic and paid. This is the open-source paid-side companion.
openai-ads-mcp is a typed Model Context Protocol server for OpenAI Ads, ChatGPT Ads, and OpenAI's Advertiser API. It lets Claude, Cursor, Codex, VS Code, and other MCP clients inspect Ads accounts, read performance insights, build paused campaigns, upload creatives, manage audiences, and send conversion events.
People often search for this as a ChatGPT Ads MCP because the ads appear in ChatGPT. The package keeps the OpenAI Ads MCP name because ChatGPT Ads are managed through OpenAI Ads, Ads Manager, and the OpenAI Advertiser API.
Current public release: 0.1.7.
It ships in two runtimes with the same tool names, arguments, defaults, safety model, and vendored OpenAPI reference:
The goal is simple: make OpenAI Ads workable from an AI assistant without making spend easy to trigger by accident.
Python with uvx:
Python with pip:
Node with npx:
Node with npm:
For local development from this monorepo:
Create an Ads API key in OpenAI Ads Manager, then pass it as an environment variable.
Recommended first connection:
Or with Node:
Readonly mode hides every write tool. They are absent from tools/list and cannot be called. Once you have confirmed the account and inspected data, unset OPENAI_ADS_MCP_READONLY to enable writes.
Optional environment variables:
This repo includes server.json for the official MCP Registry and downstream MCP directories. The canonical registry name is:
The Node package includes the matching mcpName, and the Python package README includes the matching mcp-name marker for PyPI ownership verification.
The registry metadata also advertises the hosted read-only Streamable HTTP endpoint:
That hosted endpoint is for discovery and read-only usage. It does not store or use a Trakkr-owned OpenAI Ads API key.
The hosted endpoint allows anonymous initialize and tools/list; Ads API tool calls require the caller to send X-OpenAI-Ads-API-Key.
Use "command": "npx" and "args": ["-y", "openai-ads-mcp"] for the Node runtime.
Registry-compatible clients should discover this server by name:
The registry metadata lists npm, PyPI, and the hosted Streamable HTTP endpoint. The hosted endpoint does not require an API key for discovery, but it does require X-OpenAI-Ads-API-Key for Ads API tool calls.
The repository includes production Dockerfiles for hosted Streamable HTTP deployments:
The narrower typescript/Dockerfile is used by the Cloud Run deploy script. For local stdio use, prefer uvx openai-ads-mcp or npx -y openai-ads-mcp.
The Node runtime can also serve MCP over Streamable HTTP for hosted or team deployments:
Defaults:
http://127.0.0.1:8080/mcp locally, or https://your-host/mcp behind a proxy.GET /healthz, GET /health, and GET /ready.OPENAI_ADS_MCP_READONLY=1 unless OPENAI_ADS_MCP_HTTP_ALLOW_WRITES=1 is set.OPENAI_ADS_MCP_HTTP_TOKEN protects the MCP endpoint with Authorization: Bearer <token>.X-OpenAI-Ads-API-Key per request, or the server can use a server-side OPENAI_ADS_API_KEY.Useful hosted env vars:
For public hosted endpoints, keep writes disabled and require users to bring their own Ads API key per request. Do not put a shared Ads API key in browser-visible config.
For a public discovery endpoint, use:
Hosted public mode:
OPENAI_ADS_MCP_HTTP_ALLOW_WRITES=1OPENAI_ADS_API_KEY is presentX-OpenAI-Ads-API-Base-Urltools/listX-OpenAI-Ads-API-Key for Ads API tool callsThe production runbook is in HOSTED_DEPLOY.md.
The Python and Node runtimes expose the same 27 tools.
get_insights accepts the current tagged time-range shape, for example:
The older nested shape is normalized for backward compatibility.
For conversion optimization, pass bidding_type="conversions" and exactly one
conversion_event_setting_ids value to create_campaign. The campaign cannot
use product-feed mode, and child ad groups must bill by click. build_campaign
offers the same path through its singular conversion_event_setting_id helper
argument. The bid is a CPA input even though OpenAI bills the child ad group per
click.
OpenAI's Bulk API remains a limited preview and is not exposed as a general MCP tool. Product-feed campaign objects are supported, but feed connection and catalog upload still happen in Ads Manager or through OpenAI's supported SFTP flow.
This server can affect real ad spend, so the defaults are deliberately cautious.
build_campaign creates every object paused.set_campaign_state, set_ad_group_state, and set_ad_state.OPENAI_ADS_BUDGET_CEILING_USD, default 100.confirm_budget=True.OPENAI_ADS_MCP_READONLY=1 hides every write tool entirely.validate_only=true to validate a conversion batch without ingesting it.MCP annotations are set on every tool. Read tools use readOnlyHint. Write tools use readOnlyHint=false. Activation and budget-changing tools are marked destructive and open-world so hosts can prompt before running them.
First, connect safely:
Ask your assistant:
Then restart without readonly mode and build a paused campaign:
Review the returned campaign, ad group, ads, budget, targeting, and review status. When you are ready to go live, activate each layer explicitly:
Paid placements answer: where did you buy attention?
Trakkr answers: where does your brand show up organically across ChatGPT, Perplexity, Gemini, Claude, Google AI Overviews, Reddit, citations, rankings, competitors, sentiment, prompts, reports, and actions?
Track the organic side at trakkr.ai. Use the Trakkr generator at trakkr.ai/create when you want to turn AI-search gaps into content briefs.
This MCP also exposes one optional resource:
It returns a short paste-ready briefing that connects buying ChatGPT ad placements with tracking organic ChatGPT visibility. It is never injected into tool results.
Python:
Node:
OpenAPI drift check:
The scheduled workflow runs both checks weekly. The OpenAPI comparison catches
schema drift. The guide check covers current behavior documented outside the
downloadable schema, including tagged insight ranges, obref, mobile app
events, conversion optimization, advertiser readiness, required chat-card
images, and the limited-preview Bulk API.
0.1.7 is the current public beta release for npm, PyPI, the hosted endpoint, and the live MCP Registry entry. Registry metadata versions are immutable, so registry-only corrections in this repo should ship with the next package release version. Release work is synced to the dedicated public repository before publishing. See RELEASING.md.
MIT, copyright Trakkr.
Source: README.md at commit 4c18f69
Get the authenticated OpenAI Ads account. Use this first to verify that OPENAI_ADS_API_KEY works and to read account id, name, timezone, currency, and settings.
Takes no parameters.
List campaigns in the authenticated ad account with cursor pagination.
afterlimitorderbeforeGet one campaign by id.
campaign_idrequiredList ad groups for a campaign.
afterlimitorderbeforecampaign_idrequiredGet one ad group by id.
ad_group_idrequiredList ads in an ad group.
afterlimitorderbeforead_group_idrequiredGet one ad by id, including review_status and creative metadata.
ad_idrequiredGet performance insights for account, campaign, ad group, or ad scope. Supports fields, filters, sort, product/country/device segments, time ranges, and cursor pagination.
sortafterlimitscoperequiredbeforefieldsfiltersincludessegmentsentity_idtime_rangeresponse_format+3 moreList custom audiences for the authenticated ad account.
afterlimitorderbeforeGet one custom audience by id.
audience_idrequiredSearch geo targets for targeting.locations.include and return ids usable in campaign targeting.
queryrequiredManage conversion pixels, API keys, event settings, and conversion reporting.
nameafterlimitorderactionrequiredbeforeentity_idsevent_typesource_idsclient_typetime_rangesaggregation_level+2 moreDraft deterministic context_hints for an ad group from product, audience, intent, and keywords.
intentproductrequiredaudiencekeywords100% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
export OPENAI_ADS_API_KEY="..."export OPENAI_ADS_MCP_READONLY=1uvx openai-ads-mcppython -m pip install openai-ads-mcpexport OPENAI_ADS_API_KEY="..."export OPENAI_ADS_MCP_READONLY=1openai-ads-mcpexport OPENAI_ADS_API_KEY="..."export OPENAI_ADS_MCP_READONLY=1npx -y openai-ads-mcpnpm install -g openai-ads-mcpexport OPENAI_ADS_API_KEY="..."export OPENAI_ADS_MCP_READONLY=1openai-ads-mcpcd services/openai-ads-mcp/pythonpython -m pip install -e .python -m openai_ads_mcp
cd ../typescriptnpm installnpm run buildnode dist/index.jsexport OPENAI_ADS_API_KEY="..."export OPENAI_ADS_MCP_READONLY=1uvx openai-ads-mcpexport OPENAI_ADS_MCP_READONLY=1npx -y openai-ads-mcpio.github.trakkr-aisearch/openai-ads-mcphttps://openai-ads-mcp.trakkr.ai/mcpclaude mcp add openai-ads \ -e OPENAI_ADS_API_KEY=your_ads_key_here \ -e OPENAI_ADS_MCP_READONLY=1 \ -- uvx openai-ads-mcpclaude mcp add openai-ads \ -e OPENAI_ADS_API_KEY=your_ads_key_here \ -e OPENAI_ADS_MCP_READONLY=1 \ -- npx -y openai-ads-mcp{ "mcpServers": { "openai-ads": { "command": "uvx", "args": ["openai-ads-mcp"], "env": { "OPENAI_ADS_API_KEY": "your_ads_key_here", "OPENAI_ADS_MCP_READONLY": "1" } } }}[mcp_servers.openai_ads]command = "uvx"args = ["openai-ads-mcp"]env = { OPENAI_ADS_API_KEY = "your_ads_key_here", OPENAI_ADS_MCP_READONLY = "1" }io.github.trakkr-aisearch/openai-ads-mcpdocker build -t openai-ads-mcp .docker run --rm -p 8080:8080 \ -e OPENAI_ADS_MCP_HOSTED_PUBLIC=1 \ -e OPENAI_ADS_MCP_TELEMETRY_SALT="local-test-salt" \ openai-ads-mcpexport OPENAI_ADS_MCP_HTTP_TOKEN="choose_a_long_random_token"export OPENAI_ADS_MCP_READONLY=1npx -y openai-ads-mcp --httpexport OPENAI_ADS_MCP_HOSTED_PUBLIC=1export OPENAI_ADS_MCP_TELEMETRY_SALT="long_random_value"npx -y openai-ads-mcp --http{"type":"unix_range","start":1764547200,"end":1765152000}export OPENAI_ADS_API_KEY="..."export OPENAI_ADS_MCP_READONLY=1uvx openai-ads-mcpCall get_account and list_campaigns. Confirm the Ads key works and show me what already exists.Use draft_context_hints for "AI visibility monitoring software" aimed at growth teams with comparison intent.
Then call build_campaign with:- name: "AI visibility category test"- budget_usd: 50- ad_group: name "Growth teams", billing_event "click", max_bid_usd 1.25, context_hints from the draft- ads: two chat_card variants using my uploaded file_id
Do not activate anything.Call set_campaign_state with state="activate".Call set_ad_group_state with state="activate".Call set_ad_state for the approved ad with state="activate".openai-ads://trakkr-visibilitycd services/openai-ads-mcp/pythonpython -m pytest -qpython -c "import openai_ads_mcp; print('ok')"cd services/openai-ads-mcp/typescriptnpm installnpm run buildnpm testOPENAI_ADS_MCP_READONLY=1 node dist/index.jscd services/openai-ads-mcp/typescriptnpm run check:openapinpm run check:docs