reddit-mcp-server 1.1.1 → 1.2.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/README.md +194 -359
- package/dist/bin.d.ts +1 -1
- package/dist/bin.js +21 -1245
- 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 +1305 -1020
- package/dist/index.js.map +1 -0
- package/package.json +26 -28
package/README.md
CHANGED
|
@@ -1,460 +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
|
|
32
|
+
### Option 1: Claude Desktop Extension (Easiest)
|
|
25
33
|
|
|
26
|
-
|
|
34
|
+
Download and open the extension file - Claude Desktop will install it automatically:
|
|
27
35
|
|
|
28
|
-
|
|
36
|
+
**[Download reddit-mcp-server.mcpb](https://github.com/jordanburke/reddit-mcp-server/releases/latest/download/reddit-mcp-server.mcpb)**
|
|
29
37
|
|
|
30
|
-
|
|
38
|
+
### Option 2: NPX (No install required)
|
|
31
39
|
|
|
32
40
|
```bash
|
|
33
|
-
npx
|
|
41
|
+
npx reddit-mcp-server
|
|
34
42
|
```
|
|
35
43
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
1. `git clone https://github.com/jordanburke/reddit-mcp-server`
|
|
39
|
-
|
|
40
|
-
2. Create a Reddit app [here](https://www.reddit.com/prefs/apps)
|
|
41
|
-
|
|
42
|
-

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

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