reddit-mcp-server 1.1.2 → 1.2.1
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 +194 -367
- package/dist/bin.d.ts +1 -1
- package/dist/bin.js +21 -1573
- package/dist/bin.js.map +1 -0
- package/dist/chunk-kSYXY2_d.js +34 -0
- package/dist/index.d.ts +1 -2
- package/dist/index.js +1255 -1294
- package/dist/index.js.map +1 -0
- package/package.json +27 -30
package/README.md
CHANGED
|
@@ -1,468 +1,289 @@
|
|
|
1
|
-
# Reddit MCP Server
|
|
1
|
+
# Reddit MCP Server
|
|
2
2
|
|
|
3
|
-
A Model Context Protocol (MCP)
|
|
3
|
+
A Model Context Protocol (MCP) server for interacting with Reddit - fetch posts, comments, user info, and **create content**.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[](https://www.npmjs.com/package/reddit-mcp-server)
|
|
6
|
+
[](https://www.npmjs.com/package/reddit-mcp-server)
|
|
7
|
+
[](https://github.com/jordanburke/reddit-mcp-server/stargazers)
|
|
8
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
9
|
|
|
7
|
-
|
|
10
|
+
<a href="https://glama.ai/mcp/servers/@jordanburke/reddit-mcp-server">
|
|
11
|
+
<img width="380" height="200" src="https://glama.ai/mcp/servers/@jordanburke/reddit-mcp-server/badge" alt="reddit-mcp-server MCP server" />
|
|
12
|
+
</a>
|
|
8
13
|
|
|
9
|
-
|
|
14
|
+
## Features at a Glance
|
|
10
15
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
| Feature | reddit-mcp-server | Other Reddit MCPs |
|
|
17
|
+
| ------------------------------- | :----------------: | :----------------: |
|
|
18
|
+
| **Create Posts** | :white_check_mark: | :x: |
|
|
19
|
+
| **Reply to Posts/Comments** | :white_check_mark: | :x: |
|
|
20
|
+
| **Edit Posts/Comments** | :white_check_mark: | :x: |
|
|
21
|
+
| **Delete Posts/Comments** | :white_check_mark: | :x: |
|
|
22
|
+
| **Spam Protection (Safe Mode)** | :white_check_mark: | :x: |
|
|
23
|
+
| Browse Subreddits | :white_check_mark: | :white_check_mark: |
|
|
24
|
+
| Search Reddit | :white_check_mark: | :white_check_mark: |
|
|
25
|
+
| User Analysis | :white_check_mark: | :white_check_mark: |
|
|
26
|
+
| Post Comments | :white_check_mark: | :white_check_mark: |
|
|
27
|
+
| Zero-Setup Anonymous Mode | :white_check_mark: | :white_check_mark: |
|
|
28
|
+
| Three-Tier Auth (10/60/100 rpm) | :white_check_mark: | :white_check_mark: |
|
|
20
29
|
|
|
21
|
-
|
|
30
|
+
## Quick Start
|
|
22
31
|
|
|
23
|
-
|
|
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
|
|
32
|
+
### Option 1: Claude Desktop Extension (Easiest)
|
|
29
33
|
|
|
30
|
-
|
|
34
|
+
Download and open the extension file - Claude Desktop will install it automatically:
|
|
31
35
|
|
|
32
|
-
|
|
36
|
+
**[Download reddit-mcp-server.mcpb](https://github.com/jordanburke/reddit-mcp-server/releases/latest/download/reddit-mcp-server.mcpb)**
|
|
33
37
|
|
|
34
|
-
|
|
38
|
+
### Option 2: NPX (No install required)
|
|
35
39
|
|
|
36
40
|
```bash
|
|
37
|
-
npx
|
|
41
|
+
npx reddit-mcp-server
|
|
38
42
|
```
|
|
39
43
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
1. `git clone https://github.com/jordanburke/reddit-mcp-server`
|
|
43
|
-
|
|
44
|
-
2. Create a Reddit app [here](https://www.reddit.com/prefs/apps)
|
|
45
|
-
|
|
46
|
-

|
|
47
|
-
|
|
48
|
-
Make sure to select "script"!
|
|
49
|
-
|
|
50
|
-
3. Copy the client ID and client secret
|
|
51
|
-
|
|
52
|
-
4. Create a `.env` file based on `.env.example`
|
|
53
|
-
|
|
54
|
-
Do this with your `REDDIT_CLIENT_ID` and `REDDIT_CLIENT_SECRET`
|
|
55
|
-
|
|
56
|
-
If you want to write posts you need to include your `REDDIT_USERNAME` and `REDDIT_PASSWORD`
|
|
57
|
-
|
|
58
|
-
5. Install dependencies with `pnpm install`
|
|
59
|
-
|
|
60
|
-
6. Build the project with `pnpm build`
|
|
61
|
-
|
|
62
|
-
7. Run with `pnpm dev` and open the inspection server (http://127.0.0.1:6274/)
|
|
63
|
-
|
|
64
|
-

|
|
65
|
-
|
|
66
|
-
8. If the connection works, add this to your MCP config (for Cursor or Claude Desktop)
|
|
44
|
+
Or add to your MCP config (Claude Desktop, Cursor, etc.):
|
|
67
45
|
|
|
68
46
|
```json
|
|
47
|
+
{
|
|
69
48
|
"mcpServers": {
|
|
70
49
|
"reddit": {
|
|
71
50
|
"command": "npx",
|
|
72
|
-
"args": [
|
|
73
|
-
"reddit-mcp-server"
|
|
74
|
-
],
|
|
75
|
-
"env": {
|
|
76
|
-
"REDDIT_CLIENT_ID": "<YOUR_CLIENT_ID>",
|
|
77
|
-
"REDDIT_CLIENT_SECRET": "<YOUR_CLIENT_SECRET>",
|
|
78
|
-
"REDDIT_USERNAME": "<YOUR_USERNAME_OPTIONAL>",
|
|
79
|
-
"REDDIT_PASSWORD": "<YOUR_PASSWORD_OPTIONAL>"
|
|
80
|
-
},
|
|
81
|
-
"autoApprove": [
|
|
82
|
-
"get_reddit_post",
|
|
83
|
-
"get_top_posts",
|
|
84
|
-
"get_user_info",
|
|
85
|
-
"get_subreddit_info",
|
|
86
|
-
"get_trending_subreddits",
|
|
87
|
-
"search_reddit",
|
|
88
|
-
"get_post_comments",
|
|
89
|
-
"get_user_posts",
|
|
90
|
-
"get_user_comments",
|
|
91
|
-
"create_post",
|
|
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
|
|
51
|
+
"args": ["reddit-mcp-server"]
|
|
98
52
|
}
|
|
99
53
|
}
|
|
54
|
+
}
|
|
100
55
|
```
|
|
101
56
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
### Commands
|
|
57
|
+
### Option 3: Claude Code
|
|
105
58
|
|
|
106
59
|
```bash
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
# Build TypeScript to JavaScript
|
|
111
|
-
pnpm build
|
|
60
|
+
claude mcp add --transport stdio reddit -- npx reddit-mcp-server
|
|
61
|
+
```
|
|
112
62
|
|
|
113
|
-
|
|
114
|
-
pnpm inspect
|
|
63
|
+
## Features
|
|
115
64
|
|
|
116
|
-
|
|
117
|
-
pnpm dev
|
|
65
|
+
### Read-only Tools
|
|
118
66
|
|
|
119
|
-
|
|
120
|
-
|
|
67
|
+
| Tool | Description |
|
|
68
|
+
| ------------------------- | --------------------------------------------------- |
|
|
69
|
+
| `get_reddit_post` | Get a specific Reddit post with engagement analysis |
|
|
70
|
+
| `get_top_posts` | Get top posts from a subreddit or home feed |
|
|
71
|
+
| `get_user_info` | Get detailed information about a Reddit user |
|
|
72
|
+
| `get_user_posts` | Get posts submitted by a specific user |
|
|
73
|
+
| `get_user_comments` | Get comments made by a specific user |
|
|
74
|
+
| `get_subreddit_info` | Get subreddit details and statistics |
|
|
75
|
+
| `get_trending_subreddits` | Get currently trending subreddits |
|
|
76
|
+
| `get_post_comments` | Get comments from a specific post with threading |
|
|
77
|
+
| `search_reddit` | Search for posts across Reddit |
|
|
121
78
|
|
|
122
|
-
|
|
123
|
-
pnpm lint
|
|
79
|
+
### Write Tools (Require User Credentials)
|
|
124
80
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
81
|
+
| Tool | Description |
|
|
82
|
+
| ---------------- | ------------------------------------------- |
|
|
83
|
+
| `create_post` | Create a new post in a subreddit |
|
|
84
|
+
| `reply_to_post` | Post a reply to an existing post or comment |
|
|
85
|
+
| `edit_post` | Edit your own Reddit post (self-text only) |
|
|
86
|
+
| `edit_comment` | Edit your own Reddit comment |
|
|
87
|
+
| `delete_post` | Permanently delete your own post |
|
|
88
|
+
| `delete_comment` | Permanently delete your own comment |
|
|
128
89
|
|
|
129
|
-
|
|
90
|
+
## Configuration
|
|
130
91
|
|
|
131
|
-
|
|
132
|
-
# Check version
|
|
133
|
-
npx reddit-mcp-server --version
|
|
92
|
+
### Environment Variables
|
|
134
93
|
|
|
135
|
-
|
|
136
|
-
|
|
94
|
+
| Variable | Required | Default | Description |
|
|
95
|
+
| ---------------------- | -------- | -------------- | --------------------------------------------------------- |
|
|
96
|
+
| `REDDIT_CLIENT_ID` | No\* | - | Reddit app client ID |
|
|
97
|
+
| `REDDIT_CLIENT_SECRET` | No\* | - | Reddit app client secret |
|
|
98
|
+
| `REDDIT_USERNAME` | No | - | Reddit username (for write operations) |
|
|
99
|
+
| `REDDIT_PASSWORD` | No | - | Reddit password (for write operations) |
|
|
100
|
+
| `REDDIT_USER_AGENT` | No | Auto-generated | Custom User-Agent string |
|
|
101
|
+
| `REDDIT_AUTH_MODE` | No | `auto` | Authentication mode: `auto`, `authenticated`, `anonymous` |
|
|
102
|
+
| `REDDIT_SAFE_MODE` | No | `off` | Write safeguards: `off`, `standard`, `strict` |
|
|
137
103
|
|
|
138
|
-
|
|
139
|
-
npx reddit-mcp-server --generate-token
|
|
140
|
-
```
|
|
104
|
+
\*Required only if using `authenticated` mode.
|
|
141
105
|
|
|
142
|
-
###
|
|
106
|
+
### Full MCP Config Example
|
|
143
107
|
|
|
144
|
-
|
|
108
|
+
```json
|
|
109
|
+
{
|
|
110
|
+
"mcpServers": {
|
|
111
|
+
"reddit": {
|
|
112
|
+
"command": "npx",
|
|
113
|
+
"args": ["reddit-mcp-server"],
|
|
114
|
+
"env": {
|
|
115
|
+
"REDDIT_CLIENT_ID": "your_client_id",
|
|
116
|
+
"REDDIT_CLIENT_SECRET": "your_client_secret",
|
|
117
|
+
"REDDIT_USERNAME": "your_username",
|
|
118
|
+
"REDDIT_PASSWORD": "your_password",
|
|
119
|
+
"REDDIT_SAFE_MODE": "standard"
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
```
|
|
145
125
|
|
|
146
|
-
|
|
147
|
-
# Start the HTTP server on port 3000 (default)
|
|
148
|
-
node dist/index.js
|
|
126
|
+
## Safe Mode (Spam Protection)
|
|
149
127
|
|
|
150
|
-
|
|
151
|
-
PORT=8080 node dist/index.js
|
|
128
|
+
**New!** Protect your Reddit account from spam detection and bans with built-in safeguards.
|
|
152
129
|
|
|
153
|
-
|
|
154
|
-
pnpm start
|
|
155
|
-
```
|
|
130
|
+
### Why Use Safe Mode?
|
|
156
131
|
|
|
157
|
-
|
|
132
|
+
Reddit's spam detection can flag accounts for:
|
|
158
133
|
|
|
159
|
-
|
|
134
|
+
- Rapid posting or commenting
|
|
135
|
+
- Duplicate or similar content
|
|
136
|
+
- Non-standard User-Agent strings
|
|
160
137
|
|
|
161
|
-
|
|
138
|
+
Safe Mode helps prevent these issues automatically.
|
|
162
139
|
|
|
163
|
-
|
|
140
|
+
### Mode Options
|
|
164
141
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
142
|
+
| Mode | Write Delay | Duplicate Detection | Use Case |
|
|
143
|
+
| ---------- | ----------- | ------------------- | ------------------------------ |
|
|
144
|
+
| `off` | None | No | Default, no safeguards |
|
|
145
|
+
| `standard` | 2 seconds | Last 10 items | Recommended for normal use |
|
|
146
|
+
| `strict` | 5 seconds | Last 20 items | For cautious automated posting |
|
|
169
147
|
|
|
170
|
-
|
|
148
|
+
### Enable Safe Mode
|
|
171
149
|
|
|
172
150
|
```bash
|
|
173
|
-
export
|
|
174
|
-
|
|
175
|
-
pnpm serve
|
|
151
|
+
export REDDIT_SAFE_MODE=standard
|
|
152
|
+
npx reddit-mcp-server
|
|
176
153
|
```
|
|
177
154
|
|
|
178
|
-
|
|
155
|
+
Or in your MCP config:
|
|
179
156
|
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
157
|
+
```json
|
|
158
|
+
{
|
|
159
|
+
"env": {
|
|
160
|
+
"REDDIT_SAFE_MODE": "standard"
|
|
161
|
+
}
|
|
162
|
+
}
|
|
185
163
|
```
|
|
186
164
|
|
|
187
|
-
|
|
165
|
+
### What Safe Mode Does
|
|
188
166
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
-
|
|
192
|
-
- Health check (`/`) is always unprotected; only `/mcp` requires authentication
|
|
167
|
+
1. **Rate Limiting**: Enforces minimum delays between write operations
|
|
168
|
+
2. **Duplicate Detection**: Blocks identical content from being posted twice
|
|
169
|
+
3. **Smart User-Agent**: Auto-generates Reddit-compliant User-Agent format when username is provided
|
|
193
170
|
|
|
194
|
-
|
|
171
|
+
## Authentication Modes
|
|
195
172
|
|
|
196
|
-
|
|
173
|
+
### Mode Comparison
|
|
197
174
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
method: "POST",
|
|
204
|
-
headers: {
|
|
205
|
-
Authorization: "Bearer YOUR_TOKEN",
|
|
206
|
-
"Content-Type": "application/json",
|
|
207
|
-
},
|
|
208
|
-
body: JSON.stringify({
|
|
209
|
-
jsonrpc: "2.0",
|
|
210
|
-
id: 1,
|
|
211
|
-
method: "tools/list",
|
|
212
|
-
params: {},
|
|
213
|
-
}),
|
|
214
|
-
})
|
|
215
|
-
|
|
216
|
-
const result = await response.json()
|
|
217
|
-
```
|
|
175
|
+
| Mode | Rate Limit | Setup Required | Best For |
|
|
176
|
+
| ---------------- | -------------- | -------------- | ------------------------ |
|
|
177
|
+
| `anonymous` | ~10 req/min | None | Quick testing, read-only |
|
|
178
|
+
| `auto` (default) | 10-100 req/min | Optional | Flexible usage |
|
|
179
|
+
| `authenticated` | 60-100 req/min | Required | Production use |
|
|
218
180
|
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
```javascript
|
|
222
|
-
const client = new MCP.Client({
|
|
223
|
-
transport: new MCP.HTTPTransport({
|
|
224
|
-
url: "http://localhost:3000/mcp",
|
|
225
|
-
headers: {
|
|
226
|
-
Authorization: "Bearer YOUR_TOKEN",
|
|
227
|
-
},
|
|
228
|
-
}),
|
|
229
|
-
})
|
|
230
|
-
```
|
|
181
|
+
### Anonymous Mode (Zero Setup)
|
|
231
182
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
const transport = new HTTPTransport({
|
|
239
|
-
url: "http://localhost:3000/mcp",
|
|
240
|
-
headers: {
|
|
241
|
-
Authorization: "Bearer YOUR_TOKEN",
|
|
242
|
-
"Content-Type": "application/json",
|
|
243
|
-
},
|
|
244
|
-
})
|
|
245
|
-
|
|
246
|
-
const client = new Client(
|
|
247
|
-
{
|
|
248
|
-
name: "reddit-client",
|
|
249
|
-
version: "1.0.0",
|
|
250
|
-
},
|
|
251
|
-
{
|
|
252
|
-
capabilities: {},
|
|
253
|
-
},
|
|
254
|
-
)
|
|
255
|
-
|
|
256
|
-
await client.connect(transport)
|
|
183
|
+
```json
|
|
184
|
+
{
|
|
185
|
+
"env": {
|
|
186
|
+
"REDDIT_AUTH_MODE": "anonymous"
|
|
187
|
+
}
|
|
188
|
+
}
|
|
257
189
|
```
|
|
258
190
|
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
- Replace `YOUR_TOKEN` with your generated OAuth token
|
|
262
|
-
- Authorization header MUST be included in every request to `/mcp`
|
|
263
|
-
- Tokens MUST NOT be included in URI query strings per MCP specification
|
|
264
|
-
- Use HTTPS in production for secure token transmission
|
|
265
|
-
|
|
266
|
-
**For Remote/Deployed Servers:**
|
|
267
|
-
When connecting to a remote Reddit MCP server (e.g., deployed on your infrastructure):
|
|
268
|
-
|
|
269
|
-
```javascript
|
|
270
|
-
// Production server with OAuth
|
|
271
|
-
const response = await fetch("https://your-server.com/mcp", {
|
|
272
|
-
method: "POST",
|
|
273
|
-
headers: {
|
|
274
|
-
Authorization: "Bearer YOUR_TOKEN",
|
|
275
|
-
"Content-Type": "application/json",
|
|
276
|
-
},
|
|
277
|
-
body: JSON.stringify({
|
|
278
|
-
jsonrpc: "2.0",
|
|
279
|
-
id: 1,
|
|
280
|
-
method: "tools/list",
|
|
281
|
-
params: {},
|
|
282
|
-
}),
|
|
283
|
-
})
|
|
284
|
-
```
|
|
191
|
+
### Authenticated Mode (Higher Rate Limits)
|
|
285
192
|
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
|
|
290
|
-
import { HTTPTransport } from "@modelcontextprotocol/sdk/client/http.js"
|
|
291
|
-
|
|
292
|
-
// For your deployed server
|
|
293
|
-
const transport = new HTTPTransport({
|
|
294
|
-
url: "https://your-reddit-mcp.company.com/mcp",
|
|
295
|
-
headers: {
|
|
296
|
-
Authorization: "Bearer YOUR_GENERATED_TOKEN",
|
|
297
|
-
"Content-Type": "application/json",
|
|
298
|
-
},
|
|
299
|
-
})
|
|
300
|
-
|
|
301
|
-
const client = new Client(
|
|
302
|
-
{
|
|
303
|
-
name: "reddit-client",
|
|
304
|
-
version: "1.0.0",
|
|
305
|
-
},
|
|
306
|
-
{
|
|
307
|
-
capabilities: {},
|
|
308
|
-
},
|
|
309
|
-
)
|
|
310
|
-
|
|
311
|
-
await client.connect(transport)
|
|
312
|
-
```
|
|
313
|
-
|
|
314
|
-
**Claude Desktop/Cursor with Remote Server (HTTP):**
|
|
315
|
-
For remote servers, you can use a proxy approach:
|
|
193
|
+
1. Create a Reddit app at https://www.reddit.com/prefs/apps (select "script" type)
|
|
194
|
+
2. Copy the client ID and secret
|
|
195
|
+
3. Configure:
|
|
316
196
|
|
|
317
197
|
```json
|
|
318
198
|
{
|
|
319
|
-
"
|
|
320
|
-
"
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
"-e",
|
|
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);"
|
|
325
|
-
],
|
|
326
|
-
"env": {}
|
|
327
|
-
}
|
|
199
|
+
"env": {
|
|
200
|
+
"REDDIT_AUTH_MODE": "authenticated",
|
|
201
|
+
"REDDIT_CLIENT_ID": "your_client_id",
|
|
202
|
+
"REDDIT_CLIENT_SECRET": "your_client_secret"
|
|
328
203
|
}
|
|
329
204
|
}
|
|
330
205
|
```
|
|
331
206
|
|
|
332
|
-
|
|
333
|
-
|
|
207
|
+
### Write Operations
|
|
208
|
+
|
|
209
|
+
To create posts, reply, edit, or delete content, you need user credentials:
|
|
334
210
|
|
|
335
211
|
```json
|
|
336
212
|
{
|
|
337
|
-
"
|
|
338
|
-
"
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
"env": {
|
|
342
|
-
"REDDIT_CLIENT_ID": "your_client_id",
|
|
343
|
-
"REDDIT_CLIENT_SECRET": "your_client_secret"
|
|
344
|
-
}
|
|
345
|
-
}
|
|
213
|
+
"env": {
|
|
214
|
+
"REDDIT_USERNAME": "your_username",
|
|
215
|
+
"REDDIT_PASSWORD": "your_password",
|
|
216
|
+
"REDDIT_SAFE_MODE": "standard"
|
|
346
217
|
}
|
|
347
218
|
}
|
|
348
219
|
```
|
|
349
220
|
|
|
350
|
-
|
|
221
|
+
## Development
|
|
351
222
|
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
1. **Generate secure token:**
|
|
223
|
+
### Commands
|
|
355
224
|
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
225
|
+
```bash
|
|
226
|
+
pnpm install # Install dependencies
|
|
227
|
+
pnpm build # Build TypeScript
|
|
228
|
+
pnpm dev # Build and run MCP inspector
|
|
229
|
+
pnpm test # Run tests
|
|
230
|
+
pnpm lint # Lint code
|
|
231
|
+
pnpm format # Format code
|
|
232
|
+
```
|
|
360
233
|
|
|
361
|
-
|
|
234
|
+
### CLI Options
|
|
362
235
|
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
-e REDDIT_CLIENT_SECRET=your_reddit_client_secret \
|
|
369
|
-
-e OAUTH_ENABLED=true \
|
|
370
|
-
-e OAUTH_TOKEN=xyz123abc456def789 \
|
|
371
|
-
ghcr.io/jordanburke/reddit-mcp-server:latest
|
|
372
|
-
```
|
|
236
|
+
```bash
|
|
237
|
+
npx reddit-mcp-server --version # Show version
|
|
238
|
+
npx reddit-mcp-server --help # Show help
|
|
239
|
+
npx reddit-mcp-server --generate-token # Generate OAuth token for HTTP mode
|
|
240
|
+
```
|
|
373
241
|
|
|
374
|
-
|
|
242
|
+
## HTTP Server Mode
|
|
375
243
|
|
|
376
|
-
|
|
377
|
-
Server URL: https://your-server.com/mcp
|
|
378
|
-
OAuth Token: xyz123abc456def789
|
|
379
|
-
```
|
|
244
|
+
For Docker deployments or web-based clients, use HTTP transport:
|
|
380
245
|
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
const transport = new HTTPTransport({
|
|
385
|
-
url: 'https://your-server.com/mcp',
|
|
386
|
-
headers: { 'Authorization': 'Bearer xyz123abc456def789' }
|
|
387
|
-
});
|
|
388
|
-
await client.connect(transport);
|
|
389
|
-
```
|
|
246
|
+
```bash
|
|
247
|
+
TRANSPORT_TYPE=httpStream PORT=3000 node dist/index.js
|
|
248
|
+
```
|
|
390
249
|
|
|
391
|
-
|
|
250
|
+
### With OAuth Protection
|
|
392
251
|
|
|
393
|
-
|
|
252
|
+
```bash
|
|
253
|
+
export OAUTH_ENABLED=true
|
|
254
|
+
export OAUTH_TOKEN=$(npx reddit-mcp-server --generate-token | tail -1)
|
|
255
|
+
TRANSPORT_TYPE=httpStream node dist/index.js
|
|
256
|
+
```
|
|
394
257
|
|
|
395
|
-
|
|
258
|
+
Make authenticated requests:
|
|
396
259
|
|
|
397
260
|
```bash
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
docker pull ghcr.io/jordanburke/reddit-mcp-server:v1.0.10
|
|
261
|
+
curl -H "Authorization: Bearer $OAUTH_TOKEN" \
|
|
262
|
+
-H "Content-Type: application/json" \
|
|
263
|
+
-d '{"method":"tools/list","params":{}}' \
|
|
264
|
+
http://localhost:3000/mcp
|
|
403
265
|
```
|
|
404
266
|
|
|
405
|
-
|
|
267
|
+
## Docker
|
|
268
|
+
|
|
269
|
+
### Quick Start
|
|
406
270
|
|
|
407
271
|
```bash
|
|
408
|
-
#
|
|
409
|
-
docker
|
|
410
|
-
--name reddit-mcp \
|
|
411
|
-
-p 3000:3000 \
|
|
412
|
-
-e REDDIT_CLIENT_ID=your_client_id \
|
|
413
|
-
-e REDDIT_CLIENT_SECRET=your_client_secret \
|
|
414
|
-
-e REDDIT_USERNAME=your_username \
|
|
415
|
-
-e REDDIT_PASSWORD=your_password \
|
|
416
|
-
ghcr.io/jordanburke/reddit-mcp-server:latest
|
|
272
|
+
# Pull and run
|
|
273
|
+
docker pull ghcr.io/jordanburke/reddit-mcp-server:latest
|
|
417
274
|
|
|
418
|
-
# Run with OAuth enabled (secure)
|
|
419
275
|
docker run -d \
|
|
420
276
|
--name reddit-mcp \
|
|
421
277
|
-p 3000:3000 \
|
|
422
278
|
-e REDDIT_CLIENT_ID=your_client_id \
|
|
423
279
|
-e REDDIT_CLIENT_SECRET=your_client_secret \
|
|
424
|
-
-e
|
|
425
|
-
-e OAUTH_TOKEN=your_generated_token \
|
|
280
|
+
-e REDDIT_SAFE_MODE=standard \
|
|
426
281
|
ghcr.io/jordanburke/reddit-mcp-server:latest
|
|
427
|
-
|
|
428
|
-
# Run with custom port
|
|
429
|
-
docker run -d \
|
|
430
|
-
--name reddit-mcp \
|
|
431
|
-
-p 8080:3000 \
|
|
432
|
-
--env-file .env \
|
|
433
|
-
ghcr.io/jordanburke/reddit-mcp-server:latest
|
|
434
|
-
|
|
435
|
-
# Generate token using Docker
|
|
436
|
-
docker run --rm \
|
|
437
|
-
ghcr.io/jordanburke/reddit-mcp-server:latest \
|
|
438
|
-
node dist/bin.js --generate-token
|
|
439
|
-
|
|
440
|
-
# Run as stdio MCP server (for direct integration)
|
|
441
|
-
docker run -it \
|
|
442
|
-
--env-file .env \
|
|
443
|
-
ghcr.io/jordanburke/reddit-mcp-server:latest \
|
|
444
|
-
node dist/index.js
|
|
445
282
|
```
|
|
446
283
|
|
|
447
|
-
###
|
|
448
|
-
|
|
449
|
-
```bash
|
|
450
|
-
# Build the image
|
|
451
|
-
docker build -t reddit-mcp-server .
|
|
452
|
-
|
|
453
|
-
# Run the locally built image
|
|
454
|
-
docker run -d \
|
|
455
|
-
--name reddit-mcp \
|
|
456
|
-
-p 3000:3000 \
|
|
457
|
-
--env-file .env \
|
|
458
|
-
reddit-mcp-server
|
|
459
|
-
```
|
|
460
|
-
|
|
461
|
-
### Docker Compose Example
|
|
284
|
+
### Docker Compose
|
|
462
285
|
|
|
463
286
|
```yaml
|
|
464
|
-
version: "3.8"
|
|
465
|
-
|
|
466
287
|
services:
|
|
467
288
|
reddit-mcp:
|
|
468
289
|
image: ghcr.io/jordanburke/reddit-mcp-server:latest
|
|
@@ -473,14 +294,20 @@ services:
|
|
|
473
294
|
- REDDIT_CLIENT_SECRET=${REDDIT_CLIENT_SECRET}
|
|
474
295
|
- REDDIT_USERNAME=${REDDIT_USERNAME}
|
|
475
296
|
- REDDIT_PASSWORD=${REDDIT_PASSWORD}
|
|
476
|
-
|
|
297
|
+
- REDDIT_SAFE_MODE=standard
|
|
477
298
|
- OAUTH_ENABLED=${OAUTH_ENABLED:-false}
|
|
478
299
|
- OAUTH_TOKEN=${OAUTH_TOKEN}
|
|
479
300
|
restart: unless-stopped
|
|
480
301
|
```
|
|
481
302
|
|
|
482
|
-
|
|
303
|
+
### Build Locally
|
|
304
|
+
|
|
305
|
+
```bash
|
|
306
|
+
docker build -t reddit-mcp-server .
|
|
307
|
+
docker run -d --name reddit-mcp -p 3000:3000 --env-file .env reddit-mcp-server
|
|
308
|
+
```
|
|
483
309
|
|
|
484
|
-
|
|
310
|
+
## Credits
|
|
485
311
|
|
|
486
|
-
-
|
|
312
|
+
- Fork of [reddit-mcp-server](https://github.com/alexandros-lekkas/reddit-mcp-server) by Alexandros Lekkas
|
|
313
|
+
- Inspired by [Python Reddit MCP Server](https://github.com/Arindam200/reddit-mcp) by Arindam200
|