Skip to main content

抖音公开内容 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:返回条数,默认 20
    • refresh:是否刷新,默认 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"
      }
    }
  }
}

平台差异说明

  1. 这个 MCP 直接请求抖音公开接口和公开页面,不依赖额外的 Astron 后端服务。
  2. 当前仅面向公开内容能力,不包含登录态、私有内容或用户专属数据。
  3. 当前版本聚焦稳定优先,仅保留热榜能力。
  4. 为保证可安装即用,当前实现不引入 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/*

Metadata

Release files for astron-douyin-mcp 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for astron-douyin-mcp 0.1.3
File Size Uploaded
astron_douyin_mcp-0.1.3.tar.gz 10.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for astron-douyin-mcp 0.1.3
File Interpreter ABI Platform
astron_douyin_mcp-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 21.8 kB

Release files / astron_douyin_mcp-0.1.3.tar.gz

Download URL astron_douyin_mcp-0.1.3.tar.gz
Size 10.7 kB
Tags Source
SHA-256 checksum
How to use checksums
713770e484728db6ed265f43b103a07f28f4d01825ce30132377cbed9ae817f3
BLAKE2b-256 checksum
How to use checksums
03dcb70e04b65b3330b2c19c44700f3cd483203faff05728d9adf3d62d76f480
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.0rc1

Release files / astron_douyin_mcp-0.1.3-py3-none-any.whl

Download URL astron_douyin_mcp-0.1.3-py3-none-any.whl
Size 11.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9db9528dd0480d579c016a5a2c16b25bdecbb817924922b2ccbac752cd89abf7
BLAKE2b-256 checksum
How to use checksums
cb618e00ab177fde1ae58647e8eae4014ef20eba205cc78759bdf2e66474dc05
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.0rc1

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page