@stophy/mcp 1.0.0

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.
Files changed (3) hide show
  1. package/README.md +365 -0
  2. package/dist/index.js +42 -0
  3. package/package.json +51 -0
package/README.md ADDED
@@ -0,0 +1,365 @@
1
+ # @stophy/mcp
2
+
3
+ YouTube for AI Agents. Search, transcripts, comments, channels, playlists. All as MCP tool calls.
4
+
5
+ ## Quick start
6
+
7
+ ```bash
8
+ env STOPHY_API_KEY=st_YOUR_API_KEY npx -y @stophy/mcp
9
+ ```
10
+
11
+ ## Setup
12
+
13
+ Get an API key at [stophy.dev/dashboard](https://stophy.dev/dashboard).
14
+
15
+ ### Claude Desktop
16
+
17
+ `~/Library/Application Support/Claude/claude_desktop_config.json` on macOS, `%APPDATA%\Claude\claude_desktop_config.json` on Windows:
18
+
19
+ ```json
20
+ {
21
+ "mcpServers": {
22
+ "stophy": {
23
+ "command": "npx",
24
+ "args": ["-y", "@stophy/mcp"],
25
+ "env": { "STOPHY_API_KEY": "your_api_key_here" }
26
+ }
27
+ }
28
+ }
29
+ ```
30
+
31
+ ### Claude Code
32
+
33
+ ```bash
34
+ claude mcp add stophy -e STOPHY_API_KEY=your_api_key -- npx -y @stophy/mcp
35
+ ```
36
+
37
+ ### Cursor
38
+
39
+ `.cursor/mcp.json` in your project, or `~/.cursor/mcp.json` globally:
40
+
41
+ ```json
42
+ {
43
+ "mcpServers": {
44
+ "stophy": {
45
+ "command": "npx",
46
+ "args": ["-y", "@stophy/mcp"],
47
+ "env": { "STOPHY_API_KEY": "your_api_key_here" }
48
+ }
49
+ }
50
+ }
51
+ ```
52
+
53
+ ### Windsurf
54
+
55
+ `~/.codeium/windsurf/mcp_config.json`:
56
+
57
+ ```json
58
+ {
59
+ "mcpServers": {
60
+ "stophy": {
61
+ "command": "npx",
62
+ "args": ["-y", "@stophy/mcp"],
63
+ "env": { "STOPHY_API_KEY": "your_api_key_here" }
64
+ }
65
+ }
66
+ }
67
+ ```
68
+
69
+ ## Tools
70
+
71
+ ### stophy_search_videos
72
+
73
+ Search YouTube by keyword. If you already have a video URL, use `stophy_get_video` instead.
74
+
75
+ **Arguments:**
76
+
77
+ - `q` (required): search query
78
+ - `type`: `"video"` | `"short"` | `"channel"` | `"playlist"`
79
+ - `uploadDate`: `"hour"` | `"today"` | `"week"` | `"month"` | `"year"`
80
+ - `duration`: `"short"` (under 4 min) | `"medium"` (4-20 min) | `"long"` (over 20 min)
81
+ - `sortBy`: `"relevance"` | `"popularity"` | `"date"` | `"rating"`
82
+ - `continuationToken`: from the previous response to get the next page
83
+
84
+ **Example:**
85
+
86
+ ```json
87
+ {
88
+ "name": "stophy_search_videos",
89
+ "arguments": {
90
+ "q": "typescript tutorial",
91
+ "uploadDate": "week",
92
+ "type": "video"
93
+ }
94
+ }
95
+ ```
96
+
97
+ **Returns:**
98
+
99
+ ```json
100
+ {
101
+ "items": [
102
+ {
103
+ "type": "video",
104
+ "id": "zxRUQ9foH5w",
105
+ "videoUrl": "https://youtube.com/watch?v=zxRUQ9foH5w",
106
+ "title": "Running JavaScript in TypeScript React",
107
+ "author": "Nexion Analytics",
108
+ "viewCount": 6,
109
+ "duration": "4:41",
110
+ "publishedAt": "2026-05-30T13:52:55.499Z"
111
+ }
112
+ ],
113
+ "continuationToken": "4qmFsgJ..."
114
+ }
115
+ ```
116
+
117
+ ---
118
+
119
+ ### stophy_get_video
120
+
121
+ Get details, transcript, or comments for a video. If you're looking for videos on a topic, use `stophy_search_videos` instead.
122
+
123
+ **Arguments:**
124
+
125
+ - `videoUrl` (required): YouTube video URL
126
+ - `type` (required): `"details"` | `"transcript"` | `"comments"`
127
+ - `sortBy`: `"top"` | `"latest"` — for comments only
128
+ - `continuationToken`: next page of comments, or a comment's `repliesToken` to fetch its replies
129
+
130
+ **Example:**
131
+
132
+ ```json
133
+ {
134
+ "name": "stophy_get_video",
135
+ "arguments": {
136
+ "videoUrl": "https://youtube.com/watch?v=d56mG7DezGs",
137
+ "type": "transcript"
138
+ }
139
+ }
140
+ ```
141
+
142
+ **Returns (transcript):**
143
+
144
+ ```json
145
+ {
146
+ "videoId": "d56mG7DezGs",
147
+ "language": { "code": "en", "name": "en", "isAutoGenerated": true },
148
+ "segments": [
149
+ { "text": "welcome to the ultimate typescript", "start": 2.08, "duration": 3.6 }
150
+ ]
151
+ }
152
+ ```
153
+
154
+ **Returns (comments):**
155
+
156
+ ```json
157
+ {
158
+ "videoId": "d56mG7DezGs",
159
+ "sortBy": "top",
160
+ "items": [
161
+ {
162
+ "id": "UgwfjLGxYnE9fEmwwxR4AaABAg",
163
+ "text": "This was honestly just the right amount of information...",
164
+ "author": "@Ramkatral",
165
+ "likeCount": 145,
166
+ "replyCount": 5,
167
+ "repliesToken": "Eg0SC2Q1Nm1HN0RlekdzGA..."
168
+ }
169
+ ],
170
+ "continuationToken": "4qmFsgJ..."
171
+ }
172
+ ```
173
+
174
+ To read replies, call again with `type: "comments"` and `continuationToken` set to the comment's `repliesToken`.
175
+
176
+ ---
177
+
178
+ ### stophy_get_channel
179
+
180
+ Browse a channel's content. If you have a specific video URL, use `stophy_get_video` instead.
181
+
182
+ **Arguments:**
183
+
184
+ - `channelUrl` (required): `youtube.com/@handle` or `youtube.com/channel/UCxxx`
185
+ - `tab`: `"video"` (default) | `"short"` | `"playlist"` | `"about"`
186
+ - `sortBy`: `"latest"` | `"popular"` | `"oldest"` — video tab only
187
+ - `continuationToken`: from the previous response to get the next page
188
+
189
+ **Example:**
190
+
191
+ ```json
192
+ {
193
+ "name": "stophy_get_channel",
194
+ "arguments": {
195
+ "channelUrl": "https://youtube.com/@t3dotgg",
196
+ "tab": "video",
197
+ "sortBy": "latest"
198
+ }
199
+ }
200
+ ```
201
+
202
+ **Returns:**
203
+
204
+ ```json
205
+ {
206
+ "channel": {
207
+ "name": "Theo - t3.gg",
208
+ "handle": "@t3dotgg",
209
+ "subscriberCount": "539K subscribers",
210
+ "isVerified": true
211
+ },
212
+ "tab": "video",
213
+ "items": [
214
+ {
215
+ "videoUrl": "https://youtube.com/watch?v=_goOUJkkxUk",
216
+ "title": "Anthropic fights back",
217
+ "viewCount": 119000,
218
+ "duration": "28:03"
219
+ }
220
+ ],
221
+ "continuationToken": "4qmFsgLdCBIYVUNiUlAzYzc1N2xXZz..."
222
+ }
223
+ ```
224
+
225
+ The `about` tab returns the full profile — `country`, `joinedDate`, `viewCount`, `links[]` — but no `items` or `continuationToken`.
226
+
227
+ ---
228
+
229
+ ### stophy_get_playlist
230
+
231
+ Get all videos in a playlist.
232
+
233
+ **Arguments:**
234
+
235
+ - `playlistUrl` (required): `youtube.com/playlist?list=PLxxx`
236
+ - `continuationToken`: from the previous response to get the next page
237
+
238
+ **Example:**
239
+
240
+ ```json
241
+ {
242
+ "name": "stophy_get_playlist",
243
+ "arguments": {
244
+ "playlistUrl": "https://youtube.com/playlist?list=PLTjRvDozrdlxEIuOBZkMAK5uiqp8rHUax"
245
+ }
246
+ }
247
+ ```
248
+
249
+ **Returns:**
250
+
251
+ ```json
252
+ {
253
+ "playlist": {
254
+ "title": "JavaScript Tutorials",
255
+ "author": "Programming with Mosh",
256
+ "videoCount": "25"
257
+ },
258
+ "items": [
259
+ {
260
+ "videoUrl": "https://youtube.com/watch?v=upDLs1sn7g4",
261
+ "title": "What is JavaScript?",
262
+ "duration": "5:12",
263
+ "viewCount": 987000
264
+ }
265
+ ],
266
+ "continuationToken": "4qmFsgJ..."
267
+ }
268
+ ```
269
+
270
+ ---
271
+
272
+ ### stophy_get_suggestions
273
+
274
+ YouTube autocomplete for a partial query.
275
+
276
+ **Arguments:**
277
+
278
+ - `q` (required): partial query
279
+ - `hl`: language code, e.g. `en`, `fr`. Defaults to `en`
280
+ - `gl`: country code, e.g. `US`, `GB`. Defaults to `US`
281
+
282
+ **Example:**
283
+
284
+ ```json
285
+ {
286
+ "name": "stophy_get_suggestions",
287
+ "arguments": { "q": "react hooks", "hl": "en", "gl": "US" }
288
+ }
289
+ ```
290
+
291
+ **Returns:**
292
+
293
+ ```json
294
+ {
295
+ "suggestions": [
296
+ "react hooks",
297
+ "react hooks explained",
298
+ "react hooks tutorial"
299
+ ]
300
+ }
301
+ ```
302
+
303
+ ---
304
+
305
+ ### stophy_get_credits
306
+
307
+ Check your credit balance. Doesn't cost a credit.
308
+
309
+ ```json
310
+ {
311
+ "name": "stophy_get_credits",
312
+ "arguments": {}
313
+ }
314
+ ```
315
+
316
+ **Returns:**
317
+
318
+ ```json
319
+ {
320
+ "credits": 39152
321
+ }
322
+ ```
323
+
324
+ ---
325
+
326
+ ## Pagination
327
+
328
+ Any tool that returns `continuationToken` can be paged. Pass it back in the next call with the same arguments. When it's `null`, you're at the end.
329
+
330
+ ## When there's no data
331
+
332
+ If a video has no transcript, comments are turned off, or there are no replies, you get a `200` with `empty` instead of items:
333
+
334
+ ```json
335
+ {
336
+ "empty": {
337
+ "code": "EMPTY_TRANSCRIPT_SEGMENTS",
338
+ "message": "No transcript segments found."
339
+ }
340
+ }
341
+ ```
342
+
343
+ Possible codes: `EMPTY_TRANSCRIPT_SEGMENTS`, `EMPTY_COMMENTS`, `EMPTY_COMMENT_REPLIES`.
344
+
345
+ ## Errors
346
+
347
+ Errors come back as plain text in the tool response:
348
+
349
+ ```
350
+ Stophy error (UNAUTHORIZED): Invalid API key.
351
+ ```
352
+
353
+ ```
354
+ Stophy error (MISSING_API_KEY): STOPHY_API_KEY environment variable is not set. Get a key at https://stophy.dev/dashboard.
355
+ ```
356
+
357
+ ## Environment variables
358
+
359
+ | Variable | Required | Description |
360
+ |----------|----------|-------------|
361
+ | `STOPHY_API_KEY` | Yes | Your Stophy API key from stophy.dev/dashboard |
362
+
363
+ ## License
364
+
365
+ MIT