Skip to main content
Glama
amazon-ads-mcp

amazon-ads-mcp

amazon-ads-mcp

Production-ready MCP server connecting Amazon Advertising data to Claude and any MCP-compatible client.

Query Sponsored Products, Sponsored Brands and Sponsored Display structure and performance, run Amazon DSP reports, and execute Amazon Marketing Cloud (AMC) SQL workflows — all in natural language, with live data straight from the Amazon Ads API. No mock data, ever.

CI License: MIT Node >= 20


Features

  • 23 read-only tools across profiles, Sponsored Products (v3), Sponsored Brands (v4), Sponsored Display, unified Reporting v3, Amazon DSP, and AMC

  • Data accuracy by construction — every number comes live from Amazon; downloaded reports pass integrity checks (column presence, non-negative metric invariants, daily date-coverage) and totals are computed server-side so the model never sums truncated samples

  • Resilient HTTP layer — OAuth token refresh with single-flight de-duplication, client-side token-bucket rate limiting, exponential backoff with jitter, Retry-After honoring on 429, one automatic re-auth on 401

  • Fast on large accounts — TTL response cache for entity reads, nextToken/index pagination passthrough, parallel tool calls are safe (rate limiter serializes the wire)

  • Secure by default — secrets only via environment variables, redacted from logs, never written to disk; logs go to stderr (stdout is reserved for the MCP protocol)

  • Two transports — stdio for Claude Desktop / Claude Code, streamable HTTP for Docker or remote deployment

  • Tested — 36 unit/integration tests including full MCP wire-protocol tests with the Amazon API mocked at the fetch boundary

Related MCP server: Marketing Analytics MCP Server

Architecture

flowchart LR
    subgraph Client["MCP Client"]
        C[Claude Desktop / Claude Code / any MCP host]
    end
    subgraph Server["amazon-ads-mcp"]
        T[MCP tool layer<br/>zod-validated schemas]
        V[Validation & reconciliation]
        H[HTTP client<br/>retries · rate limit · cache]
        A[Token manager<br/>LwA refresh, single-flight]
    end
    subgraph Amazon["Amazon"]
        LWA[Login with Amazon<br/>OAuth token endpoint]
        API[Amazon Ads API<br/>NA / EU / FE]
        S3[Signed report URLs]
    end

    C -- stdio / streamable HTTP --> T
    T --> V --> H
    H --> A --> LWA
    H --> API
    H -- report download<br/>no auth headers --> S3

Async reporting flow (Reporting v3, DSP, AMC all follow it):

sequenceDiagram
    participant Claude
    participant MCP as amazon-ads-mcp
    participant Ads as Amazon Ads API

    Claude->>MCP: create_report(dates, columns, ...)
    MCP->>Ads: POST /reporting/reports
    Ads-->>MCP: reportId (PENDING)
    loop until COMPLETED (1–15 min typical)
        Claude->>MCP: get_report_status(reportId)
        MCP->>Ads: GET /reporting/reports/{id}
    end
    Claude->>MCP: download_report(reportId)
    MCP->>Ads: fetch signed URL, gunzip, validate
    MCP-->>Claude: reconciled totals + row sample (+ optional JSON file)

Prerequisites

You need Amazon Ads API access (this is Amazon's process, not this project's):

  1. An Amazon Ads account (seller, vendor, or agency).

  2. A Login with Amazon (LwA) security profile with the Amazon Ads API scope approved — apply via the onboarding guide.

  3. A refresh token generated through the LwA authorization-code grant for your own account (create authorization grant).

Plus Node.js ≥ 20 (or Docker).

New to all of this? Follow the step-by-step User Guide — it walks through Amazon API onboarding, refresh-token generation, installation, and Claude setup with no prior knowledge assumed.

Installation

git clone https://github.com/Imsamiullah09/amazon-ads-mcp.git
cd amazon-ads-mcp
npm ci
npm run build

Environment variables

Copy .env.example and fill it in:

Variable

Required

Description

AMAZON_ADS_CLIENT_ID

✅

LwA client id (amzn1.application-oa2-client.…)

AMAZON_ADS_CLIENT_SECRET

✅

LwA client secret

AMAZON_ADS_REFRESH_TOKEN

✅

LwA refresh token (Atzr|…)

AMAZON_ADS_REGION

✅

NA, EU, or FE — must match where the refresh token was issued

AMAZON_ADS_PROFILE_ID

Default advertiser profile (else pass profileId per tool call)

MCP_TRANSPORT

stdio (default) or http

MCP_HTTP_PORT

HTTP port, default 3000

AMAZON_ADS_RATE_LIMIT_RPS

Client-side request ceiling, default 5/s

AMAZON_ADS_CACHE_TTL_SECONDS

Entity-read cache TTL, default 60 (0 disables)

AMAZON_ADS_MAX_RETRIES

Retry attempts for 429/5xx, default 4

LOG_LEVEL

pino level, default info (logs go to stderr)

REPORT_OUTPUT_DIR

Where download_report --saveAs writes files, default ./reports-output

Claude Desktop

Add to claude_desktop_config.json (Settings → Developer → Edit Config), or copy examples/claude_desktop_config.json:

{
  "mcpServers": {
    "amazon-ads": {
      "command": "node",
      "args": ["/absolute/path/to/amazon-ads-mcp/dist/index.js"],
      "env": {
        "AMAZON_ADS_CLIENT_ID": "amzn1.application-oa2-client.…",
        "AMAZON_ADS_CLIENT_SECRET": "…",
        "AMAZON_ADS_REFRESH_TOKEN": "Atzr|…",
        "AMAZON_ADS_REGION": "NA",
        "AMAZON_ADS_PROFILE_ID": "1234567890"
      }
    }
  }
}

Restart Claude Desktop and ask: “Run a health check on my Amazon Ads connection.”

Claude Code

claude mcp add amazon-ads \
  -e AMAZON_ADS_CLIENT_ID=… -e AMAZON_ADS_CLIENT_SECRET=… \
  -e AMAZON_ADS_REFRESH_TOKEN=… -e AMAZON_ADS_REGION=NA \
  -- node /absolute/path/to/amazon-ads-mcp/dist/index.js

Docker

cp .env.example .env   # fill in credentials
docker compose up -d   # streamable HTTP on http://127.0.0.1:3000/mcp

The compose file binds to localhost only: the HTTP endpoint deliberately ships without its own auth layer (it holds a single advertiser's credentials). For remote access, front it with your own reverse proxy and authentication. For stdio inside Docker: docker run -i --env-file .env -e MCP_TRANSPORT=stdio amazon-ads-mcp.

Example prompts

  • “List my advertiser profiles and tell me which marketplaces I'm in.”

  • “Show all enabled Sponsored Products campaigns and their daily budgets.”

  • “Create a daily campaign performance report for the last 30 days, wait for it, and summarize spend, sales and ACOS by campaign.”

  • “Pull a search-term report for May and find queries with clicks but zero purchases.”

  • “Which ASINs am I advertising in ad group X?”

  • “Run my AMC workflow path_to_conversion for last week and give me the download links.”

More in examples/prompts.md. Full tool reference in docs/API.md.

Data accuracy & reconciliation

  • No mock data. Every tool hits the live Amazon Ads API; errors are surfaced (with Amazon's request id) instead of silently degraded.

  • download_report validates each report: requested columns present, invariant metrics (impressions, clicks, cost, sales…) non-negative, and daily reports checked for date-coverage gaps.

  • Totals are computed once, server-side, and returned alongside a bounded row sample — the model is explicitly instructed to quote reconciled totals rather than re-sum samples.

  • Entity reads are cached for 60 s by default (configurable, or disable with AMAZON_ADS_CACHE_TTL_SECONDS=0); report status/downloads are never cached.

  • Caveat that applies to any Amazon Ads integration: Amazon's own attribution metrics are restated for up to ~14 days after the fact, so a report pulled today can legitimately differ from the same report pulled next week. That is Amazon-side behavior, not a sync bug.

Verified capabilities vs. assumptions

This project distinguishes what is verified against Amazon's public documentation from what depends on your account's entitlements:

Area

Status

Profiles /v2/profiles

✅ Verified, generally available

Sponsored Products v3 (POST /sp/*/list, versioned media types)

✅ Verified

Sponsored Brands v4 (POST /sb/v4/*/list)

✅ Verified

Sponsored Display (GET /sd/*)

✅ Verified for self-service SD accounts

Reporting v3 (/reporting/reports, GZIP_JSON async)

✅ Verified

Amazon DSP reports & orders

⚠️ Entitlement-gated. Requires a DSP seat with API access; without it Amazon returns 403. Endpoint media-type versions evolve — pin against Amazon's DSP docs for your account type.

AMC workflows/executions

⚠️ Entitlement-gated + evolving. Requires a provisioned AMC instance with your LwA client allow-listed. Endpoint shapes follow the AMC Reporting API; verify against the AMC docs for your instance before relying on them in production.

Write operations (create/update campaigns, bids, budgets)

❌ Intentionally not implemented in v1. This server is read/reporting-only to make it safe against production ad spend. PRs welcome behind an explicit opt-in flag.

Rate limits

Amazon's limits are dynamic and undocumented; this server enforces a client-side ceiling and honors 429 Retry-After, but cannot guarantee you'll never be throttled.

Development

npm run dev        # run from source (tsx)
npm test           # vitest suite (36 tests, no network — fetch is mocked)
npm run typecheck  # strict TS
npm run build      # emit dist/

See docs/ARCHITECTURE.md for module layout and design decisions, and CONTRIBUTING.md for workflow. Security policy: SECURITY.md.

License

MIT

Available Tools

23 tools
amc_create_workflowCreate AMC workflow (SQL)A

Save an AMC SQL workflow on an instance. AMC SQL queries clean-room event tables (impressions, clicks, conversions); aggregation thresholds apply — queries returning user-level data are rejected by AMC.

Inputs: entityId (required), marketplaceId (required), instanceId (required), workflowId (required), +1 more.

amc_execute_workflowExecute AMC workflow (async)A

Start an execution of a saved AMC workflow over a time window. Returns an execution id; poll with amc_get_execution, then fetch results with amc_get_download_urls.

Inputs: entityId (required), marketplaceId (required), instanceId (required), workflowId (required), +3 more.

amc_get_download_urlsGet AMC result download URLsA
Read-only

Get signed download URLs (CSV) for a SUCCEEDED AMC workflow execution. URLs expire after a short period.

Inputs: entityId (required), marketplaceId (required), instanceId (required), executionId (required).

amc_get_executionCheck AMC execution statusA
Read-only

Check the status of an AMC workflow execution (PENDING/RUNNING/SUCCEEDED/FAILED).

Inputs: entityId (required), marketplaceId (required), instanceId (required), executionId (required).

amc_list_instancesList AMC instancesA
Read-only

List Amazon Marketing Cloud instances for an AMC entity. REQUIRES a provisioned AMC instance with this API client allow-listed; otherwise returns 403 (an Amazon entitlement, not a server bug).

Inputs: entityId (required), marketplaceId (required).

amc_list_workflowsList AMC workflowsB
Read-only

List saved AMC SQL workflows on an instance.

Inputs: entityId (required), marketplaceId (required), instanceId (required).

create_reportCreate performance report (async)A

Request an async performance report (Reporting v3) for Sponsored Products, Brands or Display. Returns a reportId immediately; reports typically complete in 1–15 minutes (up to ~3h for large accounts). Poll with get_report_status, then fetch data with download_report. Common reportTypeIds: spCampaigns, spTargeting, spSearchTerm, spAdvertisedProduct, sbCampaigns, sdCampaigns. Example columns for spCampaigns: campaignId, campaignName, impressions, clicks, cost, purchases14d, sales14d (+ date when timeUnit=DAILY).

Inputs: startDate (required), endDate (required), adProduct (required), reportTypeId (required), +5 more.

download_reportDownload + validate report dataA
Read-only

Download a COMPLETED report, decompress it, run data-integrity checks (column presence, non-negative metrics, daily date coverage) and return reconciled totals plus a row sample. Large result sets are NOT dumped into chat: totals are computed server-side and the full dataset can be saved to a local JSON file via saveAs. Always present the reconciliation totals rather than re-summing sample rows.

Inputs: reportId (required), profileId, maxRowsInline, saveAs.

dsp_create_reportCreate DSP report (async)A

Request an async Amazon DSP report (impressions, viewability, conversions, etc.) for a DSP account. Requires DSP API access. Returns a reportId; poll with dsp_get_report until the report has a download location.

Inputs: accountId (required), startDate (required), endDate (required), profileId, +5 more.

dsp_get_reportCheck DSP report statusA
Read-only

Check status of a DSP report. When complete, the response includes a signed download location URL valid for a limited time.

Inputs: accountId (required), reportId (required), profileId.

dsp_list_ordersList DSP ordersA
Read-only

List Amazon DSP orders (campaigns) for a DSP advertiser profile. REQUIRES DSP entity access on your API client — accounts without a DSP seat get HTTP 403 (an Amazon entitlement, not a server bug).

Inputs: profileId, startIndex, count.

get_profilesList advertiser profilesA
Read-only

List all Amazon Ads advertiser profiles (accounts) accessible to these credentials in the configured region. Returns profileId, marketplace, currency, timezone and account info. Call this first: the profileId scopes every other tool.

Inputs: no named parameters.

get_report_statusCheck report statusA
Read-only

Check the status of an async report created with create_report. Status flows PENDING → PROCESSING → COMPLETED (or FAILURE with a reason). When COMPLETED, use download_report.

Inputs: reportId (required), profileId.

health_checkConnection health checkA
Read-only

Verify credentials and connectivity: refreshes the LwA access token and lists profiles, reporting region, latency and configuration (secrets redacted). Use to diagnose auth/setup issues.

Inputs: no named parameters.

sb_list_ad_groupsList Sponsored Brands ad groupsA
Read-only

List Sponsored Brands ad groups (v4), optionally filtered by campaign ids.

Inputs: profileId, stateFilter, campaignIds, maxResults, +1 more.

sb_list_campaignsList Sponsored Brands campaignsA
Read-only

List Sponsored Brands campaigns (v4) with budgets, states and dates. Paginate with nextToken. Use create_report (adProduct SPONSORED_BRANDS) for performance metrics.

Inputs: profileId, stateFilter, campaignIds, maxResults, +1 more.

sd_list_ad_groupsList Sponsored Display ad groupsA
Read-only

List Sponsored Display ad groups with bid optimization settings and states.

Inputs: profileId, stateFilter, startIndex, count.

sd_list_campaignsList Sponsored Display campaignsB
Read-only

List Sponsored Display campaigns with budgets, tactics and states. Uses startIndex/count pagination (not nextToken).

Inputs: profileId, stateFilter, startIndex, count.

sp_list_ad_groupsList Sponsored Products ad groupsA
Read-only

List Sponsored Products ad groups (v3), optionally filtered to specific campaigns. Paginate with nextToken.

Inputs: profileId, stateFilter, campaignIds, maxResults, +1 more.

sp_list_campaignsList Sponsored Products campaignsA
Read-only

List Sponsored Products campaigns (v3) with budgets, states, targeting type and dates. Paginate with nextToken. For performance metrics, use create_report instead — entity endpoints return configuration, not spend/sales.

Inputs: profileId, stateFilter, campaignIds, maxResults, +1 more.

sp_list_keywordsList Sponsored Products keywordsA
Read-only

List Sponsored Products keywords (v3) with match types, bids and states. Filter by campaignIds or adGroupIds; paginate with nextToken.

Inputs: profileId, stateFilter, campaignIds, maxResults, +2 more.

sp_list_product_adsList Sponsored Products product adsB
Read-only

List Sponsored Products product ads (v3): which ASINs/SKUs are advertised in which ad groups, with states.

Inputs: profileId, stateFilter, campaignIds, maxResults, +2 more.

sp_list_targetsList Sponsored Products product/category targetsA
Read-only

List Sponsored Products targeting clauses (v3): product, category and auto-targeting expressions with bids and states.

Inputs: profileId, stateFilter, campaignIds, maxResults, +2 more.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 23 tools

    Disambiguation5/5

    Each tool targets a distinct resource and action, with clear prefixes (amc_, dsp_, sb_, sd_, sp_) and descriptive verbs (create, list, get, download). No two tools are ambiguous; even similar listing tools differ by ad product type.

    Naming Consistency4/5

    Most tools follow a consistent pattern: domain prefix (e.g., amc_, dsp_, sp_) + verb + noun. The only slight deviation is 'health_check', which uses noun_noun instead of verb_noun, but it's a common exception. Overall, naming is predictable and well-structured.

    Tool Count5/5

    With 23 tools covering AMC workflows, multiple ad product types (Sponsored Products, Brands, Display), DSP, and general profile/health, the number is well-scoped. Each tool earns its place, and there is no bloat or redundancy.

    Completeness3/5

    The tool surface is strong for listing and reporting but lacks mutation operations (create, update, delete) for campaigns, ad groups, keywords, and targets. There are no tools to manage budgets or bids, which are essential for advertising management, leaving notable gaps.

    Maintenance

    ActivityInactive
    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
    • F
      license
      B
      quality
      D
      maintenance
      Enables natural language querying of marketing analytics across Google Search Console, GA4, Google Ads, HubSpot, and Bing. Provides tools for search queries, traffic, campaign performance, and composite cross-platform rollups.
      79
      -
    • F
      license
      Not graded
      quality
      C
      maintenance
      Enables querying ad campaign performance and setup across Meta, TikTok, and Google Ads using natural language through AI agents.
      1
      -
    • 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
      49 npm
      3
      MIT