Let AI Take Over Your Amazon Advertising: A Hands-On Guide to Claude Code + Amazon Ads API
Before We Begin
If you're a cross-border e-commerce seller, you've probably lived through this particular kind of pain:
Every week you spend 2-3 hours logging into Seller Central, manually downloading advertising reports, poring over ACOS in Excel, and then adjusting bids and adding negative keywords campaign by campaign. Six months of this, and your ACOS is still above 40%.
Today's article teaches you how to use Claude Code (Anthropic's AI coding assistant) + the Amazon Ads API to let AI manage your ads directly. Not as a concept — as a practical workflow we just got running.
The end result: AI can autonomously pull ad data, analyze ACOS, adjust bids, add negative keywords, and generate weekly reports — all without you ever opening a browser.
What MCP Is, and Why It's a Dimensional Upgrade
Before we get into the mechanics, I want to make one thing clear: MCP isn't a tool — it's a change in the structure of capability.
AI Without MCP: A Very Smart Blind Man
When you talk to ChatGPT or Claude about Amazon ad optimization, it can give you great advice: lower your bids, add negative keywords, pause zero-conversion campaigns. But once the conversation ends, then what?
You still have to log into Seller Central yourself, find that campaign yourself, change the bid yourself, and download the report yourself to verify it.
The AI is your strategist, but it can't see the battlefield and can't touch the weapons.
AI With MCP: It Grows Eyes and Hands
MCP (Model Context Protocol) is an open protocol designed by Anthropic that lets AI connect to external tools and data sources. Put simply:
- Without MCP: you tell the AI the problem, the AI tells you the answer, and you go execute it yourself
- With MCP: the AI looks at the data itself, analyzes it itself, executes itself, and verifies itself
An analogy:
AI without MCP is like a remote consultant — you send him screenshots, he gives you advice, you do the work yourself.
AI with MCP is like an operations person sitting right at your desk — he looks at your dashboard directly, makes the changes directly, and checks his own work afterward.
The Dimensional Difference: Information Density × Reaction Speed × Execution Loop
| Dimension | Without MCP (traditional mode) | With MCP (direct API) | The Gap |
|---|---|---|---|
| Getting information | You screenshot / copy-paste to the AI | AI calls the API directly for raw data | From "looking at a photo" to "being on-site" |
| Data precision | Screenshots may omit or be stale | Real-time, complete, structured | From lossy to lossless |
| Execution ability | AI produces a plan, you execute manually | AI produces a plan + executes it directly | From "saying" to "doing" |
| Verification loop | You execute, then screenshot for the AI to confirm | AI executes, then calls the API to verify itself | From open loop to closed loop |
| Reaction frequency | Check the data once a week | Every day, even every hour | From weekly to hourly cadence |
| Context continuity | You re-explain the background every time | Session files preserve memory | From amnesia to continuity |
The most critical upgrades are the last two rows: reaction frequency and the closed loop.
Ad optimization is fundamentally a feedback loop: make a change → observe the data → judge → change again. The faster this loop spins, the faster your optimization converges.
When you work manually, this loop runs at a weekly cadence — you check the data once a week and make one adjustment.
With MCP + API, this loop can run at a daily, even hourly cadence.
52 iterations a year vs. 365 iterations a year. This isn't an efficiency gain — it's a dimensional overwhelm.
The Senior Operator's Perspective: Does an Expert Even Need MCP, and How Big Is the Gap?
You might be thinking: I'm that data-savvy operations expert. Excel pivot tables are second nature; I can analyze a search-term report with my eyes closed. What use is MCP to me?
Let's run a thought experiment. Imagine two equally excellent Amazon operators, both with 5+ years of experience and an identical understanding of advertising. The only difference: one has MCP, the other doesn't.
Week 1: almost no gap
Both of them do the same things: download the search-term report, find the zero-conversion terms, add negative keywords, lower bids. The manual expert maybe spends 3 hours; the MCP operator spends 20 minutes. The result is the same.
You'll say: so it just saved a little time.
Month 1: the gap starts to appear
The MCP operator spends 5 minutes a day having the AI sweep the data. On day 8 he notices a search term suddenly taking off ("sensory friendly remote control car") and immediately builds a precise ad group. The manual expert doesn't look at the data until the weekend, and by the time he sees it, it's already day 12 — four days late, missing the traffic-dividend window Amazon's algorithm gives to new terms.
The MCP operator also notices that one campaign's ACOS suddenly spiked from 20% to 55% on Wednesday. The AI automatically investigates: a competitor launched a coupon that day and stole the clicks. He pauses the bid on that term the same day. What the manual expert sees over the weekend is the week's average ACOS of 35% — he can't spot the Wednesday anomaly, so he does nothing about it.
The essence of the gap: it's not a gap in ability, it's a gap in perceptual granularity.
The same data expert, checking data weekly, sees a "blurry average"; checking daily, sees "sharp fluctuations." It's the difference between 720p and 4K — the eyes are equally good, but the screen resolution is different.
Month 3: the gap becomes structural
The MCP operator has now accumulated 90 days of daily data, and his AI can answer questions like: "Over the past 3 months, which search terms convert better on weekends than on weekdays?" — and then automatically raise bids on Friday night and lower them again Monday morning.
The manual expert has the same insight, but he doesn't have the data foundation. A weekly report can't show day-of-week differences. He might vaguely sense that weekends convert better, but he can't quantify it, and he doesn't have the energy to manually adjust bids twice a week.
The essence of the gap: data density accumulated over time becomes an information advantage that can't be caught up to.
Month 6: the gap becomes generational
The MCP operator's AI has formed "muscle memory" for this category:
- It knows which terms see search volume rise when the seasons change
- It knows when competitors launch coupons (because every ACOS anomaly recorded the reason why)
- It knows which price band converts best
- It knows how many days after a new product goes live is the best time to start advertising
The manual expert has all this experience too — but it's in his head. Every time he changes assistants, switches product lines, or opens a new marketplace, this experience has to be taught all over again. The MCP operator's experience, meanwhile, is in the file system — session_handoff.md, optimization_log.md, weekly_kpi.md — and the AI can inherit the entire context with a single read.
The manual expert's ceiling is one person's time and energy.
The MCP operator's ceiling is how many AI Agents he's plugged in.
Let's quantify the gap:
| Metric | Senior operator (no MCP) | Senior operator (with MCP) | Gap after 6 months |
|---|---|---|---|
| Data-check frequency | 1-2 times/week | 1-7 times/day | 7-50x |
| Anomaly-detection lag | 3-7 days | Same day | 3-7 days faster |
| Campaigns manageable at once | 20-30 (attention bottleneck) | 100+ (AI parallelism) | 3-5x |
| Search-term analysis depth | Top 50 terms (no time for more) | All of them (AI doesn't mind) | 10-20x |
| Transferability of experience | Human memory, oral handoff | Structured files, instant AI inheritance | Incomparable |
| Optimization iterations/year | ~52 | ~365 | 7x |
The cruelest row is the last one. Same starting point; a year later, one person has iterated 52 times, the other 365 times. Two years later it's 104 vs. 730. The growth of operational skill compounds — the experience from each iteration makes the next one more precise. A 7x iteration speed, over two years, is a completely different league.
This isn't a question of "how good the tool is." It's a question of "at what speed your experience accumulates."
A Prediction: How the Gap Between MCP and Non-MCP Sellers Will Evolve
Now (2026 Q1): the early-dividend stage
Most sellers are still working manually. A few have started using third-party tools (Helium 10, Perpetua, etc.) for semi-automation. A tiny minority connect to the API directly.
At this stage, MCP's advantage is mainly efficiency — saving time, making fewer mistakes.
6 months out (2026 Q3): the toolchain matures
The MCP ecosystem will be more complete. The pitfalls we hit today (MCP package bugs, slow report generation) will be solved by the community. API calls will be packaged into ready-to-use tools.
At this point the gap becomes one of decision quality — sellers with MCP can see finer-grained data and make more precise decisions. For example, detecting in real time that a certain search term converts especially well at 3 a.m., and automatically raising the bid. Manual operation could never catch a signal like this.
1-2 years out (2027-2028): AI Agent autonomy
AI Agents no longer need humans to issue commands. They devise their own optimization plans, execute, verify, and iterate. The human's role shifts from "operator" to "approver" — you just set the goal (ACOS < 25%, monthly sales > $5K) and the AI figures out how to hit it.
At that point, a seller without MCP capability is like someone today still keeping accounts in a paper ledger. It's not that they can't survive, but their operating costs and reaction speed will be left far behind by competitors who have AI Agents.
In One Sentence
MCP doesn't make AI "more usable." It turns AI from a "consultant" into an "employee."
However smart a consultant is, he only comes once a week. An employee can watch your ads 7×24.
Alright — with that understood, let's look at how to actually do it.
1. What You'll Need
| Tool | Description | Cost |
|---|---|---|
| Claude Code | Anthropic's official CLI tool | Claude Pro/Max subscription |
| Amazon Ads API | Official ad-management interface | Free |
| MCP (Model Context Protocol) | Claude Code's tool-extension protocol | Free |
| A terminal | macOS/Linux Terminal | Built into the system |
Prerequisites:
- You need an Amazon Seller Central account and SP ads already running
- Basic command-line skills (you don't need to know how to program)
2. Apply for the Amazon Ads API (about 3 days)
This is the step where many people give up. In reality, the Direct Advertiser application process is simpler than you'd imagine.
Step 1: Register an Amazon Developer Account
Using the email from your Seller Central, register at developer.amazon.com.
Step 2: Create a Login with Amazon (LwA) Security Profile
- Go to the LwA Console
- Click "Create a New Security Profile"
- Name it whatever you like, e.g. "My Ads API"
- Note down your Client ID and Client Secret
Step 3: Submit the API Application
- Open the Amazon Ads Advanced Tools Center
- Log in with your advertising account
- Click "My Apps" → link the Security Profile you just created
- Select the scope:
advertising::campaign_management(this one is enough — it includes reporting)
Pitfall warning: After you submit, Amazon won't send an email notification. You need to go back to the Advanced Tools Center and check the status yourself. We waited 48 hours before discovering it had already been approved.
Step 4: Obtain the OAuth Refresh Token
Once the API is approved, you need to do a one-time OAuth 2.0 authorization to get the refresh token.
# oauth_token.py — run once to obtain a refresh token
import http.server
import urllib.parse
import webbrowser
CLIENT_ID = "your_client_id"
REDIRECT_URI = "http://localhost:8080/callback"
SCOPES = "advertising::campaign_management"
# Step 1: open the browser to authorize
auth_url = (
f"https://www.amazon.com/ap/oa?"
f"client_id={CLIENT_ID}&"
f"scope={SCOPES}&"
f"response_type=code&"
f"redirect_uri={REDIRECT_URI}"
)
webbrowser.open(auth_url)
# Step 2: local server receives the callback
class Handler(http.server.BaseHTTPRequestHandler):
def do_GET(self):
query = urllib.parse.urlparse(self.path).query
params = urllib.parse.parse_qs(query)
code = params.get("code", [""])[0]
print(f"\nAuthorization code: {code}")
print("Use this code to exchange for a refresh token (see below)")
self.send_response(200)
self.end_headers()
self.wfile.write(b"Done! Go back to terminal.")
server = http.server.HTTPServer(("localhost", 8080), Handler)
print("Waiting for Amazon callback...")
server.handle_request()
Once you have the authorization code, exchange it for a refresh token:
curl -X POST "https://api.amazon.com/auth/o2/token" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=authorization_code&code=your_auth_code&client_id=your_CLIENT_ID&client_secret=your_SECRET&redirect_uri=http://localhost:8080/callback"
The returned JSON contains a refresh_token — this is your most important credential, so keep it safe.
3. Configure the Claude Code MCP Server
MCP is Claude Code's tool-extension protocol. Once it's configured, Claude Code can call the Amazon Ads API directly.
Option A: Use the amazon-ads-mcp Package (recommended, but has a catch)
# Install
pipx install amazon-ads-mcp
# Create .mcp.json in the project root
{
"mcpServers": {
"amazon_ads": {
"command": "amazon-ads-mcp",
"args": ["--transport", "stdio"],
"env": {
"AUTH_METHOD": "direct",
"AMAZON_AD_API_CLIENT_ID": "your_client_id",
"AMAZON_AD_API_CLIENT_SECRET": "your_secret",
"AMAZON_AD_API_REFRESH_TOKEN": "your_refresh_token",
"AMAZON_AD_API_PACKAGES": "profiles,campaign-manage,sponsored-products,reporting-version-3"
}
}
}
}
The catch: As of 2026-03-23,
amazon-ads-mcpv0.2.18's Code Mode has an import bug (get_authenticated_client) that causes Reporting API calls to fail. Basic features like Campaign List work fine. If you hit this, use Option B.
Option B: Use curl Directly (more stable)
No dependency on any third-party package — Claude Code calls the API directly via the Bash tool. This is exactly how we run it in production.
# refresh access token (expires hourly)
curl -s -X POST "https://api.amazon.com/auth/o2/token" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=refresh_token&refresh_token=your_TOKEN&client_id=your_ID&client_secret=your_SECRET"
# Pull the list of SP campaigns
curl -s -X POST "https://advertising-api.amazon.com/sp/campaigns/list" \
-H "Amazon-Advertising-API-ClientId: your_CLIENT_ID" \
-H "Amazon-Advertising-API-Scope: your_PROFILE_ID" \
-H "Authorization: Bearer ACCESS_TOKEN" \
-H "Content-Type: application/vnd.spCampaign.v3+json" \
-H "Accept: application/vnd.spCampaign.v3+json" \
-d '{"stateFilter":{"include":["ENABLED","PAUSED"]},"maxResults":100}'
To make it easy to reuse, we wrapped it into a shell tool:
# tools/ads_api.sh — source it, then use the functions
# ads_refresh_token — refresh the token
# ads_list_campaigns — list all active campaigns
# ads_list_keywords — list a campaign's keywords and bids
# ads_request_report — request an async report (ACOS, spend, sales, etc.)
Claude Code will automatically source this file and then call the functions inside it.
4. What You Can Do with the API
4.1 Pull Campaign Data in Real Time
You: Pull all active SP campaigns on the US marketplace
Claude Code: [calling the API] Found 13 ENABLED campaigns:
Boys 3-5Y $30/day Manual
Girls 5-7Y $30/day Manual
...
Where it beats Seller Central: no waiting for pages to load, no manual navigation — you get structured data directly.
4.2 Verify Bids and Negative Keywords
You: Check whether the keyword bids in the "Unisex 8-11Y" campaign are correct
Claude Code: [calling the Keywords API]
kids socks Exact $0.38 ENABLED
socks for kids Exact $0.44 ENABLED
...all 21 keywords listed
4.3 Pull Performance Reports (ACOS, spend, sales)
This one uses the V3 Reporting API, which is asynchronous:
You: Pull last week's campaign ACOS data
Claude Code:
1. [requesting report] reportId: abc-123, status PENDING
2. [polling every 30 seconds] ...
3. [after about 30 minutes] report complete, downloading...
Campaign Spend Sales ACOS
Girls 5-7Y $5.27 $22.99 22.9%
Boys 3-5Y $1.58 $13.88 11.4%
...
Note: The V3 Reporting API takes about 30 minutes to generate a report — it's not real-time. Claude Code will automatically poll and wait in the background.
4.4 Search-Term Analysis
You: Pull the search-term report for 3/20-3/22
Claude Code: [requesting spSearchTerm report]
21 search terms, the highest-spend ones:
"socks for toddler boys" $0.60 0 orders
"girls socks 4-6 years" $0.56 0 orders
...
Suggestion: traffic is extremely scattered, each term has only 1 click.
Budget needs to be concentrated on converting terms.
5. Quick Reference: Available API Endpoints
| Endpoint | Purpose | Type |
|---|---|---|
/sp/campaigns/list | List SP campaigns | Sync |
/sp/keywords/list | List keywords and bids | Sync |
/sp/negativeKeywords/list | Ad-group-level negative keywords | Sync |
/sp/campaignNegativeKeywords/list | Campaign-level negative keywords | Sync |
/sp/adGroups/list | List ad groups | Sync |
/reporting/reports | Request a performance report | Async (~30min) |
/sp/campaigns (PUT) | Modify campaign status/budget | Sync |
/sp/keywords (PUT) | Modify keyword bids | Sync |
All endpoints require these headers:
Amazon-Advertising-API-ClientId: your Client ID
Amazon-Advertising-API-Scope: your Profile ID
Authorization: Bearer ACCESS_TOKEN
Content-Type: application/vnd.spXxx.v3+json
Accept: application/vnd.spXxx.v3+json
6. How to Get Your Profile ID
The Profile ID is the unique identifier for each marketplace. Get it via this endpoint:
curl -s "https://advertising-api.amazon.com/v2/profiles" \
-H "Amazon-Advertising-API-ClientId: your_CLIENT_ID" \
-H "Authorization: Bearer ACCESS_TOKEN"
In the returned JSON, each profile has a profileId and a countryCode, for example:
- US marketplace:
1234567890(marketplace: ATVPDKIKX0DER) - CA marketplace:
0987654321(marketplace: A2EUQ1WTGCTBG2)
7. Security Considerations
What you must do:
- Create a
.gitignorethat excludes every file containing a token:
.mcp.json
tools/.amazon_ads_token.json
*.token
- Do not commit your Client Secret or Refresh Token to any public repository
- The Refresh Token has broad permissions (it can modify your ads), so guard it carefully
What you should do:
- Store credentials in separate files, and have your code reference them via environment variables or file reads
- Regularly review the API operation logs to make sure only the expected calls are being made
8. Results in Practice
We use this setup to manage the US-marketplace ads for a children's-clothing category (about 20 SP campaigns). The actual experience:
| Task | Before (manual) | After (API) |
|---|---|---|
| View the status of all campaigns | 5 minutes (login + navigate + wait to load) | 3 seconds |
| Verify a bid adjustment took effect | 15 minutes (click into each campaign one by one) | 10 seconds |
| Pull a search-term report | Manual CSV download + Excel processing | One sentence, auto-downloaded and analyzed |
| Weekly ACOS comparison | 30 minutes | 2 minutes (including report-generation wait) |
| Bulk-add negative keywords | Bulk upload via Excel | Written directly via API |
The biggest change isn't speed, it's frequency — previously we checked the data once a week; now the AI can check daily, even hourly. Problems are caught earlier and reactions come faster.
9. Pitfalls Summary
- No email notification for the API application — after submitting, check the status yourself at the Advanced Tools Center
advertising::campaign_managementalready includes reporting — you don't need a separate reporting scope- V3 Reporting isn't real-time — report generation takes about 30 minutes, so build in a polling mechanism
- The amazon-ads-mcp package has a bug (v0.2.18) — using curl directly is more stable
- 7-day attribution window —
purchases7dandsales7dtake 7 days to become accurate, so don't rush to conclusions right after adjusting a bid - The Campaign List API returns ARCHIVED by default — remember to add a
stateFilterto filter them out - Campaign-level and ad-group-level negative keywords are different endpoints — for campaign level, use
/sp/campaignNegativeKeywords/list
10. Next Steps
This setup currently covers SP (Sponsored Products) ads. If you also run SB (Sponsored Brands) or SD (Sponsored Display), the API supports them too — only the endpoint and Content-Type differ.
More advanced plays:
- Automated weekly reports: automatically pull the data every Monday and generate an ACOS comparison table
- Anomaly alerts: if a campaign's ACOS suddenly spikes, automatically pause it and send a notification
- Bid optimization: automatically adjust bids based on conversion rate (be careful with this — validate the logic manually first)
- Search-term mining: automatically discover high-converting search terms and build exact-match ad groups
If you're also using Claude Code for cross-border e-commerce operations, I'd love to compare notes. We just got this path working, and there's still plenty of room to optimize.
This article is based on real project experience from March 2026. Amazon's API interfaces and approval process may change at any time — always defer to the official documentation.