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 集成