mcpField
P
pp-tiktok-shop

pp-tiktok-shop

github.com/mvanhornOther2.1k126 installsUpdated today
Repository

About pp-tiktok-shop

pp-tiktok-shop is a skill for using the TikTok Shop CLI to inspect authorized shops, orders, products, inventory, and fulfillment. Its safe v1 focuses on read operations and token handling, with mutation retries avoided.

Key features

  1. 01Check configuration and auth readiness
  2. 02Exchange and refresh tokens with redaction
  3. 03Query shops, orders, and products
  4. 04Inspect inventory and fulfillment packages
  5. 05Agent-oriented JSON output

Use cases

  1. 01Verify setup before making API requests
  2. 02Review orders and buyer details
  3. 03Check product listings and SKU inventory
  4. 04Inspect fulfillment packages and warehouses

MCP support

The skill can install a TikTok Shop MCP server. It exposes the same safe v1 read capabilities, plus an inventory_update_status explainer instead of a stock mutation tool.

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/mvanhorn/printing-press-library --skill pp-tiktok-shop

After installing, type/pp-tiktok-shopin Claude Code to confirm it loaded.

Details

From the project README

TikTok Shop - Printing Press Safe v1

Prerequisites: Install the CLI

This skill drives the tiktok-shop-pp-cli binary. You must verify the CLI is installed before invoking any command from this skill. If it is missing, install it first:

  1. Install via the Printing Press installer. It defaults binaries to $HOME/.local/bin on macOS/Linux and %LOCALAPPDATA%\Programs\PrintingPress\bin on Windows:
    npx -y @mvanhorn/printing-press-library install tiktok-shop --cli-only
    
  2. Verify: tiktok-shop-pp-cli --version
  3. Ensure the reported install directory is on $PATH for the agent/runtime that will invoke this skill.

If the npx install fails (no Node, offline, etc.), fall back to a direct Go install (requires Go 1.26.6 or newer):

go install github.com/mvanhorn/printing-press-library/library/commerce/tiktok-shop/cmd/tiktok-shop-pp-cli@latest

If --version reports "command not found" after install, the runtime cannot see the binary directory on $PATH. Do not proceed with skill commands until verification succeeds.

Official Source Boundaries

Only use official TikTok Shop Partner Center docs for API, auth, signing, scope, endpoint, and rate-limit claims:

Rate limits remain unclear in accessible official docs and are not encoded as numeric claims.

Command Reference

Implemented:

  • tiktok-shop-pp-cli doctor - Check config, env, auth readiness, and official-doc basis without sending a live probe.
  • tiktok-shop-pp-cli auth status - Show whether app credentials, tokens, and shop selector are configured without revealing secrets.
  • tiktok-shop-pp-cli auth exchange --auth-code <code> - Exchange a Partner Center authorization code for tokens; output redacts tokens.
  • tiktok-shop-pp-cli auth refresh - Refresh an access token; output redacts tokens.
  • tiktok-shop-pp-cli shops info - List shops authorized for this app/token and retrieve shop cipher.
  • tiktok-shop-pp-cli orders list - Search orders; response contains buyer/order PII.
  • tiktok-shop-pp-cli orders get <order-id> - Get order detail; response contains buyer/order PII.
  • tiktok-shop-pp-cli products list - Search products/listings.
  • tiktok-shop-pp-cli products get <product-id> - Get product detail.
  • tiktok-shop-pp-cli inventory list --product-id <id> or --sku-id <id> - Search inventory.
  • tiktok-shop-pp-cli inventory get <sku-id> - Get inventory for one SKU.
  • tiktok-shop-pp-cli fulfillment list - Search fulfillment packages; response may contain fulfillment PII.
  • tiktok-shop-pp-cli fulfillment get <package-id> - Get package detail.
  • tiktok-shop-pp-cli fulfillment warehouses - List seller warehouses.
  • tiktok-shop-pp-cli which [query] - Resolve capabilities to commands.
  • tiktok-shop-pp-cli agent-context - Emit JSON context for agents.

Deferred:

  • tiktok-shop-pp-cli inventory update - Official endpoint is confirmed, but safe v1 defers execution until idempotency and no-retry mutation behavior are designed.

Auth Setup

Set values obtained through official TikTok Shop Partner Center flows. Never hardcode secrets.

export TIKTOK_SHOP_APP_KEY="<from Partner Center>"
export TIKTOK_SHOP_APP_SECRET="<from Partner Center>"
export TIKTOK_SHOP_ACCESS_TOKEN="<from official token exchange>"
export TIKTOK_SHOP_REFRESH_TOKEN="<from official token exchange>"
export TIKTOK_SHOP_SHOP_CIPHER="<from shops info>"

Optional overrides:

export TIKTOK_SHOP_CONFIG="$HOME/.config/tiktok-shop-pp-cli/config.toml"
export TIKTOK_SHOP_BASE_URL="https://open-api.tiktokglobalshop.com"
export TIKTOK_SHOP_AUTH_BASE_URL="https://auth.tiktok-shops.com"

Run:

tiktok-shop-pp-cli doctor --json

Token exchange/refresh do not print token values. Add --save only when you intentionally want the returned token bundle persisted to ~/.config/tiktok-shop-pp-cli/config.toml with 0600 permissions.

Agent Mode

Add --agent to any command. It expands to --json --compact --no-input --no-color --yes.

Agent-safe examples:

tiktok-shop-pp-cli doctor --agent
tiktok-shop-pp-cli shops info --agent --dry-run
tiktok-shop-pp-cli which --agent
tiktok-shop-pp-cli inventory update --agent

Safety Rules

  • Treat orders, fulfillment, returns, and buyer identifiers as PII.
  • Use shops info to obtain shop_cipher; do not invent or decrypt shop ciphers.
  • Use --dry-run before first live calls to inspect signed request shape without transmitting it.
  • Do not retry mutations. Safe v1 only executes read commands and auth token calls.
  • Do not use unofficial endpoints, SDK guesses, blog posts, or copied Postman collections for missing API behavior.

Exit Codes

CodeMeaning
0Success, including intentional deferred placeholder output
1Unclassified error
2Usage error
4Authentication/config material missing
5Upstream API error
7Rate limited
10Config error

Argument Parsing

Parse $ARGUMENTS:

  1. Empty, help, or --help means show tiktok-shop-pp-cli --help.
  2. Starts with install and ends with mcp means MCP installation; otherwise CLI installation.
  3. Anything else means direct use with --agent.

MCP Server Installation

go install github.com/mvanhorn/printing-press-library/library/commerce/tiktok-shop/cmd/tiktok-shop-pp-mcp@latest
claude mcp add tiktok-shop-pp-mcp -- tiktok-shop-pp-mcp

The MCP server exposes the same safe v1 read surface and an inventory_update_status explainer instead of a stock mutation tool.

Comments

Markdown supported