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.0.tar.gz (10.5 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.0-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file astron_douyin_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: astron_douyin_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 10.5 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.0.tar.gz
Algorithm Hash digest
SHA256 625158ffd287f304594a0ebe2fc7a23bfb65432a960ce25126c9bd78185299c7
MD5 c76a3940eda7f9f3e22802e4cc50d811
BLAKE2b-256 92f2db64ba5acaa76d15682c202c42e35e10e0ed01ac1e7c4e2fd3ab4eebc1ae

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for astron_douyin_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 67133b2fc658ca910e5467d23d13715522b8d2a605cde21963a8195f47c695aa
MD5 4ae1265348a08f48eb164599f543ec3c
BLAKE2b-256 de355c9919c7a417c6fe78f33c99f9ce974b1fca975dd06996fb06a5d3f77159

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