tiktok-ads-mcp
This server provides read-only access to TikTok advertising data via an MCP interface, allowing you to retrieve business centers, ad accounts, campaigns, ad groups, ads, and performance reports.
Discover accounts: List business centers (
get_business_centers) and authorized ad accounts (get_authorized_ad_accounts)Query campaigns: Fetch campaigns for an advertiser with optional filtering (e.g., by status, objective)
Query ad groups: Retrieve ad groups, optionally filtered by campaign or custom filters, with pagination
Query ads: Fetch ads, optionally filtered by ad group or custom filters, with pagination
Generate reports: Pull performance analytics with custom dimensions, metrics, date ranges, filtering, reporting types (e.g., BASIC, audience insights), multiple advertisers, and lifetime or total metrics
Filter and paginate: Use API-aligned filters and pagination controls where supported
Multi-advertiser support: Query across multiple advertiser accounts in a single request
Safe read-only operations: No modifications to campaigns or ad data
Provides tools for managing and reporting on TikTok advertising campaigns, ad groups, ads, and performance reports via the TikTok Business API.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@tiktok-ads-mcp list my active campaigns"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
TikTok Ads MCP
A read-only Model Context Protocol (MCP) server for retrieving TikTok advertising accounts, campaigns, ad groups, ads, and performance reports.
Features
Read-Only TikTok Business API Integration: Access all major TikTok advertising endpoints for data retrieval
6 Read-Only Tools: Business centers, ad accounts, campaigns, ad groups, ads, and reports
API-aligned Filtering: Filtering and pagination for campaigns, ad groups, ads, and reports
Multi-Advertiser Support: Handle multiple advertiser accounts in a single request
Flexible Reporting: Generate detailed performance reports with custom dimensions and metrics
Current Data: Retrieve current advertising data and performance metrics
Error Handling: Comprehensive error handling and validation
Modular Architecture: Clean, maintainable code structure
Safe Operations: All tools are read-only and will not modify your campaigns or ad data
Related MCP server: Reddit Ads MCP Server
Available Tools
get_business_centers - Retrieve business centers accessible by your access token
get_authorized_ad_accounts - Get all authorized advertiser accounts
get_campaigns - Retrieve campaigns with filtering and pagination
get_ad_groups - Retrieve ad groups with filtering and pagination
get_ads - Retrieve ads with filtering and pagination
get_reports - Generate performance reports and analytics
Prerequisites
Python 3.10 or higher
TikTok Business API access
Valid API credentials (app ID, secret, access token)
Quick Start
Installation
Download the TikTok Ads MCP
Click the green "Code" button at the top of the GitHub page
Select "Download ZIP"
Unzip the downloaded file to a location you can easily find (like your Documents folder)
Alternatively, if you're familiar with Git:
git clone https://github.com/ysntony/tiktok-ads-mcp.gitInstall Dependencies
cd tiktok-ads-mcp pip install -e . # or with uv uv pip install -e .
Configuration
Set up environment variables in your MCP client configuration:
{
"mcpServers": {
"tiktok-ads": {
"command": "python",
"args": ["-m", "tiktok_ads_mcp"],
"env": {
"TIKTOK_APP_ID": "your_app_id",
"TIKTOK_SECRET": "your_secret",
"TIKTOK_ACCESS_TOKEN": "your_access_token"
}
}
}
}Required credentials:
TIKTOK_APP_ID: Your TikTok app IDTIKTOK_SECRET: Your TikTok app secretTIKTOK_ACCESS_TOKEN: Your access token
How to get these credentials:
Go to the TikTok for Business Developers portal and log in.
Click "My Apps" and create a new app.
Select "Marketing API" as the service type.
In the app settings, enable permissions related to Reading and Reporting (e.g.,
Ads Management,Reporting).Once approved, you will find your
App IDandSecretin the app details.Generate an
Access Tokenusing the "TikTok Marketing API Inspector" or via the OAuth flow documented in the portal.
Usage
Once configured, you can use the MCP tools through your MCP client (like Cursor, Claude Desktop, etc.):
Get business centers and advertiser accounts to discover available accounts
Retrieve campaigns with filtering by status, objective, or date range
Access ad groups with advanced targeting and optimization settings
View ads with detailed creative and performance data
Generate reports with custom dimensions, metrics, and time ranges
Access current advertising data and performance metrics
API Coverage
This MCP server provides read-only access to the TikTok Business API:
Business Management
Business center retrieval and access
Advertiser account information and permissions
Campaign Management
Campaign retrieval and filtering
Campaign status and performance monitoring
Campaign budget and objective information
Ad Group Management
Ad group retrieval and filtering
Advanced targeting and optimization settings
Performance monitoring and analysis
Ad Management
Ad retrieval and filtering
Creative asset information
Performance tracking and analysis
Reporting & Analytics
Basic performance reports
Audience insights reports
Playable ads reports
DSA (Dynamic Search Ads) reports
Business Center reports
Legacy GMV Max reports (
TT_SHOP) are not supported because TikTok is deprecating that report type; use the dedicated GMV Max report endpoint when adding GMV Max support.
Key Features
Filtering and pagination
Supported data tools expose API-aligned filters and pagination:
Status-based filtering (active, paused, deleted)
Time-based filtering (creation date, modification date)
Campaign, ad group, and ad identifiers
Objective, optimization, placement, and creative filters where supported by TikTok
Page number and page size, with
page_inforeturned for paginated endpoints
Modern Implementation
This package uses the FastMCP framework for optimal performance and developer experience:
Automatic Schema Generation: From Python type hints
Simplified Tool Registration: Using
@app.tool()decoratorsBuilt-in Error Handling: Consistent error responses
Type Safety: Full parameter validation from type hints
Multi-Advertiser Support
Handle multiple advertiser accounts in single requests
Cross-advertiser reporting and analytics
Unified data access across accounts
Flexible Reporting
Custom dimensions and metrics
Multiple report types and data levels
Time-based and lifetime metrics
Aggregated and detailed views
Error Handling
Comprehensive parameter validation
Detailed error messages and suggestions
Graceful handling of API limitations
Rate limiting and retry logic
Documentation
MCP_USAGE.md: Comprehensive usage guide with examples
TikTok Business API: Official API documentation
Project Wiki: Additional resources and guides
Contributing
Fork the repository
Create a feature branch
Implement your changes
Add tests and documentation
Submit a pull request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
For issues and questions:
Check the MCP_USAGE.md documentation
Review the TikTok Business API documentation
Open an issue on the GitHub repository
Contact the development team
Changelog
v0.1.5 (Current)
Protocol safety: Startup and error messages no longer pollute MCP stdio output.
Security: Access tokens and OAuth secrets are redacted from debug logs.
Campaign queries: Campaign filters now use TikTok v1.3's
filteringobject and support pagination.Response compatibility: List tools preserve newly added TikTok fields and return pagination metadata.
Reporting validation: Unsupported report combinations are rejected early; deprecated
TT_SHOPreports are blocked.Configuration:
.envfiles are loaded automatically.Example startup: Fixed the example entry point to call the synchronous server correctly.
v0.1.4
Retry Logic Fix: Fixed retry decorator being defeated by inner exception handling — retries now actually fire on rate limits and transient errors
Pagination Fix:
pageandpage_sizeparams now properly passed through toget_ad_groupsandget_adsAPI callsSecurity: Access token redacted from debug log output
Dependencies: Removed unused
requestsandpandas, bumpedmcpto>=1.27.0, addedhttpxandtenacityto requirements.txtCode Quality: Modernized type annotations to Python 3.10+ style, removed dead code and redundant error checks, fixed mutable default dict mutation in filter handling
Python Compatibility: Lowered minimum Python version to 3.10
v0.1.3
Async Support: Complete refactor to use
async/awaitwithhttpxfor improved performanceRetry Logic: Added automatic retries for rate limits and server errors using
tenacityError Handling: Simplified and standardized error handling with decorators
Dependencies: Switched from
requeststohttpx
v0.1.2
FastMCP Implementation: Modern MCP server using official FastMCP framework
70% Code Reduction: Compared to traditional MCP implementations
Automatic Schema Generation: From Python type hints
Simplified Tool Registration: Using
@app.tool()decoratorsEnhanced Error Handling: Built-in error handling with consistent responses
Type Safety: Full parameter validation from type hints
Future-Proof: Part of the official MCP SDK
v0.1.1
Complete implementation of all 6 tools
Advanced filtering and reporting capabilities
Multi-advertiser support
Comprehensive error handling
Modular tools architecture
Complete documentation and usage guides
v0.1.0
Initial release with basic MCP server structure
Core API client implementation
Basic authentication and configuration
Available Tools
6 toolsget_ad_groups_toolC
Get ad groups for a specific advertiser with optional filtering
Inputs: advertiser_id (required), campaign_id, filters, page, +1 more. Returns: result
get_ads_toolC
Get ads for a specific advertiser with optional filtering
Inputs: advertiser_id (required), adgroup_id, filters, page, +1 more. Returns: result
get_authorized_ad_accounts_toolA
Get all authorized ad accounts accessible by the current access token
Inputs: no named parameters. Returns: result
get_business_centers_toolC
Get business centers accessible by the current access token
Inputs: bc_id, page, page_size. Returns: result
get_campaigns_toolB
Get campaigns for a specific advertiser with optional filtering
Inputs: advertiser_id (required), filters. Returns: result
get_reports_toolC
Get performance reports and analytics with comprehensive filtering and grouping options
Inputs: advertiser_id, advertiser_ids, bc_id, report_type, +14 more. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool retrieves a distinct entity (ad groups, ads, ad accounts, business centers, campaigns, reports) with no overlapping purposes, making it clear which tool to use for a given resource.
All tools follow the consistent pattern 'get_<resource>_tool' with snake_case, making the naming predictable and easy to infer.
With 6 tools covering the main read operations for TikTok Ads, the number is well-scoped for a focused MCP server, not too many or too few.
The server covers all major read entities (ad accounts, business centers, campaigns, ad groups, ads, reports) but lacks create/update/delete operations, which is acceptable if intended as read-only; minor gap for read-only completeness.
Maintenance
Related MCP Connectors
Read-only Google Ads, Meta Ads and TikTok Ads performance, campaigns and creatives via OAuth.
Read-only MCP access to your DEXUN AdWhiz account: ad accounts, AI recommendations, savings.
Read and manage Meta Ads campaigns, ad sets, ads, audiences, pages and Business Manager. You provide
Read your Amazon Ads campaigns, results, rules and activity, every marketplace and ad type.
Related MCP Servers
- AlicenseBqualityBmaintenanceA read-only MCP server that provides comprehensive access to the TikTok Business API for retrieving advertising data, including campaigns, ad groups, ads, and performance reports.24MIT
- FlicenseNot gradedqualityDmaintenanceRead-only access to Reddit Ads API v3 for listing ad accounts, campaigns, ad groups, ads, and generating performance reports with OAuth2 authentication.-
- FlicenseNot gradedqualityDmaintenanceProvides read-only access to Meta Ads API, enabling campaign management, creative analysis, targeting research, and performance analytics via 39 tools.-
- AlicenseNot gradedqualityCmaintenanceProvides read-only access to Google Ads account data including campaigns, ad groups, keywords, and performance reports. Enables querying via GAQL through an MCP interface.MIT