TikTok Ads MCP
A comprehensive Model Context Protocol (MCP) server for interacting with the TikTok Business API. This package provides a complete interface to access TikTok advertising campaigns, ad groups, ads, and generate detailed performance reports.
Features
- Read-Only TikTok Business API Integration: Access all major TikTok advertising endpoints for data retrieval
- 6 Comprehensive Tools: Business centers, ad accounts, campaigns, ad groups, ads, and reports
- Advanced Filtering: Powerful filtering options for all data retrieval operations
- Multi-Advertiser Support: Handle multiple advertiser accounts in a single request
- Flexible Reporting: Generate detailed performance reports with custom dimensions and metrics
- Real-time Data: Access live 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
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 comprehensive filtering options
- get_ad_groups - Get ad groups with advanced filtering and targeting options
- get_ads - Retrieve ads with detailed creative and performance data
- get_reports - Generate comprehensive performance reports and analytics
Prerequisites
- Python 3.8 or higher
- TikTok Business API access
- Valid API credentials (app ID, secret, access token)
Quick Start
Installation
# Install the latest version from PyPI
pip install tiktok-ads-mcp
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
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 real-time 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
- GMV max ads reports
Key Features
Advanced Filtering
All tools support comprehensive filtering options:
- Status-based filtering (active, paused, deleted)
- Time-based filtering (creation date, modification date)
- Performance-based filtering (budget, optimization goals)
- Creative filtering (ad formats, material types)
Modern Implementation
This package uses the official FastMCP framework for optimal performance and developer experience:
- Automatic Schema Generation: From Python type hints
- Simplified Tool Registration: Using
@app.tool()decorators - Built-in Error Handling: Consistent error responses
- Type Safety: Full parameter validation from type hints
- Future-Proof: Part of the official MCP SDK
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.2 (Current)
- 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()decorators - Enhanced 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
Metadata
Release files for tiktok-ads-mcp 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| tiktok_ads_mcp-0.1.2.tar.gz | 15.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tiktok_ads_mcp-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 33.4 kB
Release files / tiktok_ads_mcp-0.1.2.tar.gz
| Download URL | tiktok_ads_mcp-0.1.2.tar.gz |
|---|---|
| Size | 15.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
42d8b69f9d7a06fe23c5f8382399c469a8c00a6815cf5af7d4979c9b9bd8c69d
|
|
BLAKE2b-256 checksum How to use checksums |
83abab8af9510e6e03e3b35dc98daa71ba96dde7300f76a959c9827f0b707704
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.16
|
Release files / tiktok_ads_mcp-0.1.2-py3-none-any.whl
| Download URL | tiktok_ads_mcp-0.1.2-py3-none-any.whl |
|---|---|
| Size | 18.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
71fe949640a82974ac7cd048303a6bcefec9548b17e4e0e720e41110056e0e5a
|
|
BLAKE2b-256 checksum How to use checksums |
31012c25a4c850b49cf840eed9636eae99bfbd7b0c7d1285fc0003b7718982cc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.16
|
Security for tiktok-ads-mcp 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.