douyin-favorites-mcp
douyin-favorites-mcp · 抖音コレクション MCP サービス
抖音コレクション / 抖音のお気に入り の Model Context Protocol (MCP) サーバー —— ログイン状態のブラウザセッションを通じて、自分のアカウントの抖音のお気に入り(デフォルトのお気に入り)、コレクション / アルバム(例:「学習」)を読み取り、構造化データを AI アシスタント(Claude / WorkBuddy など)にエクスポートして利用します。
English: An MCP server that reads your personal Douyin (抖音) favorites and collection folders (收藏夹/专辑) via a logged-in browser session, for use with Claude / WorkBuddy and other MCP clients.
⚠️ 個人利用の認可:本ツールは現在ログインしているアカウントのコレクションデータのみを読み取り、他人のデータスクレイピング、CAPTCHA 回避、署名クラック機能は提供しません。
機能
ツール | 説明 |
| ヘッド付き Chrome を起動して QR コードで抖音にログイン(セッションはローカル profile に保存) |
| 現在の session が有効かどうかを確認(sessionid cookie に基づく) |
| ローカルブラウザの profile をクリア |
| ヘルスチェック |
| 現在ログイン中のアカウントの基本情報を取得(ニックネーム/uid/フォロワー/フォロー/獲得いいね) |
| デフォルトの「お気に入り」フォルダの動画リストを取得 |
| すべてのコレクション(アルバム)を一覧表示:id、名前、動画数 |
| 指定したコレクション(アルバム)内の動画/画像・テキストを取得 |
| 単一の動画の詳細とインタラクションデータを取得 |
対応コンテンツタイプ:動画 + 画像・テキスト(長文記事)。タイトル / 作者 / インタラクションデータ / カバー画像 / 再生時間を抽出できます。
Related MCP server: Bilibili MCP Server
動作原理
抖音の Web API には実行時署名保護があり、API 呼び出しを直接偽造することはできません。本サービスでは次の方法を採用しています:
Playwright で実際の Chrome を起動(永続化 profile);
QR コードで一度ログインし、session cookie をローカルに保存;
ページ UI を操作(「お気に入り」タブをクリックし、「コレクション」サブタブをクリック)、XHR レスポンスを傍受;
解析して構造化データを返す。
検証済みの API(2026-08):
コレクションリスト:
GET /aweme/v1/web/collects/list/コレクションの内容:
GET /aweme/v1/web/collects/video/list/?collects_id=...&cursor=0&count=10すべてのお気に入り:
POST /aweme/v1/web/aweme/listcollection/(cursor は POST body 内)
インストール
python -m venv .venv
# Windows
.venv\Scripts\activate
# macOS / Linux
source .venv/bin/activate
pip install -e .
playwright install chromium設定(WorkBuddy / Claude Desktop)
MCP 設定に追加します(例:~/.workbuddy/mcp.json):
{
"mcpServers": {
"douyin-favorites": {
"command": "C:/absolute/path/to/douyin-favorites/.venv/Scripts/python.exe",
"args": ["-m", "douyin_favorites.server"],
"env": {
"DOUYIN_DATA_DIR": "C:/Users/<you>/.douyin-favorites"
}
}
}
}
DOUYIN_DATA_DIRはブラウザ profile(ログイン状態)の保存場所です。バージョン管理に含めないでください。
初回使用
# 1. 登录(弹出 Chrome,扫码后自动关闭)
python scripts/verify.py
# 2. 或通过 MCP 调用:
# douyin_login_start
# douyin_login_status -> {"logged_in": true}
# list_collects -> 列出收藏夹(id + 名称 + 数量)
# get_collect_videos({"collects_id": "<id>"})ログイン状態はセッションをまたいで永続化され、通常は数週間ごとに一度 QR コード再スキャンが必要です。
テスト
pytest tests/ -v
python scripts/verify.py # 端到端验证(需要登录态)
python scripts/verify_collects.py # 列收藏夹 + 第一个收藏夹的视频注意事項と既知の制限
ログイン状態の検出は session cookie に基づく(
sessionid/sessionid_ss/sid_guard/sid_tt)。DOM 要素で判断しないこと(抖音のホームページは未ログインでも多数の作者アバターが表示され、誤判定するため)。抖音のホームページは決して
networkidleに到達しないため、すべてのナビゲーションはdomcontentloadedを使用します。コレクションページのページングは実際のマウスホイールでトリガーされます(最初に
mouse.moveでコンテンツ領域に移動してからwheel)。window.scrollToは無効です。「お気に入り」タブはクリックでトリガーする必要があります。
?showTab=favoriteURL パラメータ自体は無効です。get_video_detailは、抖音の詳細 API のリニューアルにより一時的に利用できない場合があります。
免責事項
本プロジェクトは個人の学習、研究、データ整理のみを目的としています。本ツールを使用することで、以下を確認したことになります:
完全なアクセス権限を持つ自分の抖音アカウントのデータのみにアクセスすること;
本ツールを大量スクレイピング、データ販売、不正な水増し、その他の違法・規約違反行為に使用しないこと;
抖音の API は随時変更され、ツールが一時的に使用できなくなる可能性があることを理解していること。
上記の条項または関連する法律・規制に違反したことによるいかなる結果も、利用者自身が負担するものとします。
ライセンス
MIT
Available Tools
9 toolsdouyin_health_checkA
Return login status and profile health for diagnostics.
Inputs: no named parameters.
douyin_login_startA
Open a headed Chrome window for the user to scan QR code and login to Douyin.
Inputs: no named parameters.
douyin_login_statusB
Check whether the stored Douyin browser session is still valid.
Inputs: no named parameters.
douyin_logoutA
Clear the stored Douyin browser profile and force re-login next time.
Inputs: no named parameters.
get_collect_videosB
List videos inside a specific Douyin collection folder by collects_id.
Inputs: collects_id (required), limit.
get_self_user_infoB
Get basic info of the currently logged-in Douyin account.
Inputs: no named parameters.
get_video_detailB
Get detailed metadata and stats for a Douyin video by aweme_id or share_url.
Inputs: aweme_id, share_url.
list_collection_videosC
List videos from the default Douyin 'favorite' collection.
Inputs: limit, cursor.
list_collectsA
List the logged-in user's Douyin collection folders (收藏夹/专辑), with id, name and video count.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 9 tools
Most tools target distinct actions (login, logout, list, get detail), but douyin_login_status and douyin_health_check substantially overlap since health_check also reports login status. The rest are clearly separable.
Four tools use a douyin_ prefix while five use bare verb_noun, and there is confusing terminology drift between 'collection'/'collect' (list_collects, get_collect_videos). Readable but not a single consistent pattern.
Nine tools is well-scoped for a login-plus-collections server, with each tool earning its place and no bloat.
The surface is essentially read-only for a 'favorites' server: no add/remove-favorite, save-to-collection, or search operations, so agents cannot actually manage favorites as the name implies. Core listing and detail reads are covered.
Related MCP Connectors
Douyin short video, Xiaohongshu (RedNote) notes, comments & creator profile scraper remote MCP API.
Douyin short video, Xiaohongshu (RedNote) notes, comments & creator profile scraper remote MCP API.
MCP server for Hailuo (MiniMax) AI video generation
Social media MCP server: your Instagram, TikTok, YouTube, LinkedIn and Threads history for your AI.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceMCP server enabling AI agents to generate AI videos and images, analyze video content, and download videos from Douyin and Xiaohongshu.-
- AlicenseNot gradedqualityDmaintenanceAn MCP server powered by public Bilibili APIs so AI agents can search videos and read public video and creator metadata.MIT
- FlicenseBqualityDmaintenanceMCP server wrapping social-auto-upload CLI for AI clients to verify cookies and publish videos/notes to Chinese social platforms (Douyin, Kuaishou, Xiaohongshu, Bilibili).10-
- AlicenseBqualityDmaintenanceA local MCP server that reads Douyin creator data from the browser and provides tools to query, compare, and analyze video performance metrics for AI agents.131AGPL 3.0