reddit-mcp-server 1.7.2 → 2.0.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/CHANGELOG.md +140 -0
- package/README.md +73 -19
- package/dist/bin.js +12 -6
- package/dist/bin.js.map +1 -1
- package/dist/index.js +101 -125
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,146 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [2.0.1] - 2026-10-31
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- A blank environment value (`KEY=`, as in a copied `.env.example`) now counts as unset everywhere:
|
|
10
|
+
- `OAUTH_TOKEN=` with `OAUTH_ENABLED=true` generated no token and rejected every HTTP request; the server now generates one and prints it
|
|
11
|
+
- `REDDIT_AUTH_MODE=authenticated` with blank `REDDIT_CLIENT_ID`/`REDDIT_CLIENT_SECRET` started keyless; it now fails at startup, as documented
|
|
12
|
+
- Blank `REDDIT_USERNAME`/`REDDIT_PASSWORD` counted as write credentials, so `test_reddit_mcp_server` reported write access and the write tools' credential checks passed
|
|
13
|
+
- Blank `PORT` and `HOST` gave a `NaN` port and an empty bind address; they now default to 3000 and 127.0.0.1
|
|
14
|
+
- Blank `REDDIT_AUTH_MODE` and `REDDIT_SAFE_MODE` stopped the server with an "invalid mode" error; they now default to `auto` and `standard`
|
|
15
|
+
- Blank `REDDIT_MAX_RETRIES` turned off 429 retries; it now defaults to 3
|
|
16
|
+
- Blank `REDDIT_USER_AGENT` sent an empty `User-Agent` to Reddit; the server now uses its auto-generated agent
|
|
17
|
+
- Blank `REDDIT_BOT_FOOTER` with `REDDIT_BOT_DISCLOSURE=auto` posted no disclosure; the built-in footer is used
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
|
|
21
|
+
- 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
|
|
22
|
+
- The CHANGELOG gains entries for 1.5.1 through 1.7.2
|
|
23
|
+
|
|
24
|
+
## [2.0.0] - 2026-10-31
|
|
25
|
+
|
|
26
|
+
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.
|
|
27
|
+
|
|
28
|
+
### Changed
|
|
29
|
+
|
|
30
|
+
- The server runs on [somamcp](https://github.com/sapientsai/somamcp) 2.2 (MCP TypeScript SDK 2.x) instead of FastMCP. Tool names, descriptions and parameters are unchanged; tools now also carry a top-level `title`, and their input schemas are JSON Schema draft 2020-12
|
|
31
|
+
- Tool errors read as plain text: `Failed to search: …` instead of `Tool 'search_reddit' execution failed: Failed to search: …`, still with `isError: true`
|
|
32
|
+
- Invalid tool arguments come back as a tool result with `isError: true` (`Invalid arguments for tool 'get_user_posts': Too big: …`), not a JSON-RPC `-32602` protocol error, and the message no longer names the field
|
|
33
|
+
- HTTP serving is stateless: no `Mcp-Session-Id`, and `GET`/`DELETE /mcp` answer 405. MCP SDK clients handle this
|
|
34
|
+
- `/health` answers JSON (`{"name":"reddit-mcp-server","status":"running"}`) instead of the text `✓ Ok`. `/health/detail` is new and takes the bearer token when `OAUTH_ENABLED=true`; with OAuth off it always answers 401
|
|
35
|
+
- Requests over 4 MiB get 413
|
|
36
|
+
- 401 and 403 responses carry the standard reason phrases instead of custom ones; the status codes are unchanged
|
|
37
|
+
- The Docker Compose health check probes `/health` instead of `/`, which was always 404
|
|
38
|
+
- The Docker build downloads pnpm's native binary once per platform, with retries, in a cached layer. The runtime image runs on node alone, without pnpm, and shrinks from 129 MB to 72 MB
|
|
39
|
+
- `manifest.json` lists all 25 tools; it listed 15
|
|
40
|
+
- `functype` 1.22; `somamcp` 2.2.1, so `/health/detail` answers a wrong token with 403, as `/mcp` does
|
|
41
|
+
|
|
42
|
+
### Removed
|
|
43
|
+
|
|
44
|
+
- The legacy SSE endpoint (`/sse`). HTTP clients use Streamable HTTP at `/mcp`
|
|
45
|
+
- `/ready`. Use `/health`
|
|
46
|
+
|
|
47
|
+
### Unchanged on purpose
|
|
48
|
+
|
|
49
|
+
- CORS: preflight and responses still allow any origin, as under FastMCP
|
|
50
|
+
- 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
|
|
51
|
+
|
|
52
|
+
## [1.7.2] - 2026-10-30
|
|
53
|
+
|
|
54
|
+
### Changed
|
|
55
|
+
|
|
56
|
+
- 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
|
|
57
|
+
- 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
|
|
58
|
+
|
|
59
|
+
### Fixed
|
|
60
|
+
|
|
61
|
+
- Subreddit and user search results no longer show blank post-only fields (author, comments)
|
|
62
|
+
- `get_subreddit_info` no longer prints an empty Community Analysis for mid-size subreddits
|
|
63
|
+
|
|
64
|
+
## [1.7.1] - 2026-10-28
|
|
65
|
+
|
|
66
|
+
### Fixed
|
|
67
|
+
|
|
68
|
+
- Keyless search no longer reports the default `relevance` sort as ignored, and subreddit search reports its subscriber order
|
|
69
|
+
- `get_reddit_post` no longer prints an empty Engagement Analysis
|
|
70
|
+
- The publish workflow waits up to 15 minutes for the npm tarball and logs in to the MCP Registry after that wait
|
|
71
|
+
|
|
72
|
+
## [1.7.0] - 2026-10-28
|
|
73
|
+
|
|
74
|
+
### Added
|
|
75
|
+
|
|
76
|
+
- 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
|
|
77
|
+
- `get_post_comments` lists the ids of collapsed comments, so `get_more_comments` can expand them
|
|
78
|
+
- `test_reddit_mcp_server` reports whether reads come from Reddit's API or keyless sources
|
|
79
|
+
|
|
80
|
+
### Changed
|
|
81
|
+
|
|
82
|
+
- Dependencies updated to latest, with ts-builds 4 and pnpm 12; Node pinned to 24.21.0 for npm publishing
|
|
83
|
+
|
|
84
|
+
## [1.6.3] - 2026-09-27
|
|
85
|
+
|
|
86
|
+
### Fixed
|
|
87
|
+
|
|
88
|
+
- Link posts show their body text as well as their URL, and comment truncation limits are higher
|
|
89
|
+
- stdio mode warns when stdin is a terminal, which means no MCP client is attached
|
|
90
|
+
|
|
91
|
+
## [1.6.2] - 2026-09-18
|
|
92
|
+
|
|
93
|
+
### Changed
|
|
94
|
+
|
|
95
|
+
- fastmcp 4.20
|
|
96
|
+
|
|
97
|
+
### Fixed
|
|
98
|
+
|
|
99
|
+
- The publish workflow waits for npm before publishing to the MCP Registry
|
|
100
|
+
|
|
101
|
+
## [1.6.1] - 2026-09-17
|
|
102
|
+
|
|
103
|
+
### Added
|
|
104
|
+
|
|
105
|
+
- `save_content` and `unsave_content`
|
|
106
|
+
|
|
107
|
+
### Fixed
|
|
108
|
+
|
|
109
|
+
- `search_reddit` with `type=sr` or `type=user` always returned no results
|
|
110
|
+
- The publish workflow tolerates an npm version that is already published
|
|
111
|
+
|
|
112
|
+
## [1.6.0] - 2026-09-17
|
|
113
|
+
|
|
114
|
+
### Added
|
|
115
|
+
|
|
116
|
+
- RSS fallback: `browse_subreddit` and `get_top_posts` work without OAuth credentials
|
|
117
|
+
|
|
118
|
+
### Deprecated
|
|
119
|
+
|
|
120
|
+
- `REDDIT_AUTH_MODE=anonymous`, because Reddit blocks unauthenticated API requests; it is now an alias for `auto` without credentials
|
|
121
|
+
|
|
122
|
+
## [1.5.3] - 2026-08-08
|
|
123
|
+
|
|
124
|
+
### Changed
|
|
125
|
+
|
|
126
|
+
- The README documents Reddit's IP block on unauthenticated requests
|
|
127
|
+
|
|
128
|
+
## [1.5.2] - 2026-08-08
|
|
129
|
+
|
|
130
|
+
### Security
|
|
131
|
+
|
|
132
|
+
- 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
|
|
133
|
+
- SECURITY.md and private vulnerability reporting
|
|
134
|
+
|
|
135
|
+
### Fixed
|
|
136
|
+
|
|
137
|
+
- When Reddit IP-blocks unauthenticated requests, the error says so and points to OAuth credentials, instead of reading as a private subreddit
|
|
138
|
+
|
|
139
|
+
## [1.5.1] - 2026-07-01
|
|
140
|
+
|
|
141
|
+
### Changed
|
|
142
|
+
|
|
143
|
+
- Richer tool descriptions and parameter docs
|
|
144
|
+
|
|
5
145
|
## [1.5.0] - 2026-06-22
|
|
6
146
|
|
|
7
147
|
### 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,7 +261,7 @@ 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
|
|
|
224
267
|
### Keyless Mode
|
|
@@ -242,7 +285,7 @@ Without OAuth credentials, reads come from two free sources:
|
|
|
242
285
|
|
|
243
286
|
**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
287
|
|
|
245
|
-
**Still needs OAuth:** `get_trending_subreddits`, `get_post_flairs`, `get_me`, `get_my_overview`, `get_my_saved`, and all write tools.
|
|
288
|
+
**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
289
|
|
|
247
290
|
### Read-Only Access (OAuth)
|
|
248
291
|
|
|
@@ -278,7 +321,9 @@ To create posts, reply, edit, or delete content, add your Reddit username and pa
|
|
|
278
321
|
```bash
|
|
279
322
|
pnpm install # Install dependencies
|
|
280
323
|
pnpm build # Build TypeScript
|
|
281
|
-
pnpm dev #
|
|
324
|
+
pnpm dev # Rebuild on every change
|
|
325
|
+
pnpm inspect # Build and open the MCP inspector
|
|
326
|
+
pnpm validate # Format, lint, typecheck, test and build
|
|
282
327
|
pnpm test # Run tests
|
|
283
328
|
pnpm lint # Lint code
|
|
284
329
|
pnpm format # Format code
|
|
@@ -289,7 +334,6 @@ pnpm format # Format code
|
|
|
289
334
|
```bash
|
|
290
335
|
npx reddit-mcp-server --version # Show version
|
|
291
336
|
npx reddit-mcp-server --help # Show help
|
|
292
|
-
npx reddit-mcp-server --generate-token # Generate OAuth token for HTTP mode
|
|
293
337
|
```
|
|
294
338
|
|
|
295
339
|
## HTTP Server Mode
|
|
@@ -300,23 +344,30 @@ For Docker deployments or web-based clients, use HTTP transport:
|
|
|
300
344
|
TRANSPORT_TYPE=httpStream PORT=3000 node dist/index.js
|
|
301
345
|
```
|
|
302
346
|
|
|
347
|
+
- The MCP endpoint is Streamable HTTP at `/mcp`. Version 2.0 removed the legacy SSE endpoint (`/sse`) and `/ready`.
|
|
348
|
+
- The server binds `127.0.0.1` unless you set `HOST`. The Docker image sets `HOST=0.0.0.0`.
|
|
349
|
+
- `/health` answers `{"name":"reddit-mcp-server","status":"running"}` and needs no token.
|
|
350
|
+
|
|
303
351
|
### With OAuth Protection
|
|
304
352
|
|
|
305
353
|
```bash
|
|
306
354
|
export OAUTH_ENABLED=true
|
|
307
|
-
export OAUTH_TOKEN=$(
|
|
355
|
+
export OAUTH_TOKEN=$(openssl rand -hex 32)
|
|
308
356
|
TRANSPORT_TYPE=httpStream node dist/index.js
|
|
309
357
|
```
|
|
310
358
|
|
|
311
|
-
Make authenticated requests:
|
|
359
|
+
If `OAUTH_TOKEN` is unset or empty, the server generates one and prints it at startup. Make authenticated requests:
|
|
312
360
|
|
|
313
361
|
```bash
|
|
314
362
|
curl -H "Authorization: Bearer $OAUTH_TOKEN" \
|
|
315
363
|
-H "Content-Type: application/json" \
|
|
316
|
-
-
|
|
364
|
+
-H "Accept: application/json, text/event-stream" \
|
|
365
|
+
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' \
|
|
317
366
|
http://localhost:3000/mcp
|
|
318
367
|
```
|
|
319
368
|
|
|
369
|
+
A request with no token gets 401, and a wrong token gets 403.
|
|
370
|
+
|
|
320
371
|
## Docker
|
|
321
372
|
|
|
322
373
|
### Quick Start
|
|
@@ -334,6 +385,8 @@ docker run -d \
|
|
|
334
385
|
ghcr.io/jordanburke/reddit-mcp-server:latest
|
|
335
386
|
```
|
|
336
387
|
|
|
388
|
+
Leave out the two credential variables to run the container keyless.
|
|
389
|
+
|
|
337
390
|
### Docker Compose
|
|
338
391
|
|
|
339
392
|
```yaml
|
|
@@ -349,6 +402,7 @@ services:
|
|
|
349
402
|
- REDDIT_PASSWORD=${REDDIT_PASSWORD}
|
|
350
403
|
- REDDIT_SAFE_MODE=standard
|
|
351
404
|
- OAUTH_ENABLED=${OAUTH_ENABLED:-false}
|
|
405
|
+
# Unset or empty: the server generates a token and prints it at startup
|
|
352
406
|
- OAUTH_TOKEN=${OAUTH_TOKEN}
|
|
353
407
|
restart: unless-stopped
|
|
354
408
|
```
|
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("
|
|
6
|
+
console.log("2.0.1");
|
|
7
7
|
process.exit(0);
|
|
8
8
|
}
|
|
9
9
|
if (args.includes("--help") || args.includes("-h")) {
|
|
10
10
|
console.log(`
|
|
11
|
-
Reddit MCP Server
|
|
11
|
+
Reddit MCP Server v2.0.1
|
|
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"}
|