{
  "markdown": "<p align=\"center\">\n  <h1 align=\"center\">Apple Ads MCP</h1>\n</p>\n\n<p align=\"center\">\n  <a href=\"https://www.npmjs.com/package/apple-ads-mcp\"><img src=\"https://img.shields.io/npm/v/apple-ads-mcp.svg\" alt=\"npm version\"></a>\n  <a href=\"https://modelcontextprotocol.io\"><img src=\"https://img.shields.io/badge/MCP-compatible-blue\" alt=\"MCP compatible\"></a>\n  <a href=\"https://www.typescriptlang.org\"><img src=\"https://img.shields.io/badge/TypeScript-5.x-blue?logo=typescript&logoColor=white\" alt=\"TypeScript\"></a>\n  <a href=\"LICENSE\"><img src=\"https://img.shields.io/npm/l/apple-ads-mcp.svg\" alt=\"License\"></a>\n</p>\n\n<p align=\"center\">\n  MCP server for the <a href=\"https://developer.apple.com/documentation/apple_search_ads\">Apple Search Ads API v5</a>.<br>\n  Connect it to any MCP-compatible AI client and manage your campaigns, keywords, budgets, and reporting through natural language.\n</p>\n\n<p align=\"center\">\n  <a href=\"#quick-start\">Quick Start</a> &bull;\n  <a href=\"#tools\">Tools</a> &bull;\n  <a href=\"#resources\">Resources</a> &bull;\n  <a href=\"#prompts\">Prompts</a> &bull;\n  <a href=\"#clients\">Clients</a>\n</p>\n\n---\n\n**Ask your AI things like:**\n\n> *\"How did my campaigns perform last week?\"*\n> *\"Pause the brand campaign and increase the budget on discovery to $500.\"*\n> *\"What search terms are triggering my ads? Add the best ones as exact-match keywords.\"*\n\nSupports 54 tools, 3 resources, and 6 prompts — campaigns, ad groups, keywords, creatives, budgets, search terms, geo targeting, impression share, and performance reports.\n\n### Features at a glance\n\n| Feature | Description |\n|---|---|\n| **Campaign management** | Create, update, pause, and delete campaigns and ad groups |\n| **Keyword optimization** | Add/remove targeting and negative keywords, update bids |\n| **Performance reporting** | Campaign, ad group, keyword, ad, and geo reports with date presets |\n| **Search term analysis** | See actual search queries triggering your ads |\n| **Creative management** | Manage ads, creatives, and product pages |\n| **Budget control** | Create and manage budget orders, analyze utilization |\n| **Impression share** | Generate and retrieve impression share reports |\n| **Multi-org support** | Switch between organizations at runtime |\n\n---\n\n## Quick Start\n\n1. [Get your Apple credentials](#step-1--invite-an-api-user) (~10 min, one-time)\n2. [Generate your key pair](#step-3--generate-your-key-pair) (2 commands)\n3. [Add to your MCP client](#step-5--add-to-your-mcp-client)\n4. Start chatting\n\n---\n\n## Setup\n\n### Step 1 — Invite an API user\n\n> Done by the **account admin** at [searchads.apple.com](https://searchads.apple.com).\n\n1. Go to **Settings** → **User Management** → **Invite User**\n2. Enter the email of the person who will use the API\n3. Set the role:\n   - **API Account Manager** — full read/write access\n   - **API Account Read Only** — view-only access\n4. Send the invitation\n\n> The API user must be a **different Apple ID** from the admin. If you're the admin, use a second Apple ID.\n\n### Step 2 — Accept and copy your credentials\n\n> Done by the **invited user**.\n\n1. Accept the email invitation and sign in to [searchads.apple.com](https://searchads.apple.com)\n2. Go to **Settings** → **API** tab\n3. Copy and save these three values:\n   - **clientId** — starts with `SEARCHADS.`\n   - **teamId** — starts with `SEARCHADS.`\n   - **keyId** — a UUID\n\n### Step 3 — Generate your key pair\n\nOpen Terminal and run:\n\n```bash\nopenssl ecparam -genkey -name prime256v1 -noout -out ~/apple-ads-key.pem && \\\nopenssl pkcs8 -topk8 -nocrypt -in ~/apple-ads-key.pem -out ~/apple-ads-key-pkcs8.pem\n```\n\nThen generate the public key:\n\n```bash\nopenssl ec -in ~/apple-ads-key-pkcs8.pem -pubout -out ~/apple-ads-key-public.pem\n```\n\nThis creates:\n- **`~/apple-ads-key-pkcs8.pem`** — private key (keep this safe, used in your config)\n- **`~/apple-ads-key-public.pem`** — public key (upload to Apple next)\n\n### Step 4 — Upload public key to Apple\n\nPrint your public key:\n\n```bash\ncat ~/apple-ads-key-public.pem\n```\n\nCopy the entire output (including the `BEGIN` / `END` lines), then:\n\n1. Go to **Settings** → **API** tab on [searchads.apple.com](https://searchads.apple.com)\n2. Paste into the **Public Key** field\n3. **Save**\n\n### Step 5 — Add to your MCP client\n\nPick 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.\n\n> **Multiple orgs?** Omit `ASA_ORG_ID` and use `list_organizations` / `switch_organization` at runtime. Or set it in `env` to pick a default.\n\n---\n\n## Clients\n\n<details>\n<summary><strong>Claude Desktop</strong></summary>\n\nEdit `~/Library/Application Support/Claude/claude_desktop_config.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"apple-ads\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"apple-ads-mcp\"],\n      \"env\": {\n        \"ASA_CLIENT_ID\": \"SEARCHADS.xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\",\n        \"ASA_TEAM_ID\": \"SEARCHADS.xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\",\n        \"ASA_KEY_ID\": \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\",\n        \"ASA_PRIVATE_KEY_PATH\": \"/Users/yourname/apple-ads-key-pkcs8.pem\"\n      }\n    }\n  }\n}\n```\n\nRestart Claude Desktop after saving.\n\n</details>\n\n<details>\n<summary><strong>Claude Code</strong></summary>\n\n```bash\nclaude mcp add apple-ads \\\n  -e ASA_CLIENT_ID=SEARCHADS.xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx \\\n  -e ASA_TEAM_ID=SEARCHADS.xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx \\\n  -e ASA_KEY_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx \\\n  -e ASA_PRIVATE_KEY_PATH=/Users/yourname/apple-ads-key-pkcs8.pem \\\n  -- npx -y apple-ads-mcp\n```\n\n</details>\n\n<details>\n<summary><strong>Cursor</strong></summary>\n\nAdd to `.cursor/mcp.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"apple-ads\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"apple-ads-mcp\"],\n      \"env\": {\n        \"ASA_CLIENT_ID\": \"SEARCHADS.xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\",\n        \"ASA_TEAM_ID\": \"SEARCHADS.xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\",\n        \"ASA_KEY_ID\": \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\",\n        \"ASA_PRIVATE_KEY_PATH\": \"/Users/yourname/apple-ads-key-pkcs8.pem\"\n      }\n    }\n  }\n}\n```\n\n</details>\n\n<details>\n<summary><strong>VS Code</strong></summary>\n\nAdd to your `settings.json`:\n\n```json\n{\n  \"mcp\": {\n    \"servers\": {\n      \"apple-ads\": {\n        \"command\": \"npx\",\n        \"args\": [\"-y\", \"apple-ads-mcp\"],\n        \"env\": {\n          \"ASA_CLIENT_ID\": \"SEARCHADS.xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\",\n          \"ASA_TEAM_ID\": \"SEARCHADS.xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\",\n          \"ASA_KEY_ID\": \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\",\n          \"ASA_PRIVATE_KEY_PATH\": \"/Users/yourname/apple-ads-key-pkcs8.pem\"\n        }\n      }\n    }\n  }\n}\n```\n\n</details>\n\n<details>\n<summary><strong>Windsurf</strong></summary>\n\nAdd to `~/.codeium/windsurf/mcp_config.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"apple-ads\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"apple-ads-mcp\"],\n      \"env\": {\n        \"ASA_CLIENT_ID\": \"SEARCHADS.xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\",\n        \"ASA_TEAM_ID\": \"SEARCHADS.xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\",\n        \"ASA_KEY_ID\": \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\",\n        \"ASA_PRIVATE_KEY_PATH\": \"/Users/yourname/apple-ads-key-pkcs8.pem\"\n      }\n    }\n  }\n}\n```\n\n</details>\n\n<details>\n<summary><strong>Other MCP clients</strong></summary>\n\nThis server uses **STDIO transport**. Any MCP-compatible client can connect by running:\n\n```bash\nnpx -y apple-ads-mcp\n```\n\nSet these environment variables:\n\n| Variable | Description |\n|---|---|\n| `ASA_CLIENT_ID` | Your client ID (starts with `SEARCHADS.`) |\n| `ASA_TEAM_ID` | Your team ID (starts with `SEARCHADS.`) |\n| `ASA_KEY_ID` | Your key ID (UUID) |\n| `ASA_PRIVATE_KEY_PATH` | Absolute path to your PKCS#8 private key |\n| `ASA_ORG_ID` | *(optional)* Organization ID to use by default |\n\n</details>\n\n<details>\n<summary><strong>Inline key (no file)</strong></summary>\n\nReplace `ASA_PRIVATE_KEY_PATH` with `ASA_PRIVATE_KEY` and paste the PEM content with `\\n` for line breaks:\n\n```json\n\"ASA_PRIVATE_KEY\": \"-----BEGIN PRIVATE KEY-----\\nMIGH...your-key...\\n-----END PRIVATE KEY-----\"\n```\n\n</details>\n\n---\n\n## Tools\n\n| Category | Count | What you can do |\n|---|---|---|\n| **Organizations** | 3 | List and switch between organizations. Get user details. |\n| **Campaigns** | 6 | List, create, update, delete campaigns. Pull performance reports. |\n| **Ad Groups** | 6 | Manage ad groups within campaigns. Get ad group reports. |\n| **Keywords** | 11 | Add/remove targeting and negative keywords. Update bids. Keyword reports. |\n| **Search Terms** | 1 | See the actual queries people searched before tapping your ad. |\n| **Ads** | 7 | List, create, update, delete ads. Get ad reports and rejection reasons. |\n| **Creatives** | 5 | Manage creatives and product pages. |\n| **Budget Orders** | 4 | Create, update, list, and get budget order details. |\n| **Apps & Geo** | 5 | Search for eligible apps, check eligibility, find assets, search geolocations. |\n| **Geo Performance** | 1 | Performance breakdown by country/region. |\n| **Impression Share** | 3 | Create, list, and retrieve custom impression share reports. |\n| **Optimization** | 2 | Campaign snapshots and budget utilization analysis. |\n\n### All 54 tools\n\n| Category | Tools |\n|---|---|\n| **Organizations** | `list_organizations`, `switch_organization`, `get_me_details` |\n| **Campaigns** | `list_campaigns`, `get_campaign_details`, `create_campaign`, `update_campaign`, `delete_campaign`, `get_campaign_report` |\n| **Ad Groups** | `list_ad_groups`, `get_ad_group`, `create_ad_group`, `update_ad_group`, `delete_ad_group`, `get_adgroup_report` |\n| **Keywords** | `get_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` |\n| **Search Terms** | `get_search_term_report` |\n| **Ads** | `list_ads`, `get_ad`, `create_ad`, `update_ad`, `delete_ad`, `get_ad_report`, `find_ad_rejection_reasons` |\n| **Creatives** | `list_creatives`, `get_creative`, `create_creative`, `list_product_pages`, `get_product_page_by_id` |\n| **Budget Orders** | `list_budget_orders`, `get_budget_order`, `create_budget_order`, `update_budget_order` |\n| **Apps & Geo** | `search_apps`, `get_app_details`, `get_app_eligibility`, `find_app_assets`, `search_geolocations` |\n| **Geo Performance** | `get_geo_performance` |\n| **Impression Share** | `create_impression_share_report`, `get_impression_share_report_by_id`, `list_impression_share_reports` |\n| **Optimization** | `get_campaign_snapshot`, `get_budget_analysis` |\n\n---\n\n## Resources\n\nThe server exposes 3 resources:\n\n| URI | Description |\n|---|---|\n| `apple-ads://countries` | Supported countries and regions for Apple Search Ads |\n| `apple-ads://device-sizes` | App preview device sizes for creative assets |\n| `apple-ads://metrics-glossary` | Definitions, formulas, and benchmarks for all reporting metrics (CPA, CPT, TTR, etc.) |\n\n---\n\n## Prompts\n\n6 built-in workflow prompts to guide common tasks:\n\n| Prompt | Description |\n|---|---|\n| `campaign_health_check` | Comprehensive campaign analysis — reviews spend, conversions, CPA trends, and flags issues |\n| `keyword_optimization` | Keyword and search term optimization workflow — finds wasted spend and new opportunities |\n| `new_campaign_setup` | Guided new campaign creation — walks through app selection, structure, keywords, and budgets |\n| `budget_reallocation` | Cross-campaign budget analysis — identifies over/under-spending and proposes budget shifts |\n| `creative_review` | Creative A/B review — compares ad performance, flags rejections, recommends winners |\n| `geo_expansion` | Geographic expansion analysis — ranks current markets and identifies new ones to enter |\n\n---\n\n<details>\n<summary><strong>Troubleshooting</strong></summary>\n\n> **\"pkcs8 must be PKCS#8 formatted string\"**\n> Your key is in the wrong format. Re-run the `openssl pkcs8` command from [Step 3](#step-3--generate-your-key-pair).\n\n> **\"No organization selected\"**\n> Use `list_organizations` then `switch_organization`, or add `ASA_ORG_ID` to your config.\n\n> **\"Token request failed (401)\"**\n> Verify your **clientId**, **teamId**, and **keyId** match Apple's API tab. Check that you uploaded your public key.\n\n> **\"Failed to read private key\"**\n> Use an absolute path (e.g. `/Users/yourname/...`), not `~/...`.\n\n> **Server disconnects immediately**\n> A required credential is missing. You need all four: `ASA_CLIENT_ID`, `ASA_TEAM_ID`, `ASA_KEY_ID`, and `ASA_PRIVATE_KEY_PATH`.\n\n</details>\n\n<details>\n<summary><strong>Development</strong></summary>\n\n```bash\ngit clone https://github.com/javiergalloroca/AppleAdsMCP.git\ncd AppleAdsMCP\nnpm install\nnpm run build\nnpm start\n```\n\nFor hot reload: `npm run dev`\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for contribution guidelines.\n\n</details>\n\n## License\n\nMIT\n",
  "bytes": 12936,
  "sha": "2b4c825cfadfe243f98ecc5036c104b049e9015ceaf259526c34106d8e8b6551",
  "repo_slug": "happygallo/apple-ads-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_happygallo_apple_ads_1d04a1e5/readme"
}