tokens-for-good 0.1.2 → 0.1.4
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/package.json +1 -1
- package/pipeline/01-research/PROMPT.md +11 -8
- package/src/mcp-server.js +39 -4
package/package.json
CHANGED
|
@@ -42,7 +42,7 @@ Find the org in `orgs.json` by name. Extract:
|
|
|
42
42
|
|
|
43
43
|
### 2. Research the Organization
|
|
44
44
|
|
|
45
|
-
Using
|
|
45
|
+
Using the **WebSearch** and **WebFetch** tools, thoroughly research the organization. Do NOT use curl, wget, or Bash commands for web requests — always use the built-in WebSearch and WebFetch tools so the research runs without permission prompts. Search for:
|
|
46
46
|
|
|
47
47
|
1. The organization's main website — read the homepage, about page, and impact/results pages
|
|
48
48
|
2. Their impact/results/evidence pages — look for published data, annual reports, metrics
|
|
@@ -122,16 +122,19 @@ Keep the table with ALL previous columns intact. For each of the 20 negative con
|
|
|
122
122
|
|
|
123
123
|
Write a recommendation paragraph (2-4 sentences), then include this EXACT scored checklist using [x] or [ ]. The score is out of 100 points.
|
|
124
124
|
|
|
125
|
-
**IMPORTANT: Use EXACTLY these 6 criteria with EXACTLY these names and point values. Do NOT use the old 7-point checklist (a-g with "Understands the Social Issue" etc.) — that format is deprecated. There are exactly 6 items (a-f), not 7.**
|
|
125
|
+
**IMPORTANT: Use EXACTLY these 6 criteria with EXACTLY these names and point values. Do NOT use the old 7-point checklist (a-g with "Understands the Social Issue" etc.) — that format is deprecated. There are exactly 6 items (a-f), not 7. Counterfactuals (e & f) are EXTRA CREDIT — base score is out of 100, max is 120.**
|
|
126
126
|
|
|
127
|
+
Base score (out of 100):
|
|
127
128
|
- [x] or [ ] a. Has Ultimate Outcome Goals (50 pts)
|
|
128
|
-
- [x] or [ ] b. Measures Intermediate Outcomes (
|
|
129
|
-
- [x] or [ ] c. Measures Ultimate Outcomes (
|
|
130
|
-
- [x] or [ ] d.
|
|
131
|
-
- [x] or [ ] e. Measures Ultimate Counterfactuals (20 pts)
|
|
132
|
-
- [x] or [ ] f. Shows Continual Learning & Adaptation (5 pts)
|
|
129
|
+
- [x] or [ ] b. Measures Intermediate Outcomes (10 pts)
|
|
130
|
+
- [x] or [ ] c. Measures Ultimate Outcomes (15 pts)
|
|
131
|
+
- [x] or [ ] d. Shows Continual Learning & Adaptation (25 pts)
|
|
133
132
|
|
|
134
|
-
|
|
133
|
+
Extra credit:
|
|
134
|
+
- [x] or [ ] e. Measures Intermediate Counterfactual (10 pts)
|
|
135
|
+
- [x] or [ ] f. Measures Ultimate Counterfactual (10 pts)
|
|
136
|
+
|
|
137
|
+
**Score: [X]/100** (sum of checked items' point values — can exceed 100 with extra credit, max 120)
|
|
135
138
|
|
|
136
139
|
**Section 2 — The Social Problem**
|
|
137
140
|
Describe the social problem the organization is trying to solve. Include scale (how many affected, what geographies). Cite sources for prevalence data.
|
package/src/mcp-server.js
CHANGED
|
@@ -26,7 +26,7 @@ updateState({ platform });
|
|
|
26
26
|
|
|
27
27
|
const server = new McpServer({
|
|
28
28
|
name: 'tokens-for-good',
|
|
29
|
-
version: '0.1.
|
|
29
|
+
version: '0.1.4',
|
|
30
30
|
});
|
|
31
31
|
|
|
32
32
|
// --- No-key onboarding message ---
|
|
@@ -86,7 +86,7 @@ For Cursor (\`.cursor/mcp.json\` in your project root):
|
|
|
86
86
|
|
|
87
87
|
5. **Verify it loaded** by running \`/mcp\` — you should see \`tokens-for-good\` in the server list.
|
|
88
88
|
|
|
89
|
-
6. **
|
|
89
|
+
6. **Set up permissions for hands-free research:** After restarting, use the \`check_permissions\` tool to verify WebFetch and WebSearch are in the allowlist, and offer to add them if not. Without these permissions, every web request will pause for approval and the research won't complete unattended.
|
|
90
90
|
|
|
91
91
|
Once set up, they can say "Research an org for Fierce Philanthropy" and the AI does the rest. Each org takes ~5 minutes and costs ~$0.20 in tokens.
|
|
92
92
|
|
|
@@ -262,6 +262,36 @@ server.tool('setup_guide', 'Get setup instructions for Tokens for Good. Use this
|
|
|
262
262
|
return { content: [{ type: 'text', text: NO_KEY_INSTRUCTIONS }] };
|
|
263
263
|
});
|
|
264
264
|
|
|
265
|
+
server.tool('check_permissions', 'Check if WebFetch and WebSearch are in the tool allowlist. If not, offer to add them. Call this after setup or before first research run.', {}, async () => {
|
|
266
|
+
// We can't read the settings file directly, but we can tell the AI what to do
|
|
267
|
+
return {
|
|
268
|
+
content: [{ type: 'text', text: `Check if this user's Claude Code has WebFetch and WebSearch in their tool allowlist. To do this:
|
|
269
|
+
|
|
270
|
+
1. Read the file ~/.claude/settings.json
|
|
271
|
+
2. Look for the "permissions.allow" array
|
|
272
|
+
3. Check if it contains "WebFetch" and "WebSearch"
|
|
273
|
+
|
|
274
|
+
If BOTH are already present, tell the user they're all set for hands-free research.
|
|
275
|
+
|
|
276
|
+
If one or both are MISSING, explain:
|
|
277
|
+
"Tokens for Good needs WebFetch and WebSearch permissions to research nonprofits without pausing for approval on every web request. Can I add them to your allowlist?"
|
|
278
|
+
|
|
279
|
+
If they agree, edit ~/.claude/settings.json to add the missing entries to the "permissions.allow" array. For example:
|
|
280
|
+
{
|
|
281
|
+
"permissions": {
|
|
282
|
+
"allow": [
|
|
283
|
+
"WebFetch",
|
|
284
|
+
"WebSearch"
|
|
285
|
+
]
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
Merge with any existing entries — don't overwrite other allowed tools.
|
|
290
|
+
|
|
291
|
+
After adding, tell them: "Done! Research will now run hands-free. Try saying 'Research an org for Fierce Philanthropy' to get started."` }],
|
|
292
|
+
};
|
|
293
|
+
});
|
|
294
|
+
|
|
265
295
|
server.tool('setup_automation', 'Get instructions for setting up automated daily contributions on your platform.', {
|
|
266
296
|
frequency: z.enum(['hourly', 'daily', 'weekly']).optional().describe('How often to contribute'),
|
|
267
297
|
}, async ({ frequency }) => {
|
|
@@ -322,19 +352,24 @@ server.prompt('session_start', 'Check if you should research an org or complete
|
|
|
322
352
|
return { messages: [{ role: 'user', content: { type: 'text', text: 'Tokens for Good: You already contributed today. Nice work!' } }] };
|
|
323
353
|
}
|
|
324
354
|
|
|
355
|
+
// Check permissions before first research
|
|
356
|
+
const permNote = state.total_session_contributions === 0
|
|
357
|
+
? `\n\n**First time?** Before researching, use the \`check_permissions\` tool to make sure WebFetch and WebSearch are allowed — otherwise you'll get prompted for every web request.`
|
|
358
|
+
: '';
|
|
359
|
+
|
|
325
360
|
// Show the session start prompt
|
|
326
361
|
if (isSchedulable(platform)) {
|
|
327
362
|
return {
|
|
328
363
|
messages: [{
|
|
329
364
|
role: 'user',
|
|
330
|
-
content: { type: 'text', text: `Tokens for Good: Would you like to donate your spare tokens to research a nonprofit today?\n\n1. Set up automatic daily contributions (recommended)\n2. Just run one now\n3. Ask me tomorrow\n4. Ask me in a week\n\nUse setup_automation for option 1, claim_org for option 2
|
|
365
|
+
content: { type: 'text', text: `Tokens for Good: Would you like to donate your spare tokens to research a nonprofit today?\n\n1. Set up automatic daily contributions (recommended)\n2. Just run one now\n3. Ask me tomorrow\n4. Ask me in a week\n\nUse setup_automation for option 1, claim_org for option 2.${permNote}` },
|
|
331
366
|
}],
|
|
332
367
|
};
|
|
333
368
|
} else {
|
|
334
369
|
return {
|
|
335
370
|
messages: [{
|
|
336
371
|
role: 'user',
|
|
337
|
-
content: { type: 'text', text: `Tokens for Good: Would you like to research a nonprofit org today? It takes about 5 minutes and costs ~$0.20 in tokens.\n\n1. Research an org now\n2. Ask me tomorrow\n3. Ask me in a week\n\nUse claim_org for option 1
|
|
372
|
+
content: { type: 'text', text: `Tokens for Good: Would you like to research a nonprofit org today? It takes about 5 minutes and costs ~$0.20 in tokens.\n\n1. Research an org now\n2. Ask me tomorrow\n3. Ask me in a week\n\nUse claim_org for option 1.${permNote}` },
|
|
338
373
|
}],
|
|
339
374
|
};
|
|
340
375
|
}
|