Shopee MCP Server

Shopee MCP Server

Manages Shopee shops via Open Platform API v2. Enables viewing shop info, products, orders, posting products, and updating prices and inventory.

Category
访问服务器

README

Shopee MCP Server

MCP server cho Shopee Open Platform API v2 — quản lý shop bán hàng: xem shop, sản phẩm, đơn hàng; đăng bài sản phẩm; cập nhật giá & tồn kho. Chạy dạng STDIO (npx từ GitHub), thiết kế để ai cũng dùng được — chỉ cần điền thông tin shop, không sửa code.

15 tools: get_shop_info, get_item_list, get_item_base_info, get_category, get_attributes, upload_image, add_item, update_item, update_price, update_stock, unlist_item, get_channel_list, get_order_list, get_order_detail.


PHẦN A — ĐĂNG KÝ SHOPEE OPEN PLATFORM (lấy credential)

Bạn cần 5 thông tin: partner_id, partner_key, shop_id, access_token, refresh_token.

A1. Tạo tài khoản & App

  1. Vào https://open.shopee.com → Log In → Sign up (dùng email doanh nghiệp).
  2. Vào Console → App Management → App List → Create App.
  3. Chọn loại tài khoản phù hợp (thường: Seller nếu bán hàng, hoặc ISV nếu làm dịch vụ cho nhiều shop).
  4. Điền tên app, mô tả, và Redirect URL (ví dụ https://example.com/callback — nhớ URL này, dùng ở bước OAuth).
  5. Sau khi tạo, mở app → lấy Partner ID (= App ID) và Partner Key (= Secret Key). Lưu Partner Key an toàn (Shopee ít hiện lại).
  6. Trong app, thêm quyền (API modules) cần dùng: Shop, Product, Logistics, Order, MediaSpace.

⚠️ App mới thường phải chờ Shopee duyệt/kích hoạt các module ghi (đăng bài). Có thể test trước trên môi trường test-stable trước khi lên live.

A2. Uỷ quyền shop & lấy token (chạy 1 lần)

Sau khi clone repo và build (Phần B), chạy công cụ lấy token:

# Bước 1 — sinh link uỷ quyền
SHOPEE_PARTNER_ID=123456 SHOPEE_PARTNER_KEY=shpk_xxx SHOPEE_REDIRECT_URL=https://example.com/callback \
  npm run auth -- link

→ Mở link in ra, đăng nhập shop, bấm đồng ý. Shopee chuyển về Redirect URL kèm ?code=XXX&shop_id=YYY.

# Bước 2 — đổi code lấy token
SHOPEE_PARTNER_ID=123456 SHOPEE_PARTNER_KEY=shpk_xxx \
  npm run auth -- token XXX YYY

→ In ra SHOPEE_SHOP_ID, SHOPEE_ACCESS_TOKEN, SHOPEE_REFRESH_TOKEN. Copy 3 giá trị này.

(access_token hết hạn ~4 giờ — MCP tự refresh bằng refresh_token, bạn không cần làm lại bước này.)


PHẦN B — CÀI & CHẠY

B1. Chạy trực tiếp từ GitHub bằng npx (khuyên dùng cho Evose)

Không cần cài gì, npx tự build từ GitHub. Xem cấu hình import ở PHẦN C.

B2. Chạy local (để test / lấy token)

git clone https://github.com/<user>/shopee-mcp-server.git
cd shopee-mcp-server
npm install
npm run build

PHẦN C — TÍCH HỢP VÀO EVOSE (STDIO npx)

Vào Evose → thêm MCP mới → Import Configuration via JSON, dán:

{
  "mcpServers": {
    "shopee": {
      "command": "npx",
      "args": ["-y", "github:<user>/shopee-mcp-server"],
      "env": {
        "SHOPEE_PARTNER_ID": "123456",
        "SHOPEE_PARTNER_KEY": "shpk_xxxxxxxx",
        "SHOPEE_SHOP_ID": "222222",
        "SHOPEE_ACCESS_TOKEN": "xxxxxxxx",
        "SHOPEE_REFRESH_TOKEN": "xxxxxxxx"
      }
    }
  }
}

Hoặc điền tay theo form: Server Type = STDIO, Command Tool = npx, Command Parameters = -y github:<user>/shopee-mcp-server, rồi thêm 5 Environment Variables ở trên. Execution Timeout để 120s (lần đầu npx build hơi lâu).

(Thay <user> bằng GitHub username của bạn sau khi push repo lên.)


PHẦN D — QUY TRÌNH ĐĂNG BÀI (add_item) — làm đúng thứ tự

Đăng bài Shopee phức tạp hơn Etsy, cần 4 bước:

  1. get_category → chọn category_id đúng ngành hàng.
  2. get_attributes với category_id đó → lấy các thuộc tính bắt buộc → chuẩn bị attribute_list.
  3. upload_image với URL ảnh → lấy image_id (làm nhiều lần cho nhiều ảnh).
  4. get_channel_list → lấy logistics_channel_ids shop đang bật.
  5. add_item với đủ: item_name, description, category_id, original_price, seller_stock, weight, image_id_list, logistics_channel_ids, attribute_list.

GHI CHÚ QUAN TRỌNG

  • Host: live = https://partner.shopeemobile.com. Test = https://partner.test-stable.shopeemobile.com (đặt qua env SHOPEE_HOST).
  • Vùng: cấu hình này cho shop Việt Nam.
  • Bảo mật: không commit Partner Key / token lên GitHub công khai. Chỉ để trong env khi chạy.
  • MCP tự tính chữ ký HMAC-SHA256 và tự refresh token — người dùng không cần bận tâm.

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选