Skip to main content

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:返回条数,默认 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/*

Project details


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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

astron_douyin_mcp-0.1.3-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

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

Hashes for astron_douyin_mcp-0.1.3.tar.gz
Algorithm Hash digest
SHA256 713770e484728db6ed265f43b103a07f28f4d01825ce30132377cbed9ae817f3
MD5 05af5a6f147a5adafabef0e87bcd9ffc
BLAKE2b-256 03dcb70e04b65b3330b2c19c44700f3cd483203faff05728d9adf3d62d76f480

See more details on using hashes here.

File details

Details for the file astron_douyin_mcp-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for astron_douyin_mcp-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 9db9528dd0480d579c016a5a2c16b25bdecbb817924922b2ccbac752cd89abf7
MD5 46d0ea54f8f39fea631e6f820d0709c0
BLAKE2b-256 cb618e00ab177fde1ae58647e8eae4014ef20eba205cc78759bdf2e66474dc05

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page