amazon-lyr
一个代理会话,从头到尾
这是与运行 amazon-lyr 的代理进行的一次真实对话——没有隐藏任何步骤:
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每一步都是类型化的 MCP 工具调用。购买步骤被刻意设计为难以意外触发——参见安全模型。
Related MCP server: Amazon Cart MCP Server
为什么与众不同
无需 API 密钥 | 通过 |
完整生命周期 | 不仅仅是抓取:购物车变更、心愿单写入、带确认解析的结账、退货向导、取消订单 |
面向代理的原生错误 | CAPTCHA、登出重定向和软限流以带恢复提示的类型化错误形式呈现( |
工作原理
browser cookies ──▶ AmazonClient (curl_cffi, captcha-aware)
│
▼
bs4 parsers ──▶ normalized dicts ──▶ 21 FastMCP tools
(readOnly / destructive annotations)认证使用您自己的会话:amazon-lyr login 通过 obscura-core 从 Chrome、Brave、Firefox、Edge 或 Zen 导入 Cookie,或从显式 JSON 导出导入。读取操作需要登录令牌;购物车、订单、退货和结账还需要会话上下文 Cookie。
安装
# 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然后认证一次并启动服务:
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"]
}
}
}工具(21 个)
类别 | 工具 |
搜索 |
|
产品 |
|
评论 |
|
购物车 |
|
心愿单 |
|
订单 |
|
退货 |
|
购买 |
|
危险区域 |
|
会话 |
|
安全模型
资金操作恰好经过两道关卡:
会话关卡——每次变更操作都需要完整的登录 Cookie(
at-main+session-id/ubid-main)。只读会话在任何请求发出之前就会被拒绝。同意关卡——
place_order除非传入精确的字面量confirm="PLACE_ORDER",否则拒绝执行。预期流程是:为用户预览 → 用户批准 → 然后传入该字面量。cancel_order和initiate_return同样被标注为破坏性/非幂等操作,以便代理框架相应处理。
卡片验证(OTP / 3-D Secure)会在结账过程中被检测到,并以 needs_verification 形式报告,附带浏览器操作说明——绝不会猜测通过。
限制
诚实的上限,全部以类型化错误而非错误数据的形式呈现:
CAPTCHA 墙——账户区域页面比商品目录更严格;重新导入新 Cookie 或等待解除(
CaptchaError包含提示)软限流——低于 3 秒的请求节奏会静默返回空网格;怀疑受限时响应会携带
possibly_throttled: true地区价格变体——某些变体在客户端渲染价格;搜索回退到文本扫描,
get_product保持权威未经同意不自动购买——设计如此;结账要求显式的确认字面量和用户批准
开发
git clone https://github.com/ishan-parihar/amazon-lyr && cd amazon-lyr
uv sync --extra dev
uv run ruff check . && uv run pytest -q架构说明、不变式和发布流程详见 AGENTS.md。
许可证
MIT © Ishan Parihar
This server cannot be deployed
Maintenance
Related MCP Connectors
Real-time Amazon product, seller, and search data for AI agents across 21 marketplaces.
Product search for AI agents: Amazon + Shopify, cart-to-checkout buy path. Pay-per-call, no API key.
Let your AI agent operate any website through a real, logged-in browser session.
Live product search for AI agents across Shopify merchants and major retailers.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to search products, manage shopping carts, place orders, and retrieve order history from Amazon and Target accounts.2MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with your personal Amazon cart through browser automation, allowing search, add to cart, and view cart functionalities.6 npm22MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to search products, manage cart, place orders, and track shipments on Amazon via browser automation.9 npm2MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to search products across Amazon and live Shopify storefronts, vet merchants, build carts, and obtain checkout URLs via a pay-per-call API with no API key or signup.MIT