reddit-mcp-server 1.1.0 → 1.1.2
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/CHANGELOG.md +8 -2
- package/README.md +91 -62
- package/dist/bin.js +728 -1028
- package/dist/index.d.ts +1 -8
- package/dist/index.js +703 -873
- package/package.json +35 -28
- package/dist/server.d.ts +0 -5
- package/dist/server.js +0 -1754
package/CHANGELOG.md
CHANGED
|
@@ -5,30 +5,36 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
## [1.0.7] - 2025-06-27
|
|
6
6
|
|
|
7
7
|
### Fixed
|
|
8
|
+
|
|
8
9
|
- Fixed server crash issue caused by stdout pollution in bin.js
|
|
9
10
|
- Cleaned up published package to only include necessary files (reduced from 112KB to 24KB)
|
|
10
11
|
|
|
11
12
|
### Added
|
|
13
|
+
|
|
12
14
|
- Search Reddit functionality (`search_reddit` tool)
|
|
13
|
-
- Get post comments with threaded display (`get_post_comments` tool)
|
|
15
|
+
- Get post comments with threaded display (`get_post_comments` tool)
|
|
14
16
|
- Get user posts (`get_user_posts` tool)
|
|
15
17
|
- Get user comments (`get_user_comments` tool)
|
|
16
18
|
- Comprehensive test suite for all new functionality
|
|
17
19
|
|
|
18
20
|
### Changed
|
|
21
|
+
|
|
19
22
|
- Migrated from axios to native fetch API
|
|
20
23
|
- Improved error handling and removed console output that violated MCP protocol
|
|
21
24
|
|
|
22
25
|
## [1.0.6] - 2025-06-27
|
|
23
26
|
|
|
24
27
|
### Added
|
|
28
|
+
|
|
25
29
|
- New Reddit API endpoints (had packaging issues, use 1.0.7 instead)
|
|
26
30
|
|
|
27
31
|
## [1.0.5] - 2025-06-27
|
|
28
32
|
|
|
29
33
|
### Changed
|
|
34
|
+
|
|
30
35
|
- Migrated from axios to fetch for HTTP requests
|
|
31
36
|
- Fixed linting errors and improved code formatting
|
|
32
37
|
|
|
33
38
|
## [1.0.4] and earlier
|
|
34
|
-
|
|
39
|
+
|
|
40
|
+
- Previous versions with axios-based implementation
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
A Model Context Protocol (MCP) that provides tools for fetching and creating Reddit content.
|
|
4
4
|
|
|
5
|
-
> **Note**: This is a fork of the
|
|
5
|
+
> **Note**: This is a fork of the [reddit-mcp-server](https://github.com/alexandros-lekkas/reddit-mcp-server) by Alexandros Lekkas, updated with pnpm, tsup build system, and npx execution support.
|
|
6
6
|
|
|
7
7
|
## 🔧 Available Tools (Features)
|
|
8
8
|
|
|
@@ -22,18 +22,23 @@ A Model Context Protocol (MCP) that provides tools for fetching and creating Red
|
|
|
22
22
|
|
|
23
23
|
- `create_post(subreddit, title, content, is_self)` - Create a new post in a subreddit
|
|
24
24
|
- `reply_to_post(post_id, content, subreddit?)` - Post a reply to an existing Reddit post
|
|
25
|
+
- `edit_post(thing_id, new_text)` - Edit your own Reddit post (self-text posts only)
|
|
26
|
+
- `edit_comment(thing_id, new_text)` - Edit your own Reddit comment
|
|
27
|
+
- `delete_post(thing_id)` - Delete your own Reddit post
|
|
28
|
+
- `delete_comment(thing_id)` - Delete your own Reddit comment
|
|
25
29
|
|
|
26
30
|
## 🔌 Installation
|
|
27
31
|
|
|
28
32
|
### Installing via Smithery
|
|
29
33
|
|
|
30
|
-
To install Reddit Content Integration Server for Claude Desktop automatically via [Smithery](https://smithery.ai/server/@
|
|
34
|
+
To install Reddit Content Integration Server for Claude Desktop automatically via [Smithery](https://smithery.ai/server/@jordanburke/reddit-mcp-server):
|
|
31
35
|
|
|
32
36
|
```bash
|
|
33
37
|
npx -y @smithery/cli install reddit-mcp-server --client claude
|
|
34
38
|
```
|
|
35
39
|
|
|
36
40
|
### Manual Installation
|
|
41
|
+
|
|
37
42
|
1. `git clone https://github.com/jordanburke/reddit-mcp-server`
|
|
38
43
|
|
|
39
44
|
2. Create a Reddit app [here](https://www.reddit.com/prefs/apps)
|
|
@@ -84,8 +89,12 @@ If you want to write posts you need to include your `REDDIT_USERNAME` and `REDDI
|
|
|
84
89
|
"get_user_posts",
|
|
85
90
|
"get_user_comments",
|
|
86
91
|
"create_post",
|
|
87
|
-
"reply_to_post"
|
|
88
|
-
|
|
92
|
+
"reply_to_post",
|
|
93
|
+
"edit_post",
|
|
94
|
+
"edit_comment",
|
|
95
|
+
"delete_post",
|
|
96
|
+
"delete_comment"
|
|
97
|
+
] // Optional if you do not want to always approve
|
|
89
98
|
}
|
|
90
99
|
}
|
|
91
100
|
```
|
|
@@ -130,19 +139,19 @@ npx reddit-mcp-server --help
|
|
|
130
139
|
npx reddit-mcp-server --generate-token
|
|
131
140
|
```
|
|
132
141
|
|
|
133
|
-
###
|
|
142
|
+
### HTTP MCP Endpoint (FastMCP)
|
|
134
143
|
|
|
135
|
-
In addition to the standard npx execution, this server
|
|
144
|
+
In addition to the standard npx execution, this server supports HTTP transport via FastMCP for direct HTTP integration:
|
|
136
145
|
|
|
137
146
|
```bash
|
|
138
|
-
# Start the
|
|
139
|
-
|
|
147
|
+
# Start the HTTP server on port 3000 (default)
|
|
148
|
+
node dist/index.js
|
|
140
149
|
|
|
141
150
|
# Start with custom port
|
|
142
|
-
PORT=8080
|
|
151
|
+
PORT=8080 node dist/index.js
|
|
143
152
|
|
|
144
|
-
#
|
|
145
|
-
pnpm
|
|
153
|
+
# Or use the npm script
|
|
154
|
+
pnpm start
|
|
146
155
|
```
|
|
147
156
|
|
|
148
157
|
The server will be available at `http://localhost:3000` with the MCP endpoint at `http://localhost:3000/mcp`.
|
|
@@ -152,12 +161,14 @@ The server will be available at `http://localhost:3000` with the MCP endpoint at
|
|
|
152
161
|
The HTTP server supports optional OAuth protection to secure your endpoints:
|
|
153
162
|
|
|
154
163
|
**Generate a secure token:**
|
|
164
|
+
|
|
155
165
|
```bash
|
|
156
166
|
npx reddit-mcp-server --generate-token
|
|
157
167
|
# Output: Generated OAuth token: A8f2Kp9x3NmQ7vR4tL6eZ1sW5yB8hC2j
|
|
158
168
|
```
|
|
159
169
|
|
|
160
170
|
**Enable OAuth with generated token:**
|
|
171
|
+
|
|
161
172
|
```bash
|
|
162
173
|
export OAUTH_ENABLED=true
|
|
163
174
|
export OAUTH_TOKEN="A8f2Kp9x3NmQ7vR4tL6eZ1sW5yB8hC2j"
|
|
@@ -165,6 +176,7 @@ pnpm serve
|
|
|
165
176
|
```
|
|
166
177
|
|
|
167
178
|
**Make authenticated requests:**
|
|
179
|
+
|
|
168
180
|
```bash
|
|
169
181
|
curl -H "Authorization: Bearer A8f2Kp9x3NmQ7vR4tL6eZ1sW5yB8hC2j" \
|
|
170
182
|
-H "Content-Type: application/json" \
|
|
@@ -173,6 +185,7 @@ curl -H "Authorization: Bearer A8f2Kp9x3NmQ7vR4tL6eZ1sW5yB8hC2j" \
|
|
|
173
185
|
```
|
|
174
186
|
|
|
175
187
|
**OAuth Configuration:**
|
|
188
|
+
|
|
176
189
|
- `OAUTH_ENABLED=true` - Enables OAuth protection (disabled by default)
|
|
177
190
|
- `OAUTH_TOKEN=your-token` - Your custom token (or use `--generate-token`)
|
|
178
191
|
- Without OAuth, the server is accessible without authentication
|
|
@@ -183,61 +196,68 @@ curl -H "Authorization: Bearer A8f2Kp9x3NmQ7vR4tL6eZ1sW5yB8hC2j" \
|
|
|
183
196
|
For MCP clients connecting to an OAuth-protected server, configure according to the [MCP Authorization specification](https://modelcontextprotocol.io/specification/draft/basic/authorization):
|
|
184
197
|
|
|
185
198
|
**HTTP-based MCP Clients (e.g., web applications):**
|
|
199
|
+
|
|
186
200
|
```javascript
|
|
187
201
|
// Example using fetch API
|
|
188
|
-
const response = await fetch(
|
|
189
|
-
method:
|
|
202
|
+
const response = await fetch("http://localhost:3000/mcp", {
|
|
203
|
+
method: "POST",
|
|
190
204
|
headers: {
|
|
191
|
-
|
|
192
|
-
|
|
205
|
+
Authorization: "Bearer YOUR_TOKEN",
|
|
206
|
+
"Content-Type": "application/json",
|
|
193
207
|
},
|
|
194
208
|
body: JSON.stringify({
|
|
195
209
|
jsonrpc: "2.0",
|
|
196
210
|
id: 1,
|
|
197
211
|
method: "tools/list",
|
|
198
|
-
params: {}
|
|
199
|
-
})
|
|
200
|
-
})
|
|
212
|
+
params: {},
|
|
213
|
+
}),
|
|
214
|
+
})
|
|
201
215
|
|
|
202
|
-
const result = await response.json()
|
|
216
|
+
const result = await response.json()
|
|
203
217
|
```
|
|
204
218
|
|
|
205
219
|
**Direct HTTP MCP Client:**
|
|
220
|
+
|
|
206
221
|
```javascript
|
|
207
222
|
const client = new MCP.Client({
|
|
208
223
|
transport: new MCP.HTTPTransport({
|
|
209
|
-
url:
|
|
224
|
+
url: "http://localhost:3000/mcp",
|
|
210
225
|
headers: {
|
|
211
|
-
|
|
212
|
-
}
|
|
213
|
-
})
|
|
214
|
-
})
|
|
226
|
+
Authorization: "Bearer YOUR_TOKEN",
|
|
227
|
+
},
|
|
228
|
+
}),
|
|
229
|
+
})
|
|
215
230
|
```
|
|
216
231
|
|
|
217
232
|
**Custom MCP Client Implementation:**
|
|
233
|
+
|
|
218
234
|
```typescript
|
|
219
|
-
import { Client } from
|
|
220
|
-
import { HTTPTransport } from
|
|
235
|
+
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
|
|
236
|
+
import { HTTPTransport } from "@modelcontextprotocol/sdk/client/http.js"
|
|
221
237
|
|
|
222
238
|
const transport = new HTTPTransport({
|
|
223
|
-
url:
|
|
239
|
+
url: "http://localhost:3000/mcp",
|
|
224
240
|
headers: {
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
}
|
|
228
|
-
})
|
|
241
|
+
Authorization: "Bearer YOUR_TOKEN",
|
|
242
|
+
"Content-Type": "application/json",
|
|
243
|
+
},
|
|
244
|
+
})
|
|
229
245
|
|
|
230
|
-
const client = new Client(
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
246
|
+
const client = new Client(
|
|
247
|
+
{
|
|
248
|
+
name: "reddit-client",
|
|
249
|
+
version: "1.0.0",
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
capabilities: {},
|
|
253
|
+
},
|
|
254
|
+
)
|
|
236
255
|
|
|
237
|
-
await client.connect(transport)
|
|
256
|
+
await client.connect(transport)
|
|
238
257
|
```
|
|
239
258
|
|
|
240
259
|
**Important Notes:**
|
|
260
|
+
|
|
241
261
|
- Replace `YOUR_TOKEN` with your generated OAuth token
|
|
242
262
|
- Authorization header MUST be included in every request to `/mcp`
|
|
243
263
|
- Tokens MUST NOT be included in URI query strings per MCP specification
|
|
@@ -248,54 +268,59 @@ When connecting to a remote Reddit MCP server (e.g., deployed on your infrastruc
|
|
|
248
268
|
|
|
249
269
|
```javascript
|
|
250
270
|
// Production server with OAuth
|
|
251
|
-
const response = await fetch(
|
|
252
|
-
method:
|
|
271
|
+
const response = await fetch("https://your-server.com/mcp", {
|
|
272
|
+
method: "POST",
|
|
253
273
|
headers: {
|
|
254
|
-
|
|
255
|
-
|
|
274
|
+
Authorization: "Bearer YOUR_TOKEN",
|
|
275
|
+
"Content-Type": "application/json",
|
|
256
276
|
},
|
|
257
277
|
body: JSON.stringify({
|
|
258
278
|
jsonrpc: "2.0",
|
|
259
279
|
id: 1,
|
|
260
280
|
method: "tools/list",
|
|
261
|
-
params: {}
|
|
262
|
-
})
|
|
263
|
-
})
|
|
281
|
+
params: {},
|
|
282
|
+
}),
|
|
283
|
+
})
|
|
264
284
|
```
|
|
265
285
|
|
|
266
286
|
**MCP Client Configuration for Remote Server:**
|
|
287
|
+
|
|
267
288
|
```typescript
|
|
268
|
-
import { Client } from
|
|
269
|
-
import { HTTPTransport } from
|
|
289
|
+
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
|
|
290
|
+
import { HTTPTransport } from "@modelcontextprotocol/sdk/client/http.js"
|
|
270
291
|
|
|
271
292
|
// For your deployed server
|
|
272
293
|
const transport = new HTTPTransport({
|
|
273
|
-
url:
|
|
294
|
+
url: "https://your-reddit-mcp.company.com/mcp",
|
|
274
295
|
headers: {
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
}
|
|
278
|
-
})
|
|
296
|
+
Authorization: "Bearer YOUR_GENERATED_TOKEN",
|
|
297
|
+
"Content-Type": "application/json",
|
|
298
|
+
},
|
|
299
|
+
})
|
|
279
300
|
|
|
280
|
-
const client = new Client(
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
301
|
+
const client = new Client(
|
|
302
|
+
{
|
|
303
|
+
name: "reddit-client",
|
|
304
|
+
version: "1.0.0",
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
capabilities: {},
|
|
308
|
+
},
|
|
309
|
+
)
|
|
286
310
|
|
|
287
|
-
await client.connect(transport)
|
|
311
|
+
await client.connect(transport)
|
|
288
312
|
```
|
|
289
313
|
|
|
290
314
|
**Claude Desktop/Cursor with Remote Server (HTTP):**
|
|
291
315
|
For remote servers, you can use a proxy approach:
|
|
316
|
+
|
|
292
317
|
```json
|
|
293
318
|
{
|
|
294
319
|
"mcpServers": {
|
|
295
320
|
"reddit-remote": {
|
|
296
321
|
"command": "node",
|
|
297
322
|
"args": [
|
|
298
|
-
"-e",
|
|
323
|
+
"-e",
|
|
299
324
|
"const http = require('https'); const req = http.request('https://your-server.com/mcp', {method:'POST',headers:{'Authorization':'Bearer YOUR_TOKEN','Content-Type':'application/json'}}, res => res.pipe(process.stdout)); process.stdin.pipe(req);"
|
|
300
325
|
],
|
|
301
326
|
"env": {}
|
|
@@ -306,6 +331,7 @@ For remote servers, you can use a proxy approach:
|
|
|
306
331
|
|
|
307
332
|
**For Claude Desktop/Cursor (stdio transport):**
|
|
308
333
|
OAuth is not applicable when using the traditional npx execution method. Use the stdio configuration instead:
|
|
334
|
+
|
|
309
335
|
```json
|
|
310
336
|
{
|
|
311
337
|
"mcpServers": {
|
|
@@ -326,12 +352,14 @@ OAuth is not applicable when using the traditional npx execution method. Use the
|
|
|
326
352
|
**Deploy to your infrastructure and share the URL:**
|
|
327
353
|
|
|
328
354
|
1. **Generate secure token:**
|
|
355
|
+
|
|
329
356
|
```bash
|
|
330
357
|
npx reddit-mcp-server --generate-token
|
|
331
358
|
# Output: Generated OAuth token: xyz123abc456def789
|
|
332
359
|
```
|
|
333
360
|
|
|
334
361
|
2. **Deploy with Docker on your server:**
|
|
362
|
+
|
|
335
363
|
```bash
|
|
336
364
|
docker run -d \
|
|
337
365
|
--name reddit-mcp \
|
|
@@ -344,6 +372,7 @@ OAuth is not applicable when using the traditional npx execution method. Use the
|
|
|
344
372
|
```
|
|
345
373
|
|
|
346
374
|
3. **Share with your team:**
|
|
375
|
+
|
|
347
376
|
```
|
|
348
377
|
Server URL: https://your-server.com/mcp
|
|
349
378
|
OAuth Token: xyz123abc456def789
|
|
@@ -359,7 +388,7 @@ OAuth is not applicable when using the traditional npx execution method. Use the
|
|
|
359
388
|
await client.connect(transport);
|
|
360
389
|
```
|
|
361
390
|
|
|
362
|
-
This allows integration with systems that support HTTP-based MCP communication
|
|
391
|
+
This allows integration with systems that support HTTP-based MCP communication via the FastMCP framework.
|
|
363
392
|
|
|
364
393
|
## 🐳 Docker Usage
|
|
365
394
|
|
|
@@ -432,7 +461,7 @@ docker run -d \
|
|
|
432
461
|
### Docker Compose Example
|
|
433
462
|
|
|
434
463
|
```yaml
|
|
435
|
-
version:
|
|
464
|
+
version: "3.8"
|
|
436
465
|
|
|
437
466
|
services:
|
|
438
467
|
reddit-mcp:
|