reddit-mcp-server 2.0.0 → 2.0.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 +119 -0
- package/README.md +75 -19
- package/dist/bin.js +12 -6
- package/dist/bin.js.map +1 -1
- package/dist/index.js +60 -36
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,32 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [2.0.2] - 2026-11-14
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- In `auto` mode, a failed startup credential check (Reddit rejects the client id or secret, or can't be reached) no longer stops the server. It logs a warning and starts, so registries that start it with placeholder credentials, such as Glama, can list its tools. Each tool call that needs OAuth retries authentication and reports the error. `REDDIT_AUTH_MODE=authenticated` still exits at startup
|
|
10
|
+
- Startup logs say "User credentials set for" instead of "User authenticated as", since the username and password are not checked at startup, and the keyless message notes that Reddit said it would end RSS feeds on 2026-11-13
|
|
11
|
+
|
|
12
|
+
## [2.0.1] - 2026-10-31
|
|
13
|
+
|
|
14
|
+
### Fixed
|
|
15
|
+
|
|
16
|
+
- A blank environment value (`KEY=`, as in a copied `.env.example`) now counts as unset everywhere:
|
|
17
|
+
- `OAUTH_TOKEN=` with `OAUTH_ENABLED=true` generated no token and rejected every HTTP request; the server now generates one and prints it
|
|
18
|
+
- `REDDIT_AUTH_MODE=authenticated` with blank `REDDIT_CLIENT_ID`/`REDDIT_CLIENT_SECRET` started keyless; it now fails at startup, as documented
|
|
19
|
+
- Blank `REDDIT_USERNAME`/`REDDIT_PASSWORD` counted as write credentials, so `test_reddit_mcp_server` reported write access and the write tools' credential checks passed
|
|
20
|
+
- Blank `PORT` and `HOST` gave a `NaN` port and an empty bind address; they now default to 3000 and 127.0.0.1
|
|
21
|
+
- Blank `REDDIT_AUTH_MODE` and `REDDIT_SAFE_MODE` stopped the server with an "invalid mode" error; they now default to `auto` and `standard`
|
|
22
|
+
- Blank `REDDIT_MAX_RETRIES` turned off 429 retries; it now defaults to 3
|
|
23
|
+
- Blank `REDDIT_USER_AGENT` sent an empty `User-Agent` to Reddit; the server now uses its auto-generated agent
|
|
24
|
+
- Blank `REDDIT_BOT_FOOTER` with `REDDIT_BOT_DISCLOSURE=auto` posted no disclosure; the built-in footer is used
|
|
25
|
+
|
|
26
|
+
### Changed
|
|
27
|
+
|
|
28
|
+
- The README, CLAUDE.md, ROADMAP, SECURITY, `.env.example`, `manifest.json` and `server.json` descriptions, CLI help and startup message are brought up to date with 2.0 and Reddit's API shutdown, citing Reddit's 2026-09-30 announcements
|
|
29
|
+
- The CHANGELOG gains entries for 1.5.1 through 1.7.2
|
|
30
|
+
|
|
5
31
|
## [2.0.0] - 2026-10-31
|
|
6
32
|
|
|
7
33
|
A major version because HTTP clients lose `/sse` and `/ready`, and invalid arguments change shape. Stdio clients (Claude Desktop, Claude Code, `npx`) see no change.
|
|
@@ -30,6 +56,99 @@ A major version because HTTP clients lose `/sse` and `/ready`, and invalid argum
|
|
|
30
56
|
- CORS: preflight and responses still allow any origin, as under FastMCP
|
|
31
57
|
- Keepalive: HTTP responses stream as SSE with periodic keepalive frames, as FastMCP's pings did, so idle-timeout proxies don't cut long tool calls
|
|
32
58
|
|
|
59
|
+
## [1.7.2] - 2026-10-30
|
|
60
|
+
|
|
61
|
+
### Changed
|
|
62
|
+
|
|
63
|
+
- Keyless list output (search, user posts, user comments) omits the archive's lagging scores and comment counts; keyless `get_reddit_post` replaces its stats with a note and drops the engagement analysis built on them
|
|
64
|
+
- Arctic Shift throttling (HTTP 429 or "Timeout") retries once after the `X-RateLimit-Reset` time, capped at 10 seconds; a second failure says when to retry
|
|
65
|
+
|
|
66
|
+
### Fixed
|
|
67
|
+
|
|
68
|
+
- Subreddit and user search results no longer show blank post-only fields (author, comments)
|
|
69
|
+
- `get_subreddit_info` no longer prints an empty Community Analysis for mid-size subreddits
|
|
70
|
+
|
|
71
|
+
## [1.7.1] - 2026-10-28
|
|
72
|
+
|
|
73
|
+
### Fixed
|
|
74
|
+
|
|
75
|
+
- Keyless search no longer reports the default `relevance` sort as ignored, and subreddit search reports its subscriber order
|
|
76
|
+
- `get_reddit_post` no longer prints an empty Engagement Analysis
|
|
77
|
+
- The publish workflow waits up to 15 minutes for the npm tarball and logs in to the MCP Registry after that wait
|
|
78
|
+
|
|
79
|
+
## [1.7.0] - 2026-10-28
|
|
80
|
+
|
|
81
|
+
### Added
|
|
82
|
+
|
|
83
|
+
- Keyless reads through the [Arctic Shift](https://github.com/ArthurHeitmann/arctic_shift) archive, a free third-party Reddit archive, for posts, comment threads, users, subreddit info and rules, and search within a subreddit. Ranked listings stay on RSS and fall back to the archive's newest posts when RSS fails. Every archive result says where it came from
|
|
84
|
+
- `get_post_comments` lists the ids of collapsed comments, so `get_more_comments` can expand them
|
|
85
|
+
- `test_reddit_mcp_server` reports whether reads come from Reddit's API or keyless sources
|
|
86
|
+
|
|
87
|
+
### Changed
|
|
88
|
+
|
|
89
|
+
- Dependencies updated to latest, with ts-builds 4 and pnpm 12; Node pinned to 24.21.0 for npm publishing
|
|
90
|
+
|
|
91
|
+
## [1.6.3] - 2026-09-27
|
|
92
|
+
|
|
93
|
+
### Fixed
|
|
94
|
+
|
|
95
|
+
- Link posts show their body text as well as their URL, and comment truncation limits are higher
|
|
96
|
+
- stdio mode warns when stdin is a terminal, which means no MCP client is attached
|
|
97
|
+
|
|
98
|
+
## [1.6.2] - 2026-09-18
|
|
99
|
+
|
|
100
|
+
### Changed
|
|
101
|
+
|
|
102
|
+
- fastmcp 4.20
|
|
103
|
+
|
|
104
|
+
### Fixed
|
|
105
|
+
|
|
106
|
+
- The publish workflow waits for npm before publishing to the MCP Registry
|
|
107
|
+
|
|
108
|
+
## [1.6.1] - 2026-09-17
|
|
109
|
+
|
|
110
|
+
### Added
|
|
111
|
+
|
|
112
|
+
- `save_content` and `unsave_content`
|
|
113
|
+
|
|
114
|
+
### Fixed
|
|
115
|
+
|
|
116
|
+
- `search_reddit` with `type=sr` or `type=user` always returned no results
|
|
117
|
+
- The publish workflow tolerates an npm version that is already published
|
|
118
|
+
|
|
119
|
+
## [1.6.0] - 2026-09-17
|
|
120
|
+
|
|
121
|
+
### Added
|
|
122
|
+
|
|
123
|
+
- RSS fallback: `browse_subreddit` and `get_top_posts` work without OAuth credentials
|
|
124
|
+
|
|
125
|
+
### Deprecated
|
|
126
|
+
|
|
127
|
+
- `REDDIT_AUTH_MODE=anonymous`, because Reddit blocks unauthenticated API requests; it is now an alias for `auto` without credentials
|
|
128
|
+
|
|
129
|
+
## [1.5.3] - 2026-08-08
|
|
130
|
+
|
|
131
|
+
### Changed
|
|
132
|
+
|
|
133
|
+
- The README documents Reddit's IP block on unauthenticated requests
|
|
134
|
+
|
|
135
|
+
## [1.5.2] - 2026-08-08
|
|
136
|
+
|
|
137
|
+
### Security
|
|
138
|
+
|
|
139
|
+
- Subreddit names, usernames and thing ids are validated before they reach a request URL. A crafted value such as `../../api/v1/me` could previously steer the OAuth token to a different Reddit endpoint
|
|
140
|
+
- SECURITY.md and private vulnerability reporting
|
|
141
|
+
|
|
142
|
+
### Fixed
|
|
143
|
+
|
|
144
|
+
- When Reddit IP-blocks unauthenticated requests, the error says so and points to OAuth credentials, instead of reading as a private subreddit
|
|
145
|
+
|
|
146
|
+
## [1.5.1] - 2026-07-01
|
|
147
|
+
|
|
148
|
+
### Changed
|
|
149
|
+
|
|
150
|
+
- Richer tool descriptions and parameter docs
|
|
151
|
+
|
|
33
152
|
## [1.5.0] - 2026-06-22
|
|
34
153
|
|
|
35
154
|
### Added
|
package/README.md
CHANGED
|
@@ -11,6 +11,36 @@ A Model Context Protocol (MCP) server for interacting with Reddit - fetch posts,
|
|
|
11
11
|
<img width="380" height="200" src="https://glama.ai/mcp/servers/@jordanburke/reddit-mcp-server/badge" alt="reddit-mcp-server MCP server" />
|
|
12
12
|
</a>
|
|
13
13
|
|
|
14
|
+
## Reddit is closing its public API
|
|
15
|
+
|
|
16
|
+
Reddit announced on 2026-09-30 that it is ending RSS feeds and its public Data API, and moving apps to its Developer Platform ([r/redditdev post](https://www.reddit.com/r/redditdev/comments/1wubcvf/), [r/modnews post](https://www.reddit.com/r/modnews/comments/1wubgvt/)):
|
|
17
|
+
|
|
18
|
+
| Date | What Reddit does |
|
|
19
|
+
| ---------- | ------------------------------------------------------------------------------------------------------- |
|
|
20
|
+
| 2026-10-31 | Stops accepting new requests for public API access |
|
|
21
|
+
| 2026-11-13 | Stops supporting RSS feeds |
|
|
22
|
+
| 2027-01-12 | Starts removing API access for apps and users that haven't registered or responded to Reddit's outreach |
|
|
23
|
+
| March 2027 | Closes public API access for all remaining apps and users |
|
|
24
|
+
|
|
25
|
+
### What this server uses to keep working
|
|
26
|
+
|
|
27
|
+
The server reads from three sources and uses the best one you have:
|
|
28
|
+
|
|
29
|
+
| Source | Needs | Used for | Lasts until |
|
|
30
|
+
| ---------------------------------------------------------------------- | --------------------------------------------- | ---------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
|
|
31
|
+
| Reddit's API (OAuth) | `REDDIT_CLIENT_ID` and `REDDIT_CLIENT_SECRET` | Every tool, with live data (writes also need username and password) | March 2027, per Reddit |
|
|
32
|
+
| Reddit's RSS feeds | Nothing | Ranked listings (hot, top, rising, controversial) and the home feed, without credentials | 2026-11-13 |
|
|
33
|
+
| [Arctic Shift](https://github.com/ArthurHeitmann/arctic_shift) archive | Nothing | Most read tools without credentials | No announced end. It's free, run by one volunteer, has no uptime guarantee, and gets its data from Reddit's API |
|
|
34
|
+
|
|
35
|
+
Arctic Shift is a third-party copy of Reddit, not Reddit's API, though it [collects its data through Reddit's API](https://github.com/ArthurHeitmann/arctic_shift/blob/master/file_content_explanations.md). Its scores and comment counts lag, and every result from it says so. See [Keyless Mode](#keyless-mode) for what each tool can do without credentials.
|
|
36
|
+
|
|
37
|
+
### What it means for you
|
|
38
|
+
|
|
39
|
+
- **You have OAuth credentials:** every read tool works. Write tools also need `REDDIT_USERNAME` and `REDDIT_PASSWORD`. Register your app at [developers.reddit.com/app-registration](https://developers.reddit.com/app-registration) before 2027-01-12, or Reddit may remove its access early.
|
|
40
|
+
- **You don't have credentials:** most read tools work with no setup. Reddit no longer accepts new API access requests, so new users run in keyless mode.
|
|
41
|
+
- **After 2026-11-13:** without credentials, ranked listings for a single subreddit fall back to the archive's newest posts, because RSS is gone. The home feed and multireddits have no keyless source after that date.
|
|
42
|
+
- **After March 2027:** Reddit says public API access closes, and that is the path the OAuth tools use, so the write tools and the OAuth-only reads stop working. Arctic Shift says it collects all its data through Reddit's API, so the archive may stop getting new posts then. Keyless reads would still return what it already holds.
|
|
43
|
+
|
|
14
44
|
## Features at a Glance
|
|
15
45
|
|
|
16
46
|
| Feature | reddit-mcp-server | Other Reddit MCPs |
|
|
@@ -39,7 +69,7 @@ Download and open the extension file - Claude Desktop will install it automatica
|
|
|
39
69
|
|
|
40
70
|
### Option 2: NPX (No install required)
|
|
41
71
|
|
|
42
|
-
Add to your MCP config (Claude Desktop, Cursor, etc.) with
|
|
72
|
+
Add to your MCP config (Claude Desktop, Cursor, etc.). Credentials are optional: without them the server runs in [keyless mode](#keyless-mode), and with them you get live data and every tool.
|
|
43
73
|
|
|
44
74
|
```json
|
|
45
75
|
{
|
|
@@ -63,6 +93,8 @@ REDDIT_CLIENT_ID=your_client_id REDDIT_CLIENT_SECRET=your_client_secret \
|
|
|
63
93
|
claude mcp add --transport stdio reddit -- npx reddit-mcp-server
|
|
64
94
|
```
|
|
65
95
|
|
|
96
|
+
Leave out the two variables to run keyless.
|
|
97
|
+
|
|
66
98
|
## Features
|
|
67
99
|
|
|
68
100
|
### Read-only Tools
|
|
@@ -72,16 +104,27 @@ REDDIT_CLIENT_ID=your_client_id REDDIT_CLIENT_SECRET=your_client_secret \
|
|
|
72
104
|
| `get_reddit_post` | Get a specific Reddit post with engagement analysis |
|
|
73
105
|
| `get_top_posts` | Get top posts from a subreddit or home feed |
|
|
74
106
|
| `browse_subreddit` | Browse a subreddit/home feed by sort (hot, new, top, rising, controversial) |
|
|
107
|
+
| `get_post_comments` | Get comments from a specific post with threading |
|
|
108
|
+
| `get_more_comments` | Expand collapsed comments in a thread |
|
|
75
109
|
| `get_user_info` | Get detailed information about a Reddit user |
|
|
76
110
|
| `get_user_posts` | Get posts submitted by a specific user |
|
|
77
111
|
| `get_user_comments` | Get comments made by a specific user |
|
|
78
112
|
| `get_subreddit_info` | Get subreddit details and statistics |
|
|
79
|
-
| `
|
|
80
|
-
| `
|
|
81
|
-
| `
|
|
113
|
+
| `get_subreddit_rules` | Get a subreddit's posting rules |
|
|
114
|
+
| `search_reddit` | Search for posts, subreddits, or users |
|
|
115
|
+
| `get_trending_subreddits` | Get currently trending subreddits (needs OAuth) |
|
|
116
|
+
| `get_post_flairs` | List a subreddit's available post flairs (needs OAuth) |
|
|
117
|
+
| `get_me` | Get your own account info (needs OAuth and user credentials) |
|
|
118
|
+
| `get_my_overview` | Get your own recent posts and comments (needs OAuth and user credentials) |
|
|
119
|
+
| `get_my_saved` | Get your saved posts and comments (needs OAuth and user credentials) |
|
|
120
|
+
| `test_reddit_mcp_server` | Check server status and configuration |
|
|
121
|
+
|
|
122
|
+
Most read tools also work without credentials. See [Keyless Mode](#keyless-mode) for each tool's limits.
|
|
82
123
|
|
|
83
124
|
### Write Tools (Require User Credentials)
|
|
84
125
|
|
|
126
|
+
Write tools need Reddit's API, so they need OAuth credentials plus `REDDIT_USERNAME` and `REDDIT_PASSWORD`. Reddit closes its public API in March 2027 ([details](#reddit-is-closing-its-public-api)).
|
|
127
|
+
|
|
85
128
|
| Tool | Description |
|
|
86
129
|
| ---------------- | ---------------------------------------------- |
|
|
87
130
|
| `create_post` | Create a new post in a subreddit |
|
|
@@ -99,8 +142,8 @@ REDDIT_CLIENT_ID=your_client_id REDDIT_CLIENT_SECRET=your_client_secret \
|
|
|
99
142
|
|
|
100
143
|
| Variable | Required | Default | Description |
|
|
101
144
|
| ----------------------- | -------- | -------------- | --------------------------------------------------------------------- |
|
|
102
|
-
| `REDDIT_CLIENT_ID` |
|
|
103
|
-
| `REDDIT_CLIENT_SECRET` |
|
|
145
|
+
| `REDDIT_CLIENT_ID` | No | - | Reddit app client ID (omit for keyless mode) |
|
|
146
|
+
| `REDDIT_CLIENT_SECRET` | No | - | Reddit app client secret |
|
|
104
147
|
| `REDDIT_USERNAME` | No | - | Reddit username (for write operations) |
|
|
105
148
|
| `REDDIT_PASSWORD` | No | - | Reddit password (for write operations) |
|
|
106
149
|
| `REDDIT_USER_AGENT` | No | Auto-generated | Custom User-Agent string |
|
|
@@ -112,7 +155,7 @@ REDDIT_CLIENT_ID=your_client_id REDDIT_CLIENT_SECRET=your_client_secret \
|
|
|
112
155
|
| `REDDIT_CACHE_MAX_MB` | No | `50` | Cache size cap in MB (LRU eviction beyond this) |
|
|
113
156
|
| `REDDIT_MAX_RETRIES` | No | `3` | Retries on HTTP 429 with Retry-After backoff (`0` to disable) |
|
|
114
157
|
|
|
115
|
-
|
|
158
|
+
Credentials are optional. See [Keyless Mode](#keyless-mode) for what works without them.
|
|
116
159
|
|
|
117
160
|
### Full MCP Config Example
|
|
118
161
|
|
|
@@ -200,17 +243,17 @@ export REDDIT_BOT_FOOTER=$'\n\n---\n^(🤖 Custom bot footer text)'
|
|
|
200
243
|
|
|
201
244
|
### ⚠️ Reddit API Changes (2026)
|
|
202
245
|
|
|
203
|
-
**
|
|
246
|
+
**Reddit's unauthenticated API no longer works.** As of mid-2026, Reddit blocks unauthenticated API requests with HTTP 403, so reading Reddit's API needs OAuth credentials. `REDDIT_AUTH_MODE=anonymous` still exists, but it is now an alias for [keyless mode](#keyless-mode).
|
|
204
247
|
|
|
205
|
-
**Reddit is
|
|
248
|
+
**Reddit is closing its public API.** See [Reddit is closing its public API](#reddit-is-closing-its-public-api) for the dates and what this server does about them.
|
|
206
249
|
|
|
207
|
-
|
|
250
|
+
Reddit closed self-service OAuth app creation in November 2025, and as of 2026-10-31 it accepts no new requests for public API access. Existing OAuth credentials keep working until March 2027 if the app is registered by 2027-01-12. Reddit starts removing access for unregistered apps on that date.
|
|
208
251
|
|
|
209
252
|
### Getting Credentials
|
|
210
253
|
|
|
211
|
-
**If you already have a Reddit app** (created at `/prefs/apps` before November 2025): use your existing client ID and secret
|
|
254
|
+
**If you already have a Reddit app** (created at `/prefs/apps` before November 2025, or approved through Reddit's Developer Support): use your existing client ID and secret. They still work at 60-100 req/min. Register the app at [developers.reddit.com/app-registration](https://developers.reddit.com/app-registration) before 2027-01-12.
|
|
212
255
|
|
|
213
|
-
**If you
|
|
256
|
+
**If you don't have credentials**: Reddit no longer accepts new requests for public API access, so use [keyless mode](#keyless-mode).
|
|
214
257
|
|
|
215
258
|
### Mode Comparison
|
|
216
259
|
|
|
@@ -218,9 +261,11 @@ Additionally, Reddit closed self-service OAuth app creation in November 2025. Ne
|
|
|
218
261
|
| ----------------- | -------------- | ----------------- | ----------------------------------------------- | ------------- |
|
|
219
262
|
| `auto` (default) | 60-100 req/min | OAuth credentials | All tools | Most users |
|
|
220
263
|
| `authenticated` | 60-100 req/min | OAuth credentials | All tools | Explicit mode |
|
|
221
|
-
| `auto` (no creds) | Shared, free | None | Most read tools ([Keyless Mode](#keyless-mode)) |
|
|
264
|
+
| `auto` (no creds) | Shared, free | None | Most read tools ([Keyless Mode](#keyless-mode)) | New users |
|
|
222
265
|
| `anonymous` | Shared, free | None | Same as `auto` without credentials | Legacy alias |
|
|
223
266
|
|
|
267
|
+
If Reddit rejects your credentials at startup, `auto` logs a warning and starts anyway, and each tool call reports the error. `authenticated` exits instead.
|
|
268
|
+
|
|
224
269
|
### Keyless Mode
|
|
225
270
|
|
|
226
271
|
Without OAuth credentials, reads come from two free sources:
|
|
@@ -242,7 +287,7 @@ Without OAuth credentials, reads come from two free sources:
|
|
|
242
287
|
|
|
243
288
|
**Archive caveats:** scores and comment counts lag, and are often 0 or 1 on recent posts. Keyword search on large subreddits is slow, and the archive throttles it. The server waits up to 10 seconds and retries once. If that fails too, the error says when to retry. Every archive result ends with a note naming the source.
|
|
244
289
|
|
|
245
|
-
**Still needs OAuth:** `get_trending_subreddits`, `get_post_flairs`, `get_me`, `get_my_overview`, `get_my_saved`, and all write tools.
|
|
290
|
+
**Still needs OAuth:** `get_trending_subreddits`, `get_post_flairs`, `get_me`, `get_my_overview`, `get_my_saved`, `search_reddit` with `type=user`, and all write tools.
|
|
246
291
|
|
|
247
292
|
### Read-Only Access (OAuth)
|
|
248
293
|
|
|
@@ -278,7 +323,9 @@ To create posts, reply, edit, or delete content, add your Reddit username and pa
|
|
|
278
323
|
```bash
|
|
279
324
|
pnpm install # Install dependencies
|
|
280
325
|
pnpm build # Build TypeScript
|
|
281
|
-
pnpm dev #
|
|
326
|
+
pnpm dev # Rebuild on every change
|
|
327
|
+
pnpm inspect # Build and open the MCP inspector
|
|
328
|
+
pnpm validate # Format, lint, typecheck, test and build
|
|
282
329
|
pnpm test # Run tests
|
|
283
330
|
pnpm lint # Lint code
|
|
284
331
|
pnpm format # Format code
|
|
@@ -289,7 +336,6 @@ pnpm format # Format code
|
|
|
289
336
|
```bash
|
|
290
337
|
npx reddit-mcp-server --version # Show version
|
|
291
338
|
npx reddit-mcp-server --help # Show help
|
|
292
|
-
npx reddit-mcp-server --generate-token # Generate OAuth token for HTTP mode
|
|
293
339
|
```
|
|
294
340
|
|
|
295
341
|
## HTTP Server Mode
|
|
@@ -300,23 +346,30 @@ For Docker deployments or web-based clients, use HTTP transport:
|
|
|
300
346
|
TRANSPORT_TYPE=httpStream PORT=3000 node dist/index.js
|
|
301
347
|
```
|
|
302
348
|
|
|
349
|
+
- The MCP endpoint is Streamable HTTP at `/mcp`. Version 2.0 removed the legacy SSE endpoint (`/sse`) and `/ready`.
|
|
350
|
+
- The server binds `127.0.0.1` unless you set `HOST`. The Docker image sets `HOST=0.0.0.0`.
|
|
351
|
+
- `/health` answers `{"name":"reddit-mcp-server","status":"running"}` and needs no token.
|
|
352
|
+
|
|
303
353
|
### With OAuth Protection
|
|
304
354
|
|
|
305
355
|
```bash
|
|
306
356
|
export OAUTH_ENABLED=true
|
|
307
|
-
export OAUTH_TOKEN=$(
|
|
357
|
+
export OAUTH_TOKEN=$(openssl rand -hex 32)
|
|
308
358
|
TRANSPORT_TYPE=httpStream node dist/index.js
|
|
309
359
|
```
|
|
310
360
|
|
|
311
|
-
Make authenticated requests:
|
|
361
|
+
If `OAUTH_TOKEN` is unset or empty, the server generates one and prints it at startup. Make authenticated requests:
|
|
312
362
|
|
|
313
363
|
```bash
|
|
314
364
|
curl -H "Authorization: Bearer $OAUTH_TOKEN" \
|
|
315
365
|
-H "Content-Type: application/json" \
|
|
316
|
-
-
|
|
366
|
+
-H "Accept: application/json, text/event-stream" \
|
|
367
|
+
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' \
|
|
317
368
|
http://localhost:3000/mcp
|
|
318
369
|
```
|
|
319
370
|
|
|
371
|
+
A request with no token gets 401, and a wrong token gets 403.
|
|
372
|
+
|
|
320
373
|
## Docker
|
|
321
374
|
|
|
322
375
|
### Quick Start
|
|
@@ -334,6 +387,8 @@ docker run -d \
|
|
|
334
387
|
ghcr.io/jordanburke/reddit-mcp-server:latest
|
|
335
388
|
```
|
|
336
389
|
|
|
390
|
+
Leave out the two credential variables to run the container keyless.
|
|
391
|
+
|
|
337
392
|
### Docker Compose
|
|
338
393
|
|
|
339
394
|
```yaml
|
|
@@ -349,6 +404,7 @@ services:
|
|
|
349
404
|
- REDDIT_PASSWORD=${REDDIT_PASSWORD}
|
|
350
405
|
- REDDIT_SAFE_MODE=standard
|
|
351
406
|
- OAUTH_ENABLED=${OAUTH_ENABLED:-false}
|
|
407
|
+
# Unset or empty: the server generates a token and prints it at startup
|
|
352
408
|
- OAUTH_TOKEN=${OAUTH_TOKEN}
|
|
353
409
|
restart: unless-stopped
|
|
354
410
|
```
|
package/dist/bin.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// src/bin.ts
|
|
3
|
-
process.env.TRANSPORT_TYPE
|
|
3
|
+
if ((process.env.TRANSPORT_TYPE ?? "").trim() === "") process.env.TRANSPORT_TYPE = "stdio";
|
|
4
4
|
const args = process.argv.slice(2);
|
|
5
5
|
if (args.includes("--version") || args.includes("-v")) {
|
|
6
|
-
console.log("2.0.
|
|
6
|
+
console.log("2.0.2");
|
|
7
7
|
process.exit(0);
|
|
8
8
|
}
|
|
9
9
|
if (args.includes("--help") || args.includes("-h")) {
|
|
10
10
|
console.log(`
|
|
11
|
-
Reddit MCP Server v2.0.
|
|
11
|
+
Reddit MCP Server v2.0.2
|
|
12
12
|
|
|
13
13
|
Usage: reddit-mcp-server [options]
|
|
14
14
|
|
|
@@ -22,15 +22,21 @@ expects an MCP client such as Claude Desktop or Claude Code on stdin/stdout.
|
|
|
22
22
|
Run as HTTP: TRANSPORT_TYPE=httpStream npx reddit-mcp-server
|
|
23
23
|
|
|
24
24
|
Environment Variables:
|
|
25
|
-
REDDIT_CLIENT_ID Reddit API client ID (optional,
|
|
26
|
-
REDDIT_CLIENT_SECRET Reddit API client secret (optional,
|
|
25
|
+
REDDIT_CLIENT_ID Reddit API client ID (optional; without it, reads are keyless)
|
|
26
|
+
REDDIT_CLIENT_SECRET Reddit API client secret (optional, used with the client ID)
|
|
27
27
|
REDDIT_USERNAME Reddit username (optional, for write operations)
|
|
28
28
|
REDDIT_PASSWORD Reddit password (optional, for write operations)
|
|
29
29
|
REDDIT_USER_AGENT Custom user agent (optional)
|
|
30
|
-
REDDIT_AUTH_MODE Authentication mode: auto, authenticated
|
|
30
|
+
REDDIT_AUTH_MODE Authentication mode: auto, authenticated (default: auto; anonymous is deprecated)
|
|
31
31
|
REDDIT_SAFE_MODE Spam protection: off, standard, strict (default: standard)
|
|
32
32
|
REDDIT_BOT_DISCLOSURE Bot disclosure footer: auto, off (default: off)
|
|
33
33
|
REDDIT_BOT_FOOTER Custom bot footer text (optional, used with REDDIT_BOT_DISCLOSURE=auto)
|
|
34
|
+
TRANSPORT_TYPE Set to httpStream to serve Streamable HTTP at /mcp (default: stdio)
|
|
35
|
+
PORT, HOST HTTP port and bind address (defaults: 3000, 127.0.0.1)
|
|
36
|
+
OAUTH_ENABLED Set to true to require a bearer token on HTTP (token from OAUTH_TOKEN)
|
|
37
|
+
|
|
38
|
+
Without OAuth credentials, reads come from Reddit's RSS feeds (until 2026-11-13) and the
|
|
39
|
+
Arctic Shift archive. Reddit closes its public API in March 2027.
|
|
34
40
|
|
|
35
41
|
For more information, visit: https://github.com/jordanburke/reddit-mcp-server
|
|
36
42
|
`);
|
package/dist/bin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bin.js","names":[],"sources":["../src/bin.ts"],"sourcesContent":["#!/usr/bin/env node\n\ndeclare const __VERSION__: string\n\n// Force stdio mode for CLI/npx usage (unless explicitly overridden)\
|
|
1
|
+
{"version":3,"file":"bin.js","names":[],"sources":["../src/bin.ts"],"sourcesContent":["#!/usr/bin/env node\n\ndeclare const __VERSION__: string\n\n// Force stdio mode for CLI/npx usage (unless explicitly overridden)\n// A blank value (TRANSPORT_TYPE=) counts as unset, as it does in index.ts.\nif ((process.env.TRANSPORT_TYPE ?? \"\").trim() === \"\") process.env.TRANSPORT_TYPE = \"stdio\"\n\n// Handle command line arguments BEFORE any other imports\nconst args = process.argv.slice(2)\n\nif (args.includes(\"--version\") || args.includes(\"-v\")) {\n console.log(__VERSION__)\n process.exit(0)\n}\n\nif (args.includes(\"--help\") || args.includes(\"-h\")) {\n console.log(`\nReddit MCP Server v${__VERSION__}\n\nUsage: reddit-mcp-server [options]\n\nOptions:\n -v, --version Show version number\n -h, --help Show help\n\nThis is an MCP server, not an interactive CLI. In stdio mode (the default here) it\nexpects an MCP client such as Claude Desktop or Claude Code on stdin/stdout.\n Test interactively: npx @modelcontextprotocol/inspector npx reddit-mcp-server\n Run as HTTP: TRANSPORT_TYPE=httpStream npx reddit-mcp-server\n\nEnvironment Variables:\n REDDIT_CLIENT_ID Reddit API client ID (optional; without it, reads are keyless)\n REDDIT_CLIENT_SECRET Reddit API client secret (optional, used with the client ID)\n REDDIT_USERNAME Reddit username (optional, for write operations)\n REDDIT_PASSWORD Reddit password (optional, for write operations)\n REDDIT_USER_AGENT Custom user agent (optional)\n REDDIT_AUTH_MODE Authentication mode: auto, authenticated (default: auto; anonymous is deprecated)\n REDDIT_SAFE_MODE Spam protection: off, standard, strict (default: standard)\n REDDIT_BOT_DISCLOSURE Bot disclosure footer: auto, off (default: off)\n REDDIT_BOT_FOOTER Custom bot footer text (optional, used with REDDIT_BOT_DISCLOSURE=auto)\n TRANSPORT_TYPE Set to httpStream to serve Streamable HTTP at /mcp (default: stdio)\n PORT, HOST HTTP port and bind address (defaults: 3000, 127.0.0.1)\n OAUTH_ENABLED Set to true to require a bearer token on HTTP (token from OAUTH_TOKEN)\n\nWithout OAuth credentials, reads come from Reddit's RSS feeds (until 2026-11-13) and the\nArctic Shift archive. Reddit closes its public API in March 2027.\n\nFor more information, visit: https://github.com/jordanburke/reddit-mcp-server\n`)\n process.exit(0)\n}\n\n// Import and start server if not showing version/help\nasync function main() {\n await import(\"./index.js\")\n}\n\nvoid main().catch(console.error)\n"],"mappings":";;AAMA,KAAK,QAAQ,IAAI,kBAAkB,GAAA,CAAI,KAAK,MAAM,IAAI,QAAQ,IAAI,iBAAiB;AAGnF,MAAM,OAAO,QAAQ,KAAK,MAAM,CAAC;AAEjC,IAAI,KAAK,SAAS,WAAW,KAAK,KAAK,SAAS,IAAI,GAAG;CACrD,QAAQ,IAAA,OAAe;CACvB,QAAQ,KAAK,CAAC;AAChB;AAEA,IAAI,KAAK,SAAS,QAAQ,KAAK,KAAK,SAAS,IAAI,GAAG;CAClD,QAAQ,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgCb;CACC,QAAQ,KAAK,CAAC;AAChB;AAGA,eAAe,OAAO;CACpB,MAAM,OAAO;AACf;AAEK,KAAK,CAAC,CAAC,MAAM,QAAQ,KAAK"}
|