TikTok GMV Max

io.github.Buer2333由 GitHub 帳號 Buer2333 發布v0.2.1更新於 Nov 7, 2026

Read-only TikTok Business API: GMV Max campaigns and reports, ads, BC balances.

發布方自己的服務:Tiktokporn

概覽

AI 產生的概覽

唯讀的 TikTok Business API 伺服器,用來查詢 GMV Max 廣告、報表與商務中心餘額,並依商店時區與美元口徑彙總。

可以做什麼
  • 列出可存取的商務中心、授權廣告帳戶、身分與廣告主餘額
  • 瀏覽廣告活動、廣告群組、廣告、影片素材,以及 GMV Max 廣告活動、商店與影片
  • 取得 GMV Max 與手動出價報表、創意影片洞察,以及依商店時區對齊或依日期區間彙總的數據
  • 查看商務中心可用資金、各帳戶花費、交易紀錄與預算變更歷史
  • 依國家查詢 7 天或 30 天的 TikTok 熱門主題標籤
適用情境
適合管理 TikTok Shop 或 TikTok 廣告帳戶、希望助理直接回答 GMV Max 成效、廣告花費、ROI 與商務中心預算問題而不必開啟廣告後台的情況。依商店時區對齊並換算美元的報表,適合廣告帳戶日期與商店日期不一致的多商店報表。
執行需求
透過 uvx 或 pip 在本機執行,需要 Python 3.10 以上。需要 TikTok for Business 開發人員應用程式並授予讀取權限,以及長期存取權杖,透過 TIKTOK_APP_ID、TIKTOK_SECRET、TIKTOK_ACCESS_TOKEN 提供;選用 TIKTOK_ACCESS_TOKEN_2、TIKTOK_ADVERTISER_ID、TIKTOK_SANDBOX、TIKTOK_REQUEST_TIMEOUT、TIKTOK_ADS_PROXY。需要連線至 TikTok Business API 與匯率服務的網路。
安裝前請注意
需要應用程式密鑰與存取權杖(TIKTOK_SECRET、TIKTOK_ACCESS_TOKEN、TIKTOK_ACCESS_TOKEN_2),可讀取廣告帳戶與商務中心財務資料,應以機密方式保存。廣告帳戶資料與金額會傳送到 TikTok 介面,非美元金額還會經外部匯率服務換算。Python 套件名稱與 tiktok-ads-mcp 發行版衝突,請勿在同一個環境同時安裝兩者。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 TikTok GMV Max,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

TikTok GMV Max MCP

A read-only Model Context Protocol server for the TikTok Business (Marketing) API, with first-class GMV Max support. Ask your assistant how your GMV Max campaigns, regular ads, and Business Center budgets are doing, and get answers in your shop's timezone and in USD.

It runs daily in production behind a multi-shop TikTok Shop reporting stack, so most of the code beyond plain API wrappers handles things the raw API gets wrong. Report days are realigned from the ad account's timezone to the shop's. Non-USD accounts are converted at that day's rate. TikTok's transient 51010 timeouts are retried.

The Python import package tiktok_ads_mcp has the same name as the one in the tiktok-ads-mcp PyPI distribution, so don't install both into the same environment.

Tools (24, all read-only)

GMV Max

ToolWhat it returns
get_gmvmax_campaigns_toolGMV Max campaigns with status and ROI-protection info
get_gmvmax_campaign_info_toolBudget, bid, products and schedule for one campaign
get_gmvmax_reports_toolGMV Max performance reports (/gmv_max/report/get/)
get_gmvmax_report_aligned_toolOne shop-timezone day, rebuilt from hourly data: cost, gross revenue, orders, ROI
get_gmvmax_range_report_toolAggregate cost / GMV / orders / ROI for a date range
get_gmvmax_videos_toolVideos available to GMV Max for a store
get_gmvmax_store_list_toolStores linked to a GMV Max advertiser

Accounts, campaigns and ads

ToolWhat it returns
get_business_centers_toolBusiness Centers visible to the token
get_authorized_ad_accounts_toolAll authorized advertiser accounts
get_campaigns_tool / get_ad_groups_tool / get_ads_toolCampaign, ad group and ad lists with filtering
get_identities_toolTikTok identities (creator accounts) authorized to an advertiser
get_video_info_toolVideo asset URL, poster and duration by video ID

Reporting

ToolWhat it returns
get_reports_toolIntegrated reports with custom dimensions and metrics
get_ads_report_aligned_toolManual-bid ads, one shop-timezone day: cost, GMV, orders, ROAS
get_ads_range_report_toolManual-bid ads aggregate for a date range
get_creative_report_toolCreative-level video insights (engagement, play metrics)

Business Center finance

ToolWhat it returns
get_advertiser_balance_toolBalance and basic info per advertiser (≤100 IDs per call)
get_bc_balance_toolBusiness Center available funds
get_bc_account_cost_toolSpend per ad account under a BC for a date range
get_bc_transactions_toolTop-ups and deductions at BC or advertiser level
get_bc_budget_changelog_toolWho changed an advertiser's budget, and when

Discovery

ToolWhat it returns
get_trending_list_toolTrending hashtags by country (7 or 30 days), optional daily history

Install

Requires Python 3.10+.

bash
uvx tiktok-gmvmax-mcp          # run without installing# orpip install tiktok-gmvmax-mcp  # provides the `tiktok-gmvmax-mcp` command

Configure

Create an app in the TikTok for Business developer portal, grant it read permissions for the endpoints you need (ad accounts, campaigns and ads, reporting, GMV Max, Business Center), and generate a long-lived access token.

VariableRequiredMeaning
TIKTOK_APP_IDyesApp ID
TIKTOK_SECRETyesApp secret
TIKTOK_ACCESS_TOKENyesAccess token
TIKTOK_ACCESS_TOKEN_2noSecond token (e.g. another Business Center), tried on permission errors
TIKTOK_ADVERTISER_IDnoDefault advertiser
TIKTOK_SANDBOXnotrue to use the sandbox API
TIKTOK_REQUEST_TIMEOUTnoSeconds, default 30
TIKTOK_ADS_PROXYnoProxy URL used only for Business API calls
LARK_BOT_CACHE_DIRnoWhere FX rates are cached (default ~/.cache/lark-bot)

Versions before 0.2 read the token from TIKTOK_ACCESS_TOKEN_XINCHENG / TIKTOK_ACCESS_TOKEN_ZECHENG. Those names still work.

Claude Desktop / Claude Code (mcpServers):

json
{  "mcpServers": {    "tiktok-gmvmax": {      "command": "uvx",      "args": ["tiktok-gmvmax-mcp"],      "env": {        "TIKTOK_APP_ID": "your_app_id",        "TIKTOK_SECRET": "your_secret",        "TIKTOK_ACCESS_TOKEN": "your_access_token"      }    }  }}

Behavior worth knowing

  • Timezones. TikTok reports days in the ad account's timezone. The *_aligned_tools fetch hourly rows and re-aggregate them into a day in the shop's timezone, so ad spend lines up with shop orders.
  • Currency. Cost and revenue from non-USD accounts are converted to USD at that day's ECB midpoint rate (Frankfurter). If the rate API is down, a small built-in table of approximate rates is used for that call only and never cached; any other currency is then returned unconverted (rate 1.0) with a logged error.
  • Retries. Code 51010 (TikTok backend timeout) is retried with backoff at the client layer. Rate-limit and 5xx errors are retried too.
  • mcp 1.x and 2.x. Both work: the server imports MCPServer (2.x) and falls back to FastMCP (1.x).

Development

bash
git clone https://github.com/Buer2333/tiktok-gmvmax-mcp && cd tiktok-gmvmax-mcppython -m venv .venv && .venv/bin/pip install -e ".[dev]".venv/bin/python -m pytest tests -q

Issues and PRs are welcome. Please include a test with any behavior change.

Changelog

0.2.1

  • Repository renamed to tiktok-gmvmax-mcp; package links updated.

0.2.0

  • Published as tiktok-gmvmax-mcp.
  • Generic TIKTOK_ACCESS_TOKEN / TIKTOK_ACCESS_TOKEN_2. The legacy names still work.
  • CLI logs go to stderr, so stdout stays clean for the stdio protocol.
  • FX: a fallback rate used during an API outage is no longer cached permanently.
  • 18 tools added since 0.1.x: GMV Max, aligned and range reports, creatives, Business Center finance, identities, trending. Also added: account discovery, 51010 retry, USD conversion, mcp 2.x compatibility.

0.1.x

  • Six core tools, async httpx client, FastMCP server.

License

MIT. See LICENSE.

Credits

The six core campaign/report tools are based on ysntony/tiktok-ads-mcp (MIT).

來源:README.md,提交 2f29d41

工具

24

get_business_centers_tool

Get business centers accessible by the current access token

輸入參數pagebc_idpage_size

get_identities_tool

Get TikTok identities (creator accounts) authorized to an advertiser. identity_type: CUSTOMIZED_USER, AUTH_CODE, TT_USER, BC_AUTH_TT. For BC_AUTH_TT, identity_authorized_bc_id is required.

輸入參數pagepage_sizeadvertiser_id必填identity_typeidentity_authorized_bc_id

get_authorized_ad_accounts_tool

Get all authorized ad accounts accessible by the current access token

輸入參數random_string

get_campaigns_tool

Get campaigns for a specific advertiser with optional filtering

輸入參數filtersadvertiser_id必填

get_ad_groups_tool

Get ad groups for a specific advertiser with optional filtering

輸入參數pagefilterspage_sizecampaign_idadvertiser_id必填

get_ads_tool

Get ads for a specific advertiser with optional filtering

輸入參數pagefilterspage_sizeadgroup_idadvertiser_id必填

get_reports_tool

Get performance reports and analytics with comprehensive filtering and grouping options

輸入參數pagebc_idfiltersmetricsend_datepage_sizedata_leveldimensionsorder_typestart_dateorder_fieldreport_type另有 6 個

get_gmvmax_campaigns_tool

Get GMV Max campaigns via /gmv_max/campaign/get/. Returns campaign list with status and ROI protection info. Default filter: PRODUCT_GMV_MAX.

輸入參數pagefilteringpage_sizecampaign_idsadvertiser_id必填

get_gmvmax_reports_tool

Get GMV Max performance reports via /gmv_max/report/get/. store_ids is REQUIRED (get from campaign info endpoint). Metrics: cost, orders, cost_per_order, gross_revenue, roi, net_cost, creative_delivery_status, product_impressions, product_clicks, product_click_rate, ad_click_rate, ad_conversion_rate, ad_video_view_rate_2s/6s/p25/p50/p75/p100. Dimensions: advertiser_id, stat_time_day, item_id (item_id requires filtering with campaign_ids AND item_group_ids). Filtering: {"campaign_ids": ["..."], "item_group_ids": ["..."]}.

輸入參數pagemetricsend_date必填filteringpage_sizestore_ids必填dimensionsstart_date必填advertiser_id必填

get_gmvmax_campaign_info_tool

Get detailed info for a specific GMV Max campaign via /campaign/gmv_max/info/. Returns budget, bid, product, and scheduling details.

輸入參數campaign_id必填advertiser_id必填

get_video_info_tool

Get video asset details (URL, thumbnail, duration) by video IDs. Use with get_ads_tool to map ad → video_id → video URL/poster.

輸入參數video_ids必填advertiser_id必填

get_creative_report_tool

Get creative-level performance report (video insights, engagement, play metrics). report_type: VIDEO_INSIGHT (default).

輸入參數pageend_date必填filteringpage_sizestart_date必填report_typeadvertiser_id必填

get_gmvmax_videos_tool

Get videos available for GMVMAX campaigns for a given store. Returns video list with IDs for cross-referencing with creative reports.

輸入參數pagestore_id必填page_sizeadvertiser_id必填identity_listneed_auth_code_videostore_authorized_bc_id

get_bc_balance_tool

Get Business Center balance (available funds).

輸入參數bc_id必填

get_bc_account_cost_tool

Get cost summary for all ad accounts under a BC within a date range. Useful for weekly/monthly spend review.

輸入參數pagebc_id必填end_date必填page_sizestart_date必填

get_bc_transactions_tool

Get BC transaction records (top-ups, deductions). transaction_level: BC or ADVERTISER. Times format: YYYY-MM-DD HH:MM:SS.

輸入參數pagebc_id必填end_time必填page_sizestart_time必填transaction_level

get_bc_budget_changelog_tool

Get budget change history for a specific advertiser under BC. Track who changed budget and when.

輸入參數pagebc_id必填end_date必填page_sizestart_date必填advertiser_id必填

get_gmvmax_store_list_tool

Get stores linked to a GMVMAX advertiser account. Useful to verify store-advertiser bindings.

輸入參數advertiser_id必填

get_advertiser_balance_tool

Get balance and basic info for individual advertiser accounts. Max 100 IDs per request.

輸入參數advertiser_ids必填

get_gmvmax_report_aligned_tool

Get GMVMAX report aligned to shop timezone. Fetches hourly data and re-aggregates to match a shop-tz day, regardless of the ad account's native timezone. Returns aggregated metrics (cost, gross_revenue, orders), ROI, and hours included.

輸入參數date必填metricsshop_tzstore_ids必填advertiser_id必填

get_ads_report_aligned_tool

Get Ads (manual bid) report aligned to shop timezone. Fetches hourly data and re-aggregates to match a shop-tz day. Returns cost, gmv, orders, and roas.

輸入參數date必填metricsshop_tzadvertiser_id必填

get_gmvmax_range_report_tool

Get GMVMAX aggregate report for a date range (no timezone alignment). Returns cost, gmv, orders, roi.

輸入參數end_date必填store_ids必填start_date必填advertiser_id必填

get_ads_range_report_tool

Get Ads (manual bid) aggregate report for a date range (no timezone alignment). Returns cost, gmv, orders, roas.

輸入參數end_date必填start_date必填advertiser_id必填

版本歷史

2
  1. v0.2.1最新Nov 5, 2026
  2. v0.2.0Oct 19, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

其他 Tik-Tok 整合