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.
無需輸入參數。

io.github.trakkr-aisearch由 GitHub 帳號 trakkr-aisearch 發布v0.1.7更新於 Nov 1, 2026
OpenAI Ads MCP for ChatGPT Ads campaigns, creatives, audiences, insights, and conversions.
針對 OpenAI Ads(ChatGPT 廣告)的 MCP 伺服器,讓助理檢視廣告帳戶、讀取投放數據,並建立暫停狀態的廣告活動、素材、受眾與轉換。
Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。
把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。
閱讀 https://sourceweft.com/mcp/io.github.trakkr-aisearch%2Fopenai-ads-mcp/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。把它新增到你客戶端的 mcpServers 設定中。
{
"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.
來源:README.md,提交 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.
無需輸入參數。
List campaigns in the authenticated ad account with cursor pagination.
afterlimitorderbeforeGet one campaign by id.
campaign_id必填List ad groups for a campaign.
afterlimitorderbeforecampaign_id必填Get one ad group by id.
ad_group_id必填List ads in an ad group.
afterlimitorderbeforead_group_id必填Get one ad by id, including review_status and creative metadata.
ad_id必填Get performance insights for account, campaign, ad group, or ad scope. Supports fields, filters, sort, product/country/device segments, time ranges, and cursor pagination.
sortafterlimitscope必填beforefieldsfiltersincludessegmentsentity_idtime_rangeresponse_format另有 3 個List custom audiences for the authenticated ad account.
afterlimitorderbeforeGet one custom audience by id.
audience_id必填Search geo targets for targeting.locations.include and return ids usable in campaign targeting.
query必填Manage conversion pixels, API keys, event settings, and conversion reporting.
nameafterlimitorderaction必填beforeentity_idsevent_typesource_idsclient_typetime_rangesaggregation_level另有 2 個Draft deterministic context_hints for an ad group from product, audience, intent, and keywords.
intentproduct必填audiencekeywords已滿足適用檢查項的 100%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
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