Skip to main content
Glama
yangbuyiya

Short Video MCP Server

by yangbuyiya

全网短视频去水印链接提取 MCP服务

项目简介

本项目是一个基于 FastMCP 的全网短视频去水印解析服务,支持多平台视频分享链接的解析,自动提取视频真实地址及相关信息。
适用于需要批量解析、去水印、采集短视频的场景。本项目还支持视频内容文本提取功能,可以通过语音识别将视频内容转为文本。

PyPI version

Related MCP server: Douyin MCP Server

主要特性

  • 支持20+种短视频平台(抖音、快手、小红书、微博、西瓜视频等)

  • 一键解析视频分享链接,获取无水印视频地址

  • 支持多种传输方式(stdio、SSE、HTTP)

  • 支持视频内容文本提取功能(需要FFmpeg和API Key、默认使用硅基流动:https://cloud.siliconflow.cn/i/tbvUltCF

  • 支持Docker容器化部署

  • 代码结构清晰,易于扩展

演示

支持平台

目前支持以下短视频平台的解析:

  • 抖音(DouYin)

  • 快手(KuaiShou)

  • 小红书(RedBook)

  • 微博(WeiBo)

  • 皮皮虾(PiPiXia)

  • 微视(WeiShi)

  • 绿洲(LvZhou)

  • 最右(ZuiYou)

  • 度小视/全民小视频(QuanMin)

  • 西瓜视频(XiGua)

  • 梨视频(LiShiPin)

  • 皮皮搞笑(PiPiGaoXiao)

  • 虎牙(HuYa)

  • AcFun(AcFun)

  • 逗拍(DouPai)

  • 美拍(MeiPai)

  • 全民K歌(QuanMinKGe)

  • 六间房(SixRoom)

  • 新片场(XinPianChang)

  • 好看视频(HaoKan)

目录结构

crawling-short-video-mcp/
├── yby6_video_mcp_server/
│   ├── server.py                # 主服务入口
│   ├── functionality/           # 各平台解析功能模块
│   │   ├── base.py             # 基础类和枚举定义
│   │   ├── douyin.py           # 抖音解析实现
│   │   ├── kuaishou.py         # 快手解析实现
│   │   ├── ...                 # 其他平台实现
│   │   └── video_processor.py  # 视频处理和文本提取
│   └── utils/                   # 工具函数
├── Dockerfile.base              # 基础镜像构建文件
├── Dockerfile.mcp               # MCP服务镜像构建文件
├── requirements.txt             # 依赖包列表
├── pyproject.toml              # 项目配置和元数据
└── README.md                    # 项目说明

安装方法

前置依赖

FFmpeg 安装(视频文本内容提取必需)

Ubuntu/Debian:

sudo apt update
sudo apt install ffmpeg

CentOS/RHEL:

sudo yum install epel-release
sudo yum install ffmpeg ffmpeg-devel

macOS:

brew install ffmpeg

Windows:

  1. 下载 FFmpeg: https://ffmpeg.org/download.html#build-windows

  2. 解压到指定目录,如 C:\ffmpeg

  3. 添加到系统环境变量 PATH: C:\ffmpeg\bin

  4. 重启命令行或系统以使环境变量生效

验证安装:

ffmpeg -version

方法一:pypi 使用 pip 安装 (推荐)

当前最新版本: PyPI version

# 安装最新版本
pip install -i https://pypi.org/simple yby6-video-mcp-server

# 或指定版本安装
pip install -i https://pypi.org/simple yby6-video-mcp-server==1.0.2

安装完成后,可以通过以下命令验证安装:

yby6_video_mcp_server --version

MCP 配置使用

"yby6_video_mcp_server": {
  "command": "uv",
  "args": ["yby6_video_mcp_server"],
  "env": {
    "API_KEY": "前往获取免费apikey: https://cloud.siliconflow.cn/i/tbvUltCF"
  }
}

方法二:从源码安装

  1. 克隆本项目

    git clone https://github.com/yangbuyiya/yby6-crawling-short-video-mcp.git
    cd yby6-crawling-short-video-mcp
  2. 安装依赖

    推荐使用 Python 3.10+,并建议使用虚拟环境:

    macOS/Linux:

    python -m venv venv
    source venv/bin/activate
    pip install -r requirements.txt

    Windows:

    python -m venv venv
    venv\Scripts\activate
    pip install -r requirements.txt

方法三:使用 Docker 部署

本项目提供了 Docker 支持, 快速部署运行

  1. 运行容器 拉取镜像 sse 模式

    docker run -d -p 8637:8637 registry.cn-hangzhou.aliyuncs.com/yby6/yby6_video_mcp_server:1.0.2

可以通过以下命令快速构建部署:

  1. 构建基础镜像(包含 FFmpeg 和 Python 环境)

    docker build -t ffmpeg-python-base:1.0.2 -f Dockerfile.base .
  2. 构建 MCP 服务镜像

    docker build -t yby6-video-mcp:latest -f Dockerfile.mcp .
  3. 运行容器

    docker run -d -p 8637:8637 yby6-video-mcp:latest

使用方法

stdio MCP启动服务

//  pypi 拉取运行 
"yby6_video_mcp_server": {
  "command": "uv",
  "args": ["yby6_video_mcp_server"],
  "env": {
    "API_KEY": "sk-xcazqbgbnoagddpyaorhqhioxazvqdtednppksiqaotjsboe"
  }
},

// 从源码运行
"yby6_video_mcp_server": {
  "command": "uv",
  "args": [
    "--directory",
    "to/path/yby6-crawling-short-video-mcp/yby6_video_mcp_server",
    "run",
    "-m",
    "yby6_video_mcp_server.server"
  ],
  "env": {
    "API_KEY": "sk-xcazqbgbnoagddpyaorhqhioxazvqdtednppksiqaotjsboe"
  }
},

SSE or HTTP MCP服务地址

  • 支持请求头配置apikey

  • 支持请求参数配置apikey


"yby6_video_mcp_server": {
  "url": "http://127.0.0.1:8637/sse?apikey=xxxxxx",
}

启动服务

# 使用pip安装后
yby6_video_mcp_server --transport http --host 0.0.0.0 --port 8637

# 或从源码运行
python -m yby6_video_mcp_server.server --transport http --host 0.0.0.0 --port 8637

参数说明:

  • --transport 传输方式,可选:stdiossehttp(推荐 http)

  • --host 主机地址,默认 0.0.0.0

  • --port 端口号,默认 8000

  • --path 自定义MCP请求路径(可选)

API 接口说明

1. 解析视频分享链接

接口名称: share_url_parse_tool

请求参数:

参数名

类型

必填

说明

url

string

视频分享链接

返回示例:

{
  "code": 200,
  "msg": "解析成功",
  "data": {
    "video_url": "https://xxx.com/xxx.mp4",
    "cover_url": "https://xxx.com/cover.jpg",
    "title": "视频标题",
    "music_url": "https://xxx.com/music.mp3",
    "images": [],
    "author": {
      "uid": "用户ID",
      "name": "用户名",
      "avatar": "头像URL"
    }
  }
}

2. 根据视频ID解析

接口名称: video_id_parse_tool

请求参数:

参数名

类型

必填

说明

source

string

视频来源,如 douyin、kuaishou 等

video_id

string

视频ID

返回示例: 同上

3. 视频内容文本提取

接口名称: share_text_parse_tool

请求参数:

参数名

类型

必填

说明

share_link

string

抖音分享链接或包含链接的文本

api_base_url

string

API基础URL,默认使用SiliconFlow

model

string

语音识别模型,默认使用SenseVoiceSmall

链接 sse、Streamable HTTP模式的时候只需要将 apikey 带入请求参数当中: http://127.0.0.1:8637/sse?apikey=xxxxxx 使用的大模型是硅基流动前往获取apikey即可:https://cloud.siliconflow.cn/i/tbvUltCF

返回示例:

{
  "code": 200,
  "msg": "解析成功",
  "data": {
    "video_url": "https://xxx.com/xxx.mp4",
    "cover_url": "https://xxx.com/cover.jpg",
    "title": "视频标题",
    "author": {
      "uid": "用户ID",
      "name": "用户名",
      "avatar": "头像URL"
    }
  },
  "text_content": "视频中的语音文本内容"
}

依赖说明

主要依赖包括:

  • fastmcp: MCP服务框架

  • httpx: 异步HTTP客户端

  • ffmpeg-python: 视频处理

  • lxml & parsel: HTML解析

  • fake-useragent: 模拟浏览器请求

  • pydantic: 数据验证

Docker 部署

项目提供了两个Dockerfile:

  • Dockerfile.base: 构建基础镜像,包含Python环境和FFmpeg

  • Dockerfile.mcp: 构建MCP服务镜像

使用脚本快速部署:

# Windows
.\script\deployBase.bat
.\script\deployMcp.bat

# Linux/macOS
bash script/deployBase.sh
bash script/deployMcp.sh

运行容器 拉取镜像 sse 模式

docker run -d -p 8637:8637 registry.cn-hangzhou.aliyuncs.com/yby6/yby6_video_mcp_server:1.0.2

贡献与反馈

欢迎提交 issue 或 PR 参与项目改进!


本项目站在巨人的肩膀上二次开发,感谢以下项目:

⚠️ 免责声明

  1. 本项目为开源工具,仅供学习与研究用途。用户在使用本项目过程中产生的任何风险、损失或法律责任,均由用户本人承担,作者及贡献者不承担任何直接或间接责任。

  2. 本项目的功能和代码基于现有技术实现,作者不承诺其完全正确、无缺陷或持续可用。因项目缺陷或不可用导致的任何后果,作者概不负责。

  3. 本项目依赖的第三方库、插件或服务,均遵循其原有协议。用户需自行查阅、遵守相关协议,因违反第三方协议产生的责任由用户自负。

  4. 用户应确保自身的使用行为合法、合规,不得利用本项目从事任何违法、违规或侵犯他人权益的活动。因违法违规使用本项目产生的后果,均由用户自行承担。

  5. 严禁将本项目用于侵犯知识产权、传播违法信息、商业破解、数据爬取等非法用途。作者坚决反对并不支持任何非法用途。

  6. 用户在处理数据时,应确保符合相关法律法规(如数据合规、隐私保护等),因违规操作产生的责任由用户承担。

  7. 作者、贡献者与用户的具体使用行为无关,不承担任何连带责任。基于本项目的二次开发、修改、分发等行为,均与作者无关,相关责任由行为人自负。

  8. 本项目不授予任何专利许可。因专利纠纷或侵权产生的风险由用户承担。未经作者书面授权,禁止将本项目用于商业宣传、再授权或其他商业用途。

  9. 作者有权随时终止对违规用户的服务,并要求其删除相关代码和数据。

  10. 作者有权随时更新本免责声明,用户继续使用即视为接受最新条款。如不同意本声明,请立即停止使用本项目。

Available Tools

3 tools
share_text_parse_tool_wrapperC
      提取视频内容,需要传递apikey,否则无法使用视频内容提取功能!
      参数:
      - text: 抖音分享文本,包含分享链接
      - api_base_url: API基础URL,默认使用siliconflow.cn
      - model: 语音识别模型,默认使用FunAudioLLM/SenseVoiceSmall
      
ParametersJSON Schema
NameRequiredDescriptionDefault
textYes
api_base_urlNo
modelNo

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

C2.6/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description should fully disclose behavior. Mentions apikey requirement but apikey is not in input schema, causing confusion. No mention of side effects, return format, or error handling.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences, efficient. The first sentence is a warning but somewhat redundant with parameter list. Could be more structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Output schema exists but description fails to explain what 'extract video content' means in practice. Missing critical info about how to supply apikey and what the tool returns. Incomplete given the tool's complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Adds context to all three parameters (text is Douyin share text with link, defaults for api_base_url and model). However, misses the apikey parameter which description says is required, so incomplete.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description states 'extract video content' but tool name is 'parse', creating ambiguity. Does not distinguish from sibling tools 'share_url_parse_tool_wrapper' and 'video_id_parse_tool_wrapper'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus siblings. Mentions need for apikey but does not explain prerequisites or alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

share_url_parse_tool_wrapperB
      解析视频分享链接,获取视频信息
      参数:
      - url: 视频分享链接
      返回:
      - code: 状态码
      - msg: 状态信息
      - data: 视频信息
      
ParametersJSON Schema
NameRequiredDescriptionDefault
urlYes

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

B3.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must convey behavioral traits. It states that the tool parses a URL and returns code, msg, and data, implying a read-only operation, but does not disclose side effects, authentication needs, or any potential errors. The description lacks sufficient behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is brief and structured with a purpose statement, parameter list, and return fields. It is appropriately sized for a simple tool, though it could be more front-loaded with the purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with one parameter and an output schema, the description covers the core purpose and return structure (code, msg, data). However, it lacks usage guidance, behavioral detail, and any differentiation from siblings, leaving the agent with an incomplete picture for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has 0% description coverage (only type string), but the description adds meaning by labeling 'url' as a 'video share link'. However, it does not provide format, constraints, or examples, so it adds minimal value beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'parse video share link, get video info'. It specifies both the verb (parse) and the resource (video share link), and the sibling tools (share_text_parse, video_id_parse) are distinct, indicating this tool is specifically for URL parsing.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus its siblings (share_text_parse_tool_wrapper, video_id_parse_tool_wrapper). There is no mention of prerequisites, contexts, or exclusions, leaving the agent without direction for tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

video_id_parse_tool_wrapperA
      根据视频来源和ID解析视频信息
      参数:
      - source: 视频来源
      - video_id: 视频ID
      返回:
      - code: 状态码
      - msg: 状态信息
      - data: 视频信息
      
ParametersJSON Schema
NameRequiredDescriptionDefault
sourceYes
video_idYes

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A3.5/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided. Description does not disclose behavioral traits like side effects, authentication, or network usage. Merely states parsing, but fails to clarify if it's a local or API call.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Concise: one sentence plus bullet lists of parameters and returns. No redundancy, but bullet lists are not integrated into prose. Front-loaded with action.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple 2-parameter parse tool with an output schema, the description covers what, parameters, and returns. Lacks examples or error handling, but adequate for low complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, but description briefly explains 'source: 视频来源' and 'video_id: 视频ID', adding minimal meaning. Insufficient detail on parameter formats or constraints.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states the verb '解析' (parse) and resource '视频信息' (video information) based on source and ID. It distinguishes from sibling tools 'share_text_parse_tool_wrapper' and 'share_url_parse_tool_wrapper' by specifying video ID parsing.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit when-to-use or when-not-to-use guidance. The tool name and sibling list imply use for video ID parsing, but no context for alternatives or prerequisites is given.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 3 tool updatesv1.0.2
    • Changedshare_text_parse_tool_wrapper1 field changed
      • addedInput schema / additionalProperties
        Added value: +false
    • Changedshare_url_parse_tool_wrapper1 field changed
      • addedInput schema / additionalProperties
        Added value: +false
    • Changedvideo_id_parse_tool_wrapper1 field changed
      • addedInput schema / additionalProperties
        Added value: +false
  2. 3 tool updatesv1.0.0
    • Changedshare_text_parse_tool_wrapper3 fields changed
      • removedInput schema / properties / api_base_url / title
        Removed value: -"Api Base Url"
      • removedInput schema / properties / model / title
        Removed value: -"Model"
      • removedInput schema / properties / text / title
        Removed value: -"Text"
    • Changedshare_url_parse_tool_wrapper1 field changed
      • removedInput schema / properties / url / title
        Removed value: -"Url"
    • Changedvideo_id_parse_tool_wrapper2 fields changed
      • removedInput schema / properties / source / title
        Removed value: -"Source"
      • removedInput schema / properties / video_id / title
        Removed value: -"Video Id"
  3. 3 tool updates
    • First observedshare_text_parse_tool_wrapper
    • First observedshare_url_parse_tool_wrapper
    • First observedvideo_id_parse_tool_wrapper

TDQS

A3.5/5.0

Scored across 3 tools

Disambiguation5/5

Each tool targets a distinct input method (text, URL, source+ID) for parsing short video information, with clear descriptions preventing overlap.

Naming Consistency5/5

All tools follow the consistent pattern of 'input_parse_tool_wrapper', making the naming predictable and easy to understand.

Tool Count5/5

Three tools is well-scoped for a server focused on parsing short video references from common inputs, with no unnecessary or missing tools.

Completeness5/5

The tool surface covers all common ways to reference a short video (shared text, URL, or direct ID), making it complete for its intended purpose.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers