SuperAPI AI Directory

tiktok-ads-mcp

TikTok Ads: video performance metrics, creative fatigue scoring, industry benchmarks and Smart+ campaign support.

Open website

About this tool

tiktok-ads-mcp is a Model Context Protocol (MCP) server for the TikTok Business API, designed to let Claude (or any MCP-compatible AI client) connect directly to your TikTok ads account through natural language to query data such as campaigns, video performance, audience targeting, industry benchmarks, and more.

Main Capabilities

The server provides the following features:

  • Accounts and Business Centers: list authorized advertiser accounts, get advertiser metadata (currency, time zone, industry, status), list Business Centers and their members and assets.
  • Campaigns, Ad Groups, and Ads: list standard campaigns and Smart+ (AI-optimized) campaigns, list ad groups and the creatives and status of individual ads, check video assets and creative fatigue scores.
  • Reporting and Performance: custom reports using any TikTok dimensions and metrics (any date range), video-specific metrics (2-second/6-second views, completion rate, average watch time), ad benchmark comparisons (industry CTR/CVR/CPM/CPC), asynchronous reporting over large data ranges.
  • Audiences, Pixels, and Conversions: browse all interest categories for audience targeting, audience reach estimates, list TikTok Pixel installations and conversion event statistics, list offline event sets.
  • Account Operations: query the advertiser balance of authorized accounts.

How to Use

Prerequisites

  • A TikTok Business app with at least one authorized advertiser.
  • A Google Cloud project (required only for remote mode).

Step 1 — Create a TikTok Developer App

Create an app in the TikTok Business API developer portal, and note down the App ID and Secret (used as OAuth client credentials). Add the following to the advertiser redirect URLs:

  • http://localhost:8080/oauth/callback(local development)
  • https://YOUR-CLOUD-RUN-URL/oauth/callback(remote mode only — add after deployment) Note: TikTok has a 10-minute propagation delay for new redirect URLs.

Step 2 — Installation

(No specific installation command is provided in the official documentation, so none is provided here for now.)

Step 3 — Local STDIO Mode (single user)

Run the one-time OAuth flow (get_token.py / catch_auth.py), visit TikTok and capture the auth_code to exchange for a token. Set TIKTOK_ACCESS_TOKENin the environment variables. Then add it to ~/Library/Application Support/Claude/claude_desktop_config.json(macOS). Restart Claude Desktop and you're done. No Firestore, Cloud Run, or public URL is required.

Step 3 — Remote HTTP Server Mode (Claude Teams, claude.ai, multi-user)

This MCP server is also an OAuth 2.1 authorization server. When Claude connects:

  1. Claude discovers metadata at /.well-known/oauth-protected-resource and /.well-known/oauth-authorization-server .
  2. Claude registers itself via dynamic client registration (POST /oauth/register).
  3. Claude redirects the user to /oauth/authorize. We delegate authentication to TikTok Business OAuth.
  4. After TikTok login, we issue Claude our own opaque bearer token — TikTok credentials never leave the server.
  5. On every /mcp request, Claude sends our bearer; we map it server-side to the TikTok credentials stored for the corresponding user, and call the TikTok Business API.

Regarding access control: TikTok returns whatever email the user used to register (usually a personal email rather than a work email), so domain-based restrictions are unreliable. By default, this MCP allows any TikTok Business user to connect; security comes from TikTok's own permission model (each user can only see the ad accounts authorized by their TikTok profile). For stricter control, you can set ALLOWED_EMAILS A comma-separated allowlist for TikTok account emails.

Remote mode deployment:

  • Enable Firestore: The server stores OAuth bearer tokens and per-user TikTok credentials in Firestore. Create a Firestore database (Native mode) in the Cloud Console and select a region. In IAM & Admin, grant the Cloud Run service account the Cloud Datastore User role.
  • Deploy to Cloud Run: It is recommended to store TIKTOK_SECRET in Secret Manager and inject it via --set-secrets . After deployment, return to the TikTok Developer Portal to add the live callback URL.
  • Connect from Claude:
    • Claude Teams (organization owners add it once for everyone): Settings → Connectors → Add custom connector, URL:https://YOUR-SERVICE-URL.run.app/mcp. Each member clicks "Connect" and logs in with TikTok.
    • claude.ai personal edition: Add the URL and click "Connect".
    • Claude Desktop with a remote server: The OAuth flow is performed on first use.

Use cases

  • Digital marketers or agencies who want to quickly query TikTok ad account performance data using natural language.
  • Teams that need to compare industry benchmarks and analyze video ad performance and creative fatigue.
  • Organizations using Claude Teams or multiple users that want centralized management of TikTok ad data access.
  • Local single users who want to run it on their own machine without deploying a cloud service.

Limitations and considerations

  • This server has a broad read scope and deliberately keeps write operations narrow (official wording).
  • TikTok's OAuth implementation does not support PKCE, so PKCE is only enforced on the channel from Claude to this server; the channel from this server to TikTok uses the state parameter for CSRF protection.
  • TikTok's token endpoint accepts a JSON request body (using app_id、secret、auth_code), rather than the standard form-encoded client_id/code. Its access token is sent via the Access-Token header (rather than Authorization: Bearer). The OAuth proxy here normalizes both to standard OAuth 2.1 on the Claude side.
  • By default, any TikTok Business user is allowed to connect, and security relies on TikTok's own permission model; stricter restrictions can be set via ALLOWED_EMAILS .
  • Remote mode requires a Google Cloud project and incurs corresponding cloud service costs (specific costs are not provided).
  • Environment variables, available tools, example prompts, and OAuth endpoint references are listed in the official documentation, but the specific contents are not included in this material and are not provided here.

Tech stack

  • FastMCP — MCP server framework
  • Starlette + uvicorn — HTTP wrapper
  • httpx — HTTP client for the TikTok API
  • google-cloud-firestore — per-user token storage and OAuth server state (remote mode)
  • Google Cloud Run — serverless hosting

About the author

Dhawal Shah runs a 40+ person digital marketing agency in Singapore and builds automation tools for his team himself. This server is one of the tools he actually runs every week on real TikTok ad accounts. He has fourteen years of experience building companies in Asia, has worked on more than 5,000 campaigns, 400+ brands, advised more than 30 startups, and delivered more than 300 training sessions for teams including Sony, Toyota, DHL, and Interpol. He is also a certified director of the Singapore Institute of Directors.