mcp-researchpowerpack 3.6.9
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/README.md +635 -0
- package/dist/clients/reddit.d.ts +74 -0
- package/dist/clients/reddit.d.ts.map +1 -0
- package/dist/clients/reddit.js +305 -0
- package/dist/clients/reddit.js.map +1 -0
- package/dist/clients/research.d.ts +67 -0
- package/dist/clients/research.d.ts.map +1 -0
- package/dist/clients/research.js +252 -0
- package/dist/clients/research.js.map +1 -0
- package/dist/clients/scraper.d.ts +71 -0
- package/dist/clients/scraper.d.ts.map +1 -0
- package/dist/clients/scraper.js +321 -0
- package/dist/clients/scraper.js.map +1 -0
- package/dist/clients/search.d.ts +62 -0
- package/dist/clients/search.d.ts.map +1 -0
- package/dist/clients/search.js +219 -0
- package/dist/clients/search.js.map +1 -0
- package/dist/config/index.d.ts +62 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +142 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/loader.d.ts +40 -0
- package/dist/config/loader.d.ts.map +1 -0
- package/dist/config/loader.js +305 -0
- package/dist/config/loader.js.map +1 -0
- package/dist/config/types.d.ts +81 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/config/types.js +6 -0
- package/dist/config/types.js.map +1 -0
- package/dist/config/yaml/tools.yaml +130 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +271 -0
- package/dist/index.js.map +1 -0
- package/dist/schemas/deep-research.d.ts +64 -0
- package/dist/schemas/deep-research.d.ts.map +1 -0
- package/dist/schemas/deep-research.js +224 -0
- package/dist/schemas/deep-research.js.map +1 -0
- package/dist/schemas/scrape-links.d.ts +32 -0
- package/dist/schemas/scrape-links.d.ts.map +1 -0
- package/dist/schemas/scrape-links.js +34 -0
- package/dist/schemas/scrape-links.js.map +1 -0
- package/dist/schemas/web-search.d.ts +22 -0
- package/dist/schemas/web-search.d.ts.map +1 -0
- package/dist/schemas/web-search.js +21 -0
- package/dist/schemas/web-search.js.map +1 -0
- package/dist/services/file-attachment.d.ts +30 -0
- package/dist/services/file-attachment.d.ts.map +1 -0
- package/dist/services/file-attachment.js +199 -0
- package/dist/services/file-attachment.js.map +1 -0
- package/dist/services/llm-processor.d.ts +27 -0
- package/dist/services/llm-processor.d.ts.map +1 -0
- package/dist/services/llm-processor.js +179 -0
- package/dist/services/llm-processor.js.map +1 -0
- package/dist/services/markdown-cleaner.d.ts +8 -0
- package/dist/services/markdown-cleaner.d.ts.map +1 -0
- package/dist/services/markdown-cleaner.js +44 -0
- package/dist/services/markdown-cleaner.js.map +1 -0
- package/dist/tools/definitions.d.ts +16 -0
- package/dist/tools/definitions.d.ts.map +1 -0
- package/dist/tools/definitions.js +17 -0
- package/dist/tools/definitions.js.map +1 -0
- package/dist/tools/reddit.d.ts +14 -0
- package/dist/tools/reddit.d.ts.map +1 -0
- package/dist/tools/reddit.js +213 -0
- package/dist/tools/reddit.js.map +1 -0
- package/dist/tools/registry.d.ts +71 -0
- package/dist/tools/registry.d.ts.map +1 -0
- package/dist/tools/registry.js +242 -0
- package/dist/tools/registry.js.map +1 -0
- package/dist/tools/research.d.ts +14 -0
- package/dist/tools/research.d.ts.map +1 -0
- package/dist/tools/research.js +194 -0
- package/dist/tools/research.js.map +1 -0
- package/dist/tools/scrape.d.ts +14 -0
- package/dist/tools/scrape.d.ts.map +1 -0
- package/dist/tools/scrape.js +201 -0
- package/dist/tools/scrape.js.map +1 -0
- package/dist/tools/search.d.ts +10 -0
- package/dist/tools/search.d.ts.map +1 -0
- package/dist/tools/search.js +137 -0
- package/dist/tools/search.js.map +1 -0
- package/dist/tools/utils.d.ts +105 -0
- package/dist/tools/utils.d.ts.map +1 -0
- package/dist/tools/utils.js +159 -0
- package/dist/tools/utils.js.map +1 -0
- package/dist/utils/concurrency.d.ts +29 -0
- package/dist/utils/concurrency.d.ts.map +1 -0
- package/dist/utils/concurrency.js +73 -0
- package/dist/utils/concurrency.js.map +1 -0
- package/dist/utils/errors.d.ts +77 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/errors.js +335 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/logger.d.ts +39 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +57 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/markdown-formatter.d.ts +5 -0
- package/dist/utils/markdown-formatter.d.ts.map +1 -0
- package/dist/utils/markdown-formatter.js +15 -0
- package/dist/utils/markdown-formatter.js.map +1 -0
- package/dist/utils/response.d.ts +88 -0
- package/dist/utils/response.d.ts.map +1 -0
- package/dist/utils/response.js +151 -0
- package/dist/utils/response.js.map +1 -0
- package/dist/utils/url-aggregator.d.ts +90 -0
- package/dist/utils/url-aggregator.d.ts.map +1 -0
- package/dist/utils/url-aggregator.js +502 -0
- package/dist/utils/url-aggregator.js.map +1 -0
- package/dist/version.d.ts +30 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +60 -0
- package/dist/version.js.map +1 -0
- package/dist/worker.d.ts +17 -0
- package/dist/worker.d.ts.map +1 -0
- package/dist/worker.js +53 -0
- package/dist/worker.js.map +1 -0
- package/package.json +73 -0
package/README.md
ADDED
|
@@ -0,0 +1,635 @@
|
|
|
1
|
+
<h1 align="center">🔬 Research Powerpack MCP 🔬</h1>
|
|
2
|
+
<h3 align="center">Stop tab-hopping for research. Start getting structured context.</h3>
|
|
3
|
+
|
|
4
|
+
<p align="center">
|
|
5
|
+
<strong>
|
|
6
|
+
<em>The ultimate research toolkit for your AI coding assistant. It searches the web, mines Reddit, scrapes any URL, and synthesizes everything into perfectly structured context your LLM actually understands.</em>
|
|
7
|
+
</strong>
|
|
8
|
+
</p>
|
|
9
|
+
|
|
10
|
+
<p align="center">
|
|
11
|
+
<!-- Package Info -->
|
|
12
|
+
<a href="https://www.npmjs.com/package/mcp-researchpowerpack"><img alt="npm" src="https://img.shields.io/npm/v/mcp-researchpowerpack.svg?style=flat-square&color=4D87E6"></a>
|
|
13
|
+
<a href="#"><img alt="node" src="https://img.shields.io/badge/node-18+-4D87E6.svg?style=flat-square"></a>
|
|
14
|
+
•
|
|
15
|
+
<!-- Features -->
|
|
16
|
+
<a href="https://opensource.org/licenses/MIT"><img alt="license" src="https://img.shields.io/badge/License-MIT-F9A825.svg?style=flat-square"></a>
|
|
17
|
+
<a href="#"><img alt="platform" src="https://img.shields.io/badge/platform-macOS_|_Linux_|_Windows-2ED573.svg?style=flat-square"></a>
|
|
18
|
+
</p>
|
|
19
|
+
|
|
20
|
+
<p align="center">
|
|
21
|
+
<img alt="modular" src="https://img.shields.io/badge/🧩_modular-use_1_tool_or_all_5-2ED573.svg?style=for-the-badge">
|
|
22
|
+
<img alt="zero crash" src="https://img.shields.io/badge/💪_zero_crash-missing_keys_=_helpful_errors-2ED573.svg?style=for-the-badge">
|
|
23
|
+
</p>
|
|
24
|
+
|
|
25
|
+
<div align="center">
|
|
26
|
+
|
|
27
|
+
### 🧭 Quick Navigation
|
|
28
|
+
|
|
29
|
+
[**⚡ Get Started**](#-get-started-in-60-seconds) •
|
|
30
|
+
[**🎯 Why Research Powerpack**](#-why-research-powerpack) •
|
|
31
|
+
[**🎮 Tools**](#-tool-reference) •
|
|
32
|
+
[**⚙️ Configuration**](#%EF%B8%8F-environment-variables--tool-availability) •
|
|
33
|
+
[**📚 Examples**](#-recommended-workflows)
|
|
34
|
+
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
**`research-powerpack-mcp`** is the research assistant your AI has been missing. Stop asking your LLM to guess about things it doesn't know. This MCP server acts like a senior researcher -- searching the web, mining Reddit discussions, scraping documentation, and synthesizing everything into structured context so your AI can give you answers you can actually trust.
|
|
40
|
+
|
|
41
|
+
<div align="center">
|
|
42
|
+
<table>
|
|
43
|
+
<tr>
|
|
44
|
+
<td align="center">
|
|
45
|
+
<h3>🔍</h3>
|
|
46
|
+
<b>Batch Web Search</b><br/>
|
|
47
|
+
<sub>100 keywords in parallel</sub>
|
|
48
|
+
</td>
|
|
49
|
+
<td align="center">
|
|
50
|
+
<h3>💬</h3>
|
|
51
|
+
<b>Reddit Mining</b><br/>
|
|
52
|
+
<sub>Real opinions, not marketing</sub>
|
|
53
|
+
</td>
|
|
54
|
+
<td align="center">
|
|
55
|
+
<h3>🌐</h3>
|
|
56
|
+
<b>Universal Scraping</b><br/>
|
|
57
|
+
<sub>JS rendering + geo-targeting</sub>
|
|
58
|
+
</td>
|
|
59
|
+
<td align="center">
|
|
60
|
+
<h3>🧠</h3>
|
|
61
|
+
<b>Deep Research</b><br/>
|
|
62
|
+
<sub>AI synthesis with citations</sub>
|
|
63
|
+
</td>
|
|
64
|
+
</tr>
|
|
65
|
+
</table>
|
|
66
|
+
</div>
|
|
67
|
+
|
|
68
|
+
Here's how it works:
|
|
69
|
+
- **You:** "What's the best database for my use case?"
|
|
70
|
+
- **AI + Powerpack:** Searches Google, mines Reddit threads, scrapes docs, synthesizes findings.
|
|
71
|
+
- **You:** Get an actually informed answer with real community opinions and citations.
|
|
72
|
+
- **Result:** Better decisions, faster. No more juggling 47 browser tabs.
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## 🎯 Why Research Powerpack
|
|
77
|
+
|
|
78
|
+
Manual research is tedious and error-prone. `research-powerpack-mcp` replaces that entire workflow with a single integrated pipeline.
|
|
79
|
+
|
|
80
|
+
<table align="center">
|
|
81
|
+
<tr>
|
|
82
|
+
<td align="center"><b>❌ Without Research Powerpack</b></td>
|
|
83
|
+
<td align="center"><b>✅ With Research Powerpack</b></td>
|
|
84
|
+
</tr>
|
|
85
|
+
<tr>
|
|
86
|
+
<td>
|
|
87
|
+
<ol>
|
|
88
|
+
<li>Open 15 browser tabs.</li>
|
|
89
|
+
<li>Skim Stack Overflow answers from 2019.</li>
|
|
90
|
+
<li>Search Reddit, get distracted along the way.</li>
|
|
91
|
+
<li>Copy-paste random snippets to your AI.</li>
|
|
92
|
+
<li>Get a mediocre answer from confused context.</li>
|
|
93
|
+
</ol>
|
|
94
|
+
</td>
|
|
95
|
+
<td>
|
|
96
|
+
<ol>
|
|
97
|
+
<li>Ask your AI to research it.</li>
|
|
98
|
+
<li>AI searches, scrapes, mines Reddit automatically.</li>
|
|
99
|
+
<li>Receive synthesized insights with sources.</li>
|
|
100
|
+
<li>Make an informed decision.</li>
|
|
101
|
+
<li>Move on to the work that matters. ☕</li>
|
|
102
|
+
</ol>
|
|
103
|
+
</td>
|
|
104
|
+
</tr>
|
|
105
|
+
</table>
|
|
106
|
+
|
|
107
|
+
This isn't just fetching random pages. Research Powerpack builds **high-signal, low-noise context** with CTR-weighted ranking, smart comment allocation, and intelligent token distribution that prevents massive responses from breaking your LLM's context window.
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## 🚀 Get Started in 60 Seconds
|
|
112
|
+
|
|
113
|
+
### 1. Install
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
npm install research-powerpack-mcp
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### 2. Configure Your MCP Client
|
|
120
|
+
|
|
121
|
+
<div align="center">
|
|
122
|
+
|
|
123
|
+
| Client | Config File | Docs |
|
|
124
|
+
|:------:|:-----------:|:----:|
|
|
125
|
+
| 🖥️ **Claude Desktop** | `claude_desktop_config.json` | [Setup](#claude-desktop) |
|
|
126
|
+
| ⌨️ **Claude Code** | `~/.claude.json` or CLI | [Setup](#claude-code-cli) |
|
|
127
|
+
| 🎯 **Cursor** | `.cursor/mcp.json` | [Setup](#cursorwindsurf) |
|
|
128
|
+
| 🏄 **Windsurf** | MCP settings | [Setup](#cursorwindsurf) |
|
|
129
|
+
|
|
130
|
+
</div>
|
|
131
|
+
|
|
132
|
+
#### Claude Desktop
|
|
133
|
+
|
|
134
|
+
Add to your `claude_desktop_config.json`:
|
|
135
|
+
|
|
136
|
+
```json
|
|
137
|
+
{
|
|
138
|
+
"mcpServers": {
|
|
139
|
+
"research-powerpack": {
|
|
140
|
+
"command": "npx",
|
|
141
|
+
"args": ["mcp-researchpowerpack"],
|
|
142
|
+
"env": {
|
|
143
|
+
"SERPER_API_KEY": "your_key",
|
|
144
|
+
"REDDIT_CLIENT_ID": "your_id",
|
|
145
|
+
"REDDIT_CLIENT_SECRET": "your_secret",
|
|
146
|
+
"SCRAPEDO_API_KEY": "your_key",
|
|
147
|
+
"OPENROUTER_API_KEY": "your_key"
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
or quick install (for macOS):
|
|
155
|
+
|
|
156
|
+
```
|
|
157
|
+
cat ~/Library/Application\ Support/Claude/claude_desktop_config.json | jq '.mcpServers["research-powerpack"] = {
|
|
158
|
+
"command": "npx",
|
|
159
|
+
"args": ["research-powerpack-mcp@latest"],
|
|
160
|
+
"disabled": false,
|
|
161
|
+
"env": {
|
|
162
|
+
"OPENROUTER_API_KEY": "xxx",
|
|
163
|
+
"REDDIT_CLIENT_ID": "xxx",
|
|
164
|
+
"REDDIT_CLIENT_SECRET": "xxx",
|
|
165
|
+
"RESEARCH_MODEL": "xxxx",
|
|
166
|
+
"SCRAPEDO_API_KEY": "xxx",
|
|
167
|
+
"SERPER_API_KEY": "xxxx"
|
|
168
|
+
}
|
|
169
|
+
}' | tee ~/Library/Application\ Support/Claude/claude_desktop_config.json
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
#### Claude Code (CLI)
|
|
173
|
+
|
|
174
|
+
One command to set everything up:
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
claude mcp add research-powerpack npx \
|
|
178
|
+
--scope user \
|
|
179
|
+
--env SERPER_API_KEY=your_key \
|
|
180
|
+
--env REDDIT_CLIENT_ID=your_id \
|
|
181
|
+
--env REDDIT_CLIENT_SECRET=your_secret \
|
|
182
|
+
--env OPENROUTER_API_KEY=your_key \
|
|
183
|
+
--env OPENROUTER_BASE_URL=https://openrouter.ai/api/v1 \
|
|
184
|
+
--env RESEARCH_MODEL=x-ai/grok-4.1-fast \
|
|
185
|
+
-- research-powerpack-mcp
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
Or manually add to `~/.claude.json`:
|
|
189
|
+
|
|
190
|
+
```json
|
|
191
|
+
{
|
|
192
|
+
"mcpServers": {
|
|
193
|
+
"research-powerpack": {
|
|
194
|
+
"command": "npx",
|
|
195
|
+
"args": ["mcp-researchpowerpack"],
|
|
196
|
+
"env": {
|
|
197
|
+
"SERPER_API_KEY": "your_key",
|
|
198
|
+
"REDDIT_CLIENT_ID": "your_id",
|
|
199
|
+
"REDDIT_CLIENT_SECRET": "your_secret",
|
|
200
|
+
"OPENROUTER_API_KEY": "your_key",
|
|
201
|
+
"OPENROUTER_BASE_URL": "https://openrouter.ai/api/v1",
|
|
202
|
+
"RESEARCH_MODEL": "x-ai/grok-4.1-fast"
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
#### Cursor/Windsurf
|
|
210
|
+
|
|
211
|
+
Add to `.cursor/mcp.json` or equivalent:
|
|
212
|
+
|
|
213
|
+
```json
|
|
214
|
+
{
|
|
215
|
+
"mcpServers": {
|
|
216
|
+
"research-powerpack": {
|
|
217
|
+
"command": "npx",
|
|
218
|
+
"args": ["mcp-researchpowerpack"],
|
|
219
|
+
"env": {
|
|
220
|
+
"SERPER_API_KEY": "your_key"
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
> **Zero Crash Promise:** Missing API keys? No problem. The server always starts. Tools that require missing keys return helpful setup instructions instead of crashing.
|
|
228
|
+
|
|
229
|
+
---
|
|
230
|
+
|
|
231
|
+
## 🎮 Tool Reference
|
|
232
|
+
|
|
233
|
+
<div align="center">
|
|
234
|
+
<table>
|
|
235
|
+
<tr>
|
|
236
|
+
<td align="center">
|
|
237
|
+
<h3>🔍</h3>
|
|
238
|
+
<b><code>web_search</code></b><br/>
|
|
239
|
+
<sub>Batch Google search</sub>
|
|
240
|
+
</td>
|
|
241
|
+
<td align="center">
|
|
242
|
+
<h3>💬</h3>
|
|
243
|
+
<b><code>search_reddit</code></b><br/>
|
|
244
|
+
<sub>Find Reddit discussions</sub>
|
|
245
|
+
</td>
|
|
246
|
+
<td align="center">
|
|
247
|
+
<h3>📖</h3>
|
|
248
|
+
<b><code>get_reddit_post</code></b><br/>
|
|
249
|
+
<sub>Fetch posts + comments</sub>
|
|
250
|
+
</td>
|
|
251
|
+
<td align="center">
|
|
252
|
+
<h3>🌐</h3>
|
|
253
|
+
<b><code>scrape_links</code></b><br/>
|
|
254
|
+
<sub>Extract any URL</sub>
|
|
255
|
+
</td>
|
|
256
|
+
<td align="center">
|
|
257
|
+
<h3>🧠</h3>
|
|
258
|
+
<b><code>deep_research</code></b><br/>
|
|
259
|
+
<sub>AI synthesis</sub>
|
|
260
|
+
</td>
|
|
261
|
+
</tr>
|
|
262
|
+
</table>
|
|
263
|
+
</div>
|
|
264
|
+
|
|
265
|
+
### `web_search`
|
|
266
|
+
|
|
267
|
+
**Batch web search** using Google via Serper API. Search up to 100 keywords in parallel.
|
|
268
|
+
|
|
269
|
+
| Parameter | Type | Required | Description |
|
|
270
|
+
|-----------|------|----------|-------------|
|
|
271
|
+
| `keywords` | `string[]` | Yes | Search queries (1-100). Use distinct keywords for maximum coverage. |
|
|
272
|
+
|
|
273
|
+
**Supports Google operators:** `site:`, `-exclusion`, `"exact phrase"`, `filetype:`
|
|
274
|
+
|
|
275
|
+
```json
|
|
276
|
+
{
|
|
277
|
+
"keywords": [
|
|
278
|
+
"best IDE 2025",
|
|
279
|
+
"VS Code alternatives",
|
|
280
|
+
"Cursor vs Windsurf comparison"
|
|
281
|
+
]
|
|
282
|
+
}
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
---
|
|
286
|
+
|
|
287
|
+
### `search_reddit`
|
|
288
|
+
|
|
289
|
+
**Search Reddit** via Google with automatic `site:reddit.com` filtering.
|
|
290
|
+
|
|
291
|
+
| Parameter | Type | Required | Description |
|
|
292
|
+
|-----------|------|----------|-------------|
|
|
293
|
+
| `queries` | `string[]` | Yes | Search queries (max 10) |
|
|
294
|
+
| `date_after` | `string` | No | Filter results after date (YYYY-MM-DD) |
|
|
295
|
+
|
|
296
|
+
**Search operators:** `intitle:keyword`, `"exact phrase"`, `OR`, `-exclude`
|
|
297
|
+
|
|
298
|
+
```json
|
|
299
|
+
{
|
|
300
|
+
"queries": [
|
|
301
|
+
"best mechanical keyboard 2025",
|
|
302
|
+
"intitle:keyboard recommendation"
|
|
303
|
+
],
|
|
304
|
+
"date_after": "2024-01-01"
|
|
305
|
+
}
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
---
|
|
309
|
+
|
|
310
|
+
### `get_reddit_post`
|
|
311
|
+
|
|
312
|
+
**Fetch Reddit posts** with smart comment allocation (1,000 comment budget distributed automatically).
|
|
313
|
+
|
|
314
|
+
| Parameter | Type | Required | Default | Description |
|
|
315
|
+
|-----------|------|----------|---------|-------------|
|
|
316
|
+
| `urls` | `string[]` | Yes | — | Reddit post URLs (2-50) |
|
|
317
|
+
| `fetch_comments` | `boolean` | No | `true` | Whether to fetch comments |
|
|
318
|
+
| `max_comments` | `number` | No | auto | Override comment allocation |
|
|
319
|
+
|
|
320
|
+
**Smart Allocation:**
|
|
321
|
+
- 2 posts → ~500 comments/post (deep dive)
|
|
322
|
+
- 10 posts → ~100 comments/post
|
|
323
|
+
- 50 posts → ~20 comments/post (quick scan)
|
|
324
|
+
|
|
325
|
+
```json
|
|
326
|
+
{
|
|
327
|
+
"urls": [
|
|
328
|
+
"https://reddit.com/r/programming/comments/abc123/post_title",
|
|
329
|
+
"https://reddit.com/r/webdev/comments/def456/another_post"
|
|
330
|
+
]
|
|
331
|
+
}
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
---
|
|
335
|
+
|
|
336
|
+
### `scrape_links`
|
|
337
|
+
|
|
338
|
+
**Universal URL content extraction** with automatic fallback modes.
|
|
339
|
+
|
|
340
|
+
| Parameter | Type | Required | Default | Description |
|
|
341
|
+
|-----------|------|----------|---------|-------------|
|
|
342
|
+
| `urls` | `string[]` | Yes | — | URLs to scrape (3-50) |
|
|
343
|
+
| `timeout` | `number` | No | `30` | Timeout per URL (seconds) |
|
|
344
|
+
| `use_llm` | `boolean` | No | `false` | Enable AI extraction |
|
|
345
|
+
| `what_to_extract` | `string` | No | — | Extraction instructions for AI |
|
|
346
|
+
|
|
347
|
+
**Automatic Fallback:** Basic → JS rendering → JS + US geo-targeting
|
|
348
|
+
|
|
349
|
+
```json
|
|
350
|
+
{
|
|
351
|
+
"urls": ["https://example.com/article1", "https://example.com/article2"],
|
|
352
|
+
"use_llm": true,
|
|
353
|
+
"what_to_extract": "Extract the main arguments and key statistics"
|
|
354
|
+
}
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
---
|
|
358
|
+
|
|
359
|
+
### `deep_research`
|
|
360
|
+
|
|
361
|
+
**AI-powered batch research** with web search and citations.
|
|
362
|
+
|
|
363
|
+
| Parameter | Type | Required | Description |
|
|
364
|
+
|-----------|------|----------|-------------|
|
|
365
|
+
| `questions` | `object[]` | Yes | Research questions (2-10) |
|
|
366
|
+
| `questions[].question` | `string` | Yes | The research question |
|
|
367
|
+
| `questions[].file_attachments` | `object[]` | No | Files to include as context |
|
|
368
|
+
|
|
369
|
+
**Token Allocation:** 32,000 tokens distributed across questions:
|
|
370
|
+
- 2 questions → 16,000 tokens/question (deep dive)
|
|
371
|
+
- 10 questions → 3,200 tokens/question (rapid multi-topic)
|
|
372
|
+
|
|
373
|
+
```json
|
|
374
|
+
{
|
|
375
|
+
"questions": [
|
|
376
|
+
{ "question": "What are the current best practices for React Server Components in 2025?" },
|
|
377
|
+
{ "question": "Compare Bun vs Node.js for production workloads with benchmarks." }
|
|
378
|
+
]
|
|
379
|
+
}
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
---
|
|
383
|
+
|
|
384
|
+
## ⚙️ Environment Variables & Tool Availability
|
|
385
|
+
|
|
386
|
+
Research Powerpack uses a **modular architecture**. Tools are automatically enabled based on which API keys you provide:
|
|
387
|
+
|
|
388
|
+
<div align="center">
|
|
389
|
+
|
|
390
|
+
| ENV Variable | Tools Enabled | Free Tier |
|
|
391
|
+
|:------------:|:-------------:|:---------:|
|
|
392
|
+
| `SERPER_API_KEY` | `web_search`, `search_reddit` | 2,500 queries/mo |
|
|
393
|
+
| `REDDIT_CLIENT_ID` + `SECRET` | `get_reddit_post` | Unlimited |
|
|
394
|
+
| `SCRAPEDO_API_KEY` | `scrape_links` | 1,000 credits/mo |
|
|
395
|
+
| `OPENROUTER_API_KEY` | `deep_research` + AI in `scrape_links` | Pay-as-you-go |
|
|
396
|
+
| `RESEARCH_MODEL` | Model for `deep_research` | Default: `perplexity/sonar-deep-research` |
|
|
397
|
+
| `LLM_EXTRACTION_MODEL` | Model for AI extraction in `scrape_links` | Default: `openrouter/gpt-oss-120b:nitro` |
|
|
398
|
+
|
|
399
|
+
</div>
|
|
400
|
+
|
|
401
|
+
### Configuration Examples
|
|
402
|
+
|
|
403
|
+
```bash
|
|
404
|
+
# Search-only mode (just web_search and search_reddit)
|
|
405
|
+
SERPER_API_KEY=xxx
|
|
406
|
+
|
|
407
|
+
# Reddit research mode (search + fetch posts)
|
|
408
|
+
SERPER_API_KEY=xxx
|
|
409
|
+
REDDIT_CLIENT_ID=xxx
|
|
410
|
+
REDDIT_CLIENT_SECRET=xxx
|
|
411
|
+
|
|
412
|
+
# Full research mode (all 5 tools)
|
|
413
|
+
SERPER_API_KEY=xxx
|
|
414
|
+
REDDIT_CLIENT_ID=xxx
|
|
415
|
+
REDDIT_CLIENT_SECRET=xxx
|
|
416
|
+
SCRAPEDO_API_KEY=xxx
|
|
417
|
+
OPENROUTER_API_KEY=xxx
|
|
418
|
+
```
|
|
419
|
+
|
|
420
|
+
### Full Power Mode
|
|
421
|
+
|
|
422
|
+
For the best research experience, configure all four API keys:
|
|
423
|
+
|
|
424
|
+
```bash
|
|
425
|
+
SERPER_API_KEY=your_serper_key # Free: 2,500 queries/month
|
|
426
|
+
REDDIT_CLIENT_ID=your_reddit_id # Free: Unlimited
|
|
427
|
+
REDDIT_CLIENT_SECRET=your_reddit_secret
|
|
428
|
+
SCRAPEDO_API_KEY=your_scrapedo_key # Free: 1,000 credits/month
|
|
429
|
+
OPENROUTER_API_KEY=your_openrouter_key # Pay-as-you-go
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
This unlocks:
|
|
433
|
+
- **5 research tools** working together
|
|
434
|
+
- **AI-powered content extraction** in scrape_links
|
|
435
|
+
- **Deep research with web search** and citations
|
|
436
|
+
- **Complete Reddit mining** (search → fetch → analyze)
|
|
437
|
+
|
|
438
|
+
**Total setup time:** ~10 minutes. **Total free tier value:** ~$50/month equivalent.
|
|
439
|
+
|
|
440
|
+
### 🔑 API Key Setup Guides
|
|
441
|
+
|
|
442
|
+
<details>
|
|
443
|
+
<summary><b>🔍 Serper API (Google Search) — FREE: 2,500 queries/month</b></summary>
|
|
444
|
+
|
|
445
|
+
#### What you get
|
|
446
|
+
- Fast Google search results via API
|
|
447
|
+
- Enables `web_search` and `search_reddit` tools
|
|
448
|
+
|
|
449
|
+
#### Setup Steps
|
|
450
|
+
1. Go to [serper.dev](https://serper.dev)
|
|
451
|
+
2. Click **"Get API Key"** (top right)
|
|
452
|
+
3. Sign up with email or Google
|
|
453
|
+
4. Copy your API key from the dashboard
|
|
454
|
+
5. Add to your config:
|
|
455
|
+
```
|
|
456
|
+
SERPER_API_KEY=your_key_here
|
|
457
|
+
```
|
|
458
|
+
|
|
459
|
+
#### Pricing
|
|
460
|
+
- **Free**: 2,500 queries/month
|
|
461
|
+
- **Paid**: $50/month for 50,000 queries
|
|
462
|
+
|
|
463
|
+
</details>
|
|
464
|
+
|
|
465
|
+
<details>
|
|
466
|
+
<summary><b>🤖 Reddit OAuth — FREE: Unlimited access</b></summary>
|
|
467
|
+
|
|
468
|
+
#### What you get
|
|
469
|
+
- Full Reddit API access
|
|
470
|
+
- Fetch posts and comments with upvote sorting
|
|
471
|
+
- Enables `get_reddit_post` tool
|
|
472
|
+
|
|
473
|
+
#### Setup Steps
|
|
474
|
+
1. Go to [reddit.com/prefs/apps](https://www.reddit.com/prefs/apps)
|
|
475
|
+
2. Scroll down and click **"create another app..."**
|
|
476
|
+
3. Fill in:
|
|
477
|
+
- **Name**: `research-powerpack` (or any name)
|
|
478
|
+
- **App type**: Select **"script"** (important!)
|
|
479
|
+
- **Redirect URI**: `http://localhost:8080`
|
|
480
|
+
4. Click **"create app"**
|
|
481
|
+
5. Copy your credentials:
|
|
482
|
+
- **Client ID**: The string under your app name
|
|
483
|
+
- **Client Secret**: The "secret" field
|
|
484
|
+
6. Add to your config:
|
|
485
|
+
```
|
|
486
|
+
REDDIT_CLIENT_ID=your_client_id
|
|
487
|
+
REDDIT_CLIENT_SECRET=your_client_secret
|
|
488
|
+
```
|
|
489
|
+
|
|
490
|
+
</details>
|
|
491
|
+
|
|
492
|
+
<details>
|
|
493
|
+
<summary><b>🌐 Scrape.do (Web Scraping) — FREE: 1,000 credits/month</b></summary>
|
|
494
|
+
|
|
495
|
+
#### What you get
|
|
496
|
+
- JavaScript rendering support
|
|
497
|
+
- Geo-targeting and CAPTCHA handling
|
|
498
|
+
- Enables `scrape_links` tool
|
|
499
|
+
|
|
500
|
+
#### Setup Steps
|
|
501
|
+
1. Go to [scrape.do](https://scrape.do)
|
|
502
|
+
2. Click **"Start Free"**
|
|
503
|
+
3. Sign up with email
|
|
504
|
+
4. Copy your API key from the dashboard
|
|
505
|
+
5. Add to your config:
|
|
506
|
+
```
|
|
507
|
+
SCRAPEDO_API_KEY=your_key_here
|
|
508
|
+
```
|
|
509
|
+
|
|
510
|
+
#### Credit Usage
|
|
511
|
+
- **Basic scrape**: 1 credit
|
|
512
|
+
- **JavaScript rendering**: 5 credits
|
|
513
|
+
- **Geo-targeting**: +25 credits
|
|
514
|
+
|
|
515
|
+
</details>
|
|
516
|
+
|
|
517
|
+
<details>
|
|
518
|
+
<summary><b>🧠 OpenRouter (AI Models) — Pay-as-you-go</b></summary>
|
|
519
|
+
|
|
520
|
+
#### What you get
|
|
521
|
+
- Access to 100+ AI models via one API
|
|
522
|
+
- Enables `deep_research` tool
|
|
523
|
+
- Enables AI extraction in `scrape_links`
|
|
524
|
+
|
|
525
|
+
#### Setup Steps
|
|
526
|
+
1. Go to [openrouter.ai](https://openrouter.ai)
|
|
527
|
+
2. Sign up with Google/GitHub/email
|
|
528
|
+
3. Go to [openrouter.ai/keys](https://openrouter.ai/keys)
|
|
529
|
+
4. Click **"Create Key"**
|
|
530
|
+
5. Copy the key (starts with `sk-or-...`)
|
|
531
|
+
6. Add to your config:
|
|
532
|
+
```
|
|
533
|
+
OPENROUTER_API_KEY=sk-or-v1-xxxxx
|
|
534
|
+
```
|
|
535
|
+
|
|
536
|
+
#### Recommended Models for Deep Research
|
|
537
|
+
```bash
|
|
538
|
+
# Default (optimized for research)
|
|
539
|
+
RESEARCH_MODEL=perplexity/sonar-deep-research
|
|
540
|
+
|
|
541
|
+
# Fast and capable
|
|
542
|
+
RESEARCH_MODEL=x-ai/grok-4.1-fast
|
|
543
|
+
|
|
544
|
+
# High quality
|
|
545
|
+
RESEARCH_MODEL=anthropic/claude-3.5-sonnet
|
|
546
|
+
|
|
547
|
+
# Budget-friendly
|
|
548
|
+
RESEARCH_MODEL=openai/gpt-4o-mini
|
|
549
|
+
```
|
|
550
|
+
|
|
551
|
+
#### Recommended Models for AI Extraction (`use_llm` in `scrape_links`)
|
|
552
|
+
```bash
|
|
553
|
+
# Default (fast and cost-effective for extraction)
|
|
554
|
+
LLM_EXTRACTION_MODEL=openrouter/gpt-oss-120b:nitro
|
|
555
|
+
|
|
556
|
+
# High quality extraction
|
|
557
|
+
LLM_EXTRACTION_MODEL=anthropic/claude-3.5-sonnet
|
|
558
|
+
|
|
559
|
+
# Budget-friendly
|
|
560
|
+
LLM_EXTRACTION_MODEL=openai/gpt-4o-mini
|
|
561
|
+
```
|
|
562
|
+
|
|
563
|
+
> **Note:** `RESEARCH_MODEL` and `LLM_EXTRACTION_MODEL` are independent. You can use a powerful model for deep research and a faster/cheaper model for content extraction, or vice versa.
|
|
564
|
+
|
|
565
|
+
</details>
|
|
566
|
+
|
|
567
|
+
---
|
|
568
|
+
|
|
569
|
+
## 📚 Recommended Workflows
|
|
570
|
+
|
|
571
|
+
### Research a Technology Decision
|
|
572
|
+
|
|
573
|
+
```
|
|
574
|
+
1. web_search → ["React vs Vue 2025", "Next.js vs Nuxt comparison"]
|
|
575
|
+
2. search_reddit → ["best frontend framework 2025", "Next.js production experience"]
|
|
576
|
+
3. get_reddit_post → [URLs from step 2]
|
|
577
|
+
4. scrape_links → [Documentation and blog URLs from step 1]
|
|
578
|
+
5. deep_research → [Synthesize findings into specific questions]
|
|
579
|
+
```
|
|
580
|
+
|
|
581
|
+
### Competitive Analysis
|
|
582
|
+
|
|
583
|
+
```
|
|
584
|
+
1. web_search → ["competitor name review", "competitor vs alternatives"]
|
|
585
|
+
2. scrape_links → [Competitor websites, review sites]
|
|
586
|
+
3. search_reddit → ["competitor name experience", "switching from competitor"]
|
|
587
|
+
4. get_reddit_post → [URLs from step 3]
|
|
588
|
+
```
|
|
589
|
+
|
|
590
|
+
### Debug an Obscure Error
|
|
591
|
+
|
|
592
|
+
```
|
|
593
|
+
1. web_search → ["exact error message", "error + framework name"]
|
|
594
|
+
2. search_reddit → ["error message", "framework + error type"]
|
|
595
|
+
3. get_reddit_post → [URLs with solutions]
|
|
596
|
+
4. scrape_links → [Stack Overflow answers, GitHub issues]
|
|
597
|
+
```
|
|
598
|
+
|
|
599
|
+
---
|
|
600
|
+
|
|
601
|
+
## 🛠️ Development
|
|
602
|
+
|
|
603
|
+
```bash
|
|
604
|
+
git clone https://github.com/yigitkonur/mcp-researchpowerpack.git
|
|
605
|
+
cd mcp-researchpowerpack
|
|
606
|
+
npm install
|
|
607
|
+
npm run dev
|
|
608
|
+
npm run build
|
|
609
|
+
npm run typecheck
|
|
610
|
+
```
|
|
611
|
+
|
|
612
|
+
---
|
|
613
|
+
|
|
614
|
+
## 🔧 Troubleshooting
|
|
615
|
+
|
|
616
|
+
<details>
|
|
617
|
+
<summary><b>Expand for troubleshooting tips</b></summary>
|
|
618
|
+
|
|
619
|
+
| Problem | Solution |
|
|
620
|
+
| :--- | :--- |
|
|
621
|
+
| **Tool returns "API key not configured"** | Add the required ENV variable to your MCP config. The error message tells you exactly which key is missing. |
|
|
622
|
+
| **Reddit posts returning empty** | Check your `REDDIT_CLIENT_ID` and `REDDIT_CLIENT_SECRET`. Make sure you created a "script" type app. |
|
|
623
|
+
| **Scraping fails on JavaScript sites** | This is expected for the first attempt. The tool auto-retries with JS rendering. If still failing, the site may be blocking scrapers. |
|
|
624
|
+
| **Deep research taking too long** | Use a faster model like `x-ai/grok-4.1-fast` instead of `perplexity/sonar-deep-research`. |
|
|
625
|
+
| **Token limit errors** | Reduce the number of URLs/questions per request. The tool distributes a fixed token budget. |
|
|
626
|
+
|
|
627
|
+
</details>
|
|
628
|
+
|
|
629
|
+
---
|
|
630
|
+
|
|
631
|
+
<div align="center">
|
|
632
|
+
|
|
633
|
+
MIT © [Yigit Konur](https://github.com/yigitkonur)
|
|
634
|
+
|
|
635
|
+
</div>
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reddit OAuth API Client
|
|
3
|
+
* Fetches posts and comments sorted by score (most upvoted first)
|
|
4
|
+
* Implements robust error handling that NEVER crashes
|
|
5
|
+
*/
|
|
6
|
+
interface Post {
|
|
7
|
+
title: string;
|
|
8
|
+
author: string;
|
|
9
|
+
subreddit: string;
|
|
10
|
+
body: string;
|
|
11
|
+
score: number;
|
|
12
|
+
commentCount: number;
|
|
13
|
+
url: string;
|
|
14
|
+
created: Date;
|
|
15
|
+
flair?: string;
|
|
16
|
+
isNsfw: boolean;
|
|
17
|
+
isPinned: boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface Comment {
|
|
20
|
+
author: string;
|
|
21
|
+
body: string;
|
|
22
|
+
score: number;
|
|
23
|
+
depth: number;
|
|
24
|
+
isOP: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface PostResult {
|
|
27
|
+
post: Post;
|
|
28
|
+
comments: Comment[];
|
|
29
|
+
allocatedComments: number;
|
|
30
|
+
actualComments: number;
|
|
31
|
+
}
|
|
32
|
+
interface BatchPostResult {
|
|
33
|
+
results: Map<string, PostResult | Error>;
|
|
34
|
+
batchesProcessed: number;
|
|
35
|
+
totalPosts: number;
|
|
36
|
+
rateLimitHits: number;
|
|
37
|
+
commentAllocation: CommentAllocation;
|
|
38
|
+
}
|
|
39
|
+
interface CommentAllocation {
|
|
40
|
+
totalBudget: number;
|
|
41
|
+
perPostBase: number;
|
|
42
|
+
perPostCapped: number;
|
|
43
|
+
redistributed: boolean;
|
|
44
|
+
}
|
|
45
|
+
export declare function calculateCommentAllocation(postCount: number): CommentAllocation;
|
|
46
|
+
export declare class RedditClient {
|
|
47
|
+
private clientId;
|
|
48
|
+
private clientSecret;
|
|
49
|
+
private userAgent;
|
|
50
|
+
constructor(clientId: string, clientSecret: string);
|
|
51
|
+
/**
|
|
52
|
+
* Authenticate with Reddit API with retry logic
|
|
53
|
+
* Uses module-level token cache and promise deduplication to prevent
|
|
54
|
+
* concurrent auth calls from firing multiple token requests
|
|
55
|
+
* Returns null on failure instead of throwing
|
|
56
|
+
*/
|
|
57
|
+
private auth;
|
|
58
|
+
/**
|
|
59
|
+
* Internal auth implementation - called only once per cache miss
|
|
60
|
+
*/
|
|
61
|
+
private performAuth;
|
|
62
|
+
private parseUrl;
|
|
63
|
+
/**
|
|
64
|
+
* Get a single Reddit post with comments
|
|
65
|
+
* Returns PostResult or throws Error (for use with Promise.allSettled)
|
|
66
|
+
*/
|
|
67
|
+
getPost(url: string, maxComments?: number): Promise<PostResult>;
|
|
68
|
+
private formatBody;
|
|
69
|
+
private extractComments;
|
|
70
|
+
getPosts(urls: string[], maxComments?: number): Promise<Map<string, PostResult | Error>>;
|
|
71
|
+
batchGetPosts(urls: string[], maxCommentsOverride?: number, fetchComments?: boolean, onBatchComplete?: (batchNum: number, totalBatches: number, processed: number) => void): Promise<BatchPostResult>;
|
|
72
|
+
}
|
|
73
|
+
export {};
|
|
74
|
+
//# sourceMappingURL=reddit.d.ts.map
|