@stophy/mcp 1.0.5 → 2.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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Stophy
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.
package/README.md CHANGED
@@ -1,111 +1,84 @@
1
- # @stophy/mcp
1
+ # Stophy MCP
2
2
 
3
- YouTube data for AI agents. Transcripts, comments, search, channels, playlists — all as structured JSON through the Model Context Protocol.
3
+ Give your AI agent public web data: web search, YouTube, Reddit, TikTok, Instagram, LinkedIn, maps, shopping, jobs, real estate, finance, and more. Your agent reaches every Stophy endpoint through three MCP tools.
4
4
 
5
- ## How to connect
5
+ ## Connect to the hosted server
6
6
 
7
- Two ways. Pick one.
7
+ Most apps can connect to the hosted server directly. There is nothing to install.
8
8
 
9
- ### Option 1: hosted HTTP (zero install)
9
+ | URL | How you connect | What your agent can use |
10
+ | --- | --- | --- |
11
+ | `https://api.stophy.dev/mcp` | No key | The free endpoints: web search, YouTube search, and YouTube transcripts |
12
+ | `https://api.stophy.dev/mcp` | `Authorization: Bearer <key>` header | Every endpoint |
13
+ | `https://api.stophy.dev/mcp-oauth` | Sign in with your browser | Every endpoint |
10
14
 
11
- Give your MCP client this URL. Your API key goes in the path.
15
+ Get an API key at [stophy.dev/signup](https://stophy.dev/signup).
12
16
 
13
- ```
14
- https://mcp.stophy.dev/$STOPHY_API_KEY/mcp
15
- ```
17
+ ### Claude Code
16
18
 
17
- MCP client config:
19
+ To sign in with your browser, add the server, then run `/mcp` and choose **Authenticate**:
18
20
 
19
- ```json
20
- {
21
- "mcpServers": {
22
- "stophy": {
23
- "url": "https://mcp.stophy.dev/$STOPHY_API_KEY/mcp"
24
- }
25
- }
26
- }
21
+ ```bash
22
+ claude mcp add --transport http stophy https://api.stophy.dev/mcp-oauth
27
23
  ```
28
24
 
29
- No install. No Node.js. Works anywhere that speaks HTTP MCP.
25
+ To use an API key:
30
26
 
31
- Get an API key at [stophy.dev/dashboard](https://stophy.dev/dashboard).
32
-
33
- ### Option 2: run it locally (stdio)
27
+ ```bash
28
+ claude mcp add --transport http stophy https://api.stophy.dev/mcp --header "Authorization: Bearer <key>"
29
+ ```
34
30
 
35
- Your MCP client runs `@stophy/mcp` as a local process. The API key goes in the environment.
31
+ To start without a key:
36
32
 
37
33
  ```bash
38
- env STOPHY_API_KEY=$STOPHY_API_KEY npx -y @stophy/mcp
34
+ claude mcp add --transport http stophy https://api.stophy.dev/mcp
39
35
  ```
40
36
 
41
- Or install it once:
37
+ ### Codex
38
+
39
+ To use the key in your `STOPHY_API_KEY` environment variable:
42
40
 
43
41
  ```bash
44
- npm install -g @stophy/mcp
45
- env STOPHY_API_KEY=$STOPHY_API_KEY stophy-mcp
42
+ codex mcp add stophy --url https://api.stophy.dev/mcp --bearer-token-env-var STOPHY_API_KEY
46
43
  ```
47
44
 
48
- ## Client configs
45
+ To sign in with your browser instead, add the sign-in URL, then log in:
49
46
 
50
- Pick your MCP client.
47
+ ```bash
48
+ codex mcp add stophy --url https://api.stophy.dev/mcp-oauth
49
+ codex mcp login stophy
50
+ ```
51
51
 
52
- ### Claude Desktop
52
+ ### Cursor
53
53
 
54
- File: `claude_desktop_config.json`
55
- - macOS: `~/Library/Application Support/Claude/`
56
- - Windows: `%APPDATA%\Claude\`
54
+ Add this to `.cursor/mcp.json`:
57
55
 
58
56
  ```json
59
57
  {
60
58
  "mcpServers": {
61
59
  "stophy": {
62
- "command": "npx",
63
- "args": ["-y", "@stophy/mcp"],
64
- "env": {
65
- "STOPHY_API_KEY": "your_api_key_here"
66
- }
60
+ "url": "https://api.stophy.dev/mcp",
61
+ "headers": { "Authorization": "Bearer <key>" }
67
62
  }
68
63
  }
69
64
  }
70
65
  ```
71
66
 
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.
67
+ To start without a key, leave out `headers`.
73
68
 
74
- ### Claude Code
69
+ ## Run it as a local server
75
70
 
76
- Stdio:
71
+ Some apps can only start a local MCP server. For those, use this package. It runs on your computer and passes every request to the hosted server, so it always has the same tools.
77
72
 
78
73
  ```bash
79
- claude mcp add stophy -e STOPHY_API_KEY=$STOPHY_API_KEY -- npx -y @stophy/mcp
74
+ npx -y @stophy/mcp
80
75
  ```
81
76
 
82
- HTTP (if your Claude Code version supports remote MCP):
83
-
84
- ```bash
85
- claude mcp add --transport http stophy https://mcp.stophy.dev/$STOPHY_API_KEY/mcp
86
- ```
87
-
88
- ### Cursor
89
-
90
- File: `.cursor/mcp.json` (per project) or `~/.cursor/mcp.json` (global)
77
+ With `STOPHY_API_KEY` set, your agent can use every endpoint. Without it, your agent gets the free endpoints.
91
78
 
92
- ```json
93
- {
94
- "mcpServers": {
95
- "stophy": {
96
- "command": "npx",
97
- "args": ["-y", "@stophy/mcp"],
98
- "env": {
99
- "STOPHY_API_KEY": "$STOPHY_API_KEY"
100
- }
101
- }
102
- }
103
- }
104
- ```
105
-
106
- ### Windsurf
79
+ ### Claude Desktop
107
80
 
108
- File: `~/.codeium/windsurf/mcp_config.json`
81
+ Add this to `claude_desktop_config.json`, then restart Claude Desktop:
109
82
 
110
83
  ```json
111
84
  {
@@ -113,185 +86,36 @@ File: `~/.codeium/windsurf/mcp_config.json`
113
86
  "stophy": {
114
87
  "command": "npx",
115
88
  "args": ["-y", "@stophy/mcp"],
116
- "env": {
117
- "STOPHY_API_KEY": "$STOPHY_API_KEY"
118
- }
89
+ "env": { "STOPHY_API_KEY": "<key>" }
119
90
  }
120
91
  }
121
92
  }
122
93
  ```
123
94
 
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
95
+ To start without a key, leave out `env`.
138
96
 
139
- If your client takes a command + args + env block, use the pattern above. If it takes a URL, use the hosted endpoint.
97
+ The package needs Node.js 18 or later.
140
98
 
141
- ## Available tools
99
+ | Variable | What it does |
100
+ | --- | --- |
101
+ | `STOPHY_API_KEY` | Your Stophy API key. Optional. |
102
+ | `STOPHY_MCP_URL` | The server to connect to. The default is `https://api.stophy.dev/mcp`. |
142
103
 
143
- Six tools. Each call costs one credit except `stophy_get_credits` which is free.
104
+ ## Tools
144
105
 
145
106
  | Tool | What it does |
146
- |------|-------------|
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. |
153
-
154
- ## Tool reference
155
-
156
- ### stophy_search_videos
157
-
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.
159
-
160
- Arguments:
161
- - `q` (required): what to search for
162
- - `type`: `"video"`, `"short"`, `"channel"`, or `"playlist"`
163
- - `uploadDate`: `"hour"`, `"today"`, `"week"`, `"month"`, or `"year"`
164
- - `duration`: `"short"`, `"medium"`, or `"long"`
165
- - `sortBy`: `"relevance"`, `"popularity"`, `"date"`, or `"rating"`
166
- - `continuationToken`: token from previous response for the next page
167
-
168
- ```json
169
- {
170
- "q": "typescript tutorial",
171
- "uploadDate": "week",
172
- "type": "video"
173
- }
174
- ```
175
-
176
- Returns `items[]` and an optional `continuationToken`.
177
-
178
- ### stophy_get_video
179
-
180
- Get details, transcript, comments, comment replies, or live chat for a known video.
107
+ | --- | --- |
108
+ | `stophy_search_endpoints` | Finds the endpoint for a task, with its cost |
109
+ | `stophy_describe_endpoint` | Shows the input an endpoint takes and whether it has more pages |
110
+ | `stophy_call` | Runs an endpoint and returns markdown, or JSON when you ask for it |
181
111
 
182
- Arguments:
183
- - `videoUrl` (required): YouTube video URL or ID
184
- - `type` (required): `"details"`, `"transcript"`, `"comments"`, or `"livechat"`
185
- - `sortBy`: `"top"` or `"latest"` for comments
186
- - `chatType`: `"top"` or `"live"` for live chat
187
- - `continuationToken`: next page of comments, or a comment's `repliesToken` for replies
112
+ Your agent usually searches, then describes, then calls. Each result says how many credits it used.
188
113
 
189
- Transcript:
114
+ ## More
190
115
 
191
- ```json
192
- {
193
- "videoUrl": "https://youtube.com/watch?v=d56mG7DezGs",
194
- "type": "transcript"
195
- }
196
- ```
197
-
198
- Comments:
199
-
200
- ```json
201
- {
202
- "videoUrl": "https://youtube.com/watch?v=d56mG7DezGs",
203
- "type": "comments",
204
- "sortBy": "top"
205
- }
206
- ```
207
-
208
- For comment replies, call again with `type: "comments"` and set `continuationToken` to the comment's `repliesToken`.
209
-
210
- ### stophy_get_channel
211
-
212
- Browse a channel.
213
-
214
- Arguments:
215
- - `channelUrl` (required): channel URL, handle (@username), or channel ID
216
- - `tab`: `"video"`, `"short"`, `"playlist"`, or `"about"` (default: `"video"`)
217
- - `sortBy`: `"latest"`, `"popular"`, or `"oldest"` for the video tab
218
- - `continuationToken`: next page
219
-
220
- ```json
221
- {
222
- "channelUrl": "https://youtube.com/@t3dotgg",
223
- "tab": "video",
224
- "sortBy": "latest"
225
- }
226
- ```
227
-
228
- The `about` tab returns the channel's country, join date, view count, and links.
229
-
230
- ### stophy_get_playlist
231
-
232
- All videos in a playlist.
233
-
234
- Arguments:
235
- - `playlistUrl` (required): playlist URL or ID
236
- - `continuationToken`: next page
237
-
238
- ```json
239
- {
240
- "playlistUrl": "https://youtube.com/playlist?list=PLTjRvDozrdlxEIuOBZkMAK5uiqp8rHUax"
241
- }
242
- ```
243
-
244
- ### stophy_get_suggestions
245
-
246
- YouTube autocomplete. Good for topic discovery and query expansion.
247
-
248
- Arguments:
249
- - `q` (required): partial query
250
- - `hl`: language code, default `en`
251
- - `gl`: region code, default `US`
252
-
253
- ```json
254
- {
255
- "q": "react hooks",
256
- "hl": "en",
257
- "gl": "US"
258
- }
259
- ```
260
-
261
-
262
- ## Pagination
263
-
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.
265
-
266
- ## Empty results
267
-
268
- When a video has no transcript, comments are off, or a comment has no replies, Stophy returns an `empty` object:
269
-
270
- ```json
271
- {
272
- "empty": {
273
- "code": "EMPTY_TRANSCRIPT_SEGMENTS",
274
- "message": "No transcript segments found."
275
- }
276
- }
277
- ```
278
-
279
- Possible codes: `EMPTY_TRANSCRIPT_SEGMENTS`, `EMPTY_COMMENTS`, `EMPTY_COMMENT_REPLIES`.
280
-
281
- ## Errors
282
-
283
- Errors come back as text in the MCP tool response:
284
-
285
- ```
286
- Stophy error (UNAUTHORIZED): Invalid API key.
287
- ```
288
-
289
- ```
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.
291
- ```
116
+ - [Stophy docs](https://docs.stophy.dev)
117
+ - [Dashboard and API keys](https://stophy.dev/dashboard)
292
118
 
293
- ## Environment variables
119
+ ## License
294
120
 
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. |
121
+ MIT