TikTok Shop

io.github.Buer2333由 GitHub 账号 Buer2333 发布v0.3.0更新于 Oct 27, 2026

Read-only TikTok Shop Partner API: orders, finance, products and analytics across shops.

发布方自己的服务:Tiktokporn

概览

AI 生成的概览

只读的 TikTok Shop Partner API 服务器,让助手跨多个店铺查询订单、财务、商品与分析数据。

可以做什么
  • 列出已配置店铺,查看并刷新其访问令牌
  • 查询店铺订单、订单详情、退货与取消
  • 读取结算账单与店铺交易流水
  • 浏览商品目录与商品详情
  • 获取店铺、分时、商品、SKU、视频与客服绩效分析
  • 读取视频 GMV 以及视频、达人、商品的平台热销榜
适用场景
适合经营 TikTok Shop 的卖家与代运营团队,希望助手直接基于官方 Partner API 回答销售、订单、结算与达人带货表现的问题,并可跨多个店铺查询,无需浏览器抓取。
运行要求
以本地 Python 包运行(pip 或 uvx)。需要 shops.json 凭据文件,默认位于 ~/.config/tiktok-mcp/ 或由 TIKTOK_SHOP_CONFIG 指定的路径,每个店铺包含 app_key、app_secret、access_token、refresh_token、shop_id 与 shop_cipher,需在 TikTok Shop Partner Center 创建应用后授权获取。热销榜工具需要具备 Bestsellers 权限的店铺,可用 TIKTOK_SHOP_BESTSELLERS_SHOP 指定。需要访问 TikTok Shop API 的网络。
安装前请注意
凭据文件包含应用密钥与访问/刷新令牌,应仅本人可读并放在仓库之外。刷新令牌会写入该文件,安装脚本还会留下备份与恢复副本,用完后应删除。服务器对店铺为只读,但建议将 Partner Center 应用仅授权只读权限。所有请求经由 mcp-retry 依赖,该依赖可看到你的令牌。独立开源项目,与 TikTok 无隶属关系。

安装

在 SourceWeft 中

  1. 打开 控制台中的 TikTok Shop,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

tiktok-shop-mcp

A Model Context Protocol (MCP) server for the TikTok Shop Partner API — query orders, finance, products, analytics, and affiliate performance across multiple shops from Claude, or any other MCP client.

Built for sellers and agencies who operate TikTok Shops and want their AI assistant to answer questions like "what did the US shop sell yesterday?", "which SKUs are trending this week?", or "pull the settlement statements for June" — directly against the official API, with no browser scraping.

Features

  • Multi-shop — configure any number of shops in one JSON file; every tool takes an optional seller_name (partial match) to pick the shop
  • 22 tools covering orders, finance, product catalog, shop/video/SKU analytics, affiliate best-sellers, and returns/cancellations
  • Human-friendly dates — pass start_date=2026-07-01 + an IANA timezone instead of unix timestamps; the server handles conversion
  • Token lifecycle — inspect expiry and refresh access tokens (single shop or all shops) without leaving the conversation
  • Resilient by default — all requests go through mcp-retry (exponential backoff + jitter on 429/5xx/network errors)
  • Read-only against your shop — no tool edits listings, creates products, or uploads files. The only thing the server writes is your own shops.json, when it refreshes tokens, with owner-only (0600) permissions. For defense in depth, authorize the Partner Center app with read scopes only

Tools

GroupTools
Shops & authlist_shops · refresh_token · refresh_all_tokens
Ordersget_shop_orders · get_order_detail · search_returns · search_cancellations
Financeget_shop_statements · get_shop_transactions
Productsget_shop_products · get_product_detail
Shop analyticsget_shop_performance · get_shop_performance_hourly · get_shop_products_performance · get_product_performance · get_shop_videos_performance · get_sku_performance · get_customer_service_performance
Video & affiliateget_account_video_gmv · get_videos_bestselling · get_creators_bestselling · get_products_bestselling

Installation

bash
pip install tiktok-shop-mcp

Or from source, into a virtualenv, with the direct dependencies pinned to the versions the tests run against:

bash
git clone https://github.com/Buer2333/tiktok-shop-mcp.gitcd tiktok-shop-mcppython3 -m venv .venv.venv/bin/pip install -r requirements.txt.venv/bin/pip install --no-deps -e .

requirements.txt pins the direct runtime dependencies to exact versions, including mcp-retry, which wraps every API call and so sees your tokens. Transitive dependencies (pydantic, starlette, and so on) are not pinned; for a fully reproducible install, generate a lock file with pip-compile --generate-hashes. Bump a pin only after reading what changed in that release.

Compatibility

Works with both mcp 1.x and 2.x. mcp 2.0 renamed FastMCP to MCPServer (mcp.server.mcpserver) and turned mcp.server.fastmcp into a raising stub; server.py imports via a try-v2-except-v1 shim. Tests pass on 1.28.1 and 2.1.1; requirements.txt pins 2.1.1.

Configuration

Credentials live in a JSON file outside the repo (default ~/.config/tiktok-mcp/shops.json, override with the TIKTOK_SHOP_CONFIG env var). The server never reads a shops.json from the project folder, so a copy there can't be picked up and synced or committed by accident. Keep the file owner-only:

bash
chmod 700 ~/.config/tiktok-mcp && chmod 600 ~/.config/tiktok-mcp/shops.json

The setup scripts leave token backups (shops.json.bak.* and a recovery/ folder) next to it; delete them once your shops are working. A small shops.json.lock file also lives there; it is how the server, the cron refresher, and the setup scripts avoid writing the file at the same time, so leave it be.

json
[  {    "seller_name": "MY SHOP US",    "seller_base_region": "US",    "app_key": "...",    "app_secret": "...",    "access_token": "TTP_...",    "refresh_token": "TTP_...",    "shop_id": "...",    "shop_cipher": "..."  }]

You get app_key / app_secret by creating an app on the TikTok Shop Partner Center, then authorize your shop(s) to obtain tokens. shop_id / shop_cipher are returned by the authorized-shops endpoint; the bundled probe_authorized_shops.py script can fetch them for you.

The three *_bestselling tools need a shop whose app has the Bestsellers scope. The lists are platform-wide, so one such shop is enough: set TIKTOK_SHOP_BESTSELLERS_SHOP to its seller_name (partial match OK) and the tools use it whenever seller_name is omitted. Without it they fall back to the first shop in shops.json.

Claude Code

bash
claude mcp add tiktok-shop -- tiktok-shop-mcp

Claude Desktop / other MCP clients

json
{  "mcpServers": {    "tiktok-shop": {      "command": "tiktok-shop-mcp",      "env": { "TIKTOK_SHOP_CONFIG": "/path/to/shops.json" }    }  }}

Example prompts

  • "List my shops and when their tokens expire"
  • "Orders for MY SHOP US on 2026-07-18, Eastern time"
  • "Which creators drove the most GMV for us in the last 7 days?"
  • "Compare yesterday's hourly GMV curve with the day before"
  • "Refresh tokens for all shops"

Architecture

tiktok_shop_mcp/├── server.py     # FastMCP app — tool definitions, date handling, error envelope├── client.py     # Signed HTTP client (HMAC-SHA256 request signing, via mcp-retry)├── config.py     # Multi-shop credential loading & resolution└── tools/        # One module per API domain (orders, finance, products, analytics…)

All tools return structured JSON. Errors come back as {"error": true, "message": …, "suggestion": …} so the model can self-correct (e.g. refresh an expired token and retry).

Disclaimer

This is an independent open-source project, not affiliated with or endorsed by TikTok. Use of the TikTok Shop API is subject to TikTok's own terms.

License

MIT

来源:README.md,提交 8f2abb9

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.3.0最新Oct 19, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

其他 Tik-Tok 集成