
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
douyin-mcp-server
Advanced tools
一个基于 Model Context Protocol (MCP) 的抖音自动化上传服务,允许大型语言模型(LLM)通过 MCP 协议自动上传视频到抖音创作者平台。
# 克隆仓库
git clone https://github.com/lancelin111/douyin-mcp-server.git
cd douyin-mcp-server
# 安装根目录依赖
npm install
# 进入 MCP 服务器目录并安装依赖
cd mcp-server
npm install
# 构建 TypeScript
npm run build
# 在 mcp-server 目录下
npm start
在 Claude Desktop 的配置文件中添加:
{
"mcpServers": {
"douyin": {
"command": "node",
"args": ["path/to/douyin-mcp-server/mcp-server/dist/index.js"],
"env": {}
}
}
}
配置完成后,您可以直接在 Claude 中使用以下功能:
请帮我登录抖音账号
请上传视频到抖音,标题是"我的新视频",描述是"这是一个测试视频"
检查我的抖音登录状态
| 工具名称 | 功能描述 | 主要参数 |
|---|---|---|
douyin_login | 登录抖音账号并保存凭证 | headless(是否无头模式), timeout(超时时间) |
douyin_check_login | 检查当前登录状态 | headless(是否无头模式) |
douyin_upload_video | 上传视频到抖音 | videoPath(视频路径), title(标题), description(描述), tags(标签), autoPublish(是否自动发布) |
douyin_get_cookies | 获取保存的 Cookie 信息 | 无 |
douyin_clear_cookies | 清除登录数据和浏览器缓存 | 无 |
如果您想直接使用核心功能而不通过 MCP,可以参考以下代码:
import { DouyinUploader } from './mcp-server/dist/douyin-uploader.js';
const uploader = new DouyinUploader();
// 检查登录状态
const loginCheck = await uploader.checkLogin(true);
if (!loginCheck.isValid) {
// 需要登录
const loginResult = await uploader.login(false, 180000);
console.log(`登录成功: ${loginResult.user}`);
}
// 上传视频
const uploadResult = await uploader.uploadVideo({
videoPath: './test-video.mp4',
title: '我的视频标题',
description: '视频描述内容',
tags: ['标签1', '标签2'],
headless: false, // 显示浏览器窗口
autoPublish: true // 自动发布
});
console.log(`上传${uploadResult.success ? '成功' : '失败'}`);
douyin-mcp-server/
├── mcp-server/ # MCP 服务器核心代码
│ ├── index.ts # MCP 服务器入口文件
│ ├── douyin-uploader.ts # 抖音自动化核心逻辑
│ ├── package.json # MCP 服务器依赖配置
│ ├── tsconfig.json # TypeScript 配置
│ └── dist/ # 编译输出目录
├── examples/ # 使用示例
│ └── simple-upload.js # 简单上传示例
├── .claude/ # Claude 配置文件
├── test-video.mp4 # 测试视频文件
├── CLAUDE.md # Claude Code 开发指南
├── package.json # 根项目配置
├── tsconfig.json # 根 TypeScript 配置
└── README.md # 项目说明文档
# 开发模式运行(自动重新加载)
cd mcp-server && npm run dev
# 构建 TypeScript
cd mcp-server && npm run build
# 运行示例
node examples/simple-upload.js
mcp-server/index.ts):实现标准 MCP 协议,处理工具调用和参数验证mcp-server/douyin-uploader.ts):核心自动化逻辑,包含登录、上传、验证处理账号安全:
使用规范:
技术限制:
# 重新安装 Chrome
npx puppeteer browsers install chrome
# 清除保存的登录数据
rm mcp-server/douyin-cookies.json
rm -rf mcp-server/chrome-user-data
我们欢迎社区贡献!请遵循以下步骤:
git checkout -b feature/amazing-feature)git commit -m 'Add amazing feature')git push origin feature/amazing-feature)本项目采用 MIT 许可证 - 查看 LICENSE 文件了解详情
An automated video upload service for Douyin (TikTok China) based on the Model Context Protocol (MCP). This project enables Large Language Models (LLMs) to automatically upload videos to Douyin Creator Platform through MCP protocol.
# Clone repository
git clone https://github.com/lancelin111/douyin-mcp-server.git
cd douyin-mcp-server
# Install root dependencies
npm install
# Install MCP server dependencies
cd mcp-server
npm install
# Build TypeScript
npm run build
# In mcp-server directory
npm start
Add to Claude Desktop configuration:
{
"mcpServers": {
"douyin": {
"command": "node",
"args": ["path/to/douyin-mcp-server/mcp-server/dist/index.js"],
"env": {}
}
}
}
After configuration, you can directly use in Claude:
Please help me login to Douyin
Upload a video to Douyin with title "My New Video" and description "This is a test video"
Check my Douyin login status
| Tool Name | Description | Key Parameters |
|---|---|---|
douyin_login | Login to Douyin and save credentials | headless, timeout |
douyin_check_login | Check current login status | headless |
douyin_upload_video | Upload video to Douyin | videoPath, title, description, tags, autoPublish |
douyin_get_cookies | Get saved cookie information | None |
douyin_clear_cookies | Clear login data and browser cache | None |
If you want to use the core functionality without MCP:
import { DouyinUploader } from './mcp-server/dist/douyin-uploader.js';
const uploader = new DouyinUploader();
// Check login status
const loginCheck = await uploader.checkLogin(true);
if (!loginCheck.isValid) {
// Need to login
const loginResult = await uploader.login(false, 180000);
console.log(`Login successful: ${loginResult.user}`);
}
// Upload video
const uploadResult = await uploader.uploadVideo({
videoPath: './test-video.mp4',
title: 'My Video Title',
description: 'Video description content',
tags: ['tag1', 'tag2'],
headless: false, // Show browser window
autoPublish: true // Auto publish
});
console.log(`Upload ${uploadResult.success ? 'successful' : 'failed'}`);
douyin-mcp-server/
├── mcp-server/ # MCP server core code
│ ├── index.ts # MCP server entry point
│ ├── douyin-uploader.ts # Douyin automation core logic
│ ├── package.json # MCP server dependencies
│ ├── tsconfig.json # TypeScript configuration
│ └── dist/ # Compiled output directory
├── examples/ # Usage examples
│ └── simple-upload.js # Simple upload example
├── .claude/ # Claude configuration
├── test-video.mp4 # Test video file
├── CLAUDE.md # Claude Code development guide
├── package.json # Root project configuration
├── tsconfig.json # Root TypeScript configuration
└── README.md # Project documentation
# Development mode (auto-reload)
cd mcp-server && npm run dev
# Build TypeScript
cd mcp-server && npm run build
# Run example
node examples/simple-upload.js
mcp-server/index.ts): Implements standard MCP protocol with tool call handling and parameter validationmcp-server/douyin-uploader.ts): Core automation logic including login, upload, and verification handlingAccount Security:
Usage Guidelines:
Technical Limitations:
# Reinstall Chrome
npx puppeteer browsers install chrome
# Clear saved login data
rm mcp-server/douyin-cookies.json
rm -rf mcp-server/chrome-user-data
We welcome community contributions! Please follow these steps:
git checkout -b feature/amazing-feature)git commit -m 'Add amazing feature')git push origin feature/amazing-feature)This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter any issues or have questions:
本项目仅供学习和研究使用,请勿用于商业用途或违反抖音平台规则的行为。使用本项目产生的任何后果由使用者自行承担。
This project is for educational and research purposes only. Do not use it for commercial purposes or activities that violate Douyin platform rules. Users are responsible for any consequences arising from the use of this project.
FAQs
Douyin MCP Server for automated video uploads
The npm package douyin-mcp-server receives a total of 92 weekly downloads. As such, douyin-mcp-server popularity was classified as not popular.
We found that douyin-mcp-server demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.