MCP字幕服务器
从视频中提取字幕的MCP服务器。
特性
- 从涉及的YouTube视频中下载现有字幕(优先考虑手动生成而非自动生成)。
- 回到本地转录使用
mlx-whisper如果没有字幕可用。
用法
先决条件
uv已安装(紫外线简介).ffmpeg已安装(音频提取所需)。- macOS(建议使用Apple Silicon
mlx-whisper).
运行服务器
您可以直接使用以下命令运行服务器 uv:
# Run from source
uv run server.py客户端使用情况
要将此服务器与MCP客户端(如Claude Desktop或其他符合MCP的工具)一起使用,您可以按如下方式进行配置:
{
"mcpServers": {
"subtitle": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/gaoyifan/mcp-subtitle",
"mcp-subtitle"
]
}
}
}MCP JSON配置
如果你的客户阅读 mcp.json 文件,您可以放入相同的配置:
{
"mcpServers": {
"subtitle": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/gaoyifan/mcp-subtitle",
"mcp-subtitle"
]
}
}
}或者暂时运行它:
uvx --from git+https://github.com/gaoyifan/mcp-subtitle mcp-subtitleSSE模式
要在SSE模式下运行服务器(例如用于检查或远程访问):
uv run server.py --sse --port 8000使用HTTPS(提供证书和密钥文件):
uv run server.py --sse --port 8000 --ssl-certfile /path/to/cert.pem --ssl-keyfile /path/to/key.pem远程SSE MCP配置
要连接到远程SSE服务器,请将客户端指向其URL:
{
"mcpServers": {
"subtitle-remote": {
"transport": "sse",
"url": "https://your-host.example.com:8000/sse"
}
}
}开发与测试
# Run tests
uv run pytest