Skip to main content
Glama
amazon-ads-mcp

amazon-ads-mcp

amazon-ads-py

A typed Python client, command line tool and MCP server for the Amazon Ads API.

  • Every endpoint. All 1,094 operations in the 202 Ads API specs Amazon publishes can be called by id, with the right method, path and versioned media types, corrected where the live API refuses what its spec documents. Sponsored Products, suggested bids, change history, reports and profiles also have typed, hand-written methods.

  • Safe batch writes. Amazon accepts or rejects each item in a batch on its own and answers 207 even when everything failed. Every write returns per-item results, and nothing is silently dropped.

  • Change plans and rollback. Build a plan, review a before and after table, apply it, and get a rollback plan that undoes exactly what Amazon accepted. You can also restore bids and states to any moment in the last 90 days from Amazon's own change history.

  • Throttling handled. 429s are retried after Amazon's Retry-After, and every request from the client pauses during the wait. Writes that could duplicate are never retried blindly.

  • Reports in one call. Queue, poll, download and parse, with ranges longer than 31 days split automatically. Seven Sponsored Products presets have been verified against the live API.

  • A local warehouse. Report history is synced into SQLite, keeping data after Amazon deletes it (65 to 95 days) and re-pulling recent days that Amazon still revises.

  • Built for Claude. An MCP server lets Claude read the account and propose changes. It can only apply a change the user has seen and approved.

  • Amazon's undocumented quirks, handled. For example, suggested bids for ASIN targets, history queries that return nothing unless phrased a certain way, and 425 duplicate reports. See API quirks.

Not affiliated with or endorsed by Amazon.

Install

pip install "amazon-ads-py[cli]"          # library + adsctl
pip install "amazon-ads-py[cli,mcp]"      # plus the MCP server
pip install "amazon-ads-py[all]"          # plus pandas for report DataFrames

Python 3.11 or newer. With uv: uv add "amazon-ads-py[cli]" or uvx --from "amazon-ads-py[cli]" adsctl --help.

Related MCP server: Google Ads MCP Server

Credentials

You need Amazon Ads API access and a Login with Amazon client. The getting started guide walks through Amazon's onboarding. Put the credentials in the environment or a .env file:

AMAZON_ADS_CLIENT_ID=amzn1.application-oa2-client.xxxx
AMAZON_ADS_CLIENT_SECRET=xxxx
AMAZON_ADS_REFRESH_TOKEN=Atzr|xxxx
AMAZON_ADS_CONSENT_DATE=2026-09-26   # optional: warns before the 365-day expiry

No refresh token yet? Run adsctl auth url, open the link, approve, then run adsctl auth exchange --write-env .env and paste the address you were redirected to.

Python

from datetime import date
from amazon_ads import AmazonAds

ads = AmazonAds.from_env(env_file=".env")
us = ads.profile("US")                     # or "UK", "AU", a profile id...

# Read
campaigns = us.sp.campaigns.list()
keywords = us.sp.keywords.list(campaign_ids=[campaigns[0].campaign_id])

# Suggested bids for existing keywords, keyed by keyword id
for keyword_id, s in us.bids.for_keywords(keywords).items():
    print(keyword_id, s.low, s.median, s.high)

# Write, with per-item results
result = us.sp.keywords.update([{"keywordId": keywords[0].keyword_id, "bid": 0.45}])
result.raise_for_errors()                  # raises PartialFailureError listing failures

# Or review first: a plan shows before/after and can be reversed
plan = us.sp.keywords.plan_update([{"keywordId": keywords[0].keyword_id, "bid": 0.50}])
print(plan.to_markdown())
applied = plan.apply(us, check_drift=True)
applied.rollback_plan().save("rollbacks/")  # the rollback token

# Reports over any range
report = us.reports.run("sp_placement", date(2026, 8, 1), date(2026, 9, 25))
df = report.to_dataframe()

# Anything else in Amazon's specs, by operation id
us.call("sponsored-brands-v4:ListSponsoredBrandsCampaigns", {"maxResults": 10})

Command line

adsctl profiles
adsctl list keywords -m US --campaign-id 123456789
adsctl bids targets -m UK                         # suggested vs live bid, every ASIN target
adsctl history -m US --since -3 --change BID_AMOUNT
adsctl report sp_search_terms -m US --start -30 --out terms.json
adsctl sync --db ads.sqlite -m US -m UK -m CA -m AU
adsctl plan update keywords bids.csv -m US --note "raise exact bids"
adsctl plan apply plan-3f9c2a1b7d4e.json          # shows the table, asks, saves the rollback
adsctl ops search sponsored brands campaigns

Add --json, --format csv or --format jsonl to any read command. Full reference: docs/cli.md.

Claude (MCP server)

Claude Code:

claude mcp add amazon-ads --env AMAZON_ADS_ENV_FILE=/path/to/.env -- amazon-ads-mcp

Claude Desktop (claude_desktop_config.json):

{
  "mcpServers": {
    "amazon-ads": {
      "command": "amazon-ads-mcp",
      "env": { "AMAZON_ADS_ENV_FILE": "/path/to/.env" }
    }
  }
}

Claude can list and search the account, pull suggested bids, change history and reports, and call any read-only operation. To change something it builds a plan, shows you the table, and applies it only with that plan's fingerprint after you approve. AMAZON_ADS_MCP_READ_ONLY=1 removes the write tools entirely. See docs/mcp.md.

Documentation

License

Apache 2.0. See LICENSE.

Available Tools

16 tools
api_notesA
Read-only

Amazon Ads API behavior the official docs do not state. Read once per session.

Inputs: no named parameters. Returns: result

apply_planA
Destructive

Apply a saved plan. Only call after the user approved this exact plan.

fingerprint must equal the one returned when the plan was built or fetched, which guarantees the plan being applied is the one that was shown. With check_drift (default) the plan is refused if any value changed since it was built.

Inputs: plan_id (required), fingerprint (required), check_drift. Returns: object

call_operationA
Read-only

Call a read-only operation from Amazon's specs by id (see search_operations). Operations that can change data are refused here; use a plan tool instead.

Inputs: market (required), operation (required), body, query, +1 more.

get_change_historyC
Read-only

What changed, from what, to what and when (up to 90 days back).

since: ISO date or datetime; otherwise the last days days. entity_types: CAMPAIGN, AD_GROUP, AD, KEYWORD, NEGATIVE_KEYWORD, PRODUCT_TARGETING. changes: BID_AMOUNT, STATUS, BUDGET_AMOUNT, CREATED, PLACEMENT_GROUP, ...

Inputs: market (required), days, since, changes, +3 more. Returns: object

get_planB
Read-only

A saved plan's table, fingerprint and status (applied or not).

Inputs: plan_id (required). Returns: object

get_suggested_bidsA
Read-only

Amazon's suggested low/median/high bid next to the live bid, for existing enabled keywords or targets (kind: "keywords" or "targets").

Inputs: kind (required), market (required), ids, theme, +2 more. Returns: object

get_suggested_bids_for_newA
Read-only

Suggested bids before an ad group exists: for the book(s) in asins, price keywords ([{"text": ..., "match": "EXACT"|"PHRASE"|"BROAD"}]) and product targets on target_asins.

Inputs: asins (required), market (required), theme, keywords, +1 more. Returns: object

list_entitiesA
Read-only

List Sponsored Products entities in one market.

entity: campaigns, ad_groups, keywords, targets, negative_keywords, negative_targets, campaign_negative_keywords, campaign_negative_targets, product_ads or portfolios. States default to ENABLED and PAUSED; include_archived lists every state. text_contains filters keywords, names and ASINs case-insensitively after fetching.

Inputs: entity (required), market (required), ids, states, +4 more. Returns: object

list_plansB
Read-only

Recent plans, newest first, with whether each was applied.

Inputs: limit. Returns: result

list_profilesA
Read-only

Every advertising profile (account x marketplace) the credentials reach.

Inputs: no named parameters. Returns: result

plan_archiveB

Build (not apply) an archive. Archiving cannot be undone; prefer pausing.

Inputs: ids (required), entity (required), market (required), note. Returns: object

plan_createB

Build (not apply) a create, e.g. keywords [{"campaignId", "adGroupId", "keywordText", "matchType": "EXACT", "bid": 0.5, "state": "ENABLED"}].

Inputs: items (required), entity (required), market (required), note. Returns: object

plan_restore_from_historyA

Build (not apply) a plan restoring bids and states to what they were at since (ISO datetime, UTC if no offset), from Amazon's change history.

Inputs: since (required), market (required), campaign_ids. Returns: object

plan_updateB

Build (not apply) an update: each change is the entity id plus new values, e.g. {"keywordId": "123", "bid": 0.45} or {"targetId": "9", "state": "PAUSED"}.

Inputs: entity (required), market (required), changes (required), note. Returns: object

run_reportA
Read-only

Run a report (dates YYYY-MM-DD, any length) and return rows or totals.

preset: sp_campaigns, sp_placement, sp_ad_groups, sp_targeting, sp_search_terms, sp_advertised_products, sp_purchased_products. group_by (e.g. ["campaignName", "placementClassification"]) sums numeric columns per group instead of returning daily rows. save_to writes every row to a JSON file.

Inputs: end (required), start (required), market (required), preset (required), +2 more. Returns: object

search_operationsB
Read-only

Find any of the ~1,200 operations in Amazon's published specs by keyword.

Inputs: text (required), api. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 16 tools

    Disambiguation5/5

    Each tool serves a clear function: list/get for reads, plan_* for building changes, apply for execution, run_report for analytics, and history/bids/operations for specific lookups. The two suggested-bid tools are explicitly separated by 'existing' vs 'new', and the plan tools are distinct despite sharing a prefix.

    Naming Consistency3/5

    Most tools follow a verb_noun pattern (list_profiles, get_change_history, run_report, apply_plan), but the plan-building tools invert it (plan_update, plan_create, plan_archive, plan_restore_from_history) and api_notes is a bare noun. The mixed conventions are still readable, but the inconsistency is noticeable across a subset of tools.

    Tool Count4/5

    16 tools is slightly above the typical 3-15 range, but the Amazon Ads domain is broad enough to warrant the extra surface. The plan sub-system uses 7 tools, yet each covers a distinct phase of the plan lifecycle, and the remaining tools handle entities, bids, history, reports, and API introspection.

    Completeness4/5

    The set covers the core workflows: listing profiles/entities, checking bids, viewing change history, running reports, and mutating state through a well-designed plan system (create, update, archive, restore, apply). Minor gaps like a dedicated single-entity getter or direct write operations are handled reasonably through list filtering and the plan-based write path.

    Maintenance

    ActivityActive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables users to analyze, manage, and optimize digital advertising campaigns through natural language conversations in Claude, offering performance insights, interactive visualizations, and campaign management for platforms like Amazon Ads.
      5
      ISC
    • A
      license
      A
      quality
      D
      maintenance
      Enables AI assistants to interact with the Amazon Advertising API to manage campaigns, keywords, product ads, and retrieve performance metrics.
      9
      41 npm
      3
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables natural-language analysis and management of Google Ads accounts, campaigns, keywords, budgets, and performance metrics through Claude.
      MIT