vidleaf-mcp 1.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- vidleaf_mcp-1.1.0/LICENSE +21 -0
- vidleaf_mcp-1.1.0/PKG-INFO +162 -0
- vidleaf_mcp-1.1.0/README.md +129 -0
- vidleaf_mcp-1.1.0/pyproject.toml +63 -0
- vidleaf_mcp-1.1.0/setup.cfg +4 -0
- vidleaf_mcp-1.1.0/src/vidleaf_mcp/__init__.py +6 -0
- vidleaf_mcp-1.1.0/src/vidleaf_mcp/__main__.py +4 -0
- vidleaf_mcp-1.1.0/src/vidleaf_mcp/cli.py +131 -0
- vidleaf_mcp-1.1.0/src/vidleaf_mcp/client.py +332 -0
- vidleaf_mcp-1.1.0/src/vidleaf_mcp/server.py +196 -0
- vidleaf_mcp-1.1.0/src/vidleaf_mcp/tools.py +289 -0
- vidleaf_mcp-1.1.0/src/vidleaf_mcp/urls.py +172 -0
- vidleaf_mcp-1.1.0/src/vidleaf_mcp.egg-info/PKG-INFO +162 -0
- vidleaf_mcp-1.1.0/src/vidleaf_mcp.egg-info/SOURCES.txt +16 -0
- vidleaf_mcp-1.1.0/src/vidleaf_mcp.egg-info/dependency_links.txt +1 -0
- vidleaf_mcp-1.1.0/src/vidleaf_mcp.egg-info/entry_points.txt +3 -0
- vidleaf_mcp-1.1.0/src/vidleaf_mcp.egg-info/top_level.txt +1 -0
- vidleaf_mcp-1.1.0/tests/test_vidleaf_mcp.py +143 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Vidleaf (https://vidleaf.app)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: vidleaf-mcp
|
|
3
|
+
Version: 1.1.0
|
|
4
|
+
Summary: MCP server & CLI to read timestamped YouTube, Bilibili, TikTok, Vimeo, Douyin, Xiaohongshu, Facebook, and X video transcripts or jump to Vidleaf deep-reading.
|
|
5
|
+
Author-email: Vidleaf <support@vidleaf.app>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://vidleaf.app
|
|
8
|
+
Project-URL: Documentation, https://github.com/blackmirror69/vidleaf-mcp#readme
|
|
9
|
+
Project-URL: Repository, https://github.com/blackmirror69/vidleaf-mcp
|
|
10
|
+
Project-URL: Issues, https://github.com/blackmirror69/vidleaf-mcp/issues
|
|
11
|
+
Project-URL: Changelog, https://github.com/blackmirror69/vidleaf-mcp/blob/main/CHANGELOG.md
|
|
12
|
+
Project-URL: YouTube Transcript Tool, https://vidleaf.app/en/youtube-transcript
|
|
13
|
+
Project-URL: Bilibili Subtitle Extractor, https://vidleaf.app/zh/bilibili-transcript
|
|
14
|
+
Project-URL: Facebook Video Transcript, https://vidleaf.app/en/facebook-video-transcript
|
|
15
|
+
Project-URL: SRT Subtitle Converter, https://vidleaf.app/en/srt-converter
|
|
16
|
+
Project-URL: Public CC BY Transcripts, https://vidleaf.app/en/transcripts/
|
|
17
|
+
Keywords: mcp,mcp-server,model-context-protocol,vidleaf,youtube-transcript,bilibili,tiktok,vimeo,facebook-video,douyin,xiaohongshu,subtitles,srt,video-to-text
|
|
18
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
19
|
+
Classifier: Environment :: Console
|
|
20
|
+
Classifier: Intended Audience :: Developers
|
|
21
|
+
Classifier: Intended Audience :: Science/Research
|
|
22
|
+
Classifier: Programming Language :: Python :: 3
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
25
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
26
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
27
|
+
Classifier: Topic :: Multimedia :: Sound/Audio :: Speech
|
|
28
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
29
|
+
Requires-Python: >=3.10
|
|
30
|
+
Description-Content-Type: text/markdown
|
|
31
|
+
License-File: LICENSE
|
|
32
|
+
Dynamic: license-file
|
|
33
|
+
|
|
34
|
+
# Vidleaf MCP Server & CLI (`vidleaf-mcp`)
|
|
35
|
+
|
|
36
|
+
<!-- mcp-name: io.github.blackmirror69/vidleaf-mcp -->
|
|
37
|
+
|
|
38
|
+
[](https://glama.ai/mcp/servers/blackmirror69/vidleaf-mcp)
|
|
39
|
+
[](LICENSE)
|
|
40
|
+
[](https://vidleaf.app/en/)
|
|
41
|
+
|
|
42
|
+
**[English](README.md)** · **[简体中文](README.zh-CN.md)** · **[Changelog](CHANGELOG.md)**
|
|
43
|
+
|
|
44
|
+
Zero-dependency **Model Context Protocol (MCP) server and CLI** for reading timestamped transcripts, searching exact quotes, and opening deep-reading sessions from **YouTube, Bilibili, TikTok, Vimeo, Facebook (Videos & Reels), Douyin, Xiaohongshu (RedNote), and X (Twitter)** via **[Vidleaf](https://vidleaf.app/en/)**.
|
|
45
|
+
|
|
46
|
+
Most LLM chat apps cannot natively read **Bilibili subtitles** (BV IDs, `b23.tv`, multi-part `?p=` courses, Bangumi), unwrap **TikTok / Douyin / Xiaohongshu mobile share copy**, or safely fall back when a video has **no captions**. `vidleaf-mcp` bridges that gap in **Claude Desktop, Cursor, Cherry Studio, Windsurf, Cline, ChatGPT / Codex, and terminal workflows** with zero API keys required for caption reading.
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Why `vidleaf-mcp`?
|
|
51
|
+
|
|
52
|
+
- **8 Video Platforms, 1 Unified Schema**: Works across [YouTube](https://vidleaf.app/en/youtube-transcript), [Bilibili](https://vidleaf.app/en/bilibili-transcript) (`BV...`, `b23.tv`, `?p=N`, Bangumi & Courses), TikTok (`tiktok.com/@.../video/`, `vm.tiktok.com`, `vt.tiktok.com`), Vimeo (`vimeo.com/<id>`, `player.vimeo.com/video/<id>`), [Facebook Videos/Reels](https://vidleaf.app/en/facebook-video-transcript) (`fb.watch`), [Douyin](https://vidleaf.app/zh/douyin-transcript), [Xiaohongshu](https://vidleaf.app/zh/xiaohongshu-transcript), and [X / Twitter](https://vidleaf.app/en/x-video-transcript).
|
|
53
|
+
- **Free Anonymous Caption Reading**: Existing official or auto-generated subtitles load immediately with `[MM:SS]` timestamps—no API key, no browser extension, and no login required.
|
|
54
|
+
- **Safe No-Caption Fallback (`vidleaf.app/open?url=...`)**: Never triggers surprise audio billing. When a video has zero captions (such as hard-subtitled clips or raw recordings), `vidleaf-mcp` returns `status: "asr_confirmation_required"` with a one-click `https://vidleaf.app/open?url=...` link so you can inspect duration and confirm [speech-to-text transcription](https://vidleaf.app/en/guides/youtube-transcript-without-captions) or [podcast speaker diarization](https://vidleaf.app/en/guides/youtube-podcast-transcription) in the browser.
|
|
55
|
+
- **Zero Runtime Dependencies**: Pure standard library in both Python (`>=3.10`, `uvx` / `pipx`) and Node.js (`>=18`, `npx` / `.mcpb`).
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## Quick Setup (Claude Desktop / Cursor / Cherry Studio / Windsurf)
|
|
60
|
+
|
|
61
|
+
### Option A: `npx` (Node.js — zero install directly from GitHub)
|
|
62
|
+
|
|
63
|
+
```json
|
|
64
|
+
{
|
|
65
|
+
"mcpServers": {
|
|
66
|
+
"vidleaf": {
|
|
67
|
+
"command": "npx",
|
|
68
|
+
"args": ["-y", "github:blackmirror69/vidleaf-mcp"]
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Option B: `uvx` (Python — zero install directly from GitHub)
|
|
75
|
+
|
|
76
|
+
```json
|
|
77
|
+
{
|
|
78
|
+
"mcpServers": {
|
|
79
|
+
"vidleaf": {
|
|
80
|
+
"command": "uvx",
|
|
81
|
+
"args": ["--from", "git+https://github.com/blackmirror69/vidleaf-mcp", "vidleaf-mcp"]
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Option C: Claude Desktop 1-Click Extension (`.mcpb` — Official MCP Registry bundle)
|
|
88
|
+
|
|
89
|
+
Download **[`vidleaf-mcp.mcpb`](https://github.com/blackmirror69/vidleaf-mcp/releases/latest/download/vidleaf-mcp.mcpb)** from the latest GitHub Release and open or drag it into **Claude Desktop → Settings → Extensions** (zero terminal setup).
|
|
90
|
+
|
|
91
|
+
### Option D: Docker (build locally from source, zero registry login)
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
docker build -t vidleaf-mcp https://github.com/blackmirror69/vidleaf-mcp.git
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
```json
|
|
98
|
+
{
|
|
99
|
+
"mcpServers": {
|
|
100
|
+
"vidleaf": {
|
|
101
|
+
"command": "docker",
|
|
102
|
+
"args": ["run", "-i", "--rm", "vidleaf-mcp"]
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
> **Optional environment variable**: Set `VIDLEAF_SESSION_COOKIE` to your `vsub_session` value only if you want MCP reads saved to your personal Vidleaf reading history. Leave unset for free anonymous reading.
|
|
109
|
+
|
|
110
|
+
### Cherry Studio / Claude Code / Codex CLI
|
|
111
|
+
|
|
112
|
+
- **Claude Code**: `claude mcp add vidleaf -- npx -y github:blackmirror69/vidleaf-mcp`
|
|
113
|
+
- **Cherry Studio**: Settings → MCP Servers → Add Server → Type `STDIO`, Command `npx`, Args `-y github:blackmirror69/vidleaf-mcp`.
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## MCP Tools Exposed
|
|
118
|
+
|
|
119
|
+
| Tool | Purpose | Network |
|
|
120
|
+
| :--- | :--- | :--- |
|
|
121
|
+
| `read_video_transcript` | Fetch paginated `[MM:SS]` subtitle cues (`timestamped`, `markdown`, `srt`, or `plain`), track list, and Vidleaf deep-reader links (`open_url`, `summary_open_url`). | Read-only (`vidleaf.app`) |
|
|
122
|
+
| `search_video_transcript` | Search 1–10 exact phrases or keywords inside a video's captions and return timestamped matches with surrounding context lines—ideal for 2-hour lectures without filling context windows. | Read-only (`vidleaf.app`) |
|
|
123
|
+
| `build_vidleaf_open_link` | Deterministically extract a clean video URL from mobile share text and build `https://vidleaf.app/open?url=...` (`goal="transcript"` or `"summary"`), domain-swap shortcuts, and Markdown citations across all 8 platforms. | Offline (`openWorldHint: false`) |
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## CLI Usage
|
|
128
|
+
|
|
129
|
+
Both the Python and Node packages install `vidleaf-mcp` and `vidleaf` CLI commands:
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
# 1. Read timestamped transcript (YouTube, Bilibili BV ID, Vimeo, TikTok, or mobile share copy)
|
|
133
|
+
vidleaf-mcp read "https://www.bilibili.com/video/BV1GJ411x7h7" --lang zh --format markdown
|
|
134
|
+
vidleaf-mcp read "https://www.youtube.com/watch?v=UF8uR6Z6KLc" --limit 100
|
|
135
|
+
|
|
136
|
+
# 2. Search exact quotes inside a long lecture without dumping all captions
|
|
137
|
+
vidleaf-mcp search "https://www.youtube.com/watch?v=UF8uR6Z6KLc" "connect the dots" "stay hungry"
|
|
138
|
+
|
|
139
|
+
# 3. Unwrap TikTok / Douyin / Xiaohongshu / Bilibili share text into a direct Vidleaf reader or summary URL
|
|
140
|
+
vidleaf-mcp open "7.43 复制打开抖音看看 https://v.douyin.com/iYxxxxxx/" --goal summary --locale zh
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## Try Online & Quality Score (Glama MCP)
|
|
146
|
+
|
|
147
|
+
You can inspect tool schemas, verify our **A-rated** Tool Definition Quality Score (TDQS), and test `vidleaf-mcp` directly in your browser before installing via our **[Glama MCP Server listing](https://glama.ai/mcp/servers/blackmirror69/vidleaf-mcp)** or the [Glama MCP Inspector](https://glama.ai/mcp/inspector).
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## Official Vidleaf Web Tools & Documentation
|
|
152
|
+
|
|
153
|
+
- **Web Workspaces (6 Languages)**: [English](https://vidleaf.app/en/) · [简体中文](https://vidleaf.app/) · [Español](https://vidleaf.app/es/) · [日本語](https://vidleaf.app/ja/) · [Português (BR)](https://vidleaf.app/pt-BR/) · [繁體中文](https://vidleaf.app/zh-Hant/)
|
|
154
|
+
- **Dedicated Video & Subtitle Tools**: [YouTube Transcript Extractor](https://vidleaf.app/en/youtube-transcript) · [YouTube Video Summarizer](https://vidleaf.app/en/youtube-summary) · [Bilibili Subtitle Extractor](https://vidleaf.app/en/bilibili-transcript) · [Facebook Video & Reels Transcript](https://vidleaf.app/en/facebook-video-transcript) · [X (Twitter) Video Transcript](https://vidleaf.app/en/x-video-transcript) · [MP4 to Text (Browser Audio Extraction)](https://vidleaf.app/en/mp4-to-text) · [Meeting Recording Transcript](https://vidleaf.app/en/meeting-recording-transcript) · [Free Local SRT/VTT Converter](https://vidleaf.app/en/srt-converter)
|
|
155
|
+
- **Chinese Platform Extractors**: [B站字幕提取](https://vidleaf.app/zh/bilibili-transcript) · [抖音视频转文字](https://vidleaf.app/zh/douyin-transcript) · [小红书视频转文字](https://vidleaf.app/zh/xiaohongshu-transcript) · [Facebook 视频转文字](https://vidleaf.app/zh/facebook-video-transcript) · [X 视频字幕提取](https://vidleaf.app/zh/x-video-transcript)
|
|
156
|
+
- **1-on-1 Tool Comparisons**: [DownSub Alternative](https://vidleaf.app/en/alternatives/downsub) · [NoteGPT Alternative](https://vidleaf.app/en/alternatives/notegpt) · [Tactiq Alternative](https://vidleaf.app/en/alternatives/tactiq) · [Filmot Alternative](https://vidleaf.app/en/alternatives/filmot)
|
|
157
|
+
- **Research Guides & CC BY Archive**: [Transcripts Without Captions](https://vidleaf.app/en/guides/youtube-transcript-without-captions) · [Podcast Speaker Labels](https://vidleaf.app/en/guides/youtube-podcast-transcription) · [Search Exact Quotes](https://vidleaf.app/en/guides/search-youtube-transcript) · [Public CC BY Lecture Archive (93 Full Lectures, 6 Languages)](https://vidleaf.app/en/transcripts/) ([Español](https://vidleaf.app/es/transcripts/) · [中文文库](https://vidleaf.app/zh/transcripts/))
|
|
158
|
+
- **Browser Companion Scripts**: [blackmirror69/vidleaf-open](https://github.com/blackmirror69/vidleaf-open) (8-Platform Bookmarklet, Tampermonkey Userscript & Obsidian Citation Templates)
|
|
159
|
+
|
|
160
|
+
## License
|
|
161
|
+
|
|
162
|
+
Released under the [MIT License](LICENSE).
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# Vidleaf MCP Server & CLI (`vidleaf-mcp`)
|
|
2
|
+
|
|
3
|
+
<!-- mcp-name: io.github.blackmirror69/vidleaf-mcp -->
|
|
4
|
+
|
|
5
|
+
[](https://glama.ai/mcp/servers/blackmirror69/vidleaf-mcp)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
[](https://vidleaf.app/en/)
|
|
8
|
+
|
|
9
|
+
**[English](README.md)** · **[简体中文](README.zh-CN.md)** · **[Changelog](CHANGELOG.md)**
|
|
10
|
+
|
|
11
|
+
Zero-dependency **Model Context Protocol (MCP) server and CLI** for reading timestamped transcripts, searching exact quotes, and opening deep-reading sessions from **YouTube, Bilibili, TikTok, Vimeo, Facebook (Videos & Reels), Douyin, Xiaohongshu (RedNote), and X (Twitter)** via **[Vidleaf](https://vidleaf.app/en/)**.
|
|
12
|
+
|
|
13
|
+
Most LLM chat apps cannot natively read **Bilibili subtitles** (BV IDs, `b23.tv`, multi-part `?p=` courses, Bangumi), unwrap **TikTok / Douyin / Xiaohongshu mobile share copy**, or safely fall back when a video has **no captions**. `vidleaf-mcp` bridges that gap in **Claude Desktop, Cursor, Cherry Studio, Windsurf, Cline, ChatGPT / Codex, and terminal workflows** with zero API keys required for caption reading.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Why `vidleaf-mcp`?
|
|
18
|
+
|
|
19
|
+
- **8 Video Platforms, 1 Unified Schema**: Works across [YouTube](https://vidleaf.app/en/youtube-transcript), [Bilibili](https://vidleaf.app/en/bilibili-transcript) (`BV...`, `b23.tv`, `?p=N`, Bangumi & Courses), TikTok (`tiktok.com/@.../video/`, `vm.tiktok.com`, `vt.tiktok.com`), Vimeo (`vimeo.com/<id>`, `player.vimeo.com/video/<id>`), [Facebook Videos/Reels](https://vidleaf.app/en/facebook-video-transcript) (`fb.watch`), [Douyin](https://vidleaf.app/zh/douyin-transcript), [Xiaohongshu](https://vidleaf.app/zh/xiaohongshu-transcript), and [X / Twitter](https://vidleaf.app/en/x-video-transcript).
|
|
20
|
+
- **Free Anonymous Caption Reading**: Existing official or auto-generated subtitles load immediately with `[MM:SS]` timestamps—no API key, no browser extension, and no login required.
|
|
21
|
+
- **Safe No-Caption Fallback (`vidleaf.app/open?url=...`)**: Never triggers surprise audio billing. When a video has zero captions (such as hard-subtitled clips or raw recordings), `vidleaf-mcp` returns `status: "asr_confirmation_required"` with a one-click `https://vidleaf.app/open?url=...` link so you can inspect duration and confirm [speech-to-text transcription](https://vidleaf.app/en/guides/youtube-transcript-without-captions) or [podcast speaker diarization](https://vidleaf.app/en/guides/youtube-podcast-transcription) in the browser.
|
|
22
|
+
- **Zero Runtime Dependencies**: Pure standard library in both Python (`>=3.10`, `uvx` / `pipx`) and Node.js (`>=18`, `npx` / `.mcpb`).
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Quick Setup (Claude Desktop / Cursor / Cherry Studio / Windsurf)
|
|
27
|
+
|
|
28
|
+
### Option A: `npx` (Node.js — zero install directly from GitHub)
|
|
29
|
+
|
|
30
|
+
```json
|
|
31
|
+
{
|
|
32
|
+
"mcpServers": {
|
|
33
|
+
"vidleaf": {
|
|
34
|
+
"command": "npx",
|
|
35
|
+
"args": ["-y", "github:blackmirror69/vidleaf-mcp"]
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Option B: `uvx` (Python — zero install directly from GitHub)
|
|
42
|
+
|
|
43
|
+
```json
|
|
44
|
+
{
|
|
45
|
+
"mcpServers": {
|
|
46
|
+
"vidleaf": {
|
|
47
|
+
"command": "uvx",
|
|
48
|
+
"args": ["--from", "git+https://github.com/blackmirror69/vidleaf-mcp", "vidleaf-mcp"]
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Option C: Claude Desktop 1-Click Extension (`.mcpb` — Official MCP Registry bundle)
|
|
55
|
+
|
|
56
|
+
Download **[`vidleaf-mcp.mcpb`](https://github.com/blackmirror69/vidleaf-mcp/releases/latest/download/vidleaf-mcp.mcpb)** from the latest GitHub Release and open or drag it into **Claude Desktop → Settings → Extensions** (zero terminal setup).
|
|
57
|
+
|
|
58
|
+
### Option D: Docker (build locally from source, zero registry login)
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
docker build -t vidleaf-mcp https://github.com/blackmirror69/vidleaf-mcp.git
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
```json
|
|
65
|
+
{
|
|
66
|
+
"mcpServers": {
|
|
67
|
+
"vidleaf": {
|
|
68
|
+
"command": "docker",
|
|
69
|
+
"args": ["run", "-i", "--rm", "vidleaf-mcp"]
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
> **Optional environment variable**: Set `VIDLEAF_SESSION_COOKIE` to your `vsub_session` value only if you want MCP reads saved to your personal Vidleaf reading history. Leave unset for free anonymous reading.
|
|
76
|
+
|
|
77
|
+
### Cherry Studio / Claude Code / Codex CLI
|
|
78
|
+
|
|
79
|
+
- **Claude Code**: `claude mcp add vidleaf -- npx -y github:blackmirror69/vidleaf-mcp`
|
|
80
|
+
- **Cherry Studio**: Settings → MCP Servers → Add Server → Type `STDIO`, Command `npx`, Args `-y github:blackmirror69/vidleaf-mcp`.
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## MCP Tools Exposed
|
|
85
|
+
|
|
86
|
+
| Tool | Purpose | Network |
|
|
87
|
+
| :--- | :--- | :--- |
|
|
88
|
+
| `read_video_transcript` | Fetch paginated `[MM:SS]` subtitle cues (`timestamped`, `markdown`, `srt`, or `plain`), track list, and Vidleaf deep-reader links (`open_url`, `summary_open_url`). | Read-only (`vidleaf.app`) |
|
|
89
|
+
| `search_video_transcript` | Search 1–10 exact phrases or keywords inside a video's captions and return timestamped matches with surrounding context lines—ideal for 2-hour lectures without filling context windows. | Read-only (`vidleaf.app`) |
|
|
90
|
+
| `build_vidleaf_open_link` | Deterministically extract a clean video URL from mobile share text and build `https://vidleaf.app/open?url=...` (`goal="transcript"` or `"summary"`), domain-swap shortcuts, and Markdown citations across all 8 platforms. | Offline (`openWorldHint: false`) |
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## CLI Usage
|
|
95
|
+
|
|
96
|
+
Both the Python and Node packages install `vidleaf-mcp` and `vidleaf` CLI commands:
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
# 1. Read timestamped transcript (YouTube, Bilibili BV ID, Vimeo, TikTok, or mobile share copy)
|
|
100
|
+
vidleaf-mcp read "https://www.bilibili.com/video/BV1GJ411x7h7" --lang zh --format markdown
|
|
101
|
+
vidleaf-mcp read "https://www.youtube.com/watch?v=UF8uR6Z6KLc" --limit 100
|
|
102
|
+
|
|
103
|
+
# 2. Search exact quotes inside a long lecture without dumping all captions
|
|
104
|
+
vidleaf-mcp search "https://www.youtube.com/watch?v=UF8uR6Z6KLc" "connect the dots" "stay hungry"
|
|
105
|
+
|
|
106
|
+
# 3. Unwrap TikTok / Douyin / Xiaohongshu / Bilibili share text into a direct Vidleaf reader or summary URL
|
|
107
|
+
vidleaf-mcp open "7.43 复制打开抖音看看 https://v.douyin.com/iYxxxxxx/" --goal summary --locale zh
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## Try Online & Quality Score (Glama MCP)
|
|
113
|
+
|
|
114
|
+
You can inspect tool schemas, verify our **A-rated** Tool Definition Quality Score (TDQS), and test `vidleaf-mcp` directly in your browser before installing via our **[Glama MCP Server listing](https://glama.ai/mcp/servers/blackmirror69/vidleaf-mcp)** or the [Glama MCP Inspector](https://glama.ai/mcp/inspector).
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## Official Vidleaf Web Tools & Documentation
|
|
119
|
+
|
|
120
|
+
- **Web Workspaces (6 Languages)**: [English](https://vidleaf.app/en/) · [简体中文](https://vidleaf.app/) · [Español](https://vidleaf.app/es/) · [日本語](https://vidleaf.app/ja/) · [Português (BR)](https://vidleaf.app/pt-BR/) · [繁體中文](https://vidleaf.app/zh-Hant/)
|
|
121
|
+
- **Dedicated Video & Subtitle Tools**: [YouTube Transcript Extractor](https://vidleaf.app/en/youtube-transcript) · [YouTube Video Summarizer](https://vidleaf.app/en/youtube-summary) · [Bilibili Subtitle Extractor](https://vidleaf.app/en/bilibili-transcript) · [Facebook Video & Reels Transcript](https://vidleaf.app/en/facebook-video-transcript) · [X (Twitter) Video Transcript](https://vidleaf.app/en/x-video-transcript) · [MP4 to Text (Browser Audio Extraction)](https://vidleaf.app/en/mp4-to-text) · [Meeting Recording Transcript](https://vidleaf.app/en/meeting-recording-transcript) · [Free Local SRT/VTT Converter](https://vidleaf.app/en/srt-converter)
|
|
122
|
+
- **Chinese Platform Extractors**: [B站字幕提取](https://vidleaf.app/zh/bilibili-transcript) · [抖音视频转文字](https://vidleaf.app/zh/douyin-transcript) · [小红书视频转文字](https://vidleaf.app/zh/xiaohongshu-transcript) · [Facebook 视频转文字](https://vidleaf.app/zh/facebook-video-transcript) · [X 视频字幕提取](https://vidleaf.app/zh/x-video-transcript)
|
|
123
|
+
- **1-on-1 Tool Comparisons**: [DownSub Alternative](https://vidleaf.app/en/alternatives/downsub) · [NoteGPT Alternative](https://vidleaf.app/en/alternatives/notegpt) · [Tactiq Alternative](https://vidleaf.app/en/alternatives/tactiq) · [Filmot Alternative](https://vidleaf.app/en/alternatives/filmot)
|
|
124
|
+
- **Research Guides & CC BY Archive**: [Transcripts Without Captions](https://vidleaf.app/en/guides/youtube-transcript-without-captions) · [Podcast Speaker Labels](https://vidleaf.app/en/guides/youtube-podcast-transcription) · [Search Exact Quotes](https://vidleaf.app/en/guides/search-youtube-transcript) · [Public CC BY Lecture Archive (93 Full Lectures, 6 Languages)](https://vidleaf.app/en/transcripts/) ([Español](https://vidleaf.app/es/transcripts/) · [中文文库](https://vidleaf.app/zh/transcripts/))
|
|
125
|
+
- **Browser Companion Scripts**: [blackmirror69/vidleaf-open](https://github.com/blackmirror69/vidleaf-open) (8-Platform Bookmarklet, Tampermonkey Userscript & Obsidian Citation Templates)
|
|
126
|
+
|
|
127
|
+
## License
|
|
128
|
+
|
|
129
|
+
Released under the [MIT License](LICENSE).
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "vidleaf-mcp"
|
|
7
|
+
version = "1.1.0"
|
|
8
|
+
description = "MCP server & CLI to read timestamped YouTube, Bilibili, TikTok, Vimeo, Douyin, Xiaohongshu, Facebook, and X video transcripts or jump to Vidleaf deep-reading."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
requires-python = ">=3.10"
|
|
12
|
+
authors = [
|
|
13
|
+
{ name = "Vidleaf", email = "support@vidleaf.app" }
|
|
14
|
+
]
|
|
15
|
+
keywords = [
|
|
16
|
+
"mcp",
|
|
17
|
+
"mcp-server",
|
|
18
|
+
"model-context-protocol",
|
|
19
|
+
"vidleaf",
|
|
20
|
+
"youtube-transcript",
|
|
21
|
+
"bilibili",
|
|
22
|
+
"tiktok",
|
|
23
|
+
"vimeo",
|
|
24
|
+
"facebook-video",
|
|
25
|
+
"douyin",
|
|
26
|
+
"xiaohongshu",
|
|
27
|
+
"subtitles",
|
|
28
|
+
"srt",
|
|
29
|
+
"video-to-text",
|
|
30
|
+
]
|
|
31
|
+
classifiers = [
|
|
32
|
+
"Development Status :: 5 - Production/Stable",
|
|
33
|
+
"Environment :: Console",
|
|
34
|
+
"Intended Audience :: Developers",
|
|
35
|
+
"Intended Audience :: Science/Research",
|
|
36
|
+
"Programming Language :: Python :: 3",
|
|
37
|
+
"Programming Language :: Python :: 3.10",
|
|
38
|
+
"Programming Language :: Python :: 3.11",
|
|
39
|
+
"Programming Language :: Python :: 3.12",
|
|
40
|
+
"Programming Language :: Python :: 3.13",
|
|
41
|
+
"Topic :: Multimedia :: Sound/Audio :: Speech",
|
|
42
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
43
|
+
]
|
|
44
|
+
dependencies = []
|
|
45
|
+
|
|
46
|
+
[project.urls]
|
|
47
|
+
Homepage = "https://vidleaf.app"
|
|
48
|
+
Documentation = "https://github.com/blackmirror69/vidleaf-mcp#readme"
|
|
49
|
+
Repository = "https://github.com/blackmirror69/vidleaf-mcp"
|
|
50
|
+
Issues = "https://github.com/blackmirror69/vidleaf-mcp/issues"
|
|
51
|
+
Changelog = "https://github.com/blackmirror69/vidleaf-mcp/blob/main/CHANGELOG.md"
|
|
52
|
+
"YouTube Transcript Tool" = "https://vidleaf.app/en/youtube-transcript"
|
|
53
|
+
"Bilibili Subtitle Extractor" = "https://vidleaf.app/zh/bilibili-transcript"
|
|
54
|
+
"Facebook Video Transcript" = "https://vidleaf.app/en/facebook-video-transcript"
|
|
55
|
+
"SRT Subtitle Converter" = "https://vidleaf.app/en/srt-converter"
|
|
56
|
+
"Public CC BY Transcripts" = "https://vidleaf.app/en/transcripts/"
|
|
57
|
+
|
|
58
|
+
[project.scripts]
|
|
59
|
+
vidleaf-mcp = "vidleaf_mcp.cli:main"
|
|
60
|
+
vidleaf = "vidleaf_mcp.cli:main"
|
|
61
|
+
|
|
62
|
+
[tool.setuptools.packages.find]
|
|
63
|
+
where = ["src"]
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"""Unified CLI and MCP stdio entrypoint for vidleaf-mcp."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import argparse
|
|
6
|
+
import json
|
|
7
|
+
import sys
|
|
8
|
+
|
|
9
|
+
from . import __version__
|
|
10
|
+
from .client import VidleafClient, VidleafError
|
|
11
|
+
from .server import McpStdioServer
|
|
12
|
+
from .urls import ALLOWED_GOALS, ALLOWED_LOCALES, build_open_url
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def build_parser() -> argparse.ArgumentParser:
|
|
16
|
+
parser = argparse.ArgumentParser(
|
|
17
|
+
prog="vidleaf-mcp",
|
|
18
|
+
description=(
|
|
19
|
+
"Vidleaf MCP Server & CLI — read timestamped YouTube, Bilibili, TikTok, Vimeo, Facebook, "
|
|
20
|
+
"Douyin, Xiaohongshu, and X (Twitter) transcripts or generate https://vidleaf.app/open links."
|
|
21
|
+
),
|
|
22
|
+
)
|
|
23
|
+
parser.add_argument("--version", action="version", version=f"vidleaf-mcp {__version__}")
|
|
24
|
+
parser.add_argument("--stdio", action="store_true", help="Run MCP server over stdio (default when no subcommand is given).")
|
|
25
|
+
parser.add_argument("--base-url", default=None, help="Override Vidleaf base URL (default: https://vidleaf.app).")
|
|
26
|
+
|
|
27
|
+
sub = parser.add_subparsers(dest="command")
|
|
28
|
+
|
|
29
|
+
sub.add_parser("serve", help="Run Model Context Protocol (MCP) server over stdio.")
|
|
30
|
+
|
|
31
|
+
p_read = sub.add_parser("read", help="Fetch timestamped transcript for a public video URL.")
|
|
32
|
+
p_read.add_argument("url", help="Video URL, Bilibili BV ID, or mobile share text.")
|
|
33
|
+
p_read.add_argument("--lang", action="append", dest="langs", help="Preferred subtitle language (repeatable, max 3).")
|
|
34
|
+
p_read.add_argument("--offset", type=int, default=0, help="Starting cue offset (default: 0).")
|
|
35
|
+
p_read.add_argument("--limit", type=int, default=300, help="Max cues per page (1–500, default: 300).")
|
|
36
|
+
p_read.add_argument(
|
|
37
|
+
"--format",
|
|
38
|
+
choices=["timestamped", "markdown", "srt", "plain", "json"],
|
|
39
|
+
default="timestamped",
|
|
40
|
+
help="Output format (default: timestamped).",
|
|
41
|
+
)
|
|
42
|
+
p_read.add_argument("--locale", choices=["", *ALLOWED_LOCALES], default="", help="Locale for Vidleaf open link.")
|
|
43
|
+
|
|
44
|
+
p_search = sub.add_parser("search", help="Search keywords or exact phrases inside video captions.")
|
|
45
|
+
p_search.add_argument("url", help="Video URL, Bilibili BV ID, or mobile share text.")
|
|
46
|
+
p_search.add_argument("keywords", nargs="+", help="1–10 keywords or phrases to match.")
|
|
47
|
+
p_search.add_argument("--lang", default="", help="Subtitle track language.")
|
|
48
|
+
p_search.add_argument("--context", type=int, default=1, help="Context lines around each hit (0–3).")
|
|
49
|
+
p_search.add_argument("--limit", type=int, default=25, help="Maximum hits (1–100).")
|
|
50
|
+
p_search.add_argument("--json", action="store_true", help="Emit full JSON output.")
|
|
51
|
+
|
|
52
|
+
p_open = sub.add_parser("open", help="Build normalized https://vidleaf.app/open?... deep-reading link offline.")
|
|
53
|
+
p_open.add_argument("url", help="Video URL or mobile share snippet.")
|
|
54
|
+
p_open.add_argument("--goal", choices=list(ALLOWED_GOALS), default="transcript", help="Reader goal (transcript or summary).")
|
|
55
|
+
p_open.add_argument("--locale", choices=["", *ALLOWED_LOCALES], default="", help="UI locale.")
|
|
56
|
+
p_open.add_argument("--start", type=int, default=None, help="Optional start timestamp in seconds.")
|
|
57
|
+
p_open.add_argument("--json", action="store_true", help="Emit full JSON output.")
|
|
58
|
+
|
|
59
|
+
return parser
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
def main(argv: list[str] | None = None) -> int:
|
|
63
|
+
if hasattr(sys.stdout, "reconfigure"):
|
|
64
|
+
sys.stdout.reconfigure(encoding="utf-8")
|
|
65
|
+
if hasattr(sys.stderr, "reconfigure"):
|
|
66
|
+
sys.stderr.reconfigure(encoding="utf-8")
|
|
67
|
+
|
|
68
|
+
args = build_parser().parse_args(argv)
|
|
69
|
+
client = VidleafClient(base_url=args.base_url)
|
|
70
|
+
|
|
71
|
+
if args.stdio or args.command in (None, "serve"):
|
|
72
|
+
McpStdioServer(client=client).serve_forever()
|
|
73
|
+
return 0
|
|
74
|
+
|
|
75
|
+
try:
|
|
76
|
+
if args.command == "open":
|
|
77
|
+
res = build_open_url(
|
|
78
|
+
args.url,
|
|
79
|
+
goal=args.goal,
|
|
80
|
+
locale=args.locale,
|
|
81
|
+
start_seconds=args.start,
|
|
82
|
+
base_url=client.base_url,
|
|
83
|
+
)
|
|
84
|
+
if args.json:
|
|
85
|
+
print(json.dumps(res, ensure_ascii=False, indent=2))
|
|
86
|
+
else:
|
|
87
|
+
print(res["open_url"])
|
|
88
|
+
return 0
|
|
89
|
+
|
|
90
|
+
if args.command == "read":
|
|
91
|
+
fmt = "timestamped" if args.format == "json" else args.format
|
|
92
|
+
res = client.read_transcript(
|
|
93
|
+
args.url,
|
|
94
|
+
langs=args.langs,
|
|
95
|
+
offset=args.offset,
|
|
96
|
+
limit=args.limit,
|
|
97
|
+
output_format=fmt,
|
|
98
|
+
locale=args.locale,
|
|
99
|
+
)
|
|
100
|
+
if args.format == "json":
|
|
101
|
+
print(json.dumps(res, ensure_ascii=False, indent=2))
|
|
102
|
+
elif res["status"] == "ok":
|
|
103
|
+
print(res["formatted_transcript"])
|
|
104
|
+
else:
|
|
105
|
+
print(f"[{res['status']}] {res.get('message', '')}\nOpen in Vidleaf: {res['open_url']}", file=sys.stderr)
|
|
106
|
+
return 2 if res["status"] == "asr_confirmation_required" else 1
|
|
107
|
+
return 0
|
|
108
|
+
|
|
109
|
+
if args.command == "search":
|
|
110
|
+
res = client.search_transcript(
|
|
111
|
+
args.url,
|
|
112
|
+
args.keywords,
|
|
113
|
+
lang=args.lang,
|
|
114
|
+
context=args.context,
|
|
115
|
+
limit=args.limit,
|
|
116
|
+
)
|
|
117
|
+
if args.json:
|
|
118
|
+
print(json.dumps(res, ensure_ascii=False, indent=2))
|
|
119
|
+
elif res["status"] != "ok":
|
|
120
|
+
print(f"[{res['status']}] {res.get('message', '')}\nOpen in Vidleaf: {res['open_url']}", file=sys.stderr)
|
|
121
|
+
return 2 if res["status"] == "asr_confirmation_required" else 1
|
|
122
|
+
else:
|
|
123
|
+
print(f"Title: {res['title']} ({res['total_hits']} hits) — {res['open_url']}")
|
|
124
|
+
for hit in res["hits"]:
|
|
125
|
+
print(f"[{hit['time']}] {hit['text']}")
|
|
126
|
+
return 0
|
|
127
|
+
except (ValueError, VidleafError) as exc:
|
|
128
|
+
print(f"Error: {exc}", file=sys.stderr)
|
|
129
|
+
return 1
|
|
130
|
+
|
|
131
|
+
return 0
|