抖音公开内容 MCP Server
概述
Astron-douyin-mcp 是一个基于 MCP 协议的抖音工具服务,直接调用抖音游客态公开热榜接口并解析公开页面数据,不依赖额外的 Astron 后端服务。
当前工程形态:
- 使用
MCP Python SDK - 使用单文件
server.py承载工具定义、页面解析和 HTTP 调用 - 通过独立
pyproject打包 - 支持
uvx一键启动 - 通过环境变量配置超时和 User-Agent
当前仅保留 1 个稳定工具:
get_hot_list
工具列表
获取热榜 get_hot_list
- 描述:读取抖音热榜。
- 参数:
limit:返回条数,默认20refresh:是否刷新,默认False
稳定性策略
抖音游客态风控在搜索、详情、作者链路上不稳定。当前版本仅对外暴露已验证稳定的热榜能力, 其余高风险工具已从 MCP 注册中移除,避免在生产调用中触发不可控失败。
环境变量
这个包默认不需要认证信息。
可选环境变量:
export DOUYIN_MCP_TIMEOUT_SECONDS="20"
export DOUYIN_MCP_USER_AGENT="Mozilla/5.0 ..."
说明:
DOUYIN_MCP_TIMEOUT_SECONDS控制接口和页面请求超时。DOUYIN_MCP_USER_AGENT用于覆盖默认桌面请求头。
安装与启动
推荐方式:使用 uvx 一键启动
uvx --from astron-douyin-mcp astron-douyin-mcp
如果你还没有安装 uv / uvx,可先执行:
curl -fsSL https://install.astral.sh/uv | bash
使用 pip 安装
pip install astron-douyin-mcp
douyin-mcp
本地源码运行
cd MCP/douyin-mcp
PYTHONPATH=src python3 -m douyin_mcp.server
客户端配置
使用 uvx
{
"mcpServers": {
"douyin-mcp": {
"command": "uvx",
"args": ["--from", "astron-douyin-mcp", "astron-douyin-mcp"],
"env": {
"DOUYIN_MCP_TIMEOUT_SECONDS": "20"
}
}
}
}
使用本地源码
{
"mcpServers": {
"douyin-mcp": {
"command": "python3",
"args": ["-m", "douyin_mcp.server"],
"env": {
"PYTHONPATH": "/path/to/MCP/douyin-mcp/src",
"DOUYIN_MCP_TIMEOUT_SECONDS": "20"
}
}
}
}
平台差异说明
- 这个 MCP 直接请求抖音公开接口和公开页面,不依赖额外的 Astron 后端服务。
- 当前仅面向公开内容能力,不包含登录态、私有内容或用户专属数据。
- 当前版本聚焦稳定优先,仅保留热榜能力。
- 为保证可安装即用,当前实现不引入 Playwright 等浏览器依赖。
发布说明
cd MCP/douyin-mcp
rm -rf build dist src/*.egg-info
python3 -m build --no-isolation
python3 -m twine check dist/*
python3 -m twine upload dist/*
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
astron_douyin_mcp-0.1.3.tar.gz
(10.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file astron_douyin_mcp-0.1.3.tar.gz.
File metadata
- Download URL: astron_douyin_mcp-0.1.3.tar.gz
- Upload date:
- Size: 10.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.11.0rc1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
713770e484728db6ed265f43b103a07f28f4d01825ce30132377cbed9ae817f3
|
|
| MD5 |
05af5a6f147a5adafabef0e87bcd9ffc
|
|
| BLAKE2b-256 |
03dcb70e04b65b3330b2c19c44700f3cd483203faff05728d9adf3d62d76f480
|
File details
Details for the file astron_douyin_mcp-0.1.3-py3-none-any.whl.
File metadata
- Download URL: astron_douyin_mcp-0.1.3-py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.11.0rc1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9db9528dd0480d579c016a5a2c16b25bdecbb817924922b2ccbac752cd89abf7
|
|
| MD5 |
46d0ea54f8f39fea631e6f820d0709c0
|
|
| BLAKE2b-256 |
cb618e00ab177fde1ae58647e8eae4014ef20eba205cc78759bdf2e66474dc05
|