Connects Claude to the Amazon Advertising API for campaign management, reporting, DSP, and AMC workflows across NA, EU, and FE regions. The implementation focuses on error handling that teaches rather than just fails. When you hit a wrong field name or malformed request, the server returns corrective hints instead of cryptic API errors, collapsing five-round-trip debugging loops into directed retries. Built by Openbridge with full Pydantic types, multi-region routing, and coverage of both legacy v1 and current v3 reporting endpoints. Runs via Docker or stdio transport. Useful when you need an agent to manipulate Amazon ad accounts without burning context on API vocabulary mismatches and migration-era inconsistencies.
Build AI-powered advertising applications with the Model Context Protocol (MCP) SDK for Amazon Advertising API
Made with ❤️ + ☕ by Openbridge
MCP registry id (for clients and catalogs that display a stable package name): io.github.KuudoAI/amazon_ads_mcp
Think of MCP (Model Context Protocol) as a translator between an AI model and outside systems (like Amazon Ads). Each MCP tool is like a remote control button that tells the AI how to interact with Amazon Ads. Without MCP tools, the AI would have no idea how to “talk” to Amazon Ads.
With MCP tools:
👉 In short: MCP tools = a safe, well-labeled toolkit that lets AI work with the Amazon Ads API.
The Amazon Ads API MCP SDK is an open-source implementation that provides a robust foundation for creating AI-powered advertising tools, chatbots, and automated services.
Other Amazon Ads MCPs do happy path. They fall apart the moment an agent makes a reasonable mistake and Amazon's Ads API has more reasonable mistakes than almost any other large API surface. The v1 reporting catalog uses a different vocabulary than v3. The docs are scattered across migration generations. The same field can have three plausible names depending on which tutorial an agent or human was trained on.
You know the symptoms even if you've never thought of them as a single problem:
That's not the model being dumb. That's the API surface burning context vague errors trigger thrashing, thrashing fills the window, the window fills and everything useful gets evicted. Anywhere from 4 to 12 round-trips for an agent: wrong field names, wrong body shape, wrong filter operator, wrong date placement, wrong advertiser-account format.
This server is built around a different premise: the error surface is the documentation surface. Every failure is a teaching opportunity, and the server is engineered to make the next attempt smarter than the last one, for the same agent or the next one, without retraining, prompt updates, or memory tricks.
Every failure is cheaper than the last. Every agent learns from the same authoritative source. Every retry has direction. That compounding is what a smart agent solution looks like in practice.
We won't catch every edge case. Amazon's API surface is enormous, the migration history is messy, and real-world failures get more creative than anything anyone can anticipate. What we're committing to is the strategy that errors should teach, that documentation should live in the surfaces agents actually touch, that every wrong move should make the next move easier.
If you hit a failure where the envelope didn't help; vague hint, wrong suggestion, no hint at all, that's exactly the feedback we want. Open an issue, paste the envelope, tell us what you expected. The strategy is only as good as the cases it covers.
Prerequisites: Docker (recommended), Python 3.10+ if you run from source, and Amazon Ads API access (your own developer app or a partner such as Openbridge).
git clone https://github.com/KuudoAI/amazon-ads-mcp.git && cd amazon-ads-mcpcp .env.example .env and add credentials (see Configuration).docker compose up -dhttp://localhost:<PORT>/mcp/ — .env.example sets PORT=9080 (override in .env if needed).OAuth steps, client JSON samples, and a full variable reference: Configuration below, INSTALL.md, and AGENTS.md.
The MCP server mirrors broad coverage of the Amazon Ads API surface. Each enabled package maps to a set of API operations. That includes Campaign Management (Amazon Ads API v1), Exports, Amazon Marketing Cloud, and many more.
Here is a representative list of the various Amazon API services in the MCP:
The Amazon Ads API v1 represents a reimagined approach to the Amazon Ads API, built from the ground up to provide a seamless experience across all Amazon advertising products through a common model. One major benefit of this common model is improved compatibility with code generation tools such as client library generators.
⚠️ Beta Notice: These APIs are currently in beta at Amazon. Features and endpoints may change. Use in production with caution.
| Package Name | Description | Prefix |
|---|---|---|
ads-api-v1-all | Ads API v1 merged ALL surface | allv1_ |
ads-api-v1-sp | Sponsored Products v1 | spv1_ |
ads-api-v1-sb | Sponsored Brands v1 | sbv1_ |
ads-api-v1-dsp | Amazon DSP v1 | dspv1_ |
ads-api-v1-sd | Sponsored Display v1 | sdv1_ |
ads-api-v1-st | Sponsored Television v1 | stv1_ |
ads-api-v1-beta | Ads API v1 merged BETA surface | beta_ |
To activate Ads API v1 packages, add them to your AMAZON_AD_API_PACKAGES environment variable:
# Example: Enable the merged Ads API v1 ALL surface
AMAZON_AD_API_PACKAGES="profiles,ads-api-v1-all"
For more information, see Amazon's Campaign Management Overview.
We recommend running Amazon Ads API MCP with 🐳 Docker. Build the image from this repository (there is no supported docker pull for a third-party registry image here—use the Dockerfile and docker-compose.yaml in the repo).
git clone https://github.com/KuudoAI/amazon-ads-mcp.git
cd amazon-ads-mcp
Copy the environment template:
cp .env.example .env
Edit .env with your settings (including PORT if you change the default).
Start the server with Docker Compose (builds and tags amazon-ads-mcp:latest per docker-compose.yaml):
docker compose up -d
The server listens on the host port mapped from PORT in .env (.env.example uses 9080).
Check logs:
docker compose logs -f
Stop the server:
docker compose down
For full installation instructions, including verification, upgrading, and developer setup, see the Installation Guide.
Operators / self-hosters: follow the steps below and your .env file. Chat users mostly interact via prompts once the server is connected; skim Advertiser Profiles & Regions for profile and region behavior.
Amazon Ads requires that all calls to the API are authorized. If you are not sure what this means, you should read the Amazon docs:
There are two paths for connecting to the API;
If you have your own Amazon Ads API app, or want to create one, the process is detailed below.
Client ID and Client SecretPORT in .env; .env.example uses 9080):
https://your-server.com/auth/callbackhttp://localhost:<PORT>/auth/callback (e.g. http://localhost:9080/auth/callback)Once you have your app secured and approved by Amazon, you will need the client ID and secret:
# Amazon Ads API Credentials (required)
AMAZON_AD_API_CLIENT_ID="your-client-id"
AMAZON_AD_API_CLIENT_SECRET="your-client-secret"
Make sure these are in your .env file. Also, make sure you set your authorization method to direct in the same .env:
AUTH_METHOD=direct
To authorize your connection to Amazon, you need to complete an OAuth workflow as an end user. First, you need to set your region. Authorization occurs at the region level and not setting your region may cause a failure. The server will default to the na region. You can manually set the region with tool set_active_region.
set_active_regionna | eu | feExample prompt: "Set my current region to eu"
To connect to Amazon Ads API, you use an MCP tool to start your OAuth flow
start_oauth_flow
In this example, you are prompted to click the link that will open a browser window and request approval at Amazon.
In the browser window, Amazon will prompt that you approve the request to connect.
If all goes well, you will see a success response. You can close the browser window and go back to your client. If you see something else, attempt the process again and confirm all your configuration elements are correct
To confirm that your MCP server is connected to the Amazon Ads API, check your OAuth status
check_oauth_status
You are ready to start interacting with the Amazon Ads API system!
You can configure your client, like Claude, to use authentication by supplying a valid access token. This is most appropriate for service accounts, long-lived API keys, CI/CD, applications where authentication is managed separately, or other non-interactive authentication methods.
As an Ads API Partner application provider, Openbridge offers a ready-to-go gateway to the Amazon Ads API. You log into your Openbridge account, provision a token, then set your token in your client config (see below).
First, set Openbridge as the auth method:
AUTH_METHOD=openbridge
That is it for the server config. To access the server, you need configure the client, like Claude Desktop, to pass the token directly. (see Example MCP Client: Connect Claude Desktop)
Your Amazon authorizations reside in Openbridge. Your first step in your client is to request your current identities: "List my remote identities". Next, you would tell the MCP server to use one of these identities: "Set my remote identity to <>". You can then ask the MCP to List all of my Amazon Ad profiles linked to that account. If you do not see an advertiser listed, set a different identity.
To activate specific packages, set a comma-separated package list. For a streamlined default with unified Ads API v1 coverage:
AMAZON_AD_API_PACKAGES="profiles,accounts-ads-accounts,reporting-version-3,amc-workflow,ads-api-v1-all"Here is the list of tool packages available in the server:
profilestest-accountforecastsbrand-stores-managementcampaign-manageaccounts-manager-accountsaccounts-ads-accountsaccounts-portfoliosaccounts-billingaccounts-account-budgetsaudiences-discoveryreporting-version-3brand-benchmarksbrand-metricsstores-analyticssponsored-productssp-suggested-keywordssponsored-brands-v4sponsored-brands-v3sponsored-displaydsp-measurementdsp-advertisersdsp-audiencesdsp-conversionsdsp-target-kpi-recommendationsamazon-attributionaudience-insightspartner-opportunitiestactical-recommendationspersona-buildercreative-assetschange-historydata-provider-dataproducts-metadataproducts-eligibilityunified-pre-moderation-resultsmoderation-resultsamazon-marketing-streamlocationsexports-snapshotsmarketing-mix-modelingreach-forecastingamc-administrationamc-workflowamc-rule-audienceamc-ad-audienceads-api-v1-sp (Beta)ads-api-v1-sb (Beta)ads-api-v1-dsp (Beta)ads-api-v1-sd (Beta)ads-api-v1-st (Beta)ads-api-v1-allads-api-v1-beta (Beta)You will note that some are broken up into smaller groupings. For example, Amazon Marketing Cloud has bundles; amc-ad-audience, amc-administration, amc-rule-audience, and amc-workflow. This is done to create efficiencies and optimizations that reduce context limits in many AI clients.
Amazon Ads MCP tools have prefixes (like cm_ for Campaign Management or amc_ for Amazon Marketing Cloud) to help organize the specific Ads API operation.
Example prefixes:
cm_ → campaign/advertising APIsamc_ → AMC-related APIsdsp_ → DSP APIssd_ → Sponsored Displayams_ → Amazon Marketing Streamspv1_ → Sponsored Products v1 (Beta)sbv1_ → Sponsored Brands v1 (Beta)dspv1_ → Amazon DSP v1 (Beta)sdv1_ → Sponsored Display v1 (Beta)stv1_ → Sponsored Television v1 (Beta)This will translate into collections of tools that align with the API operations that are available:
Campaign Management (cm_)
cm_QueryCampaign — Query campaignscm_CreateCampaign — Create campaigncm_UpdateCampaign — Update campaigncm_DeleteCampaign — Delete campaigncm_QueryAdGroup — Query ad groupsSponsored Products (sp_)
sp_listProductAds — List product adssp_createKeywords — Create keywordssp_updateBids — Update keyword bidssp_getNegativeKeywords — Get negative keywordsAMC Workflows (amc_)
amc_listWorkflows — List AMC workflowsamc_executeWorkflow — Run workflowamc_getWorkflowStatus — Check workflow statusUsers would see tools like:
"List my Amazon Ads campaigns"
→ Claude uses: cm_QueryCampaign
"Create an AMC workflow"
→ Claude uses tools such as amc_executeWorkflow (after discovery; exact names depend on your enabled packages)
"Export my sponsored products ads data"
→ Claude uses: export_createAdExport
When tools fetch a report or export from Amazon, they download the file onto the machine running the MCP server (local disk on the server host—Docker volume, VM, or bare metal—not your laptop unless the server runs there). The default base directory is ./data (override with AMAZON_ADS_DOWNLOAD_DIR). Files are organized under data/profiles/{profile_id}/….
MCP tools list those server-side files and build URLs; clients then pull the bytes over HTTP (GET /downloads, GET /downloads/{relative-path}). Nothing streams straight from Amazon into the MCP client without hitting server storage first in these flows.
Use HTTP transport for downloads: run with --transport http (or Docker on port 9080). stdio mode does not register /downloads, and the get_download_url tool returns an error without HTTP.
createAsyncReport (POST) to create, getAsyncReport (GET) to poll status, then download_export to save the completed file on the server into profile storage.export_CampaignExport), poll with export_GetExport, then call download_export with the completion URL so the file is fetched from Amazon and written on the server (same storage layout as reports).set_active_profile) so storage and HTTP access are scoped.COMPLETED.download_export with the download URL from the completed response.list_downloads and get_download_url.GET on the URL from step 5 (browser, curl, etc.).Subpaths under the profile folder depend on report/export type (for example reports/…, exports/…). URLs look like http://localhost:9080/downloads/{relative-path} where {relative-path} matches list_downloads (illustrative example: reports/async/some-report.json.gz).
Direct HTTP (curl): /downloads uses the active profile in the running server (the one set via MCP in that process). If you see No active profile, call set_active_profile through MCP against the same server first. When no auth manager is configured, a numeric ?profile_id= query parameter may be accepted instead—see your deployment settings.
| Task | Example Prompt |
|---|---|
| Download a report | "Generate a Sponsored Products report for January 2026" |
| List available files | "Show me my downloaded files" |
| Get download link | "Get the download URL for the report we just created" |
| Filter by type | "List my downloaded campaign exports" |
# List available downloads (paths and URLs are profile-scoped)
curl http://localhost:9080/downloads
# Optional filter
curl 'http://localhost:9080/downloads?type=reports'
# Download one file (example path — use paths from list_downloads)
curl -O 'http://localhost:9080/downloads/reports/async/example-report.json.gz'
# If AMAZON_ADS_DOWNLOAD_AUTH_TOKEN is set
curl -H "Authorization: Bearer your-token" -O 'http://localhost:9080/downloads/exports/campaigns/example-export.json'
data/profiles/{profile_id}/./downloads only see the active profile’s files.profiles/ are not listed when using profile-scoped mode; move them under data/profiles/{profile_id}/ for access.Per Amazon: Profiles play a crucial role in the Amazon Ads API by determining the management scope for a given call. A profile ID is a required credential to access an advertiser's data and services in a specific marketplace.
You may not know what profile(s) authorization grants you access to. You can list all advertising profiles accessible by your authorization:
ac_listProfilesWarning: Large accounts can return very large profile lists that may exceed client context limits. Prefer these bounded tools for discovery:
summarize_profiles — "Summarize my advertiser profiles"search_profiles — "Find profiles with Acme in the name in US"page_profiles — "Show the first 20 UK profiles"refresh_profiles_cache — "Refresh my profile list cache"Response includes profile details:
Let's assume your list included profile ID 1043817530956285. You can check for more details by getting profile details to confirm this is the one you want to use.
ac_getProfile1043817530956285"Assuming this is the profile you want to use, you need to set the profile Amazon requires for API calls:
set_active_profile1043817530956285"When you set the profile, it determines:
The profile ID will be set in the background for the duration of your session. Repeat the process if you want to switch to a new profile.
Most calls to the Amazon Ads API require a Region. Each advertiser profile ID is associated with an advertising account in a specific region/marketplace.
The region is part of an advertiser profile. When you set an advertiser profile with set_active_profile, it will set the region that is associated with the profile automatically.
set_active_profileExample prompt: "Set my active advertiser profile to 111111111111"
Since profile ID 111111111111 is based in na, the region will be set based on the profile region.
The Amazon Ads MCP server includes tools for managing API regions as defaults and dynamically, allowing you to switch between North America (na), Europe (eu), and Far East (fe) regions without restarting the server.
| Region Code | Name | API Endpoint |
|---|---|---|
na | North America | https://advertising-api.amazon.com |
eu | Europe | https://advertising-api-eu.amazon.com |
fe | Far East | https://advertising-api-fe.amazon.com |
When you set a region, the system automatically:
IMPORTANT: Avoid Region Mismatch: If you attempt to set a region that is not associated with your advertiser profile, the Ads API will reject your requests. For example, if a profile ID is attached to na and you manually set the region to eu, you have created a mismatch which will cause API request failures.
If you are not sure what region is set, you can check for the region
get_active_regionExample prompt: "What is my current active region?"
Navigate to Connector Settings
Open Claude in your browser and navigate to the settings page. You can access this by clicking on your profile icon and selecting “Settings” from the dropdown menu. Once in settings, locate and click on the “Connectors” section in the sidebar. This will display your currently configured connectors and provide options to add new ones.
Edit your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
In this example, we show how to use the bearer token using the Openbridge API key. Add this configuration to your mcpServers section:
{
"mcpServers": {
"amazon_ads_mcp": {
"command": "npx",
"args": [
"-y",
"mcp-remote@latest",
"http://${HOSTNAME}:${PORT}/mcp/",
"--allow-http",
"--header",
"Authorization:Bearer ${OPENBRIDGE_API_KEY}",
"--header",
"Accept:application/json,text/event-stream",
"--debug"
],
"env": {
"HOSTNAME": "your_hostname",
"PORT": "your_server_port",
"MCP_TIMEOUT": "120000",
"MCP_REQUEST_TIMEOUT": "60000",
"MCP_CONNECTION_TIMEOUT": "10000",
"MCP_SERVER_REQUEST_TIMEOUT": "60000",
"MCP_TOOL_TIMEOUT": "120000",
"MCP_REQUEST_WARNING_THRESHOLD": "10000",
"OPENBRIDGE_API_KEY": "your_openbridge_token_here"
}
}
}
}
Note: Replace hostname, port and your_openbridge_token_here with your actual OpenBridge token.
IMPORTANT: Cursor and Claude Desktop (Windows) have a bug where spaces inside args aren't escaped when it invokes npx, which ends up mangling these values. You can work around it using: mcp-remote custom headers documentation.
The config would look something like this:
{
"mcpServers": {
"amazon_ads_mcp": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"http://${HOSTNAME}:${PORT}/mcp/",
"--allow-http",
"--header",
"Authorization:${AUTH_HEADER}",
"--header",
"Accept: application/json, text/event-stream"
],
"env": {
"HOSTNAME": "your_hostname",
"PORT": "your_server_port",
"MCP_TIMEOUT": "120000",
"MCP_REQUEST_TIMEOUT": "60000",
"MCP_CONNECTION_TIMEOUT": "10000",
"MCP_SERVER_REQUEST_TIMEOUT": "60000",
"MCP_TOOL_TIMEOUT": "120000",
"MCP_REQUEST_WARNING_THRESHOLD": "10000",
"AUTH_HEADER": "Bearer <your_openbridge_token_here>"
}
}
}
}
Here is another example, which can be used if you are using OAuth since the OPENBRIDGE_API_KEY is not needed:
{
"mcpServers": {
"amazon_ads_mcp": {
"command": "npx",
"args": [
"-y",
"mcp-remote@latest",
"http://localhost:9080/mcp/",
"--allow-http"
],
"env": {
"MCP_TIMEOUT": "120000",
"MCP_REQUEST_TIMEOUT": "60000",
"MCP_CONNECTION_TIMEOUT": "10000",
"MCP_SERVER_REQUEST_TIMEOUT": "60000",
"MCP_TOOL_TIMEOUT": "120000",
"MCP_REQUEST_WARNING_THRESHOLD": "10000"
}
}
}
}
Note: For various Claude configurations similar to what was shown above, see the MCP Remote docs for the latest settings/options.
After saving the configuration file, restart Claude Desktop to load the new MCP server.
MCP tool registration and use can impact your AI systems usage limits. Usage limits control how much you can interact with an AI system, like Claude, over a specific time period. As Anthropic states, think of the amount of information/data used as drawing down on a "conversation budget". That budget determines how many messages you can send to your AI client, or how long you can work, before needing to wait for your limit to reset.
MCP Server tools contribute metadata like titles, descriptions, hints, and schemas to the model's context. This metadata is loaded into the LLM’s context window, which acts as its short-term working memory.
Each client, like Claude, has a fixed-size context window. This defines the maximum amount of information it can process in a single interaction—including user prompts, system instructions, tool metadata, and any prior messages.
The more tools you activate, the more of that limited space gets consumed up front. When you activate many tools, their combined schema and config payloads can significantly use up this context and you may quickly hit the context ceiling. This is when you’ll start seeing errors or warnings about exceeding the chat length limit.
The Amazon Ads MCP provides coverage across the entire API. As a result, there can be 100s of tools!
If you're encountering unexpected length issues, review which tools are active. Trimming unused ones can help minimize context use.
Code Mode is a feature that dramatically reduces tool token consumption. Instead of loading every tool schema into the LLM's context upfront, Code Mode replaces the full catalog with four lightweight meta-tools. The LLM discovers tools on demand and executes them via sandboxed Python.
| Mode | Tools in Context | Tokens Used | Context Window |
|---|---|---|---|
| Standard | 55 | ~32,000 | 16.1% |
| Code Mode | 4 | ~470 | 0.2% |
| Reduction | 98.6% |
Illustrative comparison for a representative default-sized catalog; actual tool counts and token use depend on AMAZON_AD_API_PACKAGES, server version, and tokenizer.
Code Mode uses a 4-stage discovery pattern:
Stage 1: tags → Browse categories: "campaign-management (20), accounts (14), ..."
Stage 2: search → Find tools: search("campaigns") → cm_listCampaigns, cm_createCampaign, ...
Stage 3: get_schema → Get parameters: get_schema("cm_listCampaigns") → full input schema
Stage 4: execute → Run code: sandboxed Python with await call_tool("cm_listCampaigns", {...})
All 200+ tools remain fully accessible. The LLM simply discovers and calls them on demand rather than loading every schema upfront.
Code Mode defaults to CODE_MODE=true. To use the full tool catalog in context instead, set:
CODE_MODE=false
Docker Compose — add to your environment section:
environment:
- CODE_MODE=false
Docker Run (map the host port to the container PORT, e.g. 9080):
docker run -d --env-file .env -e CODE_MODE=false -e PORT=9080 -p 9080:9080 amazon-ads-mcp:latest
Local Development (entry point is python -m amazon_ads_mcp.server, which runs the MCP server module):
CODE_MODE=false uv run python -m amazon_ads_mcp.server --transport http --port 9080
| Variable | Default | Description |
|---|---|---|
CODE_MODE | true | Enable code mode |
CODE_MODE_INCLUDE_TAGS | true | Include tag browsing in discovery (set false for small catalogs) |
CODE_MODE_MAX_DURATION_SECS | 30 | Maximum execution time per sandbox run |
CODE_MODE_MAX_MEMORY | 50000000 | Memory limit per sandbox run (50 MB) |
Once enabled, your MCP client (Claude Desktop, Claude Code, etc.) will see only four tools instead of the full catalog.
Browse available categories:
"What tool categories are available?"
The LLM calls tags and sees categories like campaign-management, sponsored-products, programmatic-dsp, accounts, reporting, etc.
Find specific tools:
"Find tools for managing campaigns"
The LLM calls search("campaigns") and gets matching tool names with brief descriptions.
Get tool details:
"Show me the parameters for creating a campaign"
The LLM calls get_schema("cm_CreateCampaign") and gets the full input schema.
Execute operations:
"List my enabled campaigns"
The LLM calls execute with Python code:
result = await call_tool("cm_QueryCampaign", {
"body": {"stateFilter": {"include": ["ENABLED"]}}
})
When the LLM calls tags, it sees human-readable categories mapped from the API prefixes:
| Category | Prefix | Description |
|---|---|---|
campaign-management | cm | Create, update, query, delete campaigns, ad groups, ads, targets |
sponsored-products | sp | Sponsored Products targeting, keywords, bids |
sponsored-brands | sb | Sponsored Brands campaigns (v3 + v4) |
sponsored-display | sd | Sponsored Display campaign and targeting tools |
programmatic-dsp | dsp | DSP advertisers, audiences, conversions, measurement |
amazon-marketing-cloud | amc | AMC workflows, audiences, administration |
accounts | ac | Profiles, billing, budgets, portfolios, manager accounts |
reporting | rp | V3 reporting tools |
brand-insights | br | Brand benchmarks and metrics |
stores | st | Stores analytics |
server-management | — | Profile, region, OAuth, download tools |
Use Code Mode when:
Use Standard Mode when:
After starting the server with CODE_MODE=true, verify it is active:
# Check server logs for confirmation
docker logs <container> 2>&1 | grep "Code mode"
# Expected: "Code mode active: 4 meta-tools exposed (tags, search, get_schema, execute)"
In your MCP client, you should see only four tools: tags, search, get_schema, and execute. If you see the full tool catalog, code mode is not active — check your environment variable.
Use tool_audit to measure token footprint for tool catalogs and code mode behavior.
.venv/bin/python -m amazon_ads_mcp.tool_audit \
--url http://127.0.0.1:9080/mcp \
--limit 20
JSON output:
.venv/bin/python -m amazon_ads_mcp.tool_audit \
--url http://127.0.0.1:9080/mcp \
--format json \
--limit 0 \
> /tmp/tool_audit.json
When code mode is active, use probe mode to estimate on-demand schema fetch cost:
.venv/bin/python -m amazon_ads_mcp.tool_audit \
--url http://127.0.0.1:9080/mcp \
--format json \
--limit 0 \
--code-mode-probe \
--probe-limit 50 \
--probe-queries "campaign,ad,report,profile,dsp,amc,brand,targeting" \
> /tmp/tool_audit_code_mode.json
jq '{tool_count,total_tool_tokens,context_window_percent}' /tmp/tool_audit.json
jq '{tool_count,total_tool_tokens,context_window_percent,code_mode_probe}' /tmp/tool_audit_code_mode.json
Key fields:
total_tool_tokens: Upfront token load from tools/listcontext_window_percent: Share of configured context windowcode_mode_probe.total_schema_tokens: Total sampled schema-fetch token cost in code modecode_mode_probe.avg_schema_tokens: Average token cost per fetched schemaMany Amazon Ads API operations are long-running — report generation, export creation, AMC workflow execution, audience processing, and DSP measurement studies can take seconds to minutes. Background tasks allow these operations to run without blocking the conversation.
Background tasks are enabled by default. When a client requests background execution for any tool:
All async tools in the server support background execution automatically. The client decides per-call whether to run a tool in the foreground (wait for result) or background (get task ID, poll later).
These tools orchestrate multi-step workflows (download and HTTP access to server-side files):
| Tool | Purpose |
|---|---|
download_export | Downloads a completed export or report file from Amazon S3 to local storage |
list_downloads | Lists all downloaded files for the active profile |
get_download_url | Returns an HTTP URL to fetch a downloaded file |
These tools include progress reporting so clients can track each stage of the workflow.
| Variable | Default | Description |
|---|---|---|
ENABLE_TASKS | true | Enable background task execution for all async tools |
To disable background tasks:
ENABLE_TASKS=false
Docker Compose — add to your environment section:
environment:
- ENABLE_TASKS=false
The server uses an in-memory task backend by default. Tasks are tracked for the lifetime of the server process. If the server restarts, in-progress tasks are lost.
For persistent task tracking across restarts, configure a Redis backend:
FASTMCP_DOCKET_URL=redis://localhost:6379
| Task | Example Prompt |
|---|---|
| Generate a report | "Generate a Sponsored Products campaign report for March 2026" |
| Export campaigns | "Export all my enabled campaigns" |
| Run AMC workflow | "Execute my audience overlap workflow for the last 30 days" |
Server not connecting?
docker compose psdocker compose logs -fPORT in .env (.env.example uses 9080; your mapping must match)Authentication errors?
Claude not recognizing the server?
| Doc | Purpose |
|---|---|
| INSTALL.md | Full install, verification, upgrades, developer setup |
| AGENTS.md | Environment variables, Docker, MCP tuning, contribution workflow |
| This README | Overview, auth walkthrough, downloads, clients, code mode |
This project is licensed under the MIT License — see the LICENSE file for details.
Security: report vulnerabilities through GitHub private security advisories for this repository.
AMAZON_ADS_AUTH_METHODAuthentication method: direct or openbridge.
AMAZON_AD_API_CLIENT_IDAmazon Ads API client ID for direct auth.
AMAZON_AD_API_CLIENT_SECRETsecretAmazon Ads API client secret for direct auth.
AMAZON_AD_API_REFRESH_TOKENsecretAmazon Ads API refresh token for direct auth.
AMAZON_AD_API_PROFILE_IDAmazon Ads profile ID for direct auth.
OPENBRIDGE_REFRESH_TOKENsecretOpenbridge refresh token (API key).
OPENBRIDGE_API_KEYsecretOpenbridge API key (alias for OPENBRIDGE_REFRESH_TOKEN).
OPENBRIDGE_REMOTE_IDENTITY_IDOpenbridge remote identity ID.
AMAZON_ADS_REGIONAmazon Ads API region (na/eu/fe).
AMAZON_AD_API_PACKAGESComma-separated API packages to load.
AMAZON_ADS_DOWNLOAD_AUTH_TOKENsecretOptional bearer token to protect download routes.
io.github.shelvick/shopify-subscription-reconciliation
zleventer/google-ads-mcp
csoai-org/meok-stripe-acp-checkout-mcp
io.github.mharnett/google-ads
csoai-org/stripe-billing-mcp
co.pipeboard/google-ads-mcp