aapl-ads-mcp is a self-hosted open-source MCP server that connects Claude and other MCP-compatible clients to the Apple Search Ads API v5. MCP (Model Context Protocol) is an open standard that allows AI assistants to call external tools; this server implements the MCP stdio transport and exposes 9 read-only tools for querying campaigns, ad groups, keywords, and performance reports in an Apple Search Ads account. Once installed and pointed to by Claude Desktop, you can ask questions in natural language, such as "Which keywords drove the most installs last month?" or "Show campaigns with zero impressions this week."
[Main Capabilities] The 9 read-only tools provided include: list_orgs (verify identity and list accessible organizations), list_campaigns (enumerate campaigns, filterable by status), list_ad_groups (get the ad groups of a specified campaign), list_keywords (targeting keywords with bid amounts and match types), get_campaign_report (campaign-level statistics for impressions, taps, installs, spend, CPI, TTR), get_ad_group_report (the same metrics broken down by ad group), get_keyword_report (performance by keyword, with weekly/daily/monthly granularity), get_search_terms_report (the actual search terms that triggered ads, most useful for discovering opportunities). All tools query the last 30 days by default, and reports support HOURLY, DAILY, WEEKLY, and MONTHLY granularity.
[How to Use]
- Generate an ES256 key pair: use the modern genpkey command to generate PKCS#8 format directly, which is the format required by this server; the old ecparam -genkey generates SEC1 format and will cause a startup error. Verify that the private key starts with -----BEGIN PRIVATE KEY----- (not -----BEGIN EC PRIVATE KEY-----). It is recommended to store private-key.pem outside the repository root (for example, ~/.ssh/asa-private-key.pem).
- Create an API user in Apple Search Ads : go to ASA -> Account Settings -> User Management, click Create User, and for read-only purposes select the API Account Read Only role (recommended); API Campaign Manager is also acceptable; go to the API tab and click Create Client, upload public-key.pem, and copy the client_id, team_id, and key_id from the confirmation screen; find the org_id in Account Settings -> Overview.
- Clone and build the project.
- Configure Claude Desktop: edit claude_desktop_config.json, put the absolute path to dist/index.js in args, and set environment variables such as ASA_CLIENT_ID in env. You can also debug tool calls interactively through the Inspector UI without using Claude Desktop; before connecting, you need to set the environment variables in the UI.
[Use Cases] Suitable for users who need ad hoc analysis or automated reporting on Apple Search Ads data, especially scenarios where they want to self-host, control their keys, and avoid handing API keys to a SaaS service. It is also suitable for quickly querying ad performance in natural language, identifying high-converting keywords, and discovering search term opportunities. Install metric aggregation (such as tapInstalls, viewInstalls) is populated directly by Apple Search Ads and does not require app-side integration; AdServices / AdAttributionKit is only needed when you need to attribute installs to specific campaigns within the app (for example, for onboarding personalization).
[Limitations] It is read-only by design, and this version has no write operations (create, update, pause). It requires Apple Search Ads Campaign Management API access. It is fixed to a single organization, with org_id hardcoded in the configuration, and multi-organization switching is not implemented. Security: do not commit .env or *.pem files, both of which are already in .gitignore; the private key should be placed outside the repository root; access tokens are kept only in memory and are never written to disk; if you suspect the key has been leaked,Should be rotated in ASA → Account Settings → API. The project uses the MIT license.
[Other] The repository provides pre-commit hooks (lefthook), including gitleaks to check for secrets in the staging area, running Biome lint checks on staged .ts files, and TypeScript type checking. For technical details, see docs/ARCHITECTURE.md, which covers the authentication flow, HTTP client design, tool patterns, special aspects of the report schema, and ASA v5 experience accumulated during development.