@stophy/mcp 1.0.2 → 1.0.4

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 +93 -113
  2. package/dist/index.js +7 -7
  3. package/package.json +7 -5
package/README.md CHANGED
@@ -1,59 +1,59 @@
1
1
  # @stophy/mcp
2
2
 
3
- MCP server for Stophy's YouTube API.
3
+ YouTube data for AI agents. Transcripts, comments, search, channels, playlists — all as structured JSON through the Model Context Protocol.
4
4
 
5
- Use it to search YouTube, get transcripts, read comments, inspect channels, fetch playlists, get suggestions, and check credits from any MCP-compatible client.
5
+ ## How to connect
6
6
 
7
- You can connect in two ways:
7
+ Two ways. Pick one.
8
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.
9
+ ### Option 1: hosted HTTP (zero install)
11
10
 
12
- ## Hosted HTTP MCP
11
+ Give your MCP client this URL. Your API key goes in the path.
13
12
 
14
- Use the hosted endpoint when your MCP client supports remote HTTP servers:
15
-
16
- ```text
17
- https://mcp.stophy.dev/st_YOUR_API_KEY/mcp
13
+ ```
14
+ https://mcp.stophy.dev/$STOPHY_API_KEY/mcp
18
15
  ```
19
16
 
20
- Example client config:
17
+ MCP client config:
21
18
 
22
19
  ```json
23
20
  {
24
21
  "mcpServers": {
25
22
  "stophy": {
26
- "url": "https://mcp.stophy.dev/st_YOUR_API_KEY/mcp"
23
+ "url": "https://mcp.stophy.dev/$STOPHY_API_KEY/mcp"
27
24
  }
28
25
  }
29
26
  }
30
27
  ```
31
28
 
32
- Your API key is included in the URL path. Get a key from [stophy.dev/dashboard](https://stophy.dev/dashboard).
29
+ No install. No Node.js. Works anywhere that speaks HTTP MCP.
30
+
31
+ Get an API key at [stophy.dev/dashboard](https://stophy.dev/dashboard).
33
32
 
34
- ## Local stdio MCP
33
+ ### Option 2: run it locally (stdio)
35
34
 
36
- Use the local server when your MCP client expects a command instead of a remote URL.
35
+ Your MCP client runs `@stophy/mcp` as a local process. The API key goes in the environment.
37
36
 
38
37
  ```bash
39
- env STOPHY_API_KEY=st_YOUR_API_KEY npx -y @stophy/mcp
38
+ env STOPHY_API_KEY=$STOPHY_API_KEY npx -y @stophy/mcp
40
39
  ```
41
40
 
42
- Manual installation:
41
+ Or install it once:
43
42
 
44
43
  ```bash
45
44
  npm install -g @stophy/mcp
46
- env STOPHY_API_KEY=st_YOUR_API_KEY stophy-mcp
45
+ env STOPHY_API_KEY=$STOPHY_API_KEY stophy-mcp
47
46
  ```
48
47
 
49
- ## Client setup
48
+ ## Client configs
50
49
 
51
- ### Claude Desktop
50
+ Pick your MCP client.
52
51
 
53
- Config file locations:
52
+ ### Claude Desktop
54
53
 
55
- - macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
56
- - Windows: `%APPDATA%\Claude\claude_desktop_config.json`
54
+ File: `claude_desktop_config.json`
55
+ - macOS: `~/Library/Application Support/Claude/`
56
+ - Windows: `%APPDATA%\Claude\`
57
57
 
58
58
  ```json
59
59
  {
@@ -69,25 +69,25 @@ Config file locations:
69
69
  }
70
70
  ```
71
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.
72
+ If Claude Desktop says `spawn npx ENOENT`, Node.js is missing from PATH. Install the LTS from [nodejs.org](https://nodejs.org) and restart Claude Desktop completely.
73
73
 
74
74
  ### Claude Code
75
75
 
76
- Local stdio server:
76
+ Stdio:
77
77
 
78
78
  ```bash
79
- 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
80
  ```
81
81
 
82
- Hosted HTTP server, if your Claude Code version supports remote HTTP MCP:
82
+ HTTP (if your Claude Code version supports remote MCP):
83
83
 
84
84
  ```bash
85
- claude mcp add --transport http stophy https://mcp.stophy.dev/st_YOUR_API_KEY/mcp
85
+ claude mcp add --transport http stophy https://mcp.stophy.dev/$STOPHY_API_KEY/mcp
86
86
  ```
87
87
 
88
88
  ### Cursor
89
89
 
90
- Add this to `.cursor/mcp.json` in your project or `~/.cursor/mcp.json` globally:
90
+ File: `.cursor/mcp.json` (per project) or `~/.cursor/mcp.json` (global)
91
91
 
92
92
  ```json
93
93
  {
@@ -96,7 +96,7 @@ Add this to `.cursor/mcp.json` in your project or `~/.cursor/mcp.json` globally:
96
96
  "command": "npx",
97
97
  "args": ["-y", "@stophy/mcp"],
98
98
  "env": {
99
- "STOPHY_API_KEY": "your_api_key_here"
99
+ "STOPHY_API_KEY": "$STOPHY_API_KEY"
100
100
  }
101
101
  }
102
102
  }
@@ -105,7 +105,7 @@ Add this to `.cursor/mcp.json` in your project or `~/.cursor/mcp.json` globally:
105
105
 
106
106
  ### Windsurf
107
107
 
108
- Add this to `~/.codeium/windsurf/mcp_config.json`:
108
+ File: `~/.codeium/windsurf/mcp_config.json`
109
109
 
110
110
  ```json
111
111
  {
@@ -114,42 +114,56 @@ Add this to `~/.codeium/windsurf/mcp_config.json`:
114
114
  "command": "npx",
115
115
  "args": ["-y", "@stophy/mcp"],
116
116
  "env": {
117
- "STOPHY_API_KEY": "your_api_key_here"
117
+ "STOPHY_API_KEY": "$STOPHY_API_KEY"
118
118
  }
119
119
  }
120
120
  }
121
121
  }
122
122
  ```
123
123
 
124
- ## Tools
124
+ ### Hermes Agent
125
+
126
+ Add to `config.yaml` under `mcp_servers`:
127
+
128
+ ```yaml
129
+ mcp_servers:
130
+ - name: stophy
131
+ command: npx
132
+ args: ["-y", "@stophy/mcp"]
133
+ env:
134
+ STOPHY_API_KEY: your_api_key_here
135
+ ```
136
+
137
+ ### Any other MCP client
138
+
139
+ If your client takes a command + args + env block, use the pattern above. If it takes a URL, use the hosted endpoint.
140
+
141
+ ## Available tools
142
+
143
+ Six tools. Each call costs one credit except `stophy_get_credits` which is free.
125
144
 
126
145
  | Tool | What it does |
127
146
  |------|-------------|
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 |
134
-
135
- Each tool call costs one credit. `stophy_get_credits` is free.
147
+ | `stophy_search_videos` | Search YouTube by keyword. Returns videos, channels, playlists, or Shorts with pagination. |
148
+ | `stophy_get_video` | Get details, transcript, comments, comment replies, or live chat for one video. |
149
+ | `stophy_get_channel` | Browse a channel's videos, Shorts, playlists, or about page. |
150
+ | `stophy_get_playlist` | Fetch every video in a playlist. |
151
+ | `stophy_get_suggestions` | YouTube autocomplete for a partial query. |
152
+ | `stophy_get_credits` | Your remaining credit balance. Free. |
136
153
 
137
154
  ## Tool reference
138
155
 
139
- ### `stophy_search_videos`
156
+ ### stophy_search_videos
140
157
 
141
- Search YouTube by keyword. Use this when you need to discover videos, channels, playlists, or Shorts for a topic.
158
+ Search YouTube. Use this to discover videos on a topic or find recent uploads. Not for fetching a specific video you already have the URL for — use `stophy_get_video` instead.
142
159
 
143
160
  Arguments:
144
-
145
- - `q` (required): search query
161
+ - `q` (required): what to search for
146
162
  - `type`: `"video"`, `"short"`, `"channel"`, or `"playlist"`
147
163
  - `uploadDate`: `"hour"`, `"today"`, `"week"`, `"month"`, or `"year"`
148
164
  - `duration`: `"short"`, `"medium"`, or `"long"`
149
165
  - `sortBy`: `"relevance"`, `"popularity"`, `"date"`, or `"rating"`
150
- - `continuationToken`: token from a previous response for the next page
151
-
152
- Example:
166
+ - `continuationToken`: token from previous response for the next page
153
167
 
154
168
  ```json
155
169
  {
@@ -159,20 +173,20 @@ Example:
159
173
  }
160
174
  ```
161
175
 
162
- Returns search results with `items[]` and an optional `continuationToken`.
176
+ Returns `items[]` and an optional `continuationToken`.
163
177
 
164
- ### `stophy_get_video`
178
+ ### stophy_get_video
165
179
 
166
- Get details, transcript, comments, or replies for a known YouTube video.
180
+ Get details, transcript, comments, comment replies, or live chat for a known video.
167
181
 
168
182
  Arguments:
169
-
170
183
  - `videoUrl` (required): YouTube video URL or ID
171
- - `type` (required): `"details"`, `"transcript"`, or `"comments"`
184
+ - `type` (required): `"details"`, `"transcript"`, `"comments"`, or `"livechat"`
172
185
  - `sortBy`: `"top"` or `"latest"` for comments
173
- - `continuationToken`: next comments page, or a comment `repliesToken` to fetch replies
186
+ - `chatType`: `"top"` or `"live"` for live chat
187
+ - `continuationToken`: next page of comments, or a comment's `repliesToken` for replies
174
188
 
175
- Transcript example:
189
+ Transcript:
176
190
 
177
191
  ```json
178
192
  {
@@ -181,7 +195,7 @@ Transcript example:
181
195
  }
182
196
  ```
183
197
 
184
- Comments example:
198
+ Comments:
185
199
 
186
200
  ```json
187
201
  {
@@ -191,20 +205,17 @@ Comments example:
191
205
  }
192
206
  ```
193
207
 
194
- To read replies, call `stophy_get_video` again with `type: "comments"` and set `continuationToken` to the comment's `repliesToken`.
208
+ For comment replies, call again with `type: "comments"` and set `continuationToken` to the comment's `repliesToken`.
195
209
 
196
- ### `stophy_get_channel`
210
+ ### stophy_get_channel
197
211
 
198
- Browse a channel's content or profile.
212
+ Browse a channel.
199
213
 
200
214
  Arguments:
201
-
202
- - `channelUrl` (required): channel URL, handle, or channel ID
203
- - `tab`: `"video"`, `"short"`, `"playlist"`, or `"about"`; defaults to `"video"`
215
+ - `channelUrl` (required): channel URL, handle (@username), or channel ID
216
+ - `tab`: `"video"`, `"short"`, `"playlist"`, or `"about"` (default: `"video"`)
204
217
  - `sortBy`: `"latest"`, `"popular"`, or `"oldest"` for the video tab
205
- - `continuationToken`: token from a previous response for the next page
206
-
207
- Example:
218
+ - `continuationToken`: next page
208
219
 
209
220
  ```json
210
221
  {
@@ -214,18 +225,15 @@ Example:
214
225
  }
215
226
  ```
216
227
 
217
- The `about` tab returns profile details such as country, joined date, view count, and links.
228
+ The `about` tab returns the channel's country, join date, view count, and links.
218
229
 
219
- ### `stophy_get_playlist`
230
+ ### stophy_get_playlist
220
231
 
221
- Fetch videos from a playlist.
232
+ All videos in a playlist.
222
233
 
223
234
  Arguments:
224
-
225
235
  - `playlistUrl` (required): playlist URL or ID
226
- - `continuationToken`: token from a previous response for the next page
227
-
228
- Example:
236
+ - `continuationToken`: next page
229
237
 
230
238
  ```json
231
239
  {
@@ -233,17 +241,14 @@ Example:
233
241
  }
234
242
  ```
235
243
 
236
- ### `stophy_get_suggestions`
244
+ ### stophy_get_suggestions
237
245
 
238
- Get YouTube autocomplete suggestions for a partial query.
246
+ YouTube autocomplete. Good for topic discovery and query expansion.
239
247
 
240
248
  Arguments:
241
-
242
249
  - `q` (required): partial query
243
- - `hl`: language code, for example `en`; defaults to `en`
244
- - `gl`: region code, for example `US`; defaults to `US`
245
-
246
- Example:
250
+ - `hl`: language code, default `en`
251
+ - `gl`: region code, default `US`
247
252
 
248
253
  ```json
249
254
  {
@@ -253,31 +258,14 @@ Example:
253
258
  }
254
259
  ```
255
260
 
256
- ### `stophy_get_credits`
257
-
258
- Check your remaining credit balance. This tool does not consume a credit.
259
-
260
- Example:
261
-
262
- ```json
263
- {}
264
- ```
265
-
266
- Returns:
267
-
268
- ```json
269
- {
270
- "credits": 39152
271
- }
272
- ```
273
261
 
274
262
  ## Pagination
275
263
 
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.
264
+ Any tool that returns `continuationToken` supports pagination. Pass the token back with the same arguments to get the next page. A missing or null token means you've reached the end.
277
265
 
278
266
  ## Empty results
279
267
 
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:
268
+ When a video has no transcript, comments are off, or a comment has no replies, Stophy returns an `empty` object:
281
269
 
282
270
  ```json
283
271
  {
@@ -288,30 +276,22 @@ If a video has no transcript, comments are turned off, or a comment has no repli
288
276
  }
289
277
  ```
290
278
 
291
- Possible empty-result codes:
292
-
293
- - `EMPTY_TRANSCRIPT_SEGMENTS`
294
- - `EMPTY_COMMENTS`
295
- - `EMPTY_COMMENT_REPLIES`
279
+ Possible codes: `EMPTY_TRANSCRIPT_SEGMENTS`, `EMPTY_COMMENTS`, `EMPTY_COMMENT_REPLIES`.
296
280
 
297
281
  ## Errors
298
282
 
299
- Errors are returned as text in the MCP tool response:
283
+ Errors come back as text in the MCP tool response:
300
284
 
301
- ```text
285
+ ```
302
286
  Stophy error (UNAUTHORIZED): Invalid API key.
303
287
  ```
304
288
 
305
- ```text
289
+ ```
306
290
  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.
307
291
  ```
308
292
 
309
293
  ## Environment variables
310
294
 
311
- | Variable | Required | Description |
312
- |----------|----------|-------------|
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. |
314
-
315
- ## License
316
-
317
- MIT
295
+ | Variable | Required | What it is |
296
+ |----------|----------|-----------|
297
+ | `STOPHY_API_KEY` | Stdio only | Your Stophy API key. Not needed for hosted — the key is in the URL path. |