@stophy/mcp 1.0.0 → 1.0.3

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.
package/README.md CHANGED
@@ -1,20 +1,59 @@
1
1
  # @stophy/mcp
2
2
 
3
- YouTube for AI Agents. Search, transcripts, comments, channels, playlists. All as MCP tool calls.
3
+ MCP server for Stophy's YouTube API.
4
4
 
5
- ## Quick start
5
+ Use it to search YouTube, get transcripts, read comments, inspect channels, fetch playlists, get suggestions, and check credits from any MCP-compatible client.
6
+
7
+ You can connect in two ways:
8
+
9
+ - **Hosted HTTP MCP**: no install; connect directly to Stophy's hosted MCP server.
10
+ - **Local stdio MCP**: run `@stophy/mcp` locally with your API key in the environment.
11
+
12
+ ## Hosted HTTP MCP
13
+
14
+ Use the hosted endpoint when your MCP client supports remote HTTP servers:
15
+
16
+ ```text
17
+ https://mcp.stophy.dev/$STOPHY_API_KEY/mcp
18
+ ```
19
+
20
+ Example client config:
21
+
22
+ ```json
23
+ {
24
+ "mcpServers": {
25
+ "stophy": {
26
+ "url": "https://mcp.stophy.dev/$STOPHY_API_KEY/mcp"
27
+ }
28
+ }
29
+ }
30
+ ```
31
+
32
+ Your API key is included in the URL path. Get a key from [stophy.dev/dashboard](https://stophy.dev/dashboard).
33
+
34
+ ## Local stdio MCP
35
+
36
+ Use the local server when your MCP client expects a command instead of a remote URL.
6
37
 
7
38
  ```bash
8
- env STOPHY_API_KEY=st_YOUR_API_KEY npx -y @stophy/mcp
39
+ env STOPHY_API_KEY=$STOPHY_API_KEY npx -y @stophy/mcp
9
40
  ```
10
41
 
11
- ## Setup
42
+ Manual installation:
43
+
44
+ ```bash
45
+ npm install -g @stophy/mcp
46
+ env STOPHY_API_KEY=$STOPHY_API_KEY stophy-mcp
47
+ ```
12
48
 
13
- Get an API key at [stophy.dev/dashboard](https://stophy.dev/dashboard).
49
+ ## Client setup
14
50
 
15
51
  ### Claude Desktop
16
52
 
17
- `~/Library/Application Support/Claude/claude_desktop_config.json` on macOS, `%APPDATA%\Claude\claude_desktop_config.json` on Windows:
53
+ Config file locations:
54
+
55
+ - macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
56
+ - Windows: `%APPDATA%\Claude\claude_desktop_config.json`
18
57
 
19
58
  ```json
20
59
  {
@@ -22,21 +61,33 @@ Get an API key at [stophy.dev/dashboard](https://stophy.dev/dashboard).
22
61
  "stophy": {
23
62
  "command": "npx",
24
63
  "args": ["-y", "@stophy/mcp"],
25
- "env": { "STOPHY_API_KEY": "your_api_key_here" }
64
+ "env": {
65
+ "STOPHY_API_KEY": "your_api_key_here"
66
+ }
26
67
  }
27
68
  }
28
69
  }
29
70
  ```
30
71
 
72
+ If Claude Desktop shows `spawn npx ENOENT`, Node.js is not installed or is not in your PATH. Install the LTS release from [nodejs.org](https://nodejs.org), then fully restart Claude Desktop.
73
+
31
74
  ### Claude Code
32
75
 
76
+ Local stdio server:
77
+
33
78
  ```bash
34
- claude mcp add stophy -e STOPHY_API_KEY=your_api_key -- npx -y @stophy/mcp
79
+ claude mcp add stophy -e STOPHY_API_KEY=$STOPHY_API_KEY -- npx -y @stophy/mcp
80
+ ```
81
+
82
+ Hosted HTTP server, if your Claude Code version supports remote HTTP MCP:
83
+
84
+ ```bash
85
+ claude mcp add --transport http stophy https://mcp.stophy.dev/$STOPHY_API_KEY/mcp
35
86
  ```
36
87
 
37
88
  ### Cursor
38
89
 
39
- `.cursor/mcp.json` in your project, or `~/.cursor/mcp.json` globally:
90
+ Add this to `.cursor/mcp.json` in your project or `~/.cursor/mcp.json` globally:
40
91
 
41
92
  ```json
42
93
  {
@@ -44,7 +95,9 @@ claude mcp add stophy -e STOPHY_API_KEY=your_api_key -- npx -y @stophy/mcp
44
95
  "stophy": {
45
96
  "command": "npx",
46
97
  "args": ["-y", "@stophy/mcp"],
47
- "env": { "STOPHY_API_KEY": "your_api_key_here" }
98
+ "env": {
99
+ "STOPHY_API_KEY": "$STOPHY_API_KEY"
100
+ }
48
101
  }
49
102
  }
50
103
  }
@@ -52,7 +105,7 @@ claude mcp add stophy -e STOPHY_API_KEY=your_api_key -- npx -y @stophy/mcp
52
105
 
53
106
  ### Windsurf
54
107
 
55
- `~/.codeium/windsurf/mcp_config.json`:
108
+ Add this to `~/.codeium/windsurf/mcp_config.json`:
56
109
 
57
110
  ```json
58
111
  {
@@ -60,7 +113,9 @@ claude mcp add stophy -e STOPHY_API_KEY=your_api_key -- npx -y @stophy/mcp
60
113
  "stophy": {
61
114
  "command": "npx",
62
115
  "args": ["-y", "@stophy/mcp"],
63
- "env": { "STOPHY_API_KEY": "your_api_key_here" }
116
+ "env": {
117
+ "STOPHY_API_KEY": "$STOPHY_API_KEY"
118
+ }
64
119
  }
65
120
  }
66
121
  }
@@ -68,252 +123,147 @@ claude mcp add stophy -e STOPHY_API_KEY=your_api_key -- npx -y @stophy/mcp
68
123
 
69
124
  ## Tools
70
125
 
71
- ### stophy_search_videos
126
+ | Tool | What it does |
127
+ |------|-------------|
128
+ | `stophy_search_videos` | Search YouTube by keyword with optional filters |
129
+ | `stophy_get_video` | Get video details, transcript, comments, or comment replies |
130
+ | `stophy_get_channel` | Browse a channel's videos, Shorts, playlists, or about page |
131
+ | `stophy_get_playlist` | Fetch videos in a playlist |
132
+ | `stophy_get_suggestions` | Get YouTube autocomplete suggestions |
133
+ | `stophy_get_credits` | Check remaining Stophy credits |
72
134
 
73
- Search YouTube by keyword. If you already have a video URL, use `stophy_get_video` instead.
135
+ Each tool call costs one credit. `stophy_get_credits` is free.
74
136
 
75
- **Arguments:**
137
+ ## Tool reference
76
138
 
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
139
+ ### `stophy_search_videos`
83
140
 
84
- **Example:**
141
+ Search YouTube by keyword. Use this when you need to discover videos, channels, playlists, or Shorts for a topic.
85
142
 
86
- ```json
87
- {
88
- "name": "stophy_search_videos",
89
- "arguments": {
90
- "q": "typescript tutorial",
91
- "uploadDate": "week",
92
- "type": "video"
93
- }
94
- }
95
- ```
143
+ Arguments:
96
144
 
97
- **Returns:**
145
+ - `q` (required): search query
146
+ - `type`: `"video"`, `"short"`, `"channel"`, or `"playlist"`
147
+ - `uploadDate`: `"hour"`, `"today"`, `"week"`, `"month"`, or `"year"`
148
+ - `duration`: `"short"`, `"medium"`, or `"long"`
149
+ - `sortBy`: `"relevance"`, `"popularity"`, `"date"`, or `"rating"`
150
+ - `continuationToken`: token from a previous response for the next page
151
+
152
+ Example:
98
153
 
99
154
  ```json
100
155
  {
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..."
156
+ "q": "typescript tutorial",
157
+ "uploadDate": "week",
158
+ "type": "video"
114
159
  }
115
160
  ```
116
161
 
117
- ---
162
+ Returns search results with `items[]` and an optional `continuationToken`.
118
163
 
119
- ### stophy_get_video
164
+ ### `stophy_get_video`
120
165
 
121
- Get details, transcript, or comments for a video. If you're looking for videos on a topic, use `stophy_search_videos` instead.
166
+ Get details, transcript, comments, or replies for a known YouTube video.
122
167
 
123
- **Arguments:**
168
+ Arguments:
124
169
 
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
170
+ - `videoUrl` (required): YouTube video URL or ID
171
+ - `type` (required): `"details"`, `"transcript"`, or `"comments"`
172
+ - `sortBy`: `"top"` or `"latest"` for comments
173
+ - `continuationToken`: next comments page, or a comment `repliesToken` to fetch replies
129
174
 
130
- **Example:**
175
+ Transcript example:
131
176
 
132
177
  ```json
133
178
  {
134
- "name": "stophy_get_video",
135
- "arguments": {
136
- "videoUrl": "https://youtube.com/watch?v=d56mG7DezGs",
137
- "type": "transcript"
138
- }
179
+ "videoUrl": "https://youtube.com/watch?v=d56mG7DezGs",
180
+ "type": "transcript"
139
181
  }
140
182
  ```
141
183
 
142
- **Returns (transcript):**
184
+ Comments example:
143
185
 
144
186
  ```json
145
187
  {
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
- ]
188
+ "videoUrl": "https://youtube.com/watch?v=d56mG7DezGs",
189
+ "type": "comments",
190
+ "sortBy": "top"
151
191
  }
152
192
  ```
153
193
 
154
- **Returns (comments):**
194
+ To read replies, call `stophy_get_video` again with `type: "comments"` and set `continuationToken` to the comment's `repliesToken`.
155
195
 
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`.
196
+ ### `stophy_get_channel`
175
197
 
176
- ---
198
+ Browse a channel's content or profile.
177
199
 
178
- ### stophy_get_channel
200
+ Arguments:
179
201
 
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
- ```
202
+ - `channelUrl` (required): channel URL, handle, or channel ID
203
+ - `tab`: `"video"`, `"short"`, `"playlist"`, or `"about"`; defaults to `"video"`
204
+ - `sortBy`: `"latest"`, `"popular"`, or `"oldest"` for the video tab
205
+ - `continuationToken`: token from a previous response for the next page
201
206
 
202
- **Returns:**
207
+ Example:
203
208
 
204
209
  ```json
205
210
  {
206
- "channel": {
207
- "name": "Theo - t3.gg",
208
- "handle": "@t3dotgg",
209
- "subscriberCount": "539K subscribers",
210
- "isVerified": true
211
- },
211
+ "channelUrl": "https://youtube.com/@t3dotgg",
212
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..."
213
+ "sortBy": "latest"
222
214
  }
223
215
  ```
224
216
 
225
- The `about` tab returns the full profile — `country`, `joinedDate`, `viewCount`, `links[]` — but no `items` or `continuationToken`.
217
+ The `about` tab returns profile details such as country, joined date, view count, and links.
226
218
 
227
- ---
219
+ ### `stophy_get_playlist`
228
220
 
229
- ### stophy_get_playlist
221
+ Fetch videos from a playlist.
230
222
 
231
- Get all videos in a playlist.
223
+ Arguments:
232
224
 
233
- **Arguments:**
225
+ - `playlistUrl` (required): playlist URL or ID
226
+ - `continuationToken`: token from a previous response for the next page
234
227
 
235
- - `playlistUrl` (required): `youtube.com/playlist?list=PLxxx`
236
- - `continuationToken`: from the previous response to get the next page
237
-
238
- **Example:**
228
+ Example:
239
229
 
240
230
  ```json
241
231
  {
242
- "name": "stophy_get_playlist",
243
- "arguments": {
244
- "playlistUrl": "https://youtube.com/playlist?list=PLTjRvDozrdlxEIuOBZkMAK5uiqp8rHUax"
245
- }
232
+ "playlistUrl": "https://youtube.com/playlist?list=PLTjRvDozrdlxEIuOBZkMAK5uiqp8rHUax"
246
233
  }
247
234
  ```
248
235
 
249
- **Returns:**
236
+ ### `stophy_get_suggestions`
250
237
 
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.
238
+ Get YouTube autocomplete suggestions for a partial query.
275
239
 
276
- **Arguments:**
240
+ Arguments:
277
241
 
278
242
  - `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`
243
+ - `hl`: language code, for example `en`; defaults to `en`
244
+ - `gl`: region code, for example `US`; defaults to `US`
281
245
 
282
- **Example:**
246
+ Example:
283
247
 
284
248
  ```json
285
249
  {
286
- "name": "stophy_get_suggestions",
287
- "arguments": { "q": "react hooks", "hl": "en", "gl": "US" }
250
+ "q": "react hooks",
251
+ "hl": "en",
252
+ "gl": "US"
288
253
  }
289
254
  ```
290
255
 
291
- **Returns:**
292
-
293
- ```json
294
- {
295
- "suggestions": [
296
- "react hooks",
297
- "react hooks explained",
298
- "react hooks tutorial"
299
- ]
300
- }
301
- ```
256
+ ### `stophy_get_credits`
302
257
 
303
- ---
258
+ Check your remaining credit balance. This tool does not consume a credit.
304
259
 
305
- ### stophy_get_credits
306
-
307
- Check your credit balance. Doesn't cost a credit.
260
+ Example:
308
261
 
309
262
  ```json
310
- {
311
- "name": "stophy_get_credits",
312
- "arguments": {}
313
- }
263
+ {}
314
264
  ```
315
265
 
316
- **Returns:**
266
+ Returns:
317
267
 
318
268
  ```json
319
269
  {
@@ -321,15 +271,13 @@ Check your credit balance. Doesn't cost a credit.
321
271
  }
322
272
  ```
323
273
 
324
- ---
325
-
326
274
  ## Pagination
327
275
 
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.
276
+ Tools that return `continuationToken` can be paged. Pass the token back in the next call with the same arguments. When the token is missing or `null`, there is no next page.
329
277
 
330
- ## When there's no data
278
+ ## Empty results
331
279
 
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:
280
+ If a video has no transcript, comments are turned off, or a comment has no replies, Stophy returns an `empty` object instead of items:
333
281
 
334
282
  ```json
335
283
  {
@@ -340,26 +288,26 @@ If a video has no transcript, comments are turned off, or there are no replies,
340
288
  }
341
289
  ```
342
290
 
343
- Possible codes: `EMPTY_TRANSCRIPT_SEGMENTS`, `EMPTY_COMMENTS`, `EMPTY_COMMENT_REPLIES`.
291
+ Possible empty-result codes:
292
+
293
+ - `EMPTY_TRANSCRIPT_SEGMENTS`
294
+ - `EMPTY_COMMENTS`
295
+ - `EMPTY_COMMENT_REPLIES`
344
296
 
345
297
  ## Errors
346
298
 
347
- Errors come back as plain text in the tool response:
299
+ Errors are returned as text in the MCP tool response:
348
300
 
349
- ```
301
+ ```text
350
302
  Stophy error (UNAUTHORIZED): Invalid API key.
351
303
  ```
352
304
 
353
- ```
354
- Stophy error (MISSING_API_KEY): STOPHY_API_KEY environment variable is not set. Get a key at https://stophy.dev/dashboard.
305
+ ```text
306
+ Stophy error (MISSING_API_KEY): No Stophy API key provided. Set STOPHY_API_KEY (stdio) or include your key in the URL path (hosted). Get a key at https://stophy.dev/dashboard.
355
307
  ```
356
308
 
357
309
  ## Environment variables
358
310
 
359
311
  | Variable | Required | Description |
360
312
  |----------|----------|-------------|
361
- | `STOPHY_API_KEY` | Yes | Your Stophy API key from stophy.dev/dashboard |
362
-
363
- ## License
364
-
365
- MIT
313
+ | `STOPHY_API_KEY` | Local stdio only | Your Stophy API key. Not needed for the hosted endpoint because the key is included in the URL path. |