{
  "markdown": "# tiktok-ads-mcp-server\n\n[![CI](https://github.com/getmcpads-com/tiktok-ads-mcp-server/actions/workflows/ci.yml/badge.svg)](https://github.com/getmcpads-com/tiktok-ads-mcp-server/actions/workflows/ci.yml)\n[![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)\n[![Node](https://img.shields.io/badge/node-%E2%89%A518-brightgreen.svg)](package.json)\n\nAn open-source [Model Context Protocol](https://modelcontextprotocol.io) server for the\n**TikTok Business API**. It lets Claude, ChatGPT, Cursor or any MCP client read and analyse\nyour TikTok advertising data, and change it if you choose to.\n\nYou run it. Your token stays on your machine. Nothing is proxied through a third party.\n\n```bash\nnpx -y @getmcpads/tiktok-ads-mcp-server\n```\n\nAlso listed in the [MCP Registry](https://registry.modelcontextprotocol.io) as **`com.getmcpads/tiktok-ads`**, so clients that read the registry can install it by name.\n\n> **Prefer not to run it yourself?** [getmcpads.com](https://www.getmcpads.com) is the hosted\n> version of this server, with TikTok Ads alongside Meta Ads, Google Ads, Pinterest Ads, GA4 and\n> Search Console behind a single endpoint, hosted OAuth, and cross-platform reporting.\n> Same tools, same safety model, no setup.\n\n---\n\n## What you get\n\n| | |\n|---|---|\n| **27 read tools** | Campaigns, ad groups, ads, creatives, audiences, pixels, events, Spark Ads, catalogs, delivery diagnostics |\n| **5 write tools** | Off by default. Campaign and ad group status, budgets, campaign creation. Each one **previews before it applies** |\n| **277 metrics** | Including derived ones computed client-side |\n| **16 dimensions** | With a compatibility matrix that catches invalid combinations before they hit the API |\n| **5 resources** | Live catalogues the model can read: metrics, dimensions, compatibility rules, 12 workflow recipes |\n| **Keyword research** | `tiktok_search_keywords` and `tiktok_get_search_ads_maturity`, for TikTok Search Ads |\n| **Forward-compatible reads** | `tiktok_get_read_endpoint`, `tiktok_get_entities_raw`, `tiktok_get_report_raw` reach endpoints this server doesn't model yet |\n\n### The query planner\n\nTikTok rejects many metric and dimension combinations, and its error messages rarely say why.\nThis server encodes the compatibility matrix, so it **splits an impossible request into\nseveral valid API calls and merges the results** instead of failing.\n\n`tiktok_validate_query` lets the model check a combination before spending a call on it.\n\n### One trap this server handles for you\n\n**TikTok answers HTTP 200 even when the call failed.** The applicative `code` field is what\ndecides. A client that trusts the HTTP status reports imaginary successes back to the model,\nwhich then reasons on data that was never returned. Every call here checks `code` first.\n\n---\n\n## How this compares to TikTok's own MCP server\n\nTikTok ships an official MCP server, announced at TikTok World '26 and hosted at\n`business-api.tiktok.com/open_mcp/`. It is a serious product, and it is bigger than this one.\nHere is an honest comparison.\n\n| | **This server** | TikTok's official server | [getmcpads.com](https://www.getmcpads.com) |\n|---|---|---|---|\n| Hosting | **You host it.** stdio, local process | TikTok-hosted, remote | Hosted for you |\n| Data path | **Direct to the Business API.** No intermediary | Through TikTok's endpoint | Through our gateway |\n| Tools | **32** (27 read + 5 write) | ~400 flat, or ~40 in layered mode | 32, plus 5 other platforms |\n| Coverage | Reporting, structure, creatives, audiences | **Far broader** | Same as this server |\n| Writes | **Preview first**, applied only on `confirm: true` | Applied directly | Preview first |\n| Metric compatibility | **Query planner splits incompatible requests** | None documented | Same planner |\n| HTTP 200 on failure | **Checked on every call** | Handled internally | Checked |\n| Auditable | **Yes.** Apache-2.0, read every line | No | This server, audited |\n| Modifiable | **Fork it** | No | No |\n\n**Be clear about the trade-off.** If you want the widest possible surface of the TikTok API,\nthe official server covers far more endpoints than this one does, and you should use it.\n\nWhat this server offers instead is a **curated set**. TikTok themselves ship a layered mode\nthat exposes about 40 tools rather than 400, because loading hundreds of tool definitions\nfills the model's context and makes it pick the wrong tool more often. 27 well-described\nread tools with a compatibility-aware planner is a deliberate design choice, not a gap.\n\n**Choose the official server** for breadth, or if you don't need to see the code.\n**Choose this one** if you need your data to stay on your infrastructure, want to audit or\nextend what the model can do, or want writes that cannot fire on the first call.\n**Choose [getmcpads.com](https://www.getmcpads.com)** if you want this server's capabilities\nwithout running it, or you need more than one ad platform in the same conversation.\n\n---\n\n## Getting a token\n\nTikTok needs **two** values, not one: an access token and the App ID it belongs to.\n\n1. Create a developer app on the [TikTok for Business developer portal](https://business-api.tiktok.com/portal).\n2. Note the **App ID** and App Secret from the app's page.\n3. Authorize the advertiser accounts you want to reach. TikTok grants access per advertiser,\n   so an account you skip here stays invisible to the server no matter what the token allows.\n4. Complete the OAuth authorization flow to exchange the returned `auth_code` for an\n   **access token**. TikTok's long-lived tokens do not expire on a fixed schedule, but they\n   are revoked when the authorization is withdrawn.\n5. Put the token in `TIKTOK_ACCESS_TOKEN` and the App ID in `TIKTOK_APP_ID`.\n\n📖 [TikTok API for Business documentation](https://business-api.tiktok.com/portal/docs)\n\nRun **`tiktok_health_check`** as your first call. It verifies the credentials, lists the\nadvertiser accounts you can actually reach, and reports what is missing, without printing\nyour token.\n\n### Which permissions?\n\n| Scope group | When you need it |\n|---|---|\n| Reporting and read scopes | **Always.** Campaigns, ad groups, ads, insights |\n| Campaign management scopes | Only if you set `TIKTOK_ENABLE_WRITES=1` |\n| Catalog and Business Center scopes | Optional, for `tiktok_get_shop_catalog_diagnostics` |\n\n---\n\n## Setup\n\n### Claude Desktop\n\n`~/Library/Application Support/Claude/claude_desktop_config.json` (macOS)\nor `%APPDATA%\\Claude\\claude_desktop_config.json` (Windows):\n\n```json\n{\n  \"mcpServers\": {\n    \"tiktok-ads\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@getmcpads/tiktok-ads-mcp-server\"],\n      \"env\": {\n        \"TIKTOK_ACCESS_TOKEN\": \"your-token-here\",\n        \"TIKTOK_APP_ID\": \"your-app-id-here\"\n      }\n    }\n  }\n}\n```\n\nRestart Claude Desktop. Ask it: *\"list my TikTok advertiser accounts\"*.\n\n### Claude Code\n\n```bash\nclaude mcp add tiktok-ads --env TIKTOK_ACCESS_TOKEN=your-token --env TIKTOK_APP_ID=your-app-id -- npx -y @getmcpads/tiktok-ads-mcp-server\n```\n\n### Cursor\n\n`.cursor/mcp.json` in your project, same shape as the Claude Desktop config above.\n\n### From source\n\n```bash\ngit clone https://github.com/getmcpads-com/tiktok-ads-mcp-server.git\ncd tiktok-ads-mcp-server\nnpm install && npm run build\ncp .env.example .env   # then fill in your credentials\nnpm start\n```\n\n### Configuration\n\n| Variable | Default | Meaning |\n|---|---|---|\n| `TIKTOK_ACCESS_TOKEN` | none | **Required.** Your access token |\n| `TIKTOK_APP_ID` | none | **Required.** The App ID the token belongs to |\n| `TIKTOK_APP_SECRET` | none | Optional, for endpoints needing app authentication |\n| `TIKTOK_ADVERTISER_ID` | none | Optional default, saves passing it on every call |\n| `TIKTOK_BC_ID` | none | Optional Business Center ID |\n| `TIKTOK_ENABLE_WRITES` | *unset* | Set to `1` to register the 5 write tools |\n| `LOG_LEVEL` | `info` | `debug`, `info`, `warn`, `error` |\n\nCheck your setup at any time:\n\n```bash\nnpm run doctor\n```\n\n---\n\n## Writes, and why they preview first\n\nWrite tools are **disabled by default**. Enable them with `TIKTOK_ENABLE_WRITES=1`.\n\nWhen enabled, every write tool returns a preview and changes nothing:\n\n```jsonc\n// tiktok_update_adgroup_budget { advertiserId: \"7...\", adGroupId: \"1...\", budget: 50 }\n{\n  \"applied\": false,\n  \"action\": \"tiktok_update_adgroup_budget\",\n  \"change\": { \"advertiser\": \"7...\", \"adGroup\": \"1...\", \"newBudget\": 50,\n              \"budgetMode\": \"BUDGET_MODE_DAY\" },\n  \"message\": \"Preview only, nothing was changed. Repeat the same call with confirm: true to apply this change to the live account.\"\n}\n```\n\nOnly a second call carrying `confirm: true` touches the live account.\n\nThis is deliberate. An assistant composes these calls, and it can pick the wrong advertiser,\nthe wrong campaign, or the wrong order of magnitude on a budget. A mandatory preview makes the\nmistake visible before it costs money, and gives a human the stopping point the protocol does\nnot guarantee on its own.\n\nOne further guardrail: **`tiktok_create_campaign` always creates the campaign `DISABLE`.**\nThere is no option to create it running.\n\n| Tool | What it changes |\n|---|---|\n| `tiktok_update_campaign_status` / `tiktok_update_adgroup_status` | Pause or reactivate |\n| `tiktok_update_campaign_budget` / `tiktok_update_adgroup_budget` | Budget, in the account currency |\n| `tiktok_create_campaign` | Creates a campaign, always `DISABLE` |\n\n---\n\n## Tools\n\n<details>\n<summary><b>27 read tools</b></summary>\n\n### Discovery and health\n| Tool | Purpose |\n|---|---|\n| `tiktok_health_check` | Verifies credentials and advertiser access without exposing the token |\n| `tiktok_list_advertisers` | Every advertiser account the token can reach |\n| `tiktok_get_advertiser_info` | Account metadata: name, currency, timezone, status |\n\n### Structure\n| Tool | Purpose |\n|---|---|\n| `tiktok_get_campaigns` / `tiktok_get_adgroups` / `tiktok_get_ads` | List entities and their settings |\n| `tiktok_get_delivery_status` | Delivery state and why it may be limited |\n\n### Performance\n| Tool | Purpose |\n|---|---|\n| `tiktok_get_insights` | The main reporting tool. Metrics, dimensions, compatibility-aware planning |\n| `tiktok_validate_query` | Check a metric and dimension combination *before* running it |\n| `tiktok_get_report_raw` | Native report fields, no aliasing |\n| `tiktok_get_async_report_status` | Track a long-running async report |\n\n### Creatives\n| Tool | Purpose |\n|---|---|\n| `tiktok_get_creatives` | Ad creative text, media IDs, landing URLs |\n| `tiktok_get_video_assets` | Video assets and their metadata |\n| `tiktok_get_creative_fatigue_recipes` | Workflows for spotting creative fatigue |\n| `tiktok_get_spark_ads` / `tiktok_get_spark_organic_joins` | Spark Ads and their organic counterparts |\n\n### Audiences and targeting\n| Tool | Purpose |\n|---|---|\n| `tiktok_get_audiences` / `tiktok_get_audience_details` | Custom and lookalike audiences |\n| `tiktok_get_audience_overlap` | Overlap between audiences |\n| `tiktok_get_targeting_catalog` | Available targeting options |\n\n### Search Ads\n| Tool | Purpose |\n|---|---|\n| `tiktok_search_keywords` | Keyword suggestions for TikTok Search Ads |\n| `tiktok_get_search_ads_maturity` | How ready an account is for Search Ads |\n\n### Commerce and signals\n| Tool | Purpose |\n|---|---|\n| `tiktok_get_pixels` / `tiktok_get_events` | Pixels and the events they receive |\n| `tiktok_get_shop_catalog_diagnostics` | Catalog and product feed health |\n\n### Escape hatches\n| Tool | Purpose |\n|---|---|\n| `tiktok_get_read_endpoint` | Call an allowlisted read endpoint directly |\n| `tiktok_get_entities_raw` | Raw entity reads with your own field selection |\n\nThese exist so a new API field doesn't require a new release. Mutating endpoints, OAuth\nendpoints and credential parameters are **blocked** on these paths, so a crafted argument\ncannot turn a read tool into a write.\n\n</details>\n\n<details>\n<summary><b>5 resources</b></summary>\n\n| URI | Contents |\n|---|---|\n| `tiktok://manifest` | What this server exposes, and its current mode |\n| `tiktok://metrics` | All 277 metrics with categories and formats |\n| `tiktok://dimensions` | All 16 dimensions and where they are valid |\n| `tiktok://compatibility` | The compatibility matrix |\n| `tiktok://recipes` | 12 step-by-step workflows |\n\n</details>\n\n---\n\n## Security\n\nThe server holds a credential that can read, and optionally modify, live ad accounts.\nConcretely:\n\n- **The token is never logged.** Debug output prints `Access-Token: [redacted]`.\n- **Requests go only to `business-api.tiktok.com`**, and only under `/open_api/v1.3/`.\n  Any other host or path is refused rather than called. *Covered by tests.*\n- **Redirects are refused once a token is attached**, so a redirect cannot forward your\n  credential elsewhere.\n- **Mutating and OAuth endpoints are blocked on the generic read paths.** *Covered by tests.*\n- **No telemetry.** The server makes no network call other than to the TikTok Business API.\n  You can verify this by grepping the source for `fetch`.\n\nFull policy and reporting instructions: [SECURITY.md](SECURITY.md).\n\n---\n\n## Looking for a managed, multi-platform version?\n\nThis server does one platform, on your machine, with your token. That is on purpose.\n\nIf you'd rather not run it yourself, or you need TikTok Ads **alongside Meta Ads, Google Ads,\nPinterest Ads, GA4 and Search Console** behind one endpoint, with hosted OAuth and\ncross-platform reporting, that's what we build at **[getmcpads.com](https://www.getmcpads.com)**.\n\nSame philosophy, less plumbing. This project stays open source and independently useful\neither way.\n\n---\n\n## Contributing\n\nIssues and pull requests are welcome. See [CONTRIBUTING.md](CONTRIBUTING.md).\nPlease read [SECURITY.md](SECURITY.md) before reporting anything security-related.\n\n## Licence\n\n[Apache License 2.0](LICENSE). See also [NOTICE](NOTICE).\n\nTikTok and TikTok for Business are trademarks of ByteDance Ltd. and its affiliates.\n**This project is not affiliated with, endorsed by, or sponsored by TikTok or ByteDance.**\nIt is an independent client of a public API.\n",
  "bytes": 14082,
  "sha": "5aa581403171c4f155d529967b2e2a8cd7906ed1f39182fa58bc175b5ddae346",
  "repo_slug": "getmcpads-com/tiktok-ads-mcp-server",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_com_getmcpads_tiktok_ads_6c9a7918/readme"
}