Apple Ads

io.github.Happygallo由 GitHub 账号 Happygallo 发布v1.0.3更新于 Oct 24, 2026

Manage Apple Search Ads campaigns, keywords, budgets, and reports via API v5.

已验证STDIO仅桌面数据与分析商业与电商

概览

AI 生成的概览

面向 Apple Search Ads API v5 的本地 MCP 服务器,让助手用自然语言管理广告活动、关键词、预算和报表。

可以做什么
  • 列出、创建、更新和删除广告活动与广告组,并获取活动与广告组报表
  • 添加、修改和删除定向关键词与否定关键词,调整出价,查看关键词报表
  • 查看搜索词、广告、创意和产品页面,包括广告被拒原因
  • 创建和管理预算订单,分析预算使用情况,生成活动快照
  • 搜索可投放的应用和地理位置,查看地区表现,生成展示份额报表
  • 在多个组织之间切换,并读取内置资源和流程提示
适用场景
适合正在投放 Apple Search Ads、希望让助手查看表现、调整预算和出价、优化关键词与搜索词而无需登录网页后台的用户。已有 Apple Search Ads 凭据的账户管理员或 API 用户最适用。
运行要求
通过 npx(Node.js)以 stdio 在本地运行。需要一个 Apple Search Ads API 用户,并设置四个环境变量:ASA_CLIENT_ID、ASA_TEAM_ID、ASA_KEY_ID 和 ASA_PRIVATE_KEY_PATH(或内联的 ASA_PRIVATE_KEY)。ASA_ORG_ID 可选。需自行生成 PKCS#8 密钥对并把公钥上传到 Apple。
安装前请注意
需要私钥文件路径或内联私钥,该密钥可访问广告账户,务必妥善保管。服务器可创建、更新和删除广告活动、广告组、关键词、广告和预算订单,并修改预算,助手操作可能产生费用或删除线上设置。若只需查看报表,建议使用只读 API 角色。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Apple Ads,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

Apple Ads MCP

[npm version] [MCP compatible] [TypeScript] [License]

MCP server for the Apple Search Ads API v5.
Connect it to any MCP-compatible AI client and manage your campaigns, keywords, budgets, and reporting through natural language.

Quick Start • Tools • Resources • Prompts • Clients


Ask your AI things like:

"How did my campaigns perform last week?" "Pause the brand campaign and increase the budget on discovery to $500." "What search terms are triggering my ads? Add the best ones as exact-match keywords."

Supports 54 tools, 3 resources, and 6 prompts — campaigns, ad groups, keywords, creatives, budgets, search terms, geo targeting, impression share, and performance reports.

Features at a glance

FeatureDescription
Campaign managementCreate, update, pause, and delete campaigns and ad groups
Keyword optimizationAdd/remove targeting and negative keywords, update bids
Performance reportingCampaign, ad group, keyword, ad, and geo reports with date presets
Search term analysisSee actual search queries triggering your ads
Creative managementManage ads, creatives, and product pages
Budget controlCreate and manage budget orders, analyze utilization
Impression shareGenerate and retrieve impression share reports
Multi-org supportSwitch between organizations at runtime

Quick Start

  1. Get your Apple credentials (~10 min, one-time)
  2. Generate your key pair (2 commands)
  3. Add to your MCP client
  4. Start chatting

Setup

Step 1 — Invite an API user

Done by the account admin at searchads.apple.com.

  1. Go to Settings → User Management → Invite User
  2. Enter the email of the person who will use the API
  3. Set the role:
    • API Account Manager — full read/write access
    • API Account Read Only — view-only access
  4. Send the invitation

The API user must be a different Apple ID from the admin. If you're the admin, use a second Apple ID.

Step 2 — Accept and copy your credentials

Done by the invited user.

  1. Accept the email invitation and sign in to searchads.apple.com
  2. Go to Settings → API tab
  3. Copy and save these three values:
    • clientId — starts with SEARCHADS.
    • teamId — starts with SEARCHADS.
    • keyId — a UUID

Step 3 — Generate your key pair

Open Terminal and run:

bash
openssl ecparam -genkey -name prime256v1 -noout -out ~/apple-ads-key.pem && \openssl pkcs8 -topk8 -nocrypt -in ~/apple-ads-key.pem -out ~/apple-ads-key-pkcs8.pem

Then generate the public key:

bash
openssl ec -in ~/apple-ads-key-pkcs8.pem -pubout -out ~/apple-ads-key-public.pem

This creates:

  • ~/apple-ads-key-pkcs8.pem — private key (keep this safe, used in your config)
  • ~/apple-ads-key-public.pem — public key (upload to Apple next)

Step 4 — Upload public key to Apple

Print your public key:

bash
cat ~/apple-ads-key-public.pem

Copy the entire output (including the BEGIN / END lines), then:

  1. Go to Settings → API tab on searchads.apple.com
  2. Paste into the Public Key field
  3. Save

Step 5 — Add to your MCP client

Pick your client below and fill in your clientId, teamId, and keyId from Step 2, and the full path to your private key from Step 3.

Multiple orgs? Omit ASA_ORG_ID and use list_organizations / switch_organization at runtime. Or set it in env to pick a default.


Clients

Claude Desktop

Edit ~/Library/Application Support/Claude/claude_desktop_config.json:

json
{  "mcpServers": {    "apple-ads": {      "command": "npx",      "args": ["-y", "apple-ads-mcp"],      "env": {        "ASA_CLIENT_ID": "SEARCHADS.xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",        "ASA_TEAM_ID": "SEARCHADS.xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",        "ASA_KEY_ID": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",        "ASA_PRIVATE_KEY_PATH": "/Users/yourname/apple-ads-key-pkcs8.pem"      }    }  }}

Restart Claude Desktop after saving.

Claude Code
bash
claude mcp add apple-ads \  -e ASA_CLIENT_ID=SEARCHADS.xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx \  -e ASA_TEAM_ID=SEARCHADS.xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx \  -e ASA_KEY_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx \  -e ASA_PRIVATE_KEY_PATH=/Users/yourname/apple-ads-key-pkcs8.pem \  -- npx -y apple-ads-mcp
Cursor

Add to .cursor/mcp.json:

json
{  "mcpServers": {    "apple-ads": {      "command": "npx",      "args": ["-y", "apple-ads-mcp"],      "env": {        "ASA_CLIENT_ID": "SEARCHADS.xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",        "ASA_TEAM_ID": "SEARCHADS.xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",        "ASA_KEY_ID": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",        "ASA_PRIVATE_KEY_PATH": "/Users/yourname/apple-ads-key-pkcs8.pem"      }    }  }}
VS Code

Add to your settings.json:

json
{  "mcp": {    "servers": {      "apple-ads": {        "command": "npx",        "args": ["-y", "apple-ads-mcp"],        "env": {          "ASA_CLIENT_ID": "SEARCHADS.xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",          "ASA_TEAM_ID": "SEARCHADS.xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",          "ASA_KEY_ID": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",          "ASA_PRIVATE_KEY_PATH": "/Users/yourname/apple-ads-key-pkcs8.pem"        }      }    }  }}
Windsurf

Add to ~/.codeium/windsurf/mcp_config.json:

json
{  "mcpServers": {    "apple-ads": {      "command": "npx",      "args": ["-y", "apple-ads-mcp"],      "env": {        "ASA_CLIENT_ID": "SEARCHADS.xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",        "ASA_TEAM_ID": "SEARCHADS.xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",        "ASA_KEY_ID": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",        "ASA_PRIVATE_KEY_PATH": "/Users/yourname/apple-ads-key-pkcs8.pem"      }    }  }}
Other MCP clients

This server uses STDIO transport. Any MCP-compatible client can connect by running:

bash
npx -y apple-ads-mcp

Set these environment variables:

VariableDescription
ASA_CLIENT_IDYour client ID (starts with SEARCHADS.)
ASA_TEAM_IDYour team ID (starts with SEARCHADS.)
ASA_KEY_IDYour key ID (UUID)
ASA_PRIVATE_KEY_PATHAbsolute path to your PKCS#8 private key
ASA_ORG_ID(optional) Organization ID to use by default
Inline key (no file)

Replace ASA_PRIVATE_KEY_PATH with ASA_PRIVATE_KEY and paste the PEM content with \n for line breaks:

json
"ASA_PRIVATE_KEY": "-----BEGIN PRIVATE KEY-----\nMIGH...your-key...\n-----END PRIVATE KEY-----"

Tools

CategoryCountWhat you can do
Organizations3List and switch between organizations. Get user details.
Campaigns6List, create, update, delete campaigns. Pull performance reports.
Ad Groups6Manage ad groups within campaigns. Get ad group reports.
Keywords11Add/remove targeting and negative keywords. Update bids. Keyword reports.
Search Terms1See the actual queries people searched before tapping your ad.
Ads7List, create, update, delete ads. Get ad reports and rejection reasons.
Creatives5Manage creatives and product pages.
Budget Orders4Create, update, list, and get budget order details.
Apps & Geo5Search for eligible apps, check eligibility, find assets, search geolocations.
Geo Performance1Performance breakdown by country/region.
Impression Share3Create, list, and retrieve custom impression share reports.
Optimization2Campaign snapshots and budget utilization analysis.

All 54 tools

CategoryTools
Organizationslist_organizations, switch_organization, get_me_details
Campaignslist_campaigns, get_campaign_details, create_campaign, update_campaign, delete_campaign, get_campaign_report
Ad Groupslist_ad_groups, get_ad_group, create_ad_group, update_ad_group, delete_ad_group, get_adgroup_report
Keywordsget_keyword_report, list_targeting_keywords, get_targeting_keyword, add_targeting_keywords, update_targeting_keywords, delete_targeting_keywords, list_negative_keywords, get_negative_keyword, add_negative_keywords, update_negative_keywords, delete_negative_keywords
Search Termsget_search_term_report
Adslist_ads, get_ad, create_ad, update_ad, delete_ad, get_ad_report, find_ad_rejection_reasons
Creativeslist_creatives, get_creative, create_creative, list_product_pages, get_product_page_by_id
Budget Orderslist_budget_orders, get_budget_order, create_budget_order, update_budget_order
Apps & Geosearch_apps, get_app_details, get_app_eligibility, find_app_assets, search_geolocations
Geo Performanceget_geo_performance
Impression Sharecreate_impression_share_report, get_impression_share_report_by_id, list_impression_share_reports
Optimizationget_campaign_snapshot, get_budget_analysis

Resources

The server exposes 3 resources:

URIDescription
apple-ads://countriesSupported countries and regions for Apple Search Ads
apple-ads://device-sizesApp preview device sizes for creative assets
apple-ads://metrics-glossaryDefinitions, formulas, and benchmarks for all reporting metrics (CPA, CPT, TTR, etc.)

Prompts

6 built-in workflow prompts to guide common tasks:

PromptDescription
campaign_health_checkComprehensive campaign analysis — reviews spend, conversions, CPA trends, and flags issues
keyword_optimizationKeyword and search term optimization workflow — finds wasted spend and new opportunities
new_campaign_setupGuided new campaign creation — walks through app selection, structure, keywords, and budgets
budget_reallocationCross-campaign budget analysis — identifies over/under-spending and proposes budget shifts
creative_reviewCreative A/B review — compares ad performance, flags rejections, recommends winners
geo_expansionGeographic expansion analysis — ranks current markets and identifies new ones to enter

Troubleshooting

"pkcs8 must be PKCS#8 formatted string" Your key is in the wrong format. Re-run the openssl pkcs8 command from Step 3.

"No organization selected" Use list_organizations then switch_organization, or add ASA_ORG_ID to your config.

"Token request failed (401)" Verify your clientId, teamId, and keyId match Apple's API tab. Check that you uploaded your public key.

"Failed to read private key" Use an absolute path (e.g. /Users/yourname/...), not ~/....

Server disconnects immediately A required credential is missing. You need all four: ASA_CLIENT_ID, ASA_TEAM_ID, ASA_KEY_ID, and ASA_PRIVATE_KEY_PATH.

Development
bash
git clone https://github.com/javiergalloroca/AppleAdsMCP.gitcd AppleAdsMCPnpm installnpm run buildnpm start

For hot reload: npm run dev

See CONTRIBUTING.md for contribution guidelines.

License

MIT

来源:README.md,提交 7f73700

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v1.0.3最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分