Skip to main content

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
  • 25 tools covering orders, finance, product catalog, shop/video/SKU analytics, affiliate best-sellers, returns/cancellations, and product editing
  • 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-mostly, opt-in writes — the only mutating tools are explicit (edit_product, clone_product, upload_image); everything else is read-only

Tools

Group Tools
Shops & auth list_shops · refresh_token · refresh_all_tokens
Orders get_shop_orders · get_order_detail · search_returns · search_cancellations
Finance get_shop_statements · get_shop_transactions
Products get_shop_products · get_product_detail · edit_product · clone_product · upload_image
Shop analytics get_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 & affiliate get_account_video_gmv · get_videos_bestselling · get_creators_bestselling · get_products_bestselling

Installation

pip install tiktok-shop-mcp

Or from source:

git clone https://github.com/Buer2333/tiktok-shop-mcp.git
cd tiktok-shop-mcp
pip install -e .

Configuration

Credentials live in a JSON file outside the repo (default ~/.config/tiktok-mcp/shops.json, override with the TIKTOK_SHOP_CONFIG env var):

[
  {
    "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.

Claude Code

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

Claude Desktop / other MCP clients

{
  "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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tiktok_shop_mcp-0.2.1.tar.gz (23.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tiktok_shop_mcp-0.2.1-py3-none-any.whl (33.9 kB view details)

Uploaded Python 3

File details

Details for the file tiktok_shop_mcp-0.2.1.tar.gz.

File metadata

  • Download URL: tiktok_shop_mcp-0.2.1.tar.gz
  • Upload date:
  • Size: 23.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.10.10

File hashes

Hashes for tiktok_shop_mcp-0.2.1.tar.gz
Algorithm Hash digest
SHA256 b5e775b44af60fdd34b9a05705b321cdc8e4037a2a40d65cbcadaef166ccafbc
MD5 4827e01250f72394f40beebfb0e489e5
BLAKE2b-256 91478df896d9841e3316da27878cb8cf619d89cca2a0119d459bf97d30c215a4

See more details on using hashes here.

File details

Details for the file tiktok_shop_mcp-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for tiktok_shop_mcp-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4d96b74d9f32ab4f1f0ba2d902e12e649200349c00a16e38dd87d70ab73e93ec
MD5 bb06bca3926e528f04fccec36916578f
BLAKE2b-256 52f72889f9cba5a18e85225097f111fea7decf5bca5c40e4e0493f1b6f5d7c42

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 files

0.2.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page