
只读 AliExpress MCP 服务器——搜索,产品细节,运算. 使用在MTOP API呼叫(mtop.js可复制)上签名,由mcp-auth-bridge提供饼干.
概览
一个将AliExpress搜索和产品细节包裹起来的MCP服务器为一加拿大sopper刮去-CAD的价格,运至BC温哥华. 仅按设计阅读:它搜索,获取产品细节并检查货运. 它确实增加了车, 退货,或支付。 - search products(清,min lating, max p价, sort by) - 搜索公共批发搜索URL并解析嵌入式JSON. - get products details(项目-id-|-url)——产权,价格,折扣,评级,售出计数,销售,航运成本等ETA. - 获得 发运 估计( item id) —— 向配置国家运送成本+ETA。 - view cart () – 通过已签名的 mtop.aliexpress.trade.cart.render endpoint 的当前推车内容 。 唯相读取. 初始出品页面为客户端侧出品外壳(window. d c .isCSR = true, window.runParams = {})——JS出品后AliExpress的MTOP API中真实出品数据负载. 所以HTML刮取对PDP数据不起作用. 相反,这个服务器复制什么mtop.
概述(AI 翻译)
一个将AliExpress搜索和产品细节包裹起来的MCP服务器为一加拿大sopper刮去-CAD的价格,运至BC温哥华.
仅按设计阅读:它搜索,获取产品细节并检查货运. 它确实** 不** 添加到推车、退货或支付。
□ 工具
search_products(query, min_rating, max_price, sort_by)-搜索公共批发搜索URL并剖析嵌入式JSON.get_product_details(item_id | url)——所有权、价格、折扣、评级、已售清点、卖方、运费和ETA。get_shipping_estimate(item_id)——向所配置的国家运送费用+ETA。view_cart()——通过所签名的mtop.aliexpress.trade.cart.render端点的当前推车内容。 唯相读取.
如何运作
初始出品页面是客户端的外壳([[T5],[T6])——JS出品后从AliExpress的MTOP API上取出真正的出品数据负载. 所以HTML刮取对PDP数据不起作用.
相反,这个服务器复制了mtop.js在浏览器中所做的:它会用会话的[[T9] cookie作为HMAC符号,进行签名的呼叫. 签名算法 :
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
AliExpress MCP Server
An MCP server that wraps AliExpress search and product detail scraping for a Canadian shopper — prices in CAD, shipping to Vancouver, BC.
Read-only by design: it searches, fetches product details, and checks shipping. It does not add to cart, check out, or pay.
Tools
search_products(query, min_rating, max_price, sort_by)— searches the public wholesale search URL and parses the embedded JSON.get_product_details(item_id | url)— title, price, discount, rating, sold count, seller, shipping cost & ETA.get_shipping_estimate(item_id)— shipping cost + ETA to the configured country.view_cart()— current cart contents via the signedmtop.aliexpress.trade.cart.renderendpoint. Read-only.
How it works
The initial product page is a client-side-rendered shell (window._d_c_.isCSR = true, window.runParams = {}) — real product data loads over AJAX from AliExpress’s MTOP API after the JS runs. So HTML scraping doesn’t work for PDP data.
Instead, this server replicates what mtop.js does in the browser: it makes signed calls to mtop.aliexpress.pdp.pc.query using the session’s _m_h5_tk cookie as the HMAC token. The signing algorithm:
sign = md5(token + "&" + t_ms + "&" + "12574478" + "&" + json_payload)
where token is the prefix of _m_h5_tk before the underscore, and 12574478 is AliExpress’s public web appKey. Token refresh on FAIL_SYS_TOKEN_EXPIRED is handled automatically.
Search still uses the simpler HTML path (embedded window.runParams JSON from the search SSR HTML) — no signed calls needed.
Setup
-
Install dependencies:
pip install -r requirements.txt -
Install the MCP Auth Bridge Chrome extension. The
aliexpressentry is already in itssites.json. -
Open
https://www.aliexpress.com, log in, then click Save AliExpress in the extension popup. This writes cookies to~/.mcp-credentials/aliexpress.json. -
Add to your Claude Desktop config (
~/Library/Application Support/Claude/claude_desktop_config.json):{ "mcpServers": { "aliexpress": { "command": "python3", "args": ["/Users/YOUR_USER/justinritchie-mcp-servers/aliexpress-mcp-server/aliexpress_mcp_server.py"], "env": { "ALIEXPRESS_CREDENTIALS": "~/.mcp-credentials/aliexpress.json", "ALIEXPRESS_COUNTRY": "CA", "ALIEXPRESS_CURRENCY": "CAD" } } } } -
Restart Claude Desktop.
Known limitations
- Low-volume / brand-new listings sometimes return empty MTOP responses (endpoint returns
SUCCESSbut an empty data block). Likely a region/visibility gate. Search results still show the listing fine.
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →配置
{
"mcpServers": {
"aliexpress": {
"command": "python3",
"args": ["/Users/YOUR_USER/justinritchie-mcp-servers/aliexpress-mcp-server/aliexpress_mcp_server.py"],
"env": {
"ALIEXPRESS_CREDENTIALS": "~/.mcp-credentials/aliexpress.json",
"ALIEXPRESS_COUNTRY": "CA",
"ALIEXPRESS_CURRENCY": "CAD"
}
}
}
}