TikTok MCP Server

TikTok MCP Server

A comprehensive MCP server that enables AI assistants to search, download, and analyze TikTok content while also performing active tasks like publishing videos and interacting with posts. It provides full automation capabilities for TikTok through browser session management and anti-detection features.

Category
访问服务器

README

<div align="center">

🎵 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.

Python 3.10+ License: MIT MCP Compatible GitHub Stars

<br/>

<img src="https://img.shields.io/badge/TikTok-000000?style=for-the-badge&logo=tiktok&logoColor=white" alt="TikTok"/> <img src="https://img.shields.io/badge/Playwright-2EAD33?style=for-the-badge&logo=playwright&logoColor=white" alt="Playwright"/> <img src="https://img.shields.io/badge/Claude-8A2BE2?style=for-the-badge" alt="Claude"/>

</div>


⚡ 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
tiktok_search Search TikTok videos by keyword. Returns author, description, views, URL, hashtags.
tiktok_trending Get trending/For You videos from TikTok's main feed.
tiktok_feed Scroll the For You Page like a real user and collect video metadata.
tiktok_user_videos Get all videos from a specific user's profile with their stats.
tiktok_video_info Get detailed metadata for a specific video (stats, audio, hashtags, description).
tiktok_hashtag Explore a hashtag — view count, popular videos, and stats.
tiktok_download Download a TikTok video without watermark (HD when available via tikwm).
tiktok_publish Publish a video to TikTok with caption and hashtags via Creator Center.
tiktok_interact Like, comment, or follow — interact with any video or creator.
tiktok_sounds Get trending sounds/music on TikTok.
tiktok_session Manage your TikTok session: check login, refresh cookies, export session.
tiktok_analyze_trend 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 chromium

2. 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.pkl

Option B — Export manually:

  1. Log into TikTok in your browser
  2. Use a cookie export extension (e.g., "Get cookies.txt")
  3. 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

<!-- Add screenshots/GIFs here -->

<div align="center"> <i>Screenshots and demo GIFs coming soon.</i>

<!-- Search Demo Publish Demo -->

</div>


🏗️ 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:

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'feat: add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. 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.


<div align="center">

⭐ Star this repo if you find it useful!

Made with ❤️ by follox42

</div>

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选