amazonads-mcp
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
前提条件
Amazon Ads 账户:您需要一个有效的 Amazon Ads 账户
API 凭据:注册 Amazon Ads API 访问权限并获取:
Client ID
Client Secret
Refresh Token
获取 Amazon Ads API 凭据
步骤 1:注册您的应用程序
使用您的 Amazon Ads 账户登录
导航到开发者中心并创建一个新应用程序
您将收到一个 Client ID 和 Client Secret - 请保存好!
步骤 2:获取您的 Refresh Token
我们提供了一个辅助脚本,通过 OAuth 流程获取您的 refresh token:
在项目根目录创建一个
.env文件:AMAZON_ADS_CLIENT_ID=your_client_id_here AMAZON_ADS_CLIENT_SECRET=your_client_secret_here运行 OAuth 辅助脚本:
npm run get-token您的浏览器将打开 Amazon 的授权页面
登录并授权该应用程序
脚本将显示您的 refresh token - 将其复制到您的
.env文件中
步骤 3:注意您的区域
确定您的广告区域:
NA:北美(amazon.com)
EU:欧洲(amazon.co.uk、amazon.de 等)
FE:远东(amazon.co.jp 等)
安装
克隆此仓库:
git clone <your-repo-url>
cd amazonads-mcp安装依赖:
npm install构建项目:
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 APIClaude 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:广告活动管理(部分支持)
报告:基本绩效指标(简化实现)
重要说明
速率限制:Amazon Ads API 有速率限制。该客户端目前未实现速率限制逻辑。
Reporting API:
get_campaign_performance工具使用简化实现。对于生产环境,您应实现完整的异步报告流程:创建报告请求
轮询报告完成状态
下载并解析报告
错误处理:API 错误会返回给调用方。请确保正确配置凭据,以避免身份验证错误。
区域:请根据您的 Amazon Ads 账户设置正确的区域(NA、EU、FE)。
安全
切勿提交您的
.env文件或暴露 API 凭据Refresh token 应安全存储
考虑在生产环境中实施凭据轮换
资源
许可证
MIT
贡献
欢迎贡献!请随时提交 Pull Request。
Available Tools
9 toolsarchive_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.
| Name | Required | Description | Default |
|---|---|---|---|
| profileId | Yes | The Amazon Ads profile ID | |
| campaignId | Yes | The campaign ID to archive | |
| campaignType | Yes | Type of campaign |
create_campaignC
Create a new advertising campaign in Amazon Ads.
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Campaign name | |
| profileId | Yes | The Amazon Ads profile ID | |
| startDate | Yes | Campaign start date in YYYY-MM-DD format | |
| dailyBudget | Yes | Daily budget amount | |
| campaignType | Yes | Type of campaign to create | |
| targetingType | Yes | Targeting 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.
| Name | Required | Description | Default |
|---|---|---|---|
| endDate | Yes | End date in YYYY-MM-DD format | |
| profileId | Yes | The Amazon Ads profile ID | |
| startDate | Yes | Start date in YYYY-MM-DD format | |
| campaignId | Yes | The 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).
| Name | Required | Description | Default |
|---|---|---|---|
| state | No | Optional: Filter campaigns by state | |
| profileId | Yes | The Amazon Ads profile ID to query campaigns for | |
| campaignType | No | Optional: Filter by campaign type |
get_keywordsA
Retrieve keywords for a specific campaign or ad group, including bid amounts and match types.
| Name | Required | Description | Default |
|---|---|---|---|
| adGroupId | No | Optional: Filter keywords by ad group ID | |
| profileId | Yes | The Amazon Ads profile ID | |
| campaignId | No | Optional: Filter keywords by campaign ID |
get_product_adsA
Retrieve product ads for a specific campaign or ad group.
| Name | Required | Description | Default |
|---|---|---|---|
| adGroupId | No | Optional: Filter by ad group ID | |
| profileId | Yes | The Amazon Ads profile ID | |
| campaignId | No | Optional: Filter by campaign ID |
get_profilesA
List all available Amazon Ads profiles (accounts) that the authenticated user has access to.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
get_reportA
Check status and download a previously requested report. Use this after get_campaign_performance returns PENDING status.
| Name | Required | Description | Default |
|---|---|---|---|
| reportId | Yes | The report ID returned from get_campaign_performance | |
| profileId | Yes | The Amazon Ads profile ID |
update_keyword_bidB
Update the bid amount for a specific keyword.
| Name | Required | Description | Default |
|---|---|---|---|
| bid | Yes | The new bid amount | |
| keywordId | Yes | The keyword ID to update | |
| profileId | Yes | The Amazon Ads profile ID |
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
9 tool updates
v0.2.0- First observed
archive_campaign - First observed
create_campaign - First observed
get_campaign_performance - First observed
get_campaigns - First observed
get_keywords - First observed
get_product_ads - First observed
get_profiles - First observed
get_report - First observed
update_keyword_bid
TDQS
Scored across 9 tools
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.
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.
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.
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
Related MCP Connectors
Amazon Ads and Seller Central for your AI: listings, ads, profit, inventory and search terms.
Amazon Ads, Seller Central, Vendor Central and AMC data for AI agents. Read-only by default.
Build, edit and sync Google, Microsoft, Reddit and Meta ad campaigns from your assistant.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables 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.5ISC
- AlicenseAqualityBmaintenanceEnables 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.473MIT
- AlicenseNot gradedqualityNot gradedmaintenanceEnables 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.2Apache 2.0
- AlicenseNot gradedqualityDmaintenanceEnables AI-powered advertising applications by providing MCP-compliant tools to interact with Amazon Ads API for campaign management, reporting, and optimization.3MIT