TikTok Ads MCP Server is a local Model Context Protocol (MCP) server for integrating the TikTok Ads Marketing API. It allows MCP clients such as Claude Desktop to connect to TikTok Ads, authenticate using a TikTok Business app, and perform campaign queries, ad group and ad inspection, performance reports, audience breakdowns, advertiser information, Pixel, and targeting location queries through read-only tools. This repository is intended for users who want to run a local TikTok Ads MCP server. If you do not want to install Python, manage dependencies, or configure a TikTok developer app, AdsMCP provides a hosted remote MCP server.
Main capabilities:
- Authentication: Start and complete TikTok Ads OAuth from an MCP client.
- Campaign queries: List campaigns, inspect campaign details, list ad groups, inspect ads.
- Performance analysis: Pull campaign, ad group, ad, and audience metrics, with support for common date ranges.
- Audience and account data: Retrieve custom audiences, advertiser information, location IDs, Pixel, and Pixel event statistics.
- Read-only operations: The public MCP tool registry does not expose campaign creation, ad group creation, creative uploads, or other write operations.
Usage:
- Requirements: Python 3.10 or later, uv for dependency management, a TikTok For Business account with Marketing API access, a TikTok developer app with an App ID and App Secret, and an MCP client that supports a local stdio server (such as Claude Desktop).
- Install uv (macOS/Linux or Windows PowerShell), confirm that uv is available, and find the absolute path to uv.
- Local installation: Clone the repository and install dependencies, find the absolute path to the project directory, and verify that the project environment can import MCP.
- Configure Claude Desktop: Use uv --directory to ensure the server starts from the project directory. Edit the configuration file with the project's absolute path and the uv path.
- TikTok app setup: In TikTok For Business developer portal, create or open a developer app, copy the App ID and App Secret, ensure the redirect URI matches (by default, a specific URI is used), and add the App ID and App Secret under env in the MCP client configuration.
- Authentication flow: Run tiktok_ads_login, open the authorization URL, approve access in TikTok, copy the code parameter from the redirect URL, run tiktok_ads_complete_auth and pass in that code, and run tiktok_ads_auth_status to confirm the authentication status.
- Token storage and security: After OAuth is complete, the TikTok access token and refresh token are stored locally in ~/.tiktok_ads_mcp/tokens.json. This file is used by the local MCP server to call the TikTok Marketing API and should be treated like a password: do not commit it to Git or share it in issue reports, keep it on the local machine and protect it with operating system permissions, and delete the file if you need to disconnect.
Available tools: Authentication: tiktok_ads_login, tiktok_ads_complete_auth, tiktok_ads_auth_status, tiktok_ads_switch_ad_account. Campaign management: tiktok_ads_get_campaigns, tiktok_ads_get_campaign_details, tiktok_ads_get_adgroups, tiktok_ads_get_adgroup_details, tiktok_ads_get_ads, tiktok_ads_get_ad_details. Performance and analytics: tiktok_ads_get_campaign_performance, tiktok_ads_get_adgroup_performance, tiktok_ads_get_ad_performance, tiktok_ads_get_audience_breakdown, tiktok_ads_wasted_spend_audit. Creative and audience: tiktok_ads_get_custom_audiences, tiktok_ads_get_advertiser_info, tiktok_ads_get_location_info, tiktok_ads_get_pixel_list, tiktok_ads_get_pixel_event_stats.
Implementation audit: The current MCP tools are only listed when connected to real OAuth, local token state, or TikTok Marketing API calls. This repository does not expose placeholder or mock tools.
Roadmap: Broader GMV Max campaign coverage, safe write operations for campaigns/ad groups/ads/assets, creative and asset management, full asynchronous reporting lifecycle (create, status, download), targeting discovery and audience management.
Troubleshooting:
- Failed to spawn process: No such file or directory: The MCP client cannot find the configured command. If uv is in the application PATH, use "command": "uv"; otherwise use the full path.
- No module named 'mcp': The server is being run with the system Python instead of the project environment. Fix the MCP configuration to use uv run.
- can't open file '//run_server.py': The MCP client started uv but did not run the command from the project directory. Put the project directory into the uv arguments instead of relying on cwd.
- Missing TikTok API credentials: The server did not receive TIKTOK_APP_ID or TIKTOK_APP_SECRET. Add both under env in the MCP client configuration. Restart the MCP client after changing the configuration.
- OAuth succeeds but tools still show unauthenticated: Check whether the token file exists. To re-authenticate, delete the token file and run tiktok_ads_login again.
- Claude Desktop still shows old errors after configuration changes: Fully quit and reopen Claude Desktop. On macOS, closing the window is not always enough.
Security notes: Do not commit .env, token files, App Secrets, or OAuth codes. Keep ~/.tiktok_ads_mcp/tokens.json private. Use a TikTok developer app with only the required permissions. The current public MCP registry is read-only for TikTok Ads objects. Write operations are roadmap items and should be carefully reviewed before being exposed.
Install dependencies: Clone the repository and install dependencies. Run the server manually: use uv run.
License: MIT License. See LICENSE for details.
Issues and questions: Please create an issue in the repository.