redditapis-mcp 0.1.10 → 0.1.11

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 CHANGED
@@ -1,5 +1,16 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.11
4
+ - Two new read tools for subreddit governance (both $0.002, one upstream read each):
5
+ - **`reddit_subreddit_moderators`** (`GET /api/reddit/sub/{name}/moderators`),
6
+ a subreddit's moderator team: each moderator's username, id, mod permissions,
7
+ flair text, and the time they were added. Returns a `moderators` list.
8
+ - **`reddit_subreddit_wiki`** (`GET /api/reddit/sub/{name}/wiki/{page}`), a
9
+ subreddit's wiki page by name and page: the page's markdown and HTML content,
10
+ a may-revise flag, and the last revision's metadata. Returns a single object.
11
+ The page may be multi-segment, for example index, rules, or config/sidebar.
12
+ - Brings the published read-only tool count to 22.
13
+
3
14
  ## 0.1.10
4
15
  - Three new read tools for community DISCOVERY (all $0.002, one upstream read each):
5
16
  - **`reddit_subreddits_popular`** (`GET /api/reddit/subreddits/popular`), browse
package/README.md CHANGED
@@ -1,20 +1,62 @@
1
1
  # redditapis-mcp
2
2
 
3
- Official [Model Context Protocol](https://modelcontextprotocol.io) server for
4
- **[redditapis.com](https://www.redditapis.com)** — the Reddit API as native tools
5
- for Claude, Cursor, and any MCP client.
3
+ [![npm version](https://img.shields.io/npm/v/redditapis-mcp)](https://www.npmjs.com/package/redditapis-mcp)
4
+ [![npm downloads](https://img.shields.io/npm/dm/redditapis-mcp)](https://www.npmjs.com/package/redditapis-mcp)
5
+ [![license](https://img.shields.io/npm/l/redditapis-mcp)](./LICENSE)
6
6
 
7
- It exposes Reddit reads as typed tools: subreddit listings, post / comment /
8
- community / user / media search, a post's full comment tree, subreddit top posts,
9
- and user profile + comments. Each tool is a thin, stateless wrapper over a REST
10
- endpoint at `https://api.redditapis.com`; your API key is forwarded on every call.
7
+ Official **Model Context Protocol** server for [redditapis.com](https://www.redditapis.com), the Reddit API as native tools for Claude, Cursor, Windsurf, and any MCP client. It turns Reddit reads (search, subreddit listings, comment trees, user profiles, community metadata) into typed tools your agent can call directly.
8
+
9
+ Ask your agent to search Reddit for a topic, read a community's top posts of the week, pull a user's comment history, surface the redditors talking about a product, or read a subreddit's rules before you engage, and it calls the API for you. Every tool maps to a REST endpoint at `https://api.redditapis.com`; the server holds no state and forwards your API key on each call.
10
+
11
+ ## Quick start
12
+
13
+ No install needed. Run with `npx`. You need one thing: an API key from **[redditapis.com](https://www.redditapis.com)**. Reads work with just that key, so there is no account login or session step to set up.
11
14
 
12
15
  ## Setup
13
16
 
14
- Get an API key at [redditapis.com](https://www.redditapis.com), then add the
15
- server to your MCP client. It runs over stdio via `npx` (no install needed):
17
+ ### Claude Desktop
18
+
19
+ Edit `claude_desktop_config.json` (Settings > Developer > Edit Config):
20
+
21
+ ```json
22
+ {
23
+ "mcpServers": {
24
+ "reddit": {
25
+ "command": "npx",
26
+ "args": ["-y", "redditapis-mcp@latest"],
27
+ "env": { "REDDITAPIS_KEY": "YOUR_API_KEY" }
28
+ }
29
+ }
30
+ }
31
+ ```
32
+
33
+ Restart Claude Desktop. The `reddit_*` tools appear in the tool picker.
34
+
35
+ ### Claude Code
36
+
37
+ ```bash
38
+ claude mcp add reddit --env REDDITAPIS_KEY=YOUR_API_KEY -- npx -y redditapis-mcp@latest
39
+ ```
40
+
41
+ ### Cursor
42
+
43
+ `~/.cursor/mcp.json` (or Settings > MCP > Add New Server):
44
+
45
+ ```json
46
+ {
47
+ "mcpServers": {
48
+ "reddit": {
49
+ "command": "npx",
50
+ "args": ["-y", "redditapis-mcp@latest"],
51
+ "env": { "REDDITAPIS_KEY": "YOUR_API_KEY" }
52
+ }
53
+ }
54
+ }
55
+ ```
56
+
57
+ ### Windsurf
16
58
 
17
- ### Claude Desktop / Claude Code / Cursor (`mcp.json`)
59
+ `~/.codeium/windsurf/mcp_config.json`:
18
60
 
19
61
  ```json
20
62
  {
@@ -22,48 +64,196 @@ server to your MCP client. It runs over stdio via `npx` (no install needed):
22
64
  "reddit": {
23
65
  "command": "npx",
24
66
  "args": ["-y", "redditapis-mcp@latest"],
25
- "env": { "REDDITAPIS_KEY": "your_api_key_here" }
67
+ "env": { "REDDITAPIS_KEY": "YOUR_API_KEY" }
68
+ }
69
+ }
70
+ }
71
+ ```
72
+
73
+ ### VS Code (Copilot / agent mode)
74
+
75
+ `.vscode/mcp.json` in your workspace, or the user-level MCP settings:
76
+
77
+ ```json
78
+ {
79
+ "servers": {
80
+ "reddit": {
81
+ "type": "stdio",
82
+ "command": "npx",
83
+ "args": ["-y", "redditapis-mcp@latest"],
84
+ "env": { "REDDITAPIS_KEY": "YOUR_API_KEY" }
26
85
  }
27
86
  }
28
87
  }
29
88
  ```
30
89
 
31
- ## Configuration (env)
90
+ ## Configuration
32
91
 
33
- | Variable | Required | Default | Notes |
92
+ | Env var | Required | Default | Purpose |
34
93
  |---|---|---|---|
35
- | `REDDITAPIS_KEY` | yes | — | Your key. `REDDIT_APIS_KEY` is accepted as an alias. |
36
- | `REDDITAPIS_BASE_URL` | no | `https://api.redditapis.com` | Override the API base. |
37
- | `REDDITAPIS_TIMEOUT_MS` | no | `30000` | Per-request timeout in ms. |
94
+ | `REDDITAPIS_KEY` | Yes | (none) | API key from [redditapis.com](https://www.redditapis.com). `REDDIT_APIS_KEY` is accepted as an alias. |
95
+ | `REDDITAPIS_BASE_URL` | No | `https://api.redditapis.com` | Override the API host. |
96
+ | `REDDITAPIS_TIMEOUT_MS` | No | `30000` | Per-request timeout in milliseconds. |
97
+
98
+ Authentication is a Bearer token: the server sends `Authorization: Bearer <REDDITAPIS_KEY>` on every request.
38
99
 
39
100
  ## Tools
40
101
 
41
- All tools are **read-only**. Reddit writes (comment / vote / DM) are a separate
42
- authenticated surface and are intentionally not exposed here.
102
+ 22 tools, all reads. This server is **read-only** by design. Reddit writes (posting, commenting, voting, DMs) are a separate authenticated surface and are intentionally out of scope here, so every tool below works with just your API key, with no account login or session step.
103
+
104
+ A few conventions across the catalog:
105
+
106
+ - Subreddit names go in **without** the `r/` prefix, and usernames **without** the `u/` prefix. `reddit_subreddit_posts` takes its community as `subreddit`; the `/sub/{name}/...` tools take it as `name`.
107
+ - Listing and search tools return an `after` cursor. Pass it back as `after` to fetch the next page. `limit` accepts 1 to 100 (the API clamps out-of-range values).
108
+ - `t` (`hour`, `day`, `week`, `month`, `year`, `all`) sets the time window; on subreddit listings it applies to the `top` and `controversial` sorts, and on search it bounds the whole result set.
109
+
110
+ ### Search and discovery
43
111
 
44
112
  | Tool | Endpoint | What it does |
45
113
  |---|---|---|
46
- | `reddit_subreddit_posts` | `GET /api/reddit/posts` | List a subreddit's posts by sort (hot/new/top/rising/…) |
47
- | `reddit_search` | `GET /api/reddit/search` | Search posts across Reddit or one subreddit |
48
- | `reddit_post_comments` | `GET /api/reddit/comments` | A post + its comment tree, by permalink |
49
- | `reddit_search_communities` | `GET /api/reddit/search/communities` | Find subreddits by name/topic |
50
- | `reddit_search_comments` | `GET /api/reddit/search/comments` | Search by comment text; returns the parent posts (Reddit limitation) |
51
- | `reddit_search_media` | `GET /api/reddit/search/media` | Search image/video/gif posts |
52
- | `reddit_search_users` | `GET /api/reddit/search/users` | Find redditors by name |
53
- | `reddit_subreddit_top` | `GET /api/reddit/sub/{name}/top` | Top posts of a subreddit for a time window |
54
- | `reddit_post` | `GET /api/reddit/post/{id}` | A single post by id |
55
- | `reddit_user_profile` | `GET /api/reddit/user/{name}` | A user's public profile |
56
- | `reddit_user_comments` | `GET /api/reddit/user/{name}/comments` | A user's recent comments |
114
+ | `reddit_search` | `GET /api/reddit/search` | Search posts across all of Reddit or within one subreddit (`subreddit`). |
115
+ | `reddit_search_comments` | `GET /api/reddit/search/comments` | Search by comment text; returns the parent posts, since Reddit's comment search does not hand back the matching comment itself. |
116
+ | `reddit_deep_comment_search` | `GET /api/reddit/search/comments/deep` | Genuine comment search: returns the actual matching comment bodies (score, author, comment-deep permalink, parent post). `limit` sets how many parent posts to expand; `group_by="author"` switches to research mode (the distinct people talking about your query). Premium call. |
117
+ | `reddit_search_media` | `GET /api/reddit/search/media` | Search posts filtered to media, narrowed by `kind` (`image`, `video`, `gif`, `all`). |
118
+ | `reddit_search_communities` | `GET /api/reddit/search/communities` | Find subreddits by name or topic (title, subscribers, description, NSFW flag). |
119
+ | `reddit_search_users` | `GET /api/reddit/search/users` | Find redditors by name or keyword (username, karma, account age). |
120
+
121
+ ### Subreddits
122
+
123
+ | Tool | Endpoint | What it does |
124
+ |---|---|---|
125
+ | `reddit_subreddit_posts` | `GET /api/reddit/posts` | List a subreddit's posts by `sort` (`new`, `hot`, `top`, `rising`, `controversial`, `best`). |
126
+ | `reddit_subreddit_top` | `GET /api/reddit/sub/{name}/top` | Top posts of a subreddit for a time window (`t`). |
127
+ | `reddit_subreddit_comments` | `GET /api/reddit/sub/{name}/comments` | Stream the newest comments across an entire subreddit (not one post's thread). |
128
+ | `reddit_subreddit_about` | `GET /api/reddit/sub/{name}/about` | A subreddit's public metadata: title, description, subscriber and active-user counts, type, NSFW flag. |
129
+ | `reddit_subreddit_rules` | `GET /api/reddit/sub/{name}/rules` | A subreddit's posting rules plus Reddit's site-wide rules. |
130
+ | `reddit_subreddit_moderators` | `GET /api/reddit/sub/{name}/moderators` | A subreddit's moderator team, each with permissions, flair, and when they joined. |
131
+ | `reddit_subreddit_wiki` | `GET /api/reddit/sub/{name}/wiki/{page}` | A subreddit's wiki page by name and `page` (markdown + HTML, revision metadata). |
132
+
133
+ ### Posts and comments
134
+
135
+ | Tool | Endpoint | What it does |
136
+ |---|---|---|
137
+ | `reddit_post` | `GET /api/reddit/post/{id}` | A single post by its base-36 `id` (no `t3_` prefix): title, author, score, text, permalink, subreddit, url. |
138
+ | `reddit_post_comments` | `GET /api/reddit/comments` | A post plus its full threaded comment tree, fetched by `permalink`. |
139
+ | `reddit_by_id` | `GET /api/reddit/by_id/{fullnames}` | Bulk-hydrate up to 100 posts in one call from a comma-separated list of `t3_` fullnames. |
140
+
141
+ ### Users
142
+
143
+ | Tool | Endpoint | What it does |
144
+ |---|---|---|
145
+ | `reddit_user_profile` | `GET /api/reddit/user/{name}` | A user's public profile: karma, account age, verified/employee flags, avatar. |
146
+ | `reddit_user_comments` | `GET /api/reddit/user/{name}/comments` | A user's recent comments (body, score, subreddit, parent link, timestamp). |
147
+ | `reddit_user_submitted` | `GET /api/reddit/user/{name}/submitted` | A user's submitted posts (the sibling of `reddit_user_comments`). |
148
+
149
+ ### Community browse (no keyword)
150
+
151
+ | Tool | Endpoint | What it does |
152
+ |---|---|---|
153
+ | `reddit_subreddits_popular` | `GET /api/reddit/subreddits/popular` | Browse the most-subscribed, trending subreddits right now. |
154
+ | `reddit_subreddits_new` | `GET /api/reddit/subreddits/new` | Browse the newest subreddits, most recently created first. |
155
+ | `reddit_subreddits_default` | `GET /api/reddit/subreddits/default` | Browse Reddit's default front-page set of subreddits. |
156
+
157
+ ## Usage examples
158
+
159
+ ### Research a topic across Reddit
160
+
161
+ > "What are people saying about the Rust borrow checker this month?"
162
+
163
+ The agent calls `reddit_search` with:
164
+
165
+ ```
166
+ q: "borrow checker"
167
+ sort: "top"
168
+ t: "month"
169
+ ```
170
+
171
+ ### Read a community's top posts of the week
172
+
173
+ > "Show me the top posts in r/programming this week."
174
+
175
+ The agent calls `reddit_subreddit_top` with:
176
+
177
+ ```
178
+ name: "programming"
179
+ t: "week"
180
+ ```
181
+
182
+ To page further, pass the `after` cursor from the response back on the next call: `{ name: "programming", t: "week", after: "<after from response>" }`.
183
+
184
+ ### Find who is talking about a product
185
+
186
+ > "Which redditors are recommending mechanical keyboards, and what do they say?"
187
+
188
+ The agent calls `reddit_deep_comment_search` with:
189
+
190
+ ```
191
+ q: "mechanical keyboard"
192
+ group_by: "author"
193
+ sort: "top"
194
+ ```
195
+
196
+ Research mode returns the distinct people who mentioned the query, ranked by how many of their comments matched, each with their top comment and the subreddits they matched in.
197
+
198
+ ### Vet a subreddit, then read a thread
199
+
200
+ > "Find a discussion about API rate limiting in r/webdev, check the sub's rules, and read the full thread."
201
+
202
+ The agent calls `reddit_search` scoped to the community:
203
+
204
+ ```
205
+ q: "rate limiting"
206
+ subreddit: "webdev"
207
+ sort: "relevance"
208
+ t: "year"
209
+ ```
210
+
211
+ Then `reddit_subreddit_rules` with `{ name: "webdev" }`, and finally `reddit_post_comments` with the `permalink` from a search result, for example `{ permalink: "/r/webdev/comments/abc123/some_title/" }`, to pull the post and its comment tree.
212
+
213
+ ## Reads only, no session needed
214
+
215
+ Because this server exposes reads and nothing that writes, there is no account linking, login, or cookie step: your API key alone authorizes every call. Reddit write actions (posting, commenting, voting, sending DMs) are handled by a separate authenticated surface outside this package and are deliberately not exposed here, so an agent using this server cannot take an action on any account.
216
+
217
+ ## Troubleshooting
218
+
219
+ **`HTTP 401 (invalid or missing API key)`** Check that `REDDITAPIS_KEY` is set correctly in your MCP client config and matches the key from [redditapis.com](https://www.redditapis.com).
220
+
221
+ **`HTTP 402 (insufficient credits)`** Top up your account at [redditapis.com](https://www.redditapis.com).
222
+
223
+ **`HTTP 403 (access forbidden)`** The subreddit or user may be private, banned, or quarantined, or your plan may not include this endpoint.
224
+
225
+ **`HTTP 404 (not found)`** The subreddit, post id, user, or permalink may be wrong or the content may have been deleted or removed.
226
+
227
+ **`HTTP 429 (rate limited)`** Wait a few seconds and retry, or reduce request frequency. For bulk work, space out calls and raise `REDDITAPIS_TIMEOUT_MS`.
228
+
229
+ **`Request failed: timed out after 30000ms`** The default timeout is 30 seconds. For large `reddit_deep_comment_search` or paginated fetches, set `REDDITAPIS_TIMEOUT_MS` higher (for example `60000`).
230
+
231
+ **Tools do not appear in Claude / Cursor** Ensure `npx` is on your PATH and Node.js 18+ is installed (`node --version`). Check your MCP client logs for startup errors.
57
232
 
58
233
  ## Development
59
234
 
60
235
  ```bash
61
236
  npm install
62
- npm run check # syntax check both source files
237
+ npm run check # syntax-check both source files
63
238
  npm test # unit-test the tool catalog + query/path builders (no network)
64
239
  npm start # run the stdio server (needs REDDITAPIS_KEY)
65
240
  ```
66
241
 
242
+ ## Links
243
+
244
+ - Site and API keys: [redditapis.com](https://www.redditapis.com)
245
+ - REST API base URL (call it directly, without MCP): `https://api.redditapis.com`
246
+
247
+ ## FAQ
248
+
249
+ **Do I need a Reddit developer account?** No. Get an API key at [redditapis.com](https://www.redditapis.com); there is no application or approval step.
250
+
251
+ **Can it post, comment, or vote?** No. This server is read-only. All 22 tools read Reddit; writes are a separate authenticated surface and are not exposed here.
252
+
253
+ **Which clients are supported?** Claude Desktop, Claude Code, Cursor, Windsurf, and VS Code (Copilot agent mode), or any Model Context Protocol client.
254
+
255
+ **Does it store my key or data?** No. The server holds no state and forwards your API key on each call.
256
+
67
257
  ## License
68
258
 
69
259
  MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "redditapis-mcp",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "description": "Official MCP server for redditapis.com, the Reddit API (subreddit listings, post + comment + community + user + media search, comment trees, top posts, user profiles) as native tools for Claude, Cursor, and any MCP client.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -16,7 +16,8 @@
16
16
  "src",
17
17
  "README.md",
18
18
  "LICENSE",
19
- "CHANGELOG.md"
19
+ "CHANGELOG.md",
20
+ "smithery.yaml"
20
21
  ],
21
22
  "engines": {
22
23
  "node": ">=18"
@@ -37,7 +38,9 @@
37
38
  "reddit-api",
38
39
  "claude",
39
40
  "cursor",
40
- "redditapis"
41
+ "redditapis",
42
+ "modelcontextprotocol",
43
+ "ai-tools"
41
44
  ],
42
45
  "author": "redditapis.com",
43
46
  "license": "MIT",
package/smithery.yaml ADDED
@@ -0,0 +1,27 @@
1
+ # Smithery runtime config for redditapis-mcp.
2
+ # https://smithery.ai/docs/build/project-config
3
+ startCommand:
4
+ type: stdio
5
+ configSchema:
6
+ type: object
7
+ required:
8
+ - redditapisKey
9
+ properties:
10
+ redditapisKey:
11
+ type: string
12
+ title: RedditAPIs API key
13
+ description: Your redditapis.com API key. Get one at https://www.redditapis.com
14
+ redditapisBaseUrl:
15
+ type: string
16
+ title: API base URL
17
+ description: Optional. Defaults to https://api.redditapis.com
18
+ default: https://api.redditapis.com
19
+ commandFunction: |-
20
+ (config) => ({
21
+ command: 'node',
22
+ args: ['src/index.js'],
23
+ env: {
24
+ REDDITAPIS_KEY: config.redditapisKey,
25
+ ...(config.redditapisBaseUrl ? { REDDITAPIS_BASE_URL: config.redditapisBaseUrl } : {}),
26
+ },
27
+ })
package/src/tools.js CHANGED
@@ -271,6 +271,31 @@ export const TOOLS = [
271
271
  ),
272
272
  },
273
273
  },
274
+ {
275
+ name: "reddit_subreddit_moderators",
276
+ path: "/api/reddit/sub/{name}/moderators",
277
+ description:
278
+ "Fetch a subreddit's moderator team by name (Reddit's /r/<name>/about/moderators data). Returns a `moderators` list, each with `name`, `id`, `mod_permissions`, `flair_text`, and `added` (when they joined the mod team). Use it to see who moderates a community. Example: name='python'.",
279
+ shape: {
280
+ name: z.string().min(1).describe(
281
+ "Subreddit name WITHOUT the r/ prefix (e.g. 'python'). Required (path parameter).",
282
+ ),
283
+ },
284
+ },
285
+ {
286
+ name: "reddit_subreddit_wiki",
287
+ path: "/api/reddit/sub/{name}/wiki/{page}",
288
+ description:
289
+ "Fetch a subreddit's wiki page by name and page (Reddit's /r/<name>/wiki/<page> data). Returns a single object with `content_md` and `content_html`, a `may_revise` flag, and the last revision (`revision_id`, `revision_date`, `revised_by`, `reason`). Use it to read a community's wiki, such as its rules or FAQ. The page may be multi-segment, for example index, rules, or config/sidebar. Example: name='python', page='index'.",
290
+ shape: {
291
+ name: z.string().min(1).describe(
292
+ "Subreddit name WITHOUT the r/ prefix (e.g. 'python'). Required (path parameter).",
293
+ ),
294
+ page: z.string().min(1).describe(
295
+ "Wiki page name (e.g. 'index'). Required (path parameter). May be multi-segment like 'config/sidebar'.",
296
+ ),
297
+ },
298
+ },
274
299
  {
275
300
  name: "reddit_by_id",
276
301
  path: "/api/reddit/by_id/{fullnames}",