Astron-Douyin-MCP: 基于抖音游客态公开接口与页面解析的自包含 MCP Server,支持 MCP 协议和 uvx 一键启动。
Project description
抖音公开内容 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/*
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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.2.tar.gz.
File metadata
- Download URL: astron_douyin_mcp-0.1.2.tar.gz
- Upload date:
- Size: 10.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.0rc1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fa2ecd22aacf355b1341011869d932cbf1421e6c70e2560130f21350fbcca5cf
|
|
| MD5 |
fb07101310aac978246f22e80fd6f240
|
|
| BLAKE2b-256 |
4565b38096a3e2c6906ab2bae24922cf8d432932e64e28fa76dc1c2d01487884
|
File details
Details for the file astron_douyin_mcp-0.1.2-py3-none-any.whl.
File metadata
- Download URL: astron_douyin_mcp-0.1.2-py3-none-any.whl
- Upload date:
- Size: 10.8 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 |
65c258607cfec48bab0260d29344d0020d0d467ed7494ba88a76e7995c9ff937
|
|
| MD5 |
426e71fd09f72215db6628d632b3ddb8
|
|
| BLAKE2b-256 |
835a0b24adbf6139d779ef1f9099cdca9d5d47f4faa4aef873192fba0a7d16a8
|