@pipeworx/mcp-reddit-archive 0.0.0-stage → 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Mojibake Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,163 @@
1
- # Temporary Holding Version
1
+ # @pipeworx/reddit-archive
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Historical Reddit post and comment search, and subreddit activity over time,
4
+ going back to Reddit's early years — reaching far further back than the live
5
+ Reddit API, which only exposes a recent, unfiltered window.
6
+
7
+ Part of [Pipeworx](https://pipeworx.io) — an MCP gateway connecting AI agents to 1779+ live data sources. This is an independent, unofficial integration — not affiliated with, endorsed by, or published by the upstream provider.
8
+
9
+ ## Tools
10
+
11
+ - `reddit_history_posts(subreddit, query?, after?, before?, limit?, sort?)` — posts from one subreddit, filtered by keyword and/or date range. Returns id, title, author, created_utc (ISO), score, num_comments, permalink.
12
+ - `reddit_history_comments(subreddit?, link_id?, query?, after?, before?, limit?, sort?)` — comments scoped to a subreddit and/or a specific post, filtered by keyword and/or date range. Requires at least one of `subreddit` or `link_id`. Returns id, author, created_utc (ISO), score, body, link_id, permalink.
13
+ - `subreddit_activity(subreddit, after?, before?)` — subreddit identity (subscriber count, creation date, all-time post/comment totals, earliest indexed post/comment) plus monthly post/comment counts within a date window (default: the last 12 months).
14
+
15
+ ## Auth
16
+
17
+ Keyless.
18
+
19
+ ## Data sources
20
+
21
+ - Arctic Shift (the `arctic_shift` open-source project by Arthur Heitmann), a
22
+ historical Reddit archive — independently re-crawled and republished public
23
+ Reddit posts, comments and subreddit metadata, covering years the live
24
+ Reddit API no longer serves. No uptime guarantee is published.
25
+
26
+ ## Other notes
27
+
28
+ - **Silent-zero handling.** The upstream answers an empty result with the
29
+ same shape whether a subreddit genuinely has nothing matching a filter OR
30
+ the subreddit was never indexed at all — there is no dedicated "not found"
31
+ status for that case. On an empty result this pack makes one extra lookup
32
+ call against the upstream's own subreddit index to tell the two apart:
33
+ an unindexed/nonexistent subreddit throws a loud error; a real subreddit
34
+ with a genuinely empty window returns an explicit `verified_empty: true`
35
+ result instead of a bare `[]`. `reddit_history_comments` does the same
36
+ check against the post id when scoped by `link_id` instead of `subreddit`.
37
+ - **Transient 422s and 429s.** The upstream occasionally answers a well-formed
38
+ query with HTTP 422 ("Timeout. Maybe slow down a bit") or HTTP 429
39
+ (rate-limited) — observed live to recur 2-3 times in a row under load,
40
+ unrelated to the query itself. This pack retries both, honouring `Retry-After`
41
+ on a 429 when the upstream sends one, within a 20s wall-clock retry budget
42
+ (not just a fixed attempt count) before surfacing it as a real error.
43
+ - **Monthly bucket labelling (`subreddit_activity`).** The upstream's
44
+ aggregate endpoint buckets by local calendar month but reports each
45
+ bucket's timestamp converted to UTC, which lands on the last hour of the
46
+ PRECEDING UTC day (e.g. a January bucket arrives as
47
+ `"2019-12-31T23:00:00.000Z"`). This pack rolls that timestamp forward to
48
+ the next UTC midnight before reading the month, so `monthly_posts` /
49
+ `monthly_comments` are labelled by the month they actually cover.
50
+ - **Politeness.** This pack keeps outbound calls to roughly one per second —
51
+ tools that need more than one upstream call internally (the empty-result
52
+ existence check; `subreddit_activity`'s three calls) space them out rather
53
+ than firing in a burst.
54
+ - **No per-author aggregation.** `reddit_history_comments` accepts no author
55
+ filter and this pack does not roll any tool's results up by author — only
56
+ the raw, publicly-served posts/comments a filter matches.
57
+ - **Date format.** `after`/`before` take ISO dates like `"2019-01-01"`.
58
+ - IDs come back bare (e.g. `"ei9204"`, not `"t3_ei9204"`); `link_id` accepts
59
+ either form.
60
+
61
+ ## Quick Start
62
+
63
+ Add to your MCP client (Claude Desktop, Cursor, Windsurf, etc.):
64
+
65
+ ```json
66
+ {
67
+ "mcpServers": {
68
+ "reddit-archive": {
69
+ "url": "https://gateway.pipeworx.io/reddit-archive/mcp"
70
+ }
71
+ }
72
+ }
73
+ ```
74
+
75
+ ### What this endpoint actually serves
76
+
77
+ `tools/list` at `https://gateway.pipeworx.io/reddit-archive/mcp` returns the tools in the table
78
+ above **plus the shared Pipeworx meta-tools** — `ask_pipeworx`,
79
+ `discover_tools`, `search_within`, `remember`/`recall` and the rest of the
80
+ gateway-wide set. So the tool count you see is larger than this table: a
81
+ single-pack endpoint currently lists roughly 30 shared tools alongside the
82
+ pack's own. The connection's `initialize` response states its exact scope, and
83
+ is the authoritative answer for a given day.
84
+
85
+ This is deliberate, not multiplexing by accident. The meta-tools are what let a
86
+ scoped connection answer a question this pack does not cover — via
87
+ `ask_pipeworx`, which routes across the whole catalog — without you adding a
88
+ second MCP server. There is currently no way to mount a pack endpoint without
89
+ them; if the extra schemas cost you more context than the routing is worth,
90
+ connect to the full gateway once rather than to several pack endpoints.
91
+
92
+ Or connect to the full Pipeworx gateway to get every pack's tools listed
93
+ directly, instead of just this one's:
94
+
95
+ ```json
96
+ {
97
+ "mcpServers": {
98
+ "pipeworx": {
99
+ "url": "https://gateway.pipeworx.io/mcp"
100
+ }
101
+ }
102
+ }
103
+ ```
104
+
105
+ Both URLs reach the same gateway and the same 1779+ data sources. The
106
+ only difference is which pack's tools are listed **directly**; `ask_pipeworx`
107
+ reaches all of them from either one.
108
+
109
+ ## No MCP client? Call it over HTTP
110
+
111
+ ```bash
112
+ curl -X POST https://gateway.pipeworx.io/v1/tools/reddit_history_posts \
113
+ -H 'Content-Type: application/json' \
114
+ -d '{"subreddit":"datasets","before":"2020-01-01","after":"2019-01-01","limit":5}'
115
+ ```
116
+
117
+ No account needed for the first calls. Inspect any tool: `GET https://gateway.pipeworx.io/v1/tools/reddit_history_posts`. Find one: `POST https://gateway.pipeworx.io/v1/tools/search_packs` with `{"query":"..."}`.
118
+
119
+ ## Standalone (no gateway account)
120
+
121
+ This package also runs as a local stdio MCP server — no Pipeworx account, no
122
+ gateway round-trip:
123
+
124
+ ```json
125
+ {
126
+ "mcpServers": {
127
+ "reddit-archive": {
128
+ "command": "npx",
129
+ "args": ["-y", "@pipeworx/mcp-reddit-archive"]
130
+ }
131
+ }
132
+ }
133
+ ```
134
+
135
+ Or run it directly to confirm it starts:
136
+
137
+ ```bash
138
+ npx -y @pipeworx/mcp-reddit-archive
139
+ ```
140
+
141
+ It speaks MCP over stdin/stdout and answers `initialize`/`tools/list`/`tools/call`
142
+ for **only** this pack's tools — none of the shared meta-tools the gateway
143
+ connection above adds. Same source, same tools, no ask_pipeworx routing.
144
+
145
+ ## Using with ask_pipeworx
146
+
147
+ Instead of calling tools directly, you can ask questions in plain English —
148
+ this works on the pack endpoint above as well as on the full gateway:
149
+
150
+ ```
151
+ ask_pipeworx({ question: "your question about Reddit Archive data" })
152
+ ```
153
+
154
+ The gateway picks the right tool and fills the arguments automatically.
155
+
156
+ ## More
157
+
158
+ - [Docs and guides](https://pipeworx.io/docs)
159
+ - [pipeworx.io](https://pipeworx.io)
160
+
161
+ ## License
162
+
163
+ MIT
package/bin/cli.js ADDED
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env node
2
+ //
3
+ // Entry point for `npx @pipeworx/mcp-<slug>`.
4
+ //
5
+ // Packs ship as raw TypeScript (no build step — see publish-pack.sh for why:
6
+ // tsx sidesteps every extensionless-import / bare-JSON-import edge case a
7
+ // per-pack tsc build would have to solve one pack at a time). This file
8
+ // registers tsx's ESM loader programmatically, then hands off to src/server.ts,
9
+ // which wraps the pack's {tools, callTool} export in a stdio MCP server.
10
+ //
11
+ // Copied verbatim into every published pack repo by scripts/publish-pack.sh —
12
+ // edit this file, not a per-pack copy.
13
+ import { register } from 'tsx/esm/api';
14
+
15
+ register();
16
+
17
+ await import('../src/server.ts');
package/package.json CHANGED
@@ -1,6 +1,32 @@
1
1
  {
2
2
  "name": "@pipeworx/mcp-reddit-archive",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "Reddit Archive — historical Reddit post and comment search, and subreddit",
5
+ "type": "module",
6
+ "main": "src/index.ts",
7
+ "types": "src/index.ts",
8
+ "bin": {
9
+ "mcp-reddit-archive": "bin/cli.js"
10
+ },
11
+ "keywords": ["mcp", "mcp-server", "model-context-protocol", "pipeworx", "reddit-archive"],
12
+ "license": "MIT",
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "git+https://github.com/pipeworx-io/mcp-reddit-archive.git"
16
+ },
17
+ "scripts": {
18
+ "typecheck": "tsc --noEmit"
19
+ },
20
+ "dependencies": {
21
+ "@modelcontextprotocol/sdk": "^1.30.0",
22
+ "tsx": "^4.19.0"
23
+ },
24
+ "devDependencies": {
25
+ "typescript": "^5.9.3",
26
+ "@cloudflare/workers-types": "^4.20260405.1"
27
+ },
28
+ "pipeworx": {
29
+ "sourceHash": "v1-0cbc659dbfbc8bb3e5ac5316f6af6fcd28e7466a2eefc97939fa21ed979300d3",
30
+ "sourceCommit": "c1590c25b5e94f477a53686cb61bd09cc196c1ee"
31
+ }
32
+ }
package/server.json ADDED
@@ -0,0 +1,18 @@
1
+ {
2
+ "$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
3
+ "name": "io.github.pipeworx-io/reddit-archive",
4
+ "title": "Reddit Archive",
5
+ "description": "Reddit Archive — historical Reddit post and comment search, and subreddit",
6
+ "version": "0.1.0",
7
+ "websiteUrl": "https://pipeworx.io/packs/reddit-archive",
8
+ "repository": {
9
+ "url": "https://github.com/pipeworx-io/mcp-reddit-archive",
10
+ "source": "github"
11
+ },
12
+ "remotes": [
13
+ {
14
+ "type": "streamable-http",
15
+ "url": "https://gateway.pipeworx.io/reddit-archive/mcp"
16
+ }
17
+ ]
18
+ }