Skip to main content
Glama
amazonads-mcp

amazonads-mcp

by cprice70

Amazon Ads MCP Server

一个 Model Context Protocol (MCP) 服务器,提供用于与 Amazon Advertising API 交互的工具。该服务器使 AI 助手能够访问和管理 Amazon Ads 广告活动、关键词、性能数据等。

功能

此 MCP 服务器提供以下工具:

  • get_profiles:列出所有可用的 Amazon Ads 配置文件/账户

  • get_campaigns:检索广告活动,可按状态和类型进行筛选

  • get_campaign_performance:获取广告活动的绩效指标(展示次数、点击次数、花费、销售额)

  • get_keywords:检索广告活动或广告组的关键词

  • update_keyword_bid:更新特定关键词的出价金额

  • create_campaign:创建新的广告活动

  • get_product_ads:检索广告活动或广告组的商品广告

Related MCP server: Amazon Ads API MCP

前提条件

  1. Amazon Ads 账户:您需要一个有效的 Amazon Ads 账户

  2. API 凭据:注册 Amazon Ads API 访问权限并获取:

    • Client ID

    • Client Secret

    • Refresh Token

获取 Amazon Ads API 凭据

步骤 1:注册您的应用程序

  1. 前往 Amazon Advertising API

  2. 使用您的 Amazon Ads 账户登录

  3. 导航到开发者中心并创建一个新应用程序

  4. 您将收到一个 Client ID 和 Client Secret - 请保存好!

步骤 2:获取您的 Refresh Token

我们提供了一个辅助脚本,通过 OAuth 流程获取您的 refresh token:

  1. 在项目根目录创建一个 .env 文件:

    AMAZON_ADS_CLIENT_ID=your_client_id_here
    AMAZON_ADS_CLIENT_SECRET=your_client_secret_here
  2. 运行 OAuth 辅助脚本:

    npm run get-token
  3. 您的浏览器将打开 Amazon 的授权页面

  4. 登录并授权该应用程序

  5. 脚本将显示您的 refresh token - 将其复制到您的 .env 文件中

步骤 3:注意您的区域

确定您的广告区域:

  • NA:北美(amazon.com)

  • EU:欧洲(amazon.co.uk、amazon.de 等)

  • FE:远东(amazon.co.jp 等)

安装

  1. 克隆此仓库:

git clone <your-repo-url>
cd amazonads-mcp
  1. 安装依赖:

npm install
  1. 构建项目:

npm run build

配置

环境变量

创建 .env 文件或设置以下环境变量:

AMAZON_ADS_CLIENT_ID=your_client_id
AMAZON_ADS_CLIENT_SECRET=your_client_secret
AMAZON_ADS_REFRESH_TOKEN=your_refresh_token
AMAZON_ADS_REGION=NA  # Options: NA, EU, FE
AMAZON_ADS_SANDBOX=false  # Set to true for testing with sandbox API

Claude Desktop 配置

将此服务器添加到您的 Claude Desktop 配置文件中:

macOS:~/Library/Application Support/Claude/claude_desktop_config.json Windows:%APPDATA%/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "amazonads": {
      "command": "node",
      "args": ["/absolute/path/to/amazonads-mcp/build/index.js"],
      "env": {
        "AMAZON_ADS_CLIENT_ID": "your_client_id",
        "AMAZON_ADS_CLIENT_SECRET": "your_client_secret",
        "AMAZON_ADS_REFRESH_TOKEN": "your_refresh_token",
        "AMAZON_ADS_REGION": "NA"
      }
    }
  }
}

使用示例

在 Claude Desktop 中配置完成后,您可以要求 Claude:

  • "显示我所有的 Amazon Ads 广告活动"

  • "广告活动 ID 12345 从 1 月 1 日到 1 月 31 日的绩效指标是什么?"

  • "列出广告活动 12345 的所有关键词"

  • "将关键词 67890 的出价更新为 1.50 美元"

  • "创建一个每日预算为 50 美元的新 Sponsored Products 广告活动"

  • "显示广告活动 12345 中的所有商品广告"

开发

项目结构

amazonads-mcp/
├── src/
│   ├── index.ts              # Main MCP server implementation
│   └── amazon-ads-client.ts  # Amazon Ads API client
├── build/                     # Compiled JavaScript output
├── package.json
├── tsconfig.json
└── README.md

构建

npm run build

开发模式

监视更改并自动重新构建:

npm run watch

测试服务器

直接运行服务器:

npm start

服务器通过 stdio 进行通信,并期望接收 MCP 协议消息。

API 覆盖范围

此服务器目前支持:

  • Sponsored Products:全面支持广告活动、关键词和商品广告

  • Sponsored Brands:广告活动管理(部分支持)

  • Sponsored Display:广告活动管理(部分支持)

  • 报告:基本绩效指标(简化实现)

重要说明

  1. 速率限制:Amazon Ads API 有速率限制。该客户端目前未实现速率限制逻辑。

  2. Reporting API:get_campaign_performance 工具使用简化实现。对于生产环境,您应实现完整的异步报告流程:

    • 创建报告请求

    • 轮询报告完成状态

    • 下载并解析报告

  3. 错误处理:API 错误会返回给调用方。请确保正确配置凭据,以避免身份验证错误。

  4. 区域:请根据您的 Amazon Ads 账户设置正确的区域(NA、EU、FE)。

安全

  • 切勿提交您的 .env 文件或暴露 API 凭据

  • Refresh token 应安全存储

  • 考虑在生产环境中实施凭据轮换

资源

许可证

MIT

贡献

欢迎贡献!请随时提交 Pull Request。

Available Tools

9 tools
archive_campaignA

Archive a campaign. Archived campaigns cannot spend money and are hidden from default views. This is the only way to 'delete' a campaign in Amazon Ads.

NameRequiredDescriptionDefault
profileIdYesThe Amazon Ads profile ID
campaignIdYesThe campaign ID to archive
campaignTypeYesType of campaign
create_campaignC

Create a new advertising campaign in Amazon Ads.

NameRequiredDescriptionDefault
nameYesCampaign name
profileIdYesThe Amazon Ads profile ID
startDateYesCampaign start date in YYYY-MM-DD format
dailyBudgetYesDaily budget amount
campaignTypeYesType of campaign to create
targetingTypeYesTargeting type for the campaign
get_campaign_performanceA

Create a performance report for campaigns. Returns metrics like impressions, clicks, cost, sales. If the report takes more than 5 seconds to generate, returns a PENDING status with a reportId - use get_report to fetch the completed report.

NameRequiredDescriptionDefault
endDateYesEnd date in YYYY-MM-DD format
profileIdYesThe Amazon Ads profile ID
startDateYesStart date in YYYY-MM-DD format
campaignIdYesThe campaign ID to get performance data for
get_campaignsA

Retrieve a list of advertising campaigns from Amazon Ads. Optionally filter by campaign state (enabled, paused, archived) and campaign type (sponsoredProducts, sponsoredBrands, sponsoredDisplay).

NameRequiredDescriptionDefault
stateNoOptional: Filter campaigns by state
profileIdYesThe Amazon Ads profile ID to query campaigns for
campaignTypeNoOptional: Filter by campaign type
get_keywordsA

Retrieve keywords for a specific campaign or ad group, including bid amounts and match types.

NameRequiredDescriptionDefault
adGroupIdNoOptional: Filter keywords by ad group ID
profileIdYesThe Amazon Ads profile ID
campaignIdNoOptional: Filter keywords by campaign ID
get_product_adsA

Retrieve product ads for a specific campaign or ad group.

NameRequiredDescriptionDefault
adGroupIdNoOptional: Filter by ad group ID
profileIdYesThe Amazon Ads profile ID
campaignIdNoOptional: Filter by campaign ID
get_profilesA

List all available Amazon Ads profiles (accounts) that the authenticated user has access to.

NameRequiredDescriptionDefault

No parameters

get_reportA

Check status and download a previously requested report. Use this after get_campaign_performance returns PENDING status.

NameRequiredDescriptionDefault
reportIdYesThe report ID returned from get_campaign_performance
profileIdYesThe Amazon Ads profile ID
update_keyword_bidB

Update the bid amount for a specific keyword.

NameRequiredDescriptionDefault
bidYesThe new bid amount
keywordIdYesThe keyword ID to update
profileIdYesThe Amazon Ads profile ID

Tool Schema Changelog

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

  1. 9 tool updatesv0.2.0
    • First observedarchive_campaign
    • First observedcreate_campaign
    • First observedget_campaign_performance
    • First observedget_campaigns
    • First observedget_keywords
    • First observedget_product_ads
    • First observedget_profiles
    • First observedget_report
    • First observedupdate_keyword_bid

TDQS

A3.8/5.0

Scored across 9 tools

Disambiguation5/5

Each tool targets a distinct resource or lifecycle stage: profiles, campaigns, keywords, product ads, and report retrieval. The only potentially related pair is get_campaign_performance and get_report, but their descriptions clearly separate report request creation from report status/download.

Naming Consistency5/5

Tool names consistently follow a verb_noun pattern using snake_case, with get_ for retrieval and create/update/archive for mutations. The consistent naming makes the tool set easy to scan and predict.

Tool Count5/5

Nine tools is a well-scoped size for an Amazon Ads management server. Each tool maps to a meaningful operation, and the set feels neither bloated nor too thin.

Completeness4/5

The server covers the core campaign management workflow: viewing profiles, listing/creating/archiving campaigns, retrieving keywords and product ads, updating bids, and fetching performance reports. Some minor gaps exist, such as no direct way to update campaign budgets or status beyond archiving, but agents can still accomplish the primary intended tasks.

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
  • A
    license
    A
    quality
    B
    maintenance
    Enables AI applications to interact with Amazon Advertising API through the Model Context Protocol. Supports campaign management, performance reporting, audience targeting, and comprehensive advertising operations across Amazon's advertising ecosystem.
    4
    73
    MIT
  • A
    license
    Not graded
    quality
    Not graded
    maintenance
    Enables AI assistants to manage Google Ads accounts by providing tools for querying account data and performing write operations such as updating campaign budgets, statuses, and bidding strategies.
    2
    Apache 2.0
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI-powered advertising applications by providing MCP-compliant tools to interact with Amazon Ads API for campaign management, reporting, and optimization.
    3
    MIT