TikTok Shop MCP Server
Read-only TikTok Shop Partner API: orders, finance, products and analytics across shops.
TikTok Shop scores 70 (Good), licensed MIT and written in Python. It installs as a local process. It does not declare tools yet. Filed under Data and analytics, Finance. GitHub shows 13 stars. Package registries report about 54 downloads a week. Install configs are generated for 12 clients. Being listed in the registry is not the same as being vendor-official.
Good trust
70 of 100 from six public signals. Nobody can buy a point.
- Listed in the official MCP registry.
- OSI-style license: mit.
License, quality and maintenance
Quality: Grade C
65/100 for listing completeness. Lost points: no listed tools, short summary.
How quality is graded
Where the 70 comes from
22 + 20 + 7 + 10 + 4 + 7 = 70. Each factor is capped, so no single signal can carry a listing.
Active in the official MCP registry, plus a known vendor namespace.
Registry: 22 of 30 points.How recently the repository saw a commit or release.
Maintenance: 20 of 20 points.GitHub stars and weekly downloads, on a log scale.
Popularity: 7 of 20 points.A clear, OSI-style open-source license.
License: 10 of 10 points.Not archived, a secure install path, a pinned version.
Security: 4 of 10 points.A real summary, a README with depth, listed tools.
Docs: 7 of 10 points.Install
Pick your client, copy the config, paste it in.
Needs Cursor or VS Code installed on this device. The button opens the app and asks you to confirm before it adds the server.
{ "mcpServers": { "buer2333-tiktok-shop-mcp": { "command": "uvx", "args": [ "tiktok-shop-mcp" ], "env": { "TIKTOK_SHOP_CONFIG": "", "TIKTOK_SHOP_BESTSELLERS_SHOP": "" } } }}
Environment variables
| Name | Required | Notes |
|---|---|---|
TIKTOK_SHOP_CONFIG | Optional | Path to shops.json (default ~/.config/tiktok-mcp/shops.json) |
TIKTOK_SHOP_BESTSELLERS_SHOP | Optional | Shop used by the bestselling tools when seller_name is omitted |
Tools
All capabilitiesTools show up when the registry metadata or the repository README lists them. Public READMEs are read directly. A GitHub token is used only when one is already configured.
About
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 - 42 tools covering orders, finance, product catalog and listing lookups, shop/video/SKU analytics, affiliate best-sellers, returns/cancellations, and gated product, price, stock and seller-discount writes
- 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 by default — write tools exist (image and file upload, create, partial and full edit, activate/deactivate, stock, list prices, seller discounts), but every one of them refuses until you list the shop's exact name in
TIKTOK_SHOP_WRITE_SHOPS, and each defaults to a dry run. See Product writes. Otherwise the only thing the server writes is your ownshops.json, when it refreshes tokens, with owner-only (0600) permissions. If you never need writes, authorize the Partner Center app with read scopes 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 |
| Listing lookups | get_categories · get_category_attributes · get_category_rules · get_brands · get_warehouses |
| Product writes (opt-in, see below) | upload_product_image · upload_product_file · create_product · partial_edit_product · edit_product · activate_products · deactivate_products · update_inventory · update_sku_prices |
| Promotions | get_promotion_activity · writes (opt-in): create_discount_activity · set_discount_products · remove_discount_products · update_discount_activity_end · deactivate_activity |
| 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, into a virtualenv, with the direct dependencies pinned to the versions the tests run against:
git clone https://github.com/Buer2333/tiktok-shop-mcp.git
cd tiktok-shop-mcp
python3 -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:
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.
[
{
"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.
Adding a shop
TIKTOK_SHOP_APP_SECRET=... .venv/bin/python add_or_update_shop.py "<full_callback_url>" --seller-name "MY SHOP"
TIKTOK_SHOP_APP_SECRET is only needed for the first shop on an app; after that the script reads it from the existing entry. The callback URL carries app_key and code. The code is single-use and starts with TTP_, while an app secret is 40 hex characters, so they are easy to tell apart.
To keep one business's shops apart from another's, point TIKTOK_SHOP_CONFIG at its own file for both this script and the server. Backups and the recovery/ folder follow that path.
Token lifetime
- Access token: lasts about 7 days. An expired token gets
401/105002 Expired credentials; the server then refreshes it and retries once, so MCP use needs no scheduled job. - Refresh token: effectively does not expire (observed expiry in 2125). Each refresh returns a new refresh token, but the previous refresh token and access token keep working (observed 2026-11-11), so a second copy of the credentials on another host can refresh on its own without invalidating this one.
access_token_expire_in/refresh_token_expire_in: despite the names, these are Unix timestamps, not durations.*_expire_atinshops.jsonandlist_shops: real UTC dates. Entries written by older versions can show years like 2083 until their next refresh.
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" }
}
}
}
Product writes (opt-in)
Fourteen tools change a shop's listings, prices, stock or seller discounts. They are off unless you turn them on per shop.
| Tool | Endpoint (Product API 202309) | Required params |
|---|---|---|
upload_product_image | POST /product/202309/images/upload (multipart) | seller_name, image_path; use_case = MAIN_IMAGE (default), ATTRIBUTE_IMAGE, DESCRIPTION_IMAGE, CERTIFICATION_IMAGE, SIZE_CHART_IMAGE |
create_product | POST /product/202309/products | seller_name, product (the Create Product body: title, category_id, main_images, skus, ...) |
partial_edit_product | POST /product/202309/products/{id}/partial_edit | seller_name, product_id, changes |
activate_products | POST /product/202309/products/activate | seller_name, product_ids (max 20) |
deactivate_products | POST /product/202309/products/deactivate | seller_name, product_ids (max 20) |
upload_product_file | POST /product/202309/files/upload (multipart) | seller_name, file_path (MP4/MOV video or PDF); attach a video as {"id": <id>} |
edit_product | PUT /product/202309/products/{id} | seller_name, product_id; plus changes, add_skus, sku_images, sku_packages, sku_names or submit_draft |
update_inventory | POST /product/202309/products/{id}/inventory/update | seller_name, product_id, quantities ({seller_sku: n}) |
update_sku_prices | POST /product/202309/products/{id}/prices/update | seller_name, product_id, prices ({seller_sku: "24.99"}) |
create_discount_activity | POST /promotion/202309/activities (fixed price, per SKU) | seller_name, title, begin_time, end_time |
set_discount_products | PUT /promotion/202309/activities/{id}/products | seller_name, activity_id, products ([{product_id, prices: {seller_sku: price}}]) |
remove_discount_products | DELETE /promotion/202309/activities/{id}/products | seller_name, activity_id, products ([{product_id, seller_skus}]) |
update_discount_activity_end | PUT /promotion/202309/activities/{id} | seller_name, activity_id, end_time |
deactivate_activity | POST /promotion/202309/activities/{id}/deactivate | seller_name, activity_id |
edit_product sku_names ({seller_sku: new_value_name}) renames the SKU's first sales attribute value, e.g. Color "Red" -> "Red - 3 Rolls". The SKU id, price, inventory, images and other SKUs are carried over unchanged. The renamed attribute is sent with the new value_name and without value_id (a custom value's id belongs to its old name). Needs live verification on a draft first; the API behaviour is not yet confirmed. SKUs sharing the same first value must all be renamed to the same name; empty names, unknown seller SKUs, names over 50 characters (a guard, not a platform limit) and renames that make two SKUs' attribute combinations identical are refused. The diff lists sku_names_changed with from/to per seller SKU.
The gate. Every write tool checks, before it builds a request:
seller_nameis given and matches ashops.jsonentry exactly. The read tools' partial, case-insensitive match and first-shop fallback do not apply:"MY SHOP"will not select"MY SHOP US".- That exact name is listed in the
TIKTOK_SHOP_WRITE_SHOPSenvironment variable (comma-separated). Unset or empty means every write tool refuses, dry runs included.
{
"mcpServers": {
"tiktok-shop": {
"command": "tiktok-shop-mcp",
"env": { "TIKTOK_SHOP_WRITE_SHOPS": "MY SHOP US" }
}
}
}
Dry run first. dry_run defaults to true: the tool returns the method, path and JSON body it would send (no token, signature or app key) and makes no HTTP request. Pass dry_run=false to send. A real send then:
- goes out once. Write requests skip the automatic retry used for reads, because a create that timed out may still have gone through. On a network error the result says the outcome is unknown; read the product before trying again.
- reads the product back (
GET /product/202309/products/{id}) and returns it asread_back. Afterpartial_edit_productthe read-back asks for the version under review, since TikTok Shop keeps the old version live until the edit passes audit. Afteractivate_products/deactivate_productsit returns each product's status, anderrorslists per-product failures that come back with code 0.
What the tools will not do.
edit_productnever sends a body you wrote by hand. Edit Product (PUT .../products/{id}) overwrites every field the body leaves out, so the tool reads the current version, carries every field and SKU over, then applies your changes. It never removes or re-identifies existing SKUs. While an earlier edit is still in review, the live read-back is the last approved version; an edit that would put those reviewed values back is refused unless you pass them again or setallow_overwrite_pending=true.remove_discount_productsremoves a product's SKUs only all together: the live API drops the whole product from the activity, so a partial removal is refused. Remove the product, then put back the SKUs to keep withset_discount_products.partial_edit_productrefusesskus. The API treats each top-level field as a unit, so askuslist you send stands in for the whole property; the docs do not say what happens to SKUs left out of it (they may be removed), and SKUs carry inventory. It also refuseslisting_platformsand anything not on its list (title,description,brand_id,main_images,product_attributes,package_weight,package_dimensions,video,certifications,size_chart,search_terms,key_product_features,external_product_id,save_mode,locale).- No product deletion, coupons, or anything touching orders or finance.
Things to know before sending.
- Partial Edit leaves omitted top-level fields alone, but an object or list you do send replaces that whole property: leave out one
product_attributesentry or onepackage_dimensionsvalue and it is blanked. Send the full property. - Edits other than price and inventory go back to audit;
update_sku_pricesandupdate_inventorynormally take effect at once, and the read-back says per SKU whether the live value already matches. So do activations (statusPENDING). New products are audited after creation. create_productsets each SKU's openinginventory(warehouse_idfromget_warehouses,quantity). If another system syncs your stock, make the opening numbers match it; after creation, leave stock to that system.- US, EU and SEA shops must use
category_versionv2; the tools default to it. - The Partner Center app needs the Product Basic (
seller.product.basic) and Product Modify (seller.product.write) scopes;get_warehousesneeds Logistics Basic (seller.logistics).
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
├── write_guard.py # Exact-name + TIKTOK_SHOP_WRITE_SHOPS gate for write tools
└── 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
Frequently asked questions
What is TikTok Shop MCP Server?
Read-only TikTok Shop Partner API: orders, finance, products and analytics across shops.
How do I install TikTok Shop MCP Server in Claude Desktop, Cursor, or VS Code?
Pick your client in the Install section on this page and copy the generated config into the client's config file. Step-by-step guides: Claude Desktop, Cursor, and VS Code. TikTok Shop MCP Server runs locally from the PyPI package tiktok-shop-mcp with the command uvx tiktok-shop-mcp.
Is TikTok Shop MCP Server free and open source?
Yes. TikTok Shop MCP Server is released under the MIT license, an OSI-approved open-source license, so you can use, modify, and self-host it under those terms.
Does TikTok Shop MCP Server support remote (HTTP) connections?
No remote endpoint is listed for TikTok Shop MCP Server. It runs locally on your machine over stdio, started by your MCP client.
How is TikTok Shop MCP Server's trust score calculated?
TikTok Shop MCP Server scores 70 out of 100 (Good). The score adds six capped public signals: registry status, maintenance, popularity, license, documentation, and security. Nobody can pay for points. Read the methodology for the full formula.
Reviews
No reviews yet—Be the first to review
No published reviews yet. Used it? Tell the next person how it went.
Sign inA verified email is required to review this server.
Add badge to your README
Paste either snippet into the repository README. The image links to this listing.