MCP Server for Douyin — let AI search users, read and send Douyin direct messages via browser automation
Wellknown found it in public sources; nobody has proven control of it yet. Claiming takes one click if the repository is under your GitHub account, or a small file on your domain otherwise. Verified owners get the badge, 15-minute checks, status alerts, edits that outrank crawled data, and a ranking boost.
Agents can do it too: POST https://wellknown.network/api/v1/claims with {"agent":"douyin-chat-mcp-server","method":"well_known_file"} — machine-readable steps at claim.json, guide at /docs/claim.
Everything here was measured by our prober or read from a registry. Nothing is self-reported.
Attributed to the source that supplied each field. Treated as claims, not facts.
# Douyin MCP Server 将抖音网页版私信/聊天功能暴露为 MCP (Model Context Protocol) 工具,让 AI 助手可以搜索用户、读取和发送抖音私信。 ## 核心功能 | # | 功能 | MCP 工具 | 实现方式 | |---|------|----------|----------| | 1 | 🔍 搜索用户 | `search_user(keyword)` | 搜索页面 → DOM 提取用户信息 | | 2 | 📥 读取私信 | `read_messages(contact, limit)` | DOM 提取消息文本(零成本) | | 3 | 📤 发送私信 | `send_message(user_id, text)` | Draft.js JS 注入 + 点击发送 | | 4 | 📋 会话列表 | `list_conversations()` | DOM 提取会话项(昵称、最后消息、未读) | ## 技术架构 ``` ┌─────────────────────────────────────┐ │ MCP Host (Claude 等) │ ├─────────────────────────────────────┤ │ Douyin MCP Server │ │ ┌─────────┐ ┌───────────────────┐ │ │ │ server.py │→│ FastMCP 暴露工具 │ │ │ ├─────────┤ ├───────────────────┤ │ │ │ core.py │→│ DouyinController │ │ │ ├─────────┤ ├───────────────────┤ │ │ │browser.py│→│ BrowserManager │ │ │ │ │ │ 扫码登录 + 持久化 │ │ │ └─────────┘ └───────────────────┘ │ ├─────────────────────────────────────┤ │ Playwright + Chromium │ ├─────────────────────────────────────┤ │ 抖音网页版 (www.douyin.com) │ └─────────────────────────────────────┘ ``` ## 快速开始 ### 前提条件 - Python 3.10+ - 手机抖音 App(用于扫码登录) ### 安装 ```bash # 1. 克隆项目 git clone https://github.com/Lozzi1910/Douyin-mcp.git cd Douyin-mcp # 2. 安装依赖 pip install -e . # 3. 安装 Playwright Chromium 浏览器 playwright install chromium ``` ### 启动 ```bash # 方式一:直接运行(stdio 模式,适合本地 MCP Host) python -m douyin_mcp.server # 方式二:SSE 模式(HTTP 端口,适合远程调用) python -m douyin_mcp.server --transport sse --port 6789 # 方式三:通过 mcp CLI mcp run douyin_mcp/server.py --port 6789 ``` --- ## Docker 部署 ### 首次部署 ```bash # 1. 构建镜像 docker compose build # 2. 启动 docker compose up -d # 3. 查看日志(等待二维码出现) docker compose logs -f # 4. 用手机抖音 App 扫码 # 二维码保存在 ./data/login_qrcode.png open ./data/login_qrcode.png ``` ### 连接 MCP Host ```bash # 容器运行在 SSE 模式 # MCP Host 通过 SSE 端点连接: # http://localhost:6789/sse (SSE 事件流) # http://localhost:6789/mcp (MCP 消息端点) # http:/…
Mapped onto the structured taxonomy from declared text and observed tool names. Confidence shown for derived entries.
Every source is kept verbatim. Field changes are logged as events.