fetchtranscript-mcp 0.1.0__tar.gz → 0.1.1__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.
- {fetchtranscript_mcp-0.1.0 → fetchtranscript_mcp-0.1.1}/.gitignore +21 -0
- fetchtranscript_mcp-0.1.1/LICENSE +21 -0
- {fetchtranscript_mcp-0.1.0 → fetchtranscript_mcp-0.1.1}/PKG-INFO +10 -4
- {fetchtranscript_mcp-0.1.0 → fetchtranscript_mcp-0.1.1}/README.md +3 -1
- {fetchtranscript_mcp-0.1.0 → fetchtranscript_mcp-0.1.1}/npm/package.json +1 -1
- {fetchtranscript_mcp-0.1.0 → fetchtranscript_mcp-0.1.1}/pyproject.toml +7 -2
- {fetchtranscript_mcp-0.1.0 → fetchtranscript_mcp-0.1.1}/src/fetchtranscript_mcp/__init__.py +1 -1
- {fetchtranscript_mcp-0.1.0 → fetchtranscript_mcp-0.1.1}/src/fetchtranscript_mcp/client.py +1 -1
- {fetchtranscript_mcp-0.1.0 → fetchtranscript_mcp-0.1.1}/src/fetchtranscript_mcp/tools.py +14 -9
- {fetchtranscript_mcp-0.1.0 → fetchtranscript_mcp-0.1.1}/tests/test_tools.py +3 -3
- fetchtranscript_mcp-0.1.1/uv.lock +1382 -0
- {fetchtranscript_mcp-0.1.0 → fetchtranscript_mcp-0.1.1}/dev_server.py +0 -0
- {fetchtranscript_mcp-0.1.0 → fetchtranscript_mcp-0.1.1}/npm/bin/cli.js +0 -0
- {fetchtranscript_mcp-0.1.0 → fetchtranscript_mcp-0.1.1}/src/fetchtranscript_mcp/errors.py +0 -0
- {fetchtranscript_mcp-0.1.0 → fetchtranscript_mcp-0.1.1}/src/fetchtranscript_mcp/prompts.py +0 -0
- {fetchtranscript_mcp-0.1.0 → fetchtranscript_mcp-0.1.1}/src/fetchtranscript_mcp/resources.py +0 -0
- {fetchtranscript_mcp-0.1.0 → fetchtranscript_mcp-0.1.1}/src/fetchtranscript_mcp/server.py +0 -0
- {fetchtranscript_mcp-0.1.0 → fetchtranscript_mcp-0.1.1}/tests/__init__.py +0 -0
- {fetchtranscript_mcp-0.1.0 → fetchtranscript_mcp-0.1.1}/tests/conftest.py +0 -0
- {fetchtranscript_mcp-0.1.0 → fetchtranscript_mcp-0.1.1}/tests/test_client.py +0 -0
- {fetchtranscript_mcp-0.1.0 → fetchtranscript_mcp-0.1.1}/tests/test_server.py +0 -0
|
@@ -159,6 +159,27 @@ sdks/mcp/.mypy_cache/
|
|
|
159
159
|
sdks/mcp/.ruff_cache/
|
|
160
160
|
sdks/mcp/npm/node_modules/
|
|
161
161
|
|
|
162
|
+
# ===================
|
|
163
|
+
# Examples
|
|
164
|
+
# ===================
|
|
165
|
+
|
|
166
|
+
examples/python/.venv/
|
|
167
|
+
examples/python/venv/
|
|
168
|
+
examples/python/__pycache__/
|
|
169
|
+
examples/python/**/__pycache__/
|
|
170
|
+
examples/python/*.py[cod]
|
|
171
|
+
examples/python/.pytest_cache/
|
|
172
|
+
examples/typescript/node_modules/
|
|
173
|
+
|
|
174
|
+
# ===================
|
|
175
|
+
# Tools
|
|
176
|
+
# ===================
|
|
177
|
+
|
|
178
|
+
tools/seo-review/.venv/
|
|
179
|
+
tools/seo-review/__pycache__/
|
|
180
|
+
tools/seo-review/.pytest_cache/
|
|
181
|
+
tools/seo-review/.ruff_cache/
|
|
182
|
+
|
|
162
183
|
# ===================
|
|
163
184
|
# Misc
|
|
164
185
|
# ===================
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 FetchTranscript
|
|
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.
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
2
|
Name: fetchtranscript-mcp
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.1
|
|
4
4
|
Summary: MCP server for FetchTranscript YouTube API
|
|
5
|
+
Project-URL: Homepage, https://fetchtranscript.com
|
|
6
|
+
Project-URL: Documentation, https://fetchtranscript.com/docs/mcp
|
|
7
|
+
Project-URL: Repository, https://github.com/fetchtranscript/mcp-server
|
|
5
8
|
Author: FetchTranscript
|
|
6
9
|
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE
|
|
7
11
|
Keywords: ai,mcp,transcript,youtube
|
|
8
12
|
Classifier: Development Status :: 4 - Beta
|
|
9
13
|
Classifier: Intended Audience :: Developers
|
|
@@ -13,7 +17,7 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
13
17
|
Classifier: Programming Language :: Python :: 3.12
|
|
14
18
|
Requires-Python: >=3.10
|
|
15
19
|
Requires-Dist: httpx>=0.27.0
|
|
16
|
-
Requires-Dist: mcp[cli]
|
|
20
|
+
Requires-Dist: mcp[cli]<2,>=1.2
|
|
17
21
|
Provides-Extra: dev
|
|
18
22
|
Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
|
|
19
23
|
Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
@@ -22,6 +26,8 @@ Description-Content-Type: text/markdown
|
|
|
22
26
|
|
|
23
27
|
# FetchTranscript MCP Server
|
|
24
28
|
|
|
29
|
+
<!-- mcp-name: com.fetchtranscript/fetchtranscript -->
|
|
30
|
+
|
|
25
31
|
An [MCP](https://modelcontextprotocol.io) server that gives AI assistants (Claude Desktop, Cursor, etc.) access to YouTube transcripts, video metadata, channels, and search via the [FetchTranscript](https://fetchtranscript.com) API.
|
|
26
32
|
|
|
27
33
|
## Features
|
|
@@ -103,7 +109,7 @@ FETCHTRANSCRIPT_API_KEY=yt_xxx fetchtranscript-mcp
|
|
|
103
109
|
### npx
|
|
104
110
|
|
|
105
111
|
```bash
|
|
106
|
-
FETCHTRANSCRIPT_API_KEY=yt_xxx npx
|
|
112
|
+
FETCHTRANSCRIPT_API_KEY=yt_xxx npx fetchtranscript-mcp
|
|
107
113
|
```
|
|
108
114
|
|
|
109
115
|
## Tools
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# FetchTranscript MCP Server
|
|
2
2
|
|
|
3
|
+
<!-- mcp-name: com.fetchtranscript/fetchtranscript -->
|
|
4
|
+
|
|
3
5
|
An [MCP](https://modelcontextprotocol.io) server that gives AI assistants (Claude Desktop, Cursor, etc.) access to YouTube transcripts, video metadata, channels, and search via the [FetchTranscript](https://fetchtranscript.com) API.
|
|
4
6
|
|
|
5
7
|
## Features
|
|
@@ -81,7 +83,7 @@ FETCHTRANSCRIPT_API_KEY=yt_xxx fetchtranscript-mcp
|
|
|
81
83
|
### npx
|
|
82
84
|
|
|
83
85
|
```bash
|
|
84
|
-
FETCHTRANSCRIPT_API_KEY=yt_xxx npx
|
|
86
|
+
FETCHTRANSCRIPT_API_KEY=yt_xxx npx fetchtranscript-mcp
|
|
85
87
|
```
|
|
86
88
|
|
|
87
89
|
## Tools
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "fetchtranscript-mcp"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.1"
|
|
8
8
|
description = "MCP server for FetchTranscript YouTube API"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "MIT"
|
|
@@ -20,7 +20,7 @@ classifiers = [
|
|
|
20
20
|
"Programming Language :: Python :: 3.12",
|
|
21
21
|
]
|
|
22
22
|
dependencies = [
|
|
23
|
-
"mcp[cli]>=1.
|
|
23
|
+
"mcp[cli]>=1.2,<2", # 2.x renamed FastMCP: the server does not start on it
|
|
24
24
|
"httpx>=0.27.0",
|
|
25
25
|
]
|
|
26
26
|
|
|
@@ -31,5 +31,10 @@ dev = [
|
|
|
31
31
|
"respx>=0.22",
|
|
32
32
|
]
|
|
33
33
|
|
|
34
|
+
[project.urls]
|
|
35
|
+
Homepage = "https://fetchtranscript.com"
|
|
36
|
+
Documentation = "https://fetchtranscript.com/docs/mcp"
|
|
37
|
+
Repository = "https://github.com/fetchtranscript/mcp-server"
|
|
38
|
+
|
|
34
39
|
[project.scripts]
|
|
35
40
|
fetchtranscript-mcp = "fetchtranscript_mcp.server:main"
|
|
@@ -6,13 +6,18 @@ import json
|
|
|
6
6
|
from collections.abc import Callable
|
|
7
7
|
|
|
8
8
|
from mcp.server.fastmcp import FastMCP
|
|
9
|
+
from mcp.server.fastmcp.exceptions import ToolError
|
|
9
10
|
|
|
10
11
|
from .client import FetchTranscriptClient
|
|
11
12
|
from .errors import FetchTranscriptError
|
|
12
13
|
|
|
13
14
|
|
|
14
15
|
def register_tools(mcp: FastMCP, get_client: Callable[[], FetchTranscriptClient]) -> None:
|
|
15
|
-
"""Register all tools on the MCP server instance.
|
|
16
|
+
"""Register all tools on the MCP server instance.
|
|
17
|
+
|
|
18
|
+
API errors are raised as ToolError, so the client sees a failed call (isError) with the
|
|
19
|
+
API's message, not a successful result that reads like a transcript.
|
|
20
|
+
"""
|
|
16
21
|
|
|
17
22
|
@mcp.tool()
|
|
18
23
|
async def get_transcript(
|
|
@@ -30,7 +35,7 @@ def register_tools(mcp: FastMCP, get_client: Callable[[], FetchTranscriptClient]
|
|
|
30
35
|
try:
|
|
31
36
|
data = await get_client().get_transcript(video_id, lang=lang, format=format)
|
|
32
37
|
except FetchTranscriptError as e:
|
|
33
|
-
|
|
38
|
+
raise ToolError(e.message) from e
|
|
34
39
|
|
|
35
40
|
if format == "text" and data.get("text"):
|
|
36
41
|
lines = []
|
|
@@ -53,7 +58,7 @@ def register_tools(mcp: FastMCP, get_client: Callable[[], FetchTranscriptClient]
|
|
|
53
58
|
try:
|
|
54
59
|
data = await get_client().list_languages(video_id)
|
|
55
60
|
except FetchTranscriptError as e:
|
|
56
|
-
|
|
61
|
+
raise ToolError(e.message) from e
|
|
57
62
|
|
|
58
63
|
langs = data.get("languages", [])
|
|
59
64
|
if not langs:
|
|
@@ -75,7 +80,7 @@ def register_tools(mcp: FastMCP, get_client: Callable[[], FetchTranscriptClient]
|
|
|
75
80
|
try:
|
|
76
81
|
data = await get_client().get_video_metadata(video_id)
|
|
77
82
|
except FetchTranscriptError as e:
|
|
78
|
-
|
|
83
|
+
raise ToolError(e.message) from e
|
|
79
84
|
|
|
80
85
|
lines = [
|
|
81
86
|
f"**{data.get('title', 'Unknown')}**",
|
|
@@ -103,7 +108,7 @@ def register_tools(mcp: FastMCP, get_client: Callable[[], FetchTranscriptClient]
|
|
|
103
108
|
try:
|
|
104
109
|
data = await get_client().get_chapters(video_id)
|
|
105
110
|
except FetchTranscriptError as e:
|
|
106
|
-
|
|
111
|
+
raise ToolError(e.message) from e
|
|
107
112
|
|
|
108
113
|
if not data.get("has_chapters"):
|
|
109
114
|
return "This video has no chapters."
|
|
@@ -126,7 +131,7 @@ def register_tools(mcp: FastMCP, get_client: Callable[[], FetchTranscriptClient]
|
|
|
126
131
|
try:
|
|
127
132
|
data = await get_client().get_comments(video_id, limit=limit)
|
|
128
133
|
except FetchTranscriptError as e:
|
|
129
|
-
|
|
134
|
+
raise ToolError(e.message) from e
|
|
130
135
|
|
|
131
136
|
comments = data.get("comments", [])
|
|
132
137
|
if not comments:
|
|
@@ -151,7 +156,7 @@ def register_tools(mcp: FastMCP, get_client: Callable[[], FetchTranscriptClient]
|
|
|
151
156
|
try:
|
|
152
157
|
data = await get_client().get_channel_info(channel_id)
|
|
153
158
|
except FetchTranscriptError as e:
|
|
154
|
-
|
|
159
|
+
raise ToolError(e.message) from e
|
|
155
160
|
|
|
156
161
|
subs = data.get("subscriber_count")
|
|
157
162
|
subs_str = f"{subs:,}" if isinstance(subs, int) else "N/A"
|
|
@@ -186,7 +191,7 @@ def register_tools(mcp: FastMCP, get_client: Callable[[], FetchTranscriptClient]
|
|
|
186
191
|
channel_id, limit=limit, offset=offset, include_shorts=include_shorts
|
|
187
192
|
)
|
|
188
193
|
except FetchTranscriptError as e:
|
|
189
|
-
|
|
194
|
+
raise ToolError(e.message) from e
|
|
190
195
|
|
|
191
196
|
videos = data.get("videos", [])
|
|
192
197
|
if not videos:
|
|
@@ -213,7 +218,7 @@ def register_tools(mcp: FastMCP, get_client: Callable[[], FetchTranscriptClient]
|
|
|
213
218
|
try:
|
|
214
219
|
data = await get_client().search_videos(query, limit=limit)
|
|
215
220
|
except FetchTranscriptError as e:
|
|
216
|
-
|
|
221
|
+
raise ToolError(e.message) from e
|
|
217
222
|
|
|
218
223
|
results = data.get("results", [])
|
|
219
224
|
if not results:
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
import pytest
|
|
6
|
+
from mcp.server.fastmcp.exceptions import ToolError
|
|
6
7
|
import respx
|
|
7
8
|
|
|
8
9
|
from fetchtranscript_mcp.client import FetchTranscriptClient
|
|
@@ -52,9 +53,8 @@ async def test_get_transcript_error(mcp_server: FastMCP):
|
|
|
52
53
|
json={"error": "video_not_found", "message": "Video not found"},
|
|
53
54
|
)
|
|
54
55
|
tools = mcp_server._tool_manager._tools
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
assert "Video not found" in result
|
|
56
|
+
with pytest.raises(ToolError, match="Video not found"):
|
|
57
|
+
await tools["get_transcript"].fn(video_id="notfound1234")
|
|
58
58
|
|
|
59
59
|
|
|
60
60
|
@pytest.mark.asyncio
|