TikTok MCP Server
Provides tools for searching videos, browsing the For You Page, downloading watermark-free videos, publishing content via Creator Center, interacting with creators through likes, comments, and follows, and analyzing trending hashtags and music.
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 MCP Server Search for 'AI productivity' and download the most popular video."
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 MCP Server
The first complete TikTok MCP server with publish, interact, and browse
Search • Download • Publish • Like • Comment • Follow • Analyze Trends — all from your AI assistant.
⚡ Why tiktok-mcp?
Most TikTok MCP servers only let you read data. This one lets you act.
🔍 Browse — Search videos, explore hashtags, scroll the For You Page
📥 Download — Save videos without watermark (HD when available)
📤 Publish — Upload videos directly to TikTok via Creator Center
💬 Interact — Like, comment, and follow — all automated
📊 Analyze — Cross-keyword trend analysis with top hashtags & creators
12 tools. One server. Full TikTok automation.
🛠️ All 12 Tools
Tool | Description |
| Search TikTok videos by keyword. Returns author, description, views, URL, hashtags. |
| Get trending/For You videos from TikTok's main feed. |
| Scroll the For You Page like a real user and collect video metadata. |
| Get all videos from a specific user's profile with their stats. |
| Get detailed metadata for a specific video (stats, audio, hashtags, description). |
| Explore a hashtag — view count, popular videos, and stats. |
| Download a TikTok video without watermark (HD when available via tikwm). |
| Publish a video to TikTok with caption and hashtags via Creator Center. |
| Like, comment, or follow — interact with any video or creator. |
| Get trending sounds/music on TikTok. |
| Manage your TikTok session: check login, refresh cookies, export session. |
| Multi-keyword trend analysis: top hashtags, top creators, posting patterns. |
🚀 Installation (3 Steps)
1. Clone & Install
git clone https://github.com/follox42/tiktok-mcp.git
cd tiktok-mcp
pip install -e .
playwright install chromium2. Get Your TikTok Cookies
You need authenticated cookies for publish/interact features. Two options:
Option A — From TikSimPro (recommended):
# If you use TikSimPro, cookies are already at:
~/TikSimPro/tiktok_cookies.pklOption B — Export manually:
Log into TikTok in your browser
Use a cookie export extension (e.g., "Get cookies.txt")
Save as JSON:
[
{"name": "sessionid", "value": "xxx", "domain": ".tiktok.com", "path": "/"},
{"name": "sid_tt", "value": "xxx", "domain": ".tiktok.com", "path": "/"}
]3. Set Environment Variables
export TIKTOK_COOKIES_PATH="/path/to/your/cookies.pkl" # or .json
export TIKTOK_HEADLESS=true # false to see the browser
export TIKTOK_MIN_INTERVAL=2.0 # rate limit between calls (seconds)
export TIKTOK_DOWNLOAD_DIR="./downloads"⚙️ Configuration
Claude Desktop (claude_desktop_config.json)
{
"mcpServers": {
"tiktok": {
"command": "tiktok-mcp",
"env": {
"TIKTOK_COOKIES_PATH": "/home/you/TikSimPro/tiktok_cookies.pkl",
"TIKTOK_HEADLESS": "true"
}
}
}
}mcporter
{
"servers": {
"tiktok": {
"command": "tiktok-mcp",
"env": {
"TIKTOK_COOKIES_PATH": "/home/you/TikSimPro/tiktok_cookies.pkl"
}
}
}
}Direct (stdio)
tiktok-mcp
# or
python -m tiktok_mcp📖 Usage Examples
🔍 Search Videos
Use tiktok_search to find "AI productivity" videos{"query": "AI productivity", "count": 10}📊 Analyze a Niche
Analyze trends for "solopreneur" and "indie hacker" — what hashtags and creators dominate?{"keywords": ["solopreneur", "indie hacker", "build in public"], "count_per_keyword": 15}👤 Research a Creator
Get the last 20 videos from @garyvee{"username": "garyvee", "count": 20}📥 Download a Video
Download this video without watermark: https://www.tiktok.com/@user/video/123456{"video_url": "https://www.tiktok.com/@user/video/123456"}📤 Publish a Video
Publish my video with caption "Building in public day 47 🚀" and hashtags buildinpublic, startup, coding{
"video_path": "/path/to/video.mp4",
"caption": "Building in public day 47 🚀",
"hashtags": ["buildinpublic", "startup", "coding"]
}💬 Interact (Like / Comment / Follow)
Like this video and leave a comment: "This is incredible! 🔥"{"action": "like", "video_url": "https://www.tiktok.com/@user/video/123456"}
{"action": "comment", "video_url": "https://www.tiktok.com/@user/video/123456", "text": "This is incredible! 🔥"}
{"action": "follow", "video_url": "https://www.tiktok.com/@user/video/123456"}🎵 Trending Sounds
What sounds are trending on TikTok right now?{"count": 20}🔐 Session Management
Check if my TikTok session is still active{"action": "check_login"}
{"action": "refresh_cookies"}
{"action": "export_session"}🏆 Comparison — Why This One?
Feature | tiktok-mcp | Other TikTok MCPs |
Search videos | ✅ | ✅ |
Trending feed | ✅ | ⚠️ Some |
User profiles | ✅ | ⚠️ Some |
Video details | ✅ | ✅ |
Hashtag exploration | ✅ | ❌ |
Download (no watermark) | ✅ | ❌ |
Publish videos | ✅ | ❌ |
Like / Comment / Follow | ✅ | ❌ |
Trending sounds | ✅ | ❌ |
Trend analysis | ✅ | ❌ |
Session management | ✅ | ❌ |
Stealth / anti-detection | ✅ | ❌ |
Cookie auth (TikSimPro) | ✅ | ❌ |
Total tools | 12 | 2-4 |
tiktok-mcp is the only MCP server that lets you publish and interact on TikTok.
📸 Demo
🏗️ Built With
Playwright — Browser automation with stealth capabilities
playwright-stealth — Anti-detection patches
MCP SDK — Model Context Protocol for AI integration
TikSimPro — Cookie management & TikTok session handling
tikwm — Watermark-free video downloads
httpx — Async HTTP client
🤝 Contributing
Contributions are welcome! Here's how:
Fork the repository
Create your feature branch (
git checkout -b feature/amazing-feature)Commit your changes (
git commit -m 'feat: add amazing feature')Push to the branch (
git push origin feature/amazing-feature)Open a Pull Request
Ideas for contributions:
📱 Mobile viewport support
🌍 Multi-language support
📊 Advanced analytics (engagement rate, best posting times)
🔄 Scheduled posting
🎭 Multiple account support
📄 License
This project is licensed under the MIT License — see the LICENSE file for details.
⭐ Star this repo if you find it useful!
Made with ❤️ by follox42
Available Tools
12 toolstiktok_analyze_trendC
Analyze trends for a niche: search multiple keywords, aggregate stats on popular sounds, hashtags, posting patterns.
Inputs: keywords (required), count_per_keyword.
tiktok_downloadC
Download a TikTok video (without watermark when possible).
Inputs: video_url (required), output_path.
tiktok_feedC
Scroll the For You Page like a real user and collect video metadata.
Inputs: count.
tiktok_hashtagC
Explore a TikTok hashtag — popular videos and stats.
Inputs: hashtag (required), count.
tiktok_interactC
Interact with a TikTok video: like, comment, or follow the creator.
Inputs: action (required), video_url (required), text.
tiktok_publishA
Publish a video to TikTok. Requires authenticated session. Uses browser automation via Creator Center.
Inputs: video_path (required), caption (required), hashtags.
tiktok_searchB
Search TikTok videos by keyword. Returns metadata: author, description, views, URL, hashtags.
Inputs: query (required), count.
tiktok_sessionB
Manage TikTok session: check login status, refresh cookies, export session info.
Inputs: action (required).
tiktok_soundsC
Get trending sounds/music on TikTok.
Inputs: count.
tiktok_trendingC
Get trending/For You videos from TikTok feed.
Inputs: count.
tiktok_user_videosC
Get videos from a specific TikTok user's profile.
Inputs: username (required), count.
tiktok_video_infoC
Get detailed metadata for a specific TikTok video (stats, audio, hashtags, description).
Inputs: video_url (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 12 tools
Most tools have distinct purposes, but there is some overlap between tiktok_feed and tiktok_trending (both fetch trending/For You Page content) and between tiktok_search and tiktok_hashtag (both search-related). Descriptions help differentiate them, but an agent might occasionally misselect between these pairs.
All tools follow a consistent tiktok_verb_noun naming pattern, using snake_case throughout. This predictability makes it easy for an agent to understand and navigate the toolset.
With 12 tools, this server is well-scoped for TikTok operations, covering analysis, downloading, interaction, publishing, and session management. Each tool serves a clear purpose without feeling excessive or insufficient.
The toolset provides comprehensive coverage for TikTok interactions, including CRUD-like operations (e.g., publish, interact, download) and data retrieval. A minor gap is the lack of tools for managing user profiles or direct messaging, but core workflows are well-supported.
Related MCP Connectors
Hosted TikTok Pages MCP server, with each action switched on or off per account.
Social media MCP server: your Instagram, TikTok, YouTube, LinkedIn and Threads history for your AI.
TikTok Ads MCP server: run TikTok campaigns, ad groups, ads and reports from AI.
MCP server for AI agents: WhatsApp, Instagram, TikTok, Facebook and Google Business Profile.