redditapis-mcp 0.11.0 → 0.12.0

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,21 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.12.0 (2026-10-18)
4
+
5
+ ### The read price in the server instructions is passed in, never written
6
+
7
+ The instructions said "most $0.002", a figure written into this file. The day
8
+ read plans moved the read rate to $0.0015, every MCP client would have been told
9
+ a price the API no longer bills. The hosted server now passes the rate
10
+ its own billing charges (`createServer({ readRateUsd })`, the rate the API bills), and the local server names no figure and points at
11
+ redditapis.com/pricing. A missing, non-positive or non-finite rate falls back to
12
+ the figure-free sentence. test/read-price.test.mjs covers both modes and refuses
13
+ a price literal in src/server.js. The instructions stay under the 2048-character
14
+ budget (2044 local, 1853 hosted).
15
+
16
+ The README states the launch prices: $0.0015 per read pay as you go, monthly
17
+ read plans from $19 for 30,000 reads, and 1,000 free reads a month.
18
+
3
19
  ## 0.11.0 (2026-10-16)
4
20
 
5
21
  Released to npm as 0.11.0: the changes below plus reddit_account_payments (#23), which makes this a minor release (the version-class gate refuses a patch that adds a tool).
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
  [![npm downloads](https://img.shields.io/npm/dm/redditapis-mcp)](https://www.npmjs.com/package/redditapis-mcp)
5
5
  [![license](https://img.shields.io/npm/l/redditapis-mcp)](./LICENSE)
6
6
 
7
- redditapis-mcp is the official MCP server for RedditAPIs, built for developers and AI agents that need live Reddit data in Claude, Cursor, Windsurf, VS Code or any MCP client, with no Reddit developer app. Your agent can search posts and comments, read subreddit feeds and rules, expand comment trees, look up users and communities, and set up monitors that send new matching posts to your webhook. Reads cost $0.002 per call, and new accounts get $0.50 of free credit with no card. The server only reads Reddit; posting, commenting and voting stay on the RedditAPIs REST API. Every tool maps to one endpoint at api.redditapis.com.
7
+ redditapis-mcp is the official MCP server for RedditAPIs, built for developers and AI agents that need live Reddit data in Claude, Cursor, Windsurf, VS Code or any MCP client, with no Reddit developer app. Your agent can search posts and comments, read subreddit feeds and rules, expand comment trees, look up users and communities, and set up monitors that send new matching posts to your webhook. Reads cost $0.0015 per call (or a monthly read plan from $19 for 30,000 reads), every account gets 1,000 free reads a month, and new accounts get $0.50 of free credit with no card. The server only reads Reddit; posting, commenting and voting stay on the RedditAPIs REST API. Every tool maps to one endpoint at api.redditapis.com.
8
8
 
9
9
  Install: `npx -y redditapis-mcp@latest` with `REDDITAPIS_KEY` from https://www.redditapis.com
10
10
 
@@ -346,7 +346,7 @@ npm start # run the stdio server (needs REDDITAPIS_KEY)
346
346
 
347
347
  **Do I need a Reddit developer app?** No. One RedditAPIs key covers every read, with no Reddit developer app to register.
348
348
 
349
- **What does it cost?** $0.002 per read, with $0.50 of free credit at signup and no card. Monitors need a monitoring plan, which has no free tier.
349
+ **What does it cost?** $0.0015 per read pay as you go, or a monthly read plan from $19 for 30,000 reads; every account gets 1,000 free reads a month, plus $0.50 of free credit at signup and no card. Monitors need a monitoring plan, which has no free tier.
350
350
 
351
351
  **Can it post, comment or vote?** Not through this server. It reads Reddit only; writes are on the RedditAPIs REST API. All 30 Reddit-facing tools read Reddit; posting, commenting, voting, and DMs are a separate authenticated surface and are not exposed here. Of the other 17, the 10 monitor/webhook tools manage your OWN redditapis.com monitors and webhooks (a write, but never a write to Reddit itself), `reddit_set_watch` sets up a whole watch in one call, `reddit_explain` says where the rows you hold came from, the 3 feedback tools send or read a report to the redditapis.com team, and `reddit_account_me` and `reddit_account_payments` read your own balance, plan and top-up history.
352
352
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "redditapis-mcp",
3
- "version": "0.11.0",
3
+ "version": "0.12.0",
4
4
  "mcpName": "io.github.redditapis/redditapis-mcp",
5
5
  "description": "Official MCP server for redditapis.com. Search Reddit posts, comments, communities, users and media; read subreddits, comment trees, top posts and profiles; create and manage monitors and webhooks. Native tools for Claude, Cursor and any MCP client.",
6
6
  "repository": {
@@ -31,7 +31,7 @@
31
31
  "scripts": {
32
32
  "start": "node src/index.js",
33
33
  "check": "node --check src/index.js && node --check src/tools.js && node --check src/feedback.js && node --check src/server.js && node --check src/watch.js && node --check src/watch-text.js && node --check src/provenance.js && node --check src/playbooks.js && node --check src/annotations.js",
34
- "test": "node test/tools.test.mjs && node test/watch.test.mjs && node test/watch-invariants.test.mjs && node test/provenance.test.mjs && node test/playbooks.test.mjs && node test/description-compliance.test.mjs && node test/inline-credentials.test.mjs && node test/feedback.test.mjs && node test/index-lasterror.test.mjs && node test/scannable-without-key.test.mjs && node test/per-caller-state.test.mjs && node test/paywall.test.mjs && node test/remote-host.test.mjs && node test/hub-parity.test.mjs && node test/version-parity.test.mjs && node test/readme-opening.test.mjs && node test/annotations.test.mjs",
34
+ "test": "node test/tools.test.mjs && node test/watch.test.mjs && node test/watch-invariants.test.mjs && node test/provenance.test.mjs && node test/playbooks.test.mjs && node test/description-compliance.test.mjs && node test/inline-credentials.test.mjs && node test/feedback.test.mjs && node test/index-lasterror.test.mjs && node test/scannable-without-key.test.mjs && node test/per-caller-state.test.mjs && node test/paywall.test.mjs && node test/remote-host.test.mjs && node test/hub-parity.test.mjs && node test/version-parity.test.mjs && node test/readme-opening.test.mjs && node test/annotations.test.mjs && node test/read-price.test.mjs",
35
35
  "prepublishOnly": "node scripts/prepublish-tenant-check.mjs",
36
36
  "postpublish": "node scripts/postpublish.mjs",
37
37
  "check:registry-drift": "node scripts/registry-drift.mjs",
package/src/server.js CHANGED
@@ -165,13 +165,28 @@ export function hintFor(status, path, error) {
165
165
  const SESSION_SENTENCE =
166
166
  "reddit_home_feed and reddit_user_upvoted/saved/hidden/gilded need the user's own Reddit cookies (reddit_session, loid) from POST /api/reddit/login on the REST API, not an MCP tool. ";
167
167
 
168
- export function buildInstructions({ inlineCredentials = true } = {}) {
169
- return INSTRUCTIONS_HEAD + (inlineCredentials ? SESSION_SENTENCE : "") + INSTRUCTIONS_TAIL;
168
+ // THE READ PRICE IS PASSED IN, NEVER WRITTEN HERE. The hosted server passes the
169
+ // rate its own billing charges (readRateUsd, from the API's pricing module), so
170
+ // the instructions can never name a price the API does not bill; a published
171
+ // figure in this file went stale the day read plans changed the read rate.
172
+ // Without a rate (the local stdio server) the sentence names no figure and
173
+ // points at the pricing page. A non-number or a non-positive rate is ignored.
174
+ export function readPriceSentence(readRateUsd) {
175
+ const r = Number(readRateUsd);
176
+ const priced = readRateUsd !== null && readRateUsd !== undefined && readRateUsd !== "" && Number.isFinite(r) && r > 0;
177
+ return priced
178
+ ? `Read tools bill per call (most $${r}); monitor, webhook and feedback tools are free. `
179
+ : "Read tools bill per call (prices: redditapis.com/pricing); monitor, webhook and feedback tools are free. ";
170
180
  }
171
181
 
182
+ export function buildInstructions({ inlineCredentials = true, readRateUsd = null } = {}) {
183
+ return INSTRUCTIONS_LEAD + readPriceSentence(readRateUsd) + INSTRUCTIONS_HEAD + (inlineCredentials ? SESSION_SENTENCE : "") + INSTRUCTIONS_TAIL;
184
+ }
185
+
186
+ const INSTRUCTIONS_LEAD = "redditapis.com MCP server. ";
187
+
172
188
  const INSTRUCTIONS_HEAD =
173
- "redditapis.com MCP server. Read tools cost credits per call (most $0.002); monitor, webhook and feedback tools are free. " +
174
- "reddit_account_me shows the balance for free before a large batch; on a 402, give the user the error's top-up URL. " +
189
+ "reddit_account_me shows the balance free before a big batch; on a 402, give the user the error's top-up URL. " +
175
190
  "reddit_search: sort='relevance' with a large `limit` for best matches; sort_type='score' re-orders that page; a quoted phrase or `subreddit` narrows it. " +
176
191
  "reddit_deep_comment_search returns matching comments; reddit_search_comments only their posts. " +
177
192
  "reddit_search_communities searches subreddits; reddit_subreddits_popular/new/default browse them. ";
@@ -215,6 +230,9 @@ export const INSTRUCTIONS = buildInstructions({ inlineCredentials: true });
215
230
  * proxy (takesInlineCredentials in tools.js) UNREGISTERED, and drops the
216
231
  * instructions sentence that names them. A remote host passes false so a
217
232
  * connected app is never asked to send a Reddit session through it.
233
+ * @param {number|null} [opts.readRateUsd] the read price the API bills right now.
234
+ * The hosted server passes it from its own pricing; omitted (the local
235
+ * server) the instructions name no figure (readPriceSentence).
218
236
  */
219
237
  export function createServer({
220
238
  apiKey,
@@ -227,6 +245,7 @@ export function createServer({
227
245
  nowImpl = () => Date.now(),
228
246
  retryDelaysMs = [3000, 8000],
229
247
  inlineCredentials = true,
248
+ readRateUsd = null,
230
249
  } = {}) {
231
250
  // A STRING "false" from an environment variable must not silently leave the
232
251
  // cookie tools exposed on a hosted server (review 2026-10-02): booleans only.
@@ -430,7 +449,7 @@ export function createServer({
430
449
 
431
450
  const server = new McpServer(
432
451
  { name: "redditapis", version: VERSION },
433
- { instructions: buildInstructions({ inlineCredentials: inlineCredentials !== false }) },
452
+ { instructions: buildInstructions({ inlineCredentials: inlineCredentials !== false, readRateUsd }) },
434
453
  );
435
454
 
436
455
  // Handlers for tools that carry local: "<name>" in the catalog. A name the