amazon-lyr
Enables AI agents to research and shop on Amazon using their own logged-in browser session, supporting product search, details, reviews, cart, wishlist, and order tracking without API keys.
README
<p align="center"> <img src="https://github.com/ishan-parihar/amazon-lyr/actions/workflows/ci.yml/badge.svg" alt="CI"> <img src="https://img.shields.io/badge/python-3.11%2B-2b6cb0?style=flat&logo=python&logoColor=white" alt="Python 3.11+"> <img src="https://img.shields.io/badge/tools-21-c026d3?style=flat&logo=modelcontextprotocol&logoColor=white" alt="21 MCP tools"> <img src="https://img.shields.io/badge/license-MIT-059669?style=flat" alt="MIT"> </p>
<h1 align="center">amazon-lyr</h1>
<p align="center"> <strong>The full Amazon lifecycle as MCP tools for AI agents</strong> — research products and reviews, manage the cart, place orders, track shipments, start returns — all through your own logged-in browser session. No PA-API keys. </p>
<p align="center"> <img src="./assets/readme/hero.svg" width="100%" alt="amazon-lyr: an agent session panel showing search_products, review_insights and checkout_preview flowing into a highlighted place_order step and a green order-confirmation chip"> </p>
An agent session, start to finish
This is one real conversation with an agent running amazon-lyr — no steps hidden:
1. search_products("noise cancelling headphones", max_price=300, min_rating=4)
2. review_insights("B0X1234567") # star spread + keyword themes
3. search_in_reviews("B0X1234567", query="broke") # what actually breaks?
4. add_to_cart("B0X1234567", quantity=1)
5. checkout_preview() # totals + address + payment, nothing bought
6. place_order(confirm="PLACE_ORDER") # only after the user said "buy it"
✓ order placed · #111-2223334-5556667
7. track_shipment("111-2223334-5556667")
8. initiate_return("111-2223334-5556667", reason="defective", asin_hint="…")
9. list_returns() # refund status confirmed
Every step is a typed MCP tool call. The buying step is deliberately hard to fire by accident — see Safety model.
Why it's different
| No API keys | Speaks Amazon's own web endpoints over curl_cffi with Chrome TLS impersonation — the same session your browser has |
| Full lifecycle | Not just scraping: cart mutations, wishlist writes, checkout with confirmation parsing, returns wizard, cancellations |
| Agent-native errors | CAPTCHAs, sign-out redirects and soft throttles surface as typed errors with recovery hints (possibly_throttled, manual-fallback URLs) — never silent garbage |
How it works
browser cookies ──▶ AmazonClient (curl_cffi, captcha-aware)
│
▼
bs4 parsers ──▶ normalized dicts ──▶ 21 FastMCP tools
(readOnly / destructive annotations)
Auth is your own session: amazon-lyr login imports cookies from Chrome,
Brave, Firefox, Edge or Zen via obscura-core,
or from an explicit JSON export. Reads need the login token; cart, orders,
returns and checkout also need the session context cookies.
Install
# Persistent install — uv tool (isolated; bootstraps uv on clean systems)
curl -sSL https://raw.githubusercontent.com/ishan-parihar/amazon-lyr/main/install.sh | bash
# Zero-install run without persistence:
uvx --from git+https://github.com/ishan-parihar/amazon-lyr amazon-lyr --version
Then authenticate once and serve:
amazon-lyr login --browser chrome # or: --cookies-file cookies.json
amazon-lyr search "mechanical keyboard" # shell works immediately
amazon-lyr serve # MCP server (stdio)
{
"mcpServers": {
"amazon": {
"command": "amazon-lyr",
"args": ["serve"]
}
}
}
Tools (21)
| Category | Tools |
|---|---|
| Search | search_products (department, price range, min-rating filters) |
| Product | get_product, compare_products (up to 5 ASINs) |
| Reviews | get_reviews, review_insights, search_in_reviews |
| Cart | add_to_cart, view_cart, update_cart_quantity, remove_from_cart |
| Wishlist | add_to_wishlist, get_wishlist |
| Orders | get_orders, get_order_details, track_shipment |
| Returns | list_returns, initiate_return (friendly reason codes) |
| Buying | checkout_preview, place_order |
| Danger zone | cancel_order |
| Session | get_session_status |
Safety model
Money moves through exactly two gates:
- Session gate — every mutation requires full login cookies
(
at-main+session-id/ubid-main). Reads-only sessions are refused before any request is made. - Consent gate —
place_orderrefuses to run unless passed the exact literalconfirm="PLACE_ORDER". The intended flow is: preview for the user → user approves → then pass the literal.cancel_orderandinitiate_returnare similarly annotated as destructive/non-idempotent so agent frameworks treat them accordingly.
Card verification (OTP / 3-D Secure) is detected mid-checkout and reported
as needs_verification with browser instructions — never guessed through.
Limits
Honest ceilings, all surfaced as typed errors instead of wrong data:
- CAPTCHA walls — account-area pages are stricter than the catalog;
re-import fresh cookies or wait it out (
CaptchaErrorincludes hints) - Soft throttles — sub-3-second cadences get silent empty grids;
responses carry
possibly_throttled: truewhen suspected - Geo price variants — some variants render prices client-side;
search falls back to text-scanning,
get_productstays authoritative - No auto-buy without consent — by design; checkout demands the explicit confirm literal and user approval
Development
git clone https://github.com/ishan-parihar/amazon-lyr && cd amazon-lyr
uv sync --extra dev
uv run ruff check . && uv run pytest -q
Architecture notes, invariants, and the release process live in AGENTS.md.
License
MIT © Ishan Parihar
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。