redditapis-mcp 0.3.0 → 0.3.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 CHANGED
@@ -1,5 +1,54 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.2
4
+ - **Security: 10 Dependabot alerts closed (3 high, 6 moderate, 1 low)**, all in
5
+ transitive dependencies pulled in by `@modelcontextprotocol/sdk` (never a
6
+ direct dependency of this package): `hono` (SSR output cross-user
7
+ disclosure, ReDoS in CORS/language middleware, header handling in the proxy
8
+ helper), `fast-uri` (host confusion via a backslash authority delimiter),
9
+ `ip-address` (three separate SSRF/trust-boundary bypasses via octal,
10
+ IPv4-mapped, and CIDR-suffix address confusion), and `@hono/node-server`
11
+ (path traversal on Windows). Fixed by a clean reinstall against the
12
+ existing `@modelcontextprotocol/sdk: ^1.0.0` range, which already permitted
13
+ the patched versions; no version constraint changed, only the resolved
14
+ tree (SDK 1.29.0 to 1.30.0, hono to 4.13.2, fast-uri to 3.1.5, ip-address
15
+ to 10.5.0, @hono/node-server to 2.1.1). This server only imports the SDK's
16
+ stdio transport (confirmed: `src/index.js` never imports `hono` or the
17
+ SDK's HTTP transport), so `hono` and `@hono/node-server` never load at
18
+ runtime here; `fast-uri` and `ip-address` sit deeper in the SDK's own
19
+ dependency tree and were not individually traced. Fixed regardless, since
20
+ Dependabot flags them independent of reachability and a clean scan is
21
+ the point.
22
+
23
+ ## 0.3.1
24
+ - **Fix: the server no longer exits at startup when `REDDITAPIS_KEY` is missing.**
25
+ A registry connectivity scanner (Smithery, Glama, the official MCP registry,
26
+ Claude Connectors Directory) spins up the server with no real credential to
27
+ enumerate `tools/list`. Exiting before the transport connects made every
28
+ automated scan fail outright and read as a generic connectivity error rather
29
+ than a missing-key error, which is most of why this listing scored low on
30
+ every registry's capability-quality checks. Tools now register and
31
+ `tools/list` responds regardless of whether a key is present; an actual tool
32
+ call with no key still fails clearly, at the point of the call, with the
33
+ same style of message the existing 401 branch already used.
34
+ - Adds `server.json` (official MCP server manifest: description, homepage,
35
+ repository, npm package identifier, and the `REDDITAPIS_KEY` config field
36
+ with a title and description) to the repo and to the published package, so
37
+ registry submissions have a durable, versioned source instead of a local,
38
+ never-committed file.
39
+
40
+ ## 0.3.0
41
+ - 4 new READ tools for the caller's own private Reddit listings (upvoted,
42
+ saved, hidden, gilded), each requiring the caller's own Reddit session
43
+ cookie obtained via `POST /api/reddit/login`.
44
+ - Pagination docs clarified across every listing tool: `listing_status` on the
45
+ final page distinguishes `complete` (nothing missing) from `truncated`/
46
+ `unknown` (Reddit stopped serving a busy listing early), so a client no
47
+ longer reads a null `after` cursor as proof of a complete result set.
48
+ - This CHANGELOG entry is retroactive; 0.3.0 published without one, along with
49
+ drifting one npm publish ahead of what GitHub had committed. Both are
50
+ corrected as part of the 0.3.1 pass.
51
+
3
52
  ## 0.2.0
4
53
  - **10 new monitor/webhook management tools** (task #43), the first WRITES this
5
54
  catalog has ever carried. Unlike the reddit comment/vote/DM writes this MCP
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "redditapis-mcp",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "mcpName": "io.github.redditapis/redditapis-mcp",
5
5
  "description": "Official MCP server for redditapis.com, the Reddit API (subreddit listings, post + comment + community + user + media search, comment trees, top posts, user profiles) plus monitor/webhook management (create/list/update/remove a monitor, register/test/delete a webhook, read delivery history) as native tools for Claude, Cursor, and any MCP client.",
6
6
  "repository": {
@@ -18,7 +18,8 @@
18
18
  "README.md",
19
19
  "LICENSE",
20
20
  "CHANGELOG.md",
21
- "smithery.yaml"
21
+ "smithery.yaml",
22
+ "server.json"
22
23
  ],
23
24
  "engines": {
24
25
  "node": ">=18"
package/server.json ADDED
@@ -0,0 +1,30 @@
1
+ {
2
+ "$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
3
+ "name": "io.github.redditapis/redditapis-mcp",
4
+ "description": "Reddit API as MCP tools: search, subreddits, posts, comments, users, monitors, and webhooks.",
5
+ "title": "RedditAPIs",
6
+ "version": "0.3.2",
7
+ "websiteUrl": "https://www.redditapis.com",
8
+ "repository": {
9
+ "url": "https://github.com/redditapis/redditapis-mcp",
10
+ "source": "github"
11
+ },
12
+ "packages": [
13
+ {
14
+ "registryType": "npm",
15
+ "identifier": "redditapis-mcp",
16
+ "version": "0.3.2",
17
+ "transport": {
18
+ "type": "stdio"
19
+ },
20
+ "environmentVariables": [
21
+ {
22
+ "name": "REDDITAPIS_KEY",
23
+ "description": "Your redditapis.com API key. Get one at https://www.redditapis.com",
24
+ "isRequired": true,
25
+ "isSecret": true
26
+ }
27
+ ]
28
+ }
29
+ ]
30
+ }
package/src/index.js CHANGED
@@ -33,11 +33,19 @@ const REQUEST_TIMEOUT_MS = Number(process.env.REDDITAPIS_TIMEOUT_MS || 30000);
33
33
  // User-Agent and MCP server handshake understated its own version for months.
34
34
  const { version: VERSION } = createRequire(import.meta.url)("../package.json");
35
35
 
36
+ // Lazy validation, not exit-on-boot: an MCP registry scanner (Smithery, Glama,
37
+ // the official registry, Claude Connectors) connects the stdio transport with
38
+ // no real credential to enumerate tools/list. Exiting here before the server
39
+ // ever registers a tool makes that handshake fail outright and reads as a
40
+ // generic connectivity error, not a missing-key error, on the scanner side --
41
+ // confirmed live 2026-08-18 (Smithery: "Initialization failed... could not be
42
+ // automatically scanned", HTTP 404). Warn and continue; a real tool CALL made
43
+ // with no key still fails clearly, at the point of the call, same as it
44
+ // already does for a bad key (see the 401 branch below).
36
45
  if (!API_KEY) {
37
46
  console.error(
38
- "[reddit-mcp] Missing REDDITAPIS_KEY. Get a key at https://www.redditapis.com and set it in your MCP client config.",
47
+ "[reddit-mcp] Missing REDDITAPIS_KEY. Get a key at https://www.redditapis.com and set it in your MCP client config. Tools are registered but every call will fail until it is set.",
39
48
  );
40
- process.exit(1);
41
49
  }
42
50
 
43
51
  // REST call. Resolves any {param} path placeholders from args, and for GET
@@ -46,6 +54,15 @@ if (!API_KEY) {
46
54
  // `filterSpecFields`). Forwards the API key as a Bearer token (redditapis.com
47
55
  // authenticates via `Authorization: Bearer <key>` only).
48
56
  async function callEndpoint(pathTemplate, args, method = "GET", tool = null) {
57
+ if (!API_KEY) {
58
+ return {
59
+ isError: true,
60
+ content: [{
61
+ type: "text",
62
+ text: "Missing REDDITAPIS_KEY (invalid or missing API key, get one at https://www.redditapis.com and set it in your MCP client config).",
63
+ }],
64
+ };
65
+ }
49
66
  const { path, rest } = buildPath(pathTemplate, args);
50
67
  const isWrite = method !== "GET";
51
68
  const q = isWrite ? "" : buildQuery(rest);