redditapis-mcp 0.3.0 → 0.3.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 CHANGED
@@ -1,5 +1,34 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.1
4
+ - **Fix: the server no longer exits at startup when `REDDITAPIS_KEY` is missing.**
5
+ A registry connectivity scanner (Smithery, Glama, the official MCP registry,
6
+ Claude Connectors Directory) spins up the server with no real credential to
7
+ enumerate `tools/list`. Exiting before the transport connects made every
8
+ automated scan fail outright and read as a generic connectivity error rather
9
+ than a missing-key error, which is most of why this listing scored low on
10
+ every registry's capability-quality checks. Tools now register and
11
+ `tools/list` responds regardless of whether a key is present; an actual tool
12
+ call with no key still fails clearly, at the point of the call, with the
13
+ same style of message the existing 401 branch already used.
14
+ - Adds `server.json` (official MCP server manifest: description, homepage,
15
+ repository, npm package identifier, and the `REDDITAPIS_KEY` config field
16
+ with a title and description) to the repo and to the published package, so
17
+ registry submissions have a durable, versioned source instead of a local,
18
+ never-committed file.
19
+
20
+ ## 0.3.0
21
+ - 4 new READ tools for the caller's own private Reddit listings (upvoted,
22
+ saved, hidden, gilded), each requiring the caller's own Reddit session
23
+ cookie obtained via `POST /api/reddit/login`.
24
+ - Pagination docs clarified across every listing tool: `listing_status` on the
25
+ final page distinguishes `complete` (nothing missing) from `truncated`/
26
+ `unknown` (Reddit stopped serving a busy listing early), so a client no
27
+ longer reads a null `after` cursor as proof of a complete result set.
28
+ - This CHANGELOG entry is retroactive; 0.3.0 published without one, along with
29
+ drifting one npm publish ahead of what GitHub had committed. Both are
30
+ corrected as part of the 0.3.1 pass.
31
+
3
32
  ## 0.2.0
4
33
  - **10 new monitor/webhook management tools** (task #43), the first WRITES this
5
34
  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.1",
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.1",
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.1",
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);