@cesteral/tiktok-mcp
v3.0.0
Published
TikTok Ads MCP Server - Campaign entity management and reporting via TikTok Marketing API v1.3
Maintainers
Readme
@cesteral/tiktok-mcp
TikTok Ads MCP Server - Campaign management and reporting via TikTok Marketing API v1.3.
Purpose
Management server for TikTok Ads. Provides full CRUD operations, async reporting, targeting discovery, bulk operations, and specialized features like entity duplication and audience estimation. Designed for AI agents to manage TikTok Ads campaigns programmatically through the Model Context Protocol with per-session Bearer token authentication.
Features
- Per-session Bearer token auth via
TikTokBearerAuthStrategy(validates tokens and extracts advertiser ID) - Streamable HTTP + stdio transports via Hono + the MCP SDK's web-standard transport
- OpenTelemetry instrumentation for traces and metrics
- Rate limiting via shared
RateLimiterclass (10/min default, per TikTok access token per process; report calls have their own bucket of the same size) - Structured logging via Pino
- Automatic
advertiser_idinjection into GET query params and POST request bodies
MCP Tools
Core CRUD
1. tiktok_list_entities
List TikTok Ads entities with page-based pagination and optional filtering.
Parameters:
entityType(string, required): Type of entity to listadvertiserId(string, required): TikTok Advertiser IDfilters(object, optional): Filter criteria for the entity listpage(number, optional): Page number for paginationpageSize(number, optional): Results per page
2. tiktok_get_entity
Get a single TikTok Ads entity by ID.
Parameters:
entityType(string, required): Type of entity to retrieveadvertiserId(string, required): TikTok Advertiser IDentityId(string, required): The entity ID
3. tiktok_create_entity
Create a new TikTok Ads entity.
Parameters:
entityType(string, required): Type of entity to createadvertiserId(string, required): TikTok Advertiser IDdata(object, required): Entity fields as key-value pairs
4. tiktok_update_entity
Update an existing TikTok Ads entity.
Parameters:
entityType(string, required): Type of entity to updateadvertiserId(string, required): TikTok Advertiser IDentityId(string, required): The entity ID to updatedata(object, required): Fields to update as key-value pairs
5. tiktok_delete_entity
Delete TikTok Ads entities. TikTok v1.3 has no /delete/ endpoint for these entities, so this
sends operation_status: "DELETE" to the entity's /status/update/ endpoint. Irreversible.
Parameters:
entityType(string, required): Type of entities to deleteadvertiserId(string, required): TikTok Advertiser IDentityIds(string[], required): Entity IDs to delete (max 20)
Account
6. tiktok_list_advertisers
Get account info for the session-bound advertiser (advertiser/info/ with advertiser_ids).
TikTok's advertiser/info/ does not enumerate every advertiser a token can access.
Parameters: (none)
Reporting
All TikTok reporting tools return data using the shared bounded report-view contract:
mode("summary"default — headers + counts + 10-row preview, or"rows"for a paginated rows page),columns(project to selected columns),offset(zero-based pagination), andmaxRows(page size; default 10 for summary, 50 for rows; hard cap 200).
7. tiktok_get_report
Run a report via TikTok's synchronous report/integrated/get/ endpoint and return the rows.
Parameters:
advertiserId(string, required): TikTok Advertiser IDdimensions(string[], required): Report dimensions (e.g.,campaign_id,adgroup_id)metrics(string[], required): Metrics to include (e.g.,spend,impressions,clicks)startDate(string, required): Start date (YYYY-MM-DD)endDate(string, required): End date (YYYY-MM-DD)mode,columns,offset,maxRows(optional): Bounded report-view params (see note above)
8. tiktok_get_report_breakdowns
Submit a report with additional breakdown dimensions.
Parameters:
advertiserId(string, required): TikTok Advertiser IDdimensions(string[], required): Primary dimensionsbreakdowns(string[], required): Breakdown dimensions (e.g.,age,gender,country)metrics(string[], required): Metrics to includestartDate(string, required): Start date (YYYY-MM-DD)endDate(string, required): End date (YYYY-MM-DD)mode,columns,offset,maxRows(optional): Bounded report-view params (see note above)
9. tiktok_submit_report
Submit an async report without waiting for completion (non-blocking).
Parameters:
advertiserId(string, required): TikTok Advertiser IDdimensions(string[], required): Report dimensionsmetrics(string[], required): Metrics to includestartDate(string, required): Start date (YYYY-MM-DD)endDate(string, required): End date (YYYY-MM-DD)
10. tiktok_check_report_status
Single status check for a submitted report. TikTok's statuses are QUEUING, PROCESSING, SUCCESS, FAILED and CANCELED.
Parameters:
advertiserId(string, required): TikTok Advertiser IDtaskId(string, required): Report task ID from submit
11. tiktok_download_report
Download and parse the CSV of a finished async report task. TikTok issues a signed download URL for the task (GET report/task/download/, valid one hour), which is validated and fetched.
Parameters:
advertiserId(string, required): TikTok Advertiser IDtaskId(string, required): Report task ID fromtiktok_submit_reportmode,columns,offset,maxRows(optional): Bounded report-view params (see note above the reporting tools)
Bulk Operations
12. tiktok_bulk_update_status
Batch enable, disable, or delete multiple entities.
Parameters:
entityType(string, required): Type of entities to updateadvertiserId(string, required): TikTok Advertiser IDentityIds(string[], required): Entity IDs to update (max 50)operationStatus(string, required):ENABLE,DISABLE, orDELETE
13. tiktok_bulk_create_entities
Batch create multiple entities of the same type.
Parameters:
entityType(string, required): Type of entities to createadvertiserId(string, required): TikTok Advertiser IDitems(array, required): Array of entity data objects (max 50)
14. tiktok_bulk_update_entities
Batch update multiple entities with individual data payloads.
Parameters:
entityType(string, required): Type of entities to updateadvertiserId(string, required): TikTok Advertiser IDitems(array, required): Array of update items (max 50), each with entity ID and data
Bid Adjustment
15. tiktok_adjust_bids
Batch adjust ad group bid prices with safe read-modify-write pattern.
Parameters:
advertiserId(string, required): TikTok Advertiser IDadjustments(array, required): Array of bid adjustments, each with ad group ID, adjustment type, and value
Targeting
16. tiktok_search_targeting
Search location targeting tags via tool/targeting/search/.
Parameters:
advertiserId(string, required): TikTok Advertiser IDquery(string or string[], required): Keyword(s), sent askeywordsplacements(string[], required),objectiveType(string, required)searchType(optional):FUZZY_SEARCH(default),BATCH_REGION_SEARCH,BATCH_ZIPCODE_SEARCH
17. tiktok_get_targeting_options
Browse available targeting categories.
Parameters:
advertiserId(string, required): TikTok Advertiser IDtargetingType(string, optional): Filter by targeting type
Specialized
18. tiktok_duplicate_entity
Not available — TikTok v1.3 has no copy endpoint, so this tool always returns an error.
Duplicate by reading the entity with tiktok_get_entity and creating a new one with
tiktok_create_entity.
Parameters:
entityType(string, required): Type of entity to duplicate (campaign,adGroup,ad)advertiserId(string, required): TikTok Advertiser IDentityId(string, required): ID of the entity to duplicateoptions(object, optional): Duplication options (e.g., rename prefix/suffix)
19. tiktok_get_audience_estimate
Get estimated audience size for a targeting configuration.
Parameters:
advertiserId(string, required): TikTok Advertiser IDtargetingConfig(object, required): Targeting specification for estimation
20. tiktok_get_ad_preview
Not available — TikTok v1.3 has no ad-preview endpoint, so this tool always returns an error.
Parameters:
advertiserId(string, required): TikTok Advertiser IDadId(string, required): Ad ID to previewadFormat(string, optional): Ad format for preview rendering
Validation
21. tiktok_validate_entity
Client-side validation of entity payloads without making API calls.
Parameters:
entityType(string, required): Type of entity to validatemode(string, required): Validation mode (createorupdate)data(object, required): Entity data to validate
Media
22. tiktok_upload_image / 23. tiktok_upload_video
Download an image or video from a URL and upload it to the advertiser's asset
library (file/image/ad/upload/, file/video/ad/upload/, multipart with the
required MD5 signature). Reference the returned IDs in an ad's creatives[].
Upgraded Smart+
From 2027-01-01 TikTok's legacy /campaign/create/, /adgroup/create/ and /ad/create/ no longer
create non-Search campaigns, or ad groups and ads under them, for the Sales (WEB_CONVERSIONS),
App Promotion (APP_PROMOTION) and Lead Generation (LEAD_GENERATION) objectives; the replacement
is the Upgraded Smart+ API under /smart_plus/. Other objectives (for example TRAFFIC) are not offered
by it and stay on the legacy tools. The legacy update endpoints cannot edit Upgraded Smart+ entities, so
these four tools cover create, update, status and read. The ad account must be allowlisted by TikTok for
Upgraded Smart+ campaign management.
26. tiktok_create_smart_plus_entity
Create a campaign, ad group or ad via /smart_plus/{campaign,adgroup,ad}/create/. Same parameters as
tiktok_create_entity (entityType, advertiserId, data, dry_run) but the payload shapes differ
(ad groups need promotion_type and targeting_spec; ads take creative_list). A request_id
(TikTok's idempotency key) is generated unless data.request_id is given. An ad is returned as
smart_plus_ad_id.
27. tiktok_update_smart_plus_entity
Update via /smart_plus/{campaign,adgroup,ad}/update/. Parameters: entityType, advertiserId, entityId,
data, dry_run. Status changes go through the status tool.
28. tiktok_update_smart_plus_status
Enable, pause or delete 1-20 entities via /smart_plus/{campaign,adgroup,ad}/status/update/. Parameters:
entityType, advertiserId, entityIds, operationStatus (ENABLE / DISABLE / DELETE), dry_run.
29. tiktok_get_smart_plus_entity
Read one entity via /smart_plus/{campaign,adgroup,ad}/get/. Parameters: entityType, advertiserId, entityId.
Client-side helpers
24. tiktok_get_pacing_status
Pacing calculator; makes no API call. Pass spend from tiktok_get_report and
the budget and flight dates from tiktok_get_entity. Flight dates live on ad
groups (schedule_start_time / schedule_end_time), not campaigns.
25. tiktok_search_tools
Rank this server's tools against a natural-language query.
Supported Entity Types
| Entity Type | API Object | Notes |
| ----------- | ---------- | ----------------------------------------------- |
| campaign | Campaign | Top-level entity under advertiser account |
| adGroup | Ad Group | Targeting, budget, schedule, bidding, placement |
| ad | Ad | Carries its creatives (creatives[]) |
Entity Hierarchy: Advertiser > Campaign > Ad Group > Ad. There is no standalone creative
entity in v1.3 (no creative/adcreative/* endpoints); upload assets with tiktok_upload_image /
tiktok_upload_video and reference them in the ad's creatives[].
Current Status
Tools target TikTok Marketing API v1.3 as described by TikTok's official Business API SDK
(github.com/tiktok/tiktok-business-api-sdk). Clients authenticate to this server with
Authorization: Bearer; upstream calls send the token in TikTok's Access-Token header.
Refresh-token credentials are rejected (TikTok documents no refresh endpoint). Nothing has
been exercised against a live TikTok account.
Development
# Install dependencies
pnpm install
# Run in development mode
pnpm run dev:http
# Build
pnpm run build
# Start production server
pnpm run start
# Type check
pnpm run typecheckEnvironment Variables
TIKTOK_MCP_PORT: Server port (default: 3007)TIKTOK_MCP_HOST: Server host (default:127.0.0.1in development,0.0.0.0in production)MCP_AUTH_MODE: Authentication mode -tiktok-bearer(default),jwt, ornoneMCP_AUTH_SECRET_KEY: Required whenMCP_AUTH_MODE=jwtTIKTOK_API_BASE_URL: TikTok Business API base URL (default:https://business-api.tiktok.com)TIKTOK_API_VERSION: API version (default:v1.3)TIKTOK_RATE_LIMIT_PER_MINUTE: Rate limit ceiling (default: 10)TIKTOK_ACCESS_TOKEN: Access token for stdio modeTIKTOK_ADVERTISER_ID: Advertiser ID for stdio mode
Architecture
Key Components
TikTokHttpClient- HTTP client for TikTok Marketing API v1.3TikTokService- CRUD, bulk ops, targeting, audience estimatesTikTokReportingService- Synchronous reports (report/integrated/get/), async task submission and status checksTikTokBearerAuthStrategy- Bearer token + advertiser ID authTikTokAuthAdapter- Token + advertiser ID management for per-session API callsSessionServiceStore- Per-session service instances keyed by session ID
Key Gotchas
advertiser_idis automatically injected into GET query params and POST request bodies- Uses page-based pagination (
page/page_size) not cursor-based tiktok_get_reportis synchronous; the async task path is submit -> status check (TikTok's documented check response has no download URL)- Delete operations accept max 20 entity IDs per call
DISABLEstatus is used instead ofPAUSED(TikTok-specific terminology)
Transport
Streamable HTTP via Hono + the MCP SDK's web-standard transport. Health check at /health.
Contributing
See root CLAUDE.md for development guidelines, build system details, and monorepo conventions. See the root README for full architecture context.
Get Started
Self-host: Follow the deployment guide to run this server on your own infrastructure.
Cesteral Intelligence: Request access -- governed execution with credential brokering, approvals, audit, and multi-tenant access.
Book a workflow demo: See it in action with your own ad accounts.
Compare options: OSS connectors vs Cesteral Intelligence
License
Apache License 2.0 — see LICENSE for details. This package is part of Cesteral's open-source connector layer; managed hosting and higher-level governance features live outside this repository.
