freshcontext-mcp 0.3.14 → 0.3.16
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/.env.example +8 -0
- package/README.md +117 -125
- package/RESEARCH.md +487 -0
- package/RISKS.md +137 -0
- package/cleanup.ps1 +99 -0
- package/demo/README.md +70 -0
- package/demo/data.json +88 -0
- package/demo/generate.mjs +199 -0
- package/demo/index.html +513 -0
- package/demo/logo-export.html +61 -0
- package/demo/logo.svg +23 -0
- package/dist/server.js +124 -66
- package/dist/tools/freshnessStamp.js +30 -22
- package/freshcontext-validate.js +196 -0
- package/freshcontext.schema.json +103 -0
- package/package.json +2 -2
- package/server.json +3 -3
- package/time-check.ps1 +46 -0
- package/.actor/Dockerfile +0 -16
- package/.actor/actor.json +0 -9
- package/.actor/output_schema.json +0 -13
- package/ARCHITECTURE_UPGRADE_CHECKLIST.md +0 -88
- package/ARCHITECTURE_UPGRADE_ROADMAP_V1.md +0 -174
- package/FRESHCONTEXT_SPEC.md +0 -178
- package/HANDOFF.md +0 -184
- package/ROADMAP.md +0 -174
- package/SESSION_SAVE_ARCHITECTURE_V1.md +0 -67
- package/SESSION_SAVE_ARCHITECTURE_V2.md +0 -142
- package/SESSION_SAVE_V4.md +0 -60
- package/SESSION_SAVE_V5.md +0 -121
- package/USAGE.md +0 -294
- package/add-cache.cjs +0 -86
- package/dataset_schema.json +0 -41
- package/input_schema.json +0 -48
package/HANDOFF.md
DELETED
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
# FreshContext — Handoff Document
|
|
2
|
-
**Version:** 0.3.11
|
|
3
|
-
**Date:** 2026-03-20
|
|
4
|
-
**Author:** Immanuel Gabriel (Prince Gabriel), Grootfontein, Namibia
|
|
5
|
-
**Contact:** gimmanuel73@gmail.com
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## What You Are Receiving
|
|
10
|
-
|
|
11
|
-
FreshContext is a web intelligence engine for AI agents. It wraps every piece of
|
|
12
|
-
retrieved web data in a structured freshness envelope — exact retrieval timestamp,
|
|
13
|
-
publication date estimate, freshness confidence (high/medium/low), and a 0-100
|
|
14
|
-
numeric score with domain-specific decay rates.
|
|
15
|
-
|
|
16
|
-
15 tools. No API keys required. Deployed globally on Cloudflare's edge. Listed on
|
|
17
|
-
Anthropic's official MCP Registry, npm, and Apify Store.
|
|
18
|
-
|
|
19
|
-
The two tools that exist nowhere else: extract_govcontracts (US federal contract
|
|
20
|
-
intelligence via USASpending.gov) and extract_changelog (product release velocity
|
|
21
|
-
from any GitHub repo, npm package, or website).
|
|
22
|
-
|
|
23
|
-
---
|
|
24
|
-
|
|
25
|
-
## Services and Infrastructure
|
|
26
|
-
|
|
27
|
-
### 1. GitHub Repository
|
|
28
|
-
URL: https://github.com/PrinceGabriel-lgtm/freshcontext-mcp
|
|
29
|
-
Branch: main
|
|
30
|
-
Transfer method: GitHub Settings > Transfer ownership
|
|
31
|
-
What it contains: All source code, Dockerfile, specs, session saves, roadmap
|
|
32
|
-
|
|
33
|
-
### 2. npm Package
|
|
34
|
-
Package: freshcontext-mcp (v0.3.11)
|
|
35
|
-
URL: https://www.npmjs.com/package/freshcontext-mcp
|
|
36
|
-
Account: immanuel-gabriel on npmjs.com
|
|
37
|
-
Transfer method: npm owner add new-username freshcontext-mcp
|
|
38
|
-
Note: Published automatically via GitHub Actions on every push to main
|
|
39
|
-
|
|
40
|
-
### 3. Cloudflare Account
|
|
41
|
-
What lives here:
|
|
42
|
-
Worker: freshcontext-mcp (the live MCP endpoint)
|
|
43
|
-
D1: freshcontext-db (ID: d9898d65-f67e-4dcb-abdc-7f7b53f2d444)
|
|
44
|
-
KV: RATE_LIMITER and CACHE (IDs in wrangler.jsonc)
|
|
45
|
-
Cron: 0 */6 * * * (every 6 hours, runs automatically)
|
|
46
|
-
Endpoint: https://freshcontext-mcp.gimmanuel73.workers.dev/mcp
|
|
47
|
-
|
|
48
|
-
Transfer method: Add new account as Super Administrator, remove original.
|
|
49
|
-
D1 export: wrangler d1 export freshcontext-db --output=dump.sql
|
|
50
|
-
|
|
51
|
-
### 4. Apify Actor
|
|
52
|
-
Actor: prince_gabriel/freshcontext-mcp
|
|
53
|
-
URL: https://apify.com/prince_gabriel/freshcontext-mcp
|
|
54
|
-
Monetization: $50.00 per 1,000 results (Pay per event)
|
|
55
|
-
Transfer method: Re-publish under new Apify account
|
|
56
|
-
|
|
57
|
-
### 5. MCP Registry Listing
|
|
58
|
-
Entry: io.github.PrinceGabriel-lgtm/freshcontext
|
|
59
|
-
Config: server.json in the GitHub repo
|
|
60
|
-
Transfer method: Update server.json with new repo URL and re-submit
|
|
61
|
-
|
|
62
|
-
### 6. GitHub Actions CI/CD
|
|
63
|
-
File: .github/workflows/publish.yml
|
|
64
|
-
Action: On every push to main — npm ci > tsc > npm publish
|
|
65
|
-
Secret: NPM_TOKEN (granular access token from npmjs.com, renew annually)
|
|
66
|
-
|
|
67
|
-
---
|
|
68
|
-
|
|
69
|
-
## Credentials Map (categories only — not values)
|
|
70
|
-
|
|
71
|
-
| Credential | Where Used | Location |
|
|
72
|
-
|---|---|---|
|
|
73
|
-
| API_KEY | Worker auth header | Cloudflare env var |
|
|
74
|
-
| ANTHROPIC_KEY | Synthesis/briefing endpoint | Cloudflare env var |
|
|
75
|
-
| GITHUB_TOKEN | GitHub API rate limit bypass | Cloudflare env var |
|
|
76
|
-
| NPM_TOKEN | GitHub Actions auto-publish | GitHub secret |
|
|
77
|
-
|
|
78
|
-
---
|
|
79
|
-
|
|
80
|
-
## Codebase Map
|
|
81
|
-
|
|
82
|
-
src/server.ts — MCP stdio server, all 15 tools registered here
|
|
83
|
-
src/apify.ts — Apify Actor entry point (read input, call adapter, exit)
|
|
84
|
-
src/security.ts — URL validation, SSRF prevention
|
|
85
|
-
src/types.ts — FreshContext, AdapterResult, ExtractOptions interfaces
|
|
86
|
-
src/adapters/ — One file per data source (13 files)
|
|
87
|
-
changelog.ts — UNIQUE: GitHub Releases API + npm + auto-discover
|
|
88
|
-
govcontracts.ts — UNIQUE: USASpending.gov federal contract awards
|
|
89
|
-
src/tools/
|
|
90
|
-
freshnessStamp.ts — Score calculation, JSON form, text envelope
|
|
91
|
-
worker/src/worker.ts — Cloudflare Worker: 15 tools + KV cache + rate limit
|
|
92
|
-
+ D1 cron scraper + briefing formatter
|
|
93
|
-
.actor/Dockerfile — Apify build config (Node 20, runs dist/apify.js)
|
|
94
|
-
.actor/actor.json — Apify Actor metadata
|
|
95
|
-
FRESHCONTEXT_SPEC.md — The open standard (MIT license)
|
|
96
|
-
ROADMAP.md — 10-layer product vision
|
|
97
|
-
server.json — MCP Registry listing
|
|
98
|
-
.github/workflows/
|
|
99
|
-
publish.yml — GitHub Actions CI/CD
|
|
100
|
-
|
|
101
|
-
---
|
|
102
|
-
|
|
103
|
-
## The 15 Tools
|
|
104
|
-
|
|
105
|
-
Standard (11):
|
|
106
|
-
extract_github, extract_hackernews, extract_scholar, extract_arxiv,
|
|
107
|
-
extract_reddit, extract_yc, extract_producthunt, search_repos,
|
|
108
|
-
package_trends, extract_finance, search_jobs
|
|
109
|
-
|
|
110
|
-
Composite landscapes (3):
|
|
111
|
-
extract_landscape — YC + GitHub + HN + Reddit + Product Hunt + npm
|
|
112
|
-
extract_gov_landscape — govcontracts + HN + GitHub + changelog
|
|
113
|
-
extract_finance_landscape — finance + HN + Reddit + GitHub + changelog
|
|
114
|
-
|
|
115
|
-
Unique — not in any other MCP server (2):
|
|
116
|
-
extract_changelog — release history from any repo, package, or website
|
|
117
|
-
extract_govcontracts — US federal contract awards from USASpending.gov
|
|
118
|
-
|
|
119
|
-
---
|
|
120
|
-
|
|
121
|
-
## D1 Database Schema
|
|
122
|
-
|
|
123
|
-
watched_queries — 18 active monitored topics
|
|
124
|
-
id, adapter, query, label, filters, enabled, last_run_at
|
|
125
|
-
|
|
126
|
-
scrape_results — raw results, deduplicated by content hash
|
|
127
|
-
id, watched_query_id, adapter, query, raw_content, result_hash, is_new, scraped_at
|
|
128
|
-
|
|
129
|
-
briefings — formatted intelligence reports per cron run
|
|
130
|
-
id, user_id, summary, new_results_count, adapters_run, created_at
|
|
131
|
-
|
|
132
|
-
user_profiles — personalization data for briefing synthesis
|
|
133
|
-
id, name, skills, certifications, targets, location, context
|
|
134
|
-
|
|
135
|
-
---
|
|
136
|
-
|
|
137
|
-
## The FreshContext Specification
|
|
138
|
-
|
|
139
|
-
FRESHCONTEXT_SPEC.md is the open standard, MIT license, authored March 2026.
|
|
140
|
-
Any implementation returning the [FRESHCONTEXT]...[/FRESHCONTEXT] envelope
|
|
141
|
-
or the structured JSON form with freshcontext.retrieved_at and
|
|
142
|
-
freshcontext.freshness_confidence is FreshContext-compatible.
|
|
143
|
-
|
|
144
|
-
The spec is the durable asset. The code is the reference implementation.
|
|
145
|
-
|
|
146
|
-
---
|
|
147
|
-
|
|
148
|
-
## What Keeps Running Without You
|
|
149
|
-
|
|
150
|
-
The Cloudflare cron fires every 6 hours automatically. Every run scrapes all 18
|
|
151
|
-
watched queries, deduplicates by content hash, stores new signals in D1, and
|
|
152
|
-
generates a briefing. The dataset accumulates indefinitely. No action required.
|
|
153
|
-
|
|
154
|
-
---
|
|
155
|
-
|
|
156
|
-
## Pending Items at Time of Handoff
|
|
157
|
-
|
|
158
|
-
Apify Playwright — extract_reddit, extract_yc, extract_producthunt may error on
|
|
159
|
-
Apify. Fix: add RUN npx playwright install chromium --with-deps to .actor/Dockerfile.
|
|
160
|
-
|
|
161
|
-
Synthesis endpoint — /briefing/now is paused. Needs ANTHROPIC_KEY in Worker env
|
|
162
|
-
and credits loaded at console.anthropic.com. Infrastructure is fully built.
|
|
163
|
-
|
|
164
|
-
Agnost AI analytics — free MCP analytics offered by Apify. Sign up at app.agnost.ai,
|
|
165
|
-
add one line to server.ts. Gives tool call tracking and usage dashboards.
|
|
166
|
-
|
|
167
|
-
Apify GitHub Actions trigger — npm publish is automated but Apify rebuild is
|
|
168
|
-
manual. Add a workflow step calling Apify's API to auto-rebuild on push.
|
|
169
|
-
|
|
170
|
-
---
|
|
171
|
-
|
|
172
|
-
## Outreach Status at Time of Handoff
|
|
173
|
-
|
|
174
|
-
19 confirmed delivered emails across US, Singapore, China, and Europe.
|
|
175
|
-
Cloudflare for Startups — awaiting reply (10 business day window).
|
|
176
|
-
GovTech Singapore — auto-acknowledged, reply expected by March 25, 2026.
|
|
177
|
-
All others — first contact sent, no replies yet.
|
|
178
|
-
|
|
179
|
-
HN post live: https://news.ycombinator.com/user?id=Prince-Gabriel
|
|
180
|
-
|
|
181
|
-
---
|
|
182
|
-
|
|
183
|
-
*"The work isn't gone. It's just waiting to be continued."*
|
|
184
|
-
*— Prince Gabriel, Grootfontein, Namibia*
|
package/ROADMAP.md
DELETED
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
# FreshContext Roadmap
|
|
2
|
-
|
|
3
|
-
> *This document describes what FreshContext is becoming — not just what it is today.*
|
|
4
|
-
> *Built by Prince Gabriel — Grootfontein, Namibia 🇳🇦*
|
|
5
|
-
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
## Where We Are Today
|
|
9
|
-
|
|
10
|
-
FreshContext is a working, deployed, monetized web intelligence engine for AI agents.
|
|
11
|
-
|
|
12
|
-
**What's live and functional right now:**
|
|
13
|
-
|
|
14
|
-
- 11 MCP adapters — GitHub, Hacker News, Google Scholar, arXiv, Reddit, YC Companies, Product Hunt, npm/PyPI trends, finance, job search, and `extract_landscape` (all 6 sources in one call)
|
|
15
|
-
- Cloudflare Worker deployed globally at the edge with KV caching and rate limiting
|
|
16
|
-
- D1 database with 18 active watched queries running on a 6-hour cron schedule
|
|
17
|
-
- `GET /briefing` and `POST /briefing/now` endpoints for scheduled AI synthesis (synthesis paused pending Anthropic credits — infrastructure fully built)
|
|
18
|
-
- Listed on npm (`freshcontext-mcp@0.3.1`) and the official MCP Registry
|
|
19
|
-
- Published FreshContext Specification v1.0 — the standard this project is authoring
|
|
20
|
-
- Apify Store listing pending approval (account under manual review)
|
|
21
|
-
|
|
22
|
-
---
|
|
23
|
-
|
|
24
|
-
## Layer 5 — Dashboard (Next Build)
|
|
25
|
-
|
|
26
|
-
**Status: Designed, not yet built**
|
|
27
|
-
|
|
28
|
-
A React frontend that makes the intelligence pipeline visible and beautiful.
|
|
29
|
-
|
|
30
|
-
The dashboard pulls from live endpoints already built:
|
|
31
|
-
|
|
32
|
-
- `GET /briefing` → renders the latest AI-generated briefing with per-adapter sections
|
|
33
|
-
- `POST /briefing/now` → force-triggers a fresh synthesis on demand
|
|
34
|
-
- `GET /watched-queries` → manage what topics are being monitored
|
|
35
|
-
- User profile editor → update skills, targets, and context that shape briefing personalization
|
|
36
|
-
|
|
37
|
-
**Design targets:**
|
|
38
|
-
- Freshness confidence indicators on every source card (high/medium/low with color coding)
|
|
39
|
-
- Briefing history timeline showing how signal has evolved over time
|
|
40
|
-
- Watched query manager — add, pause, delete, and score queries by signal quality
|
|
41
|
-
- "Force refresh" button with live streaming output
|
|
42
|
-
|
|
43
|
-
**Deployment:** Cloudflare Pages — stays entirely within the Cloudflare free tier ecosystem.
|
|
44
|
-
|
|
45
|
-
---
|
|
46
|
-
|
|
47
|
-
## Layer 6 — Personalization Engine
|
|
48
|
-
|
|
49
|
-
**Status: Schema designed in D1, logic not yet built**
|
|
50
|
-
|
|
51
|
-
The `user_profiles` table already exists in D1 with fields for skills, certifications, targets, location, and context. The synthesis prompt already uses this data. What's missing is the user-facing surface:
|
|
52
|
-
|
|
53
|
-
- Onboarding flow — build your profile in the app in under 3 minutes
|
|
54
|
-
- Multiple profiles — team mode where each member gets their own briefing
|
|
55
|
-
- Custom briefing schedules — not just every 6h, but user-defined intervals
|
|
56
|
-
- Notification delivery — push briefings to Slack, email, or SMS via webhook
|
|
57
|
-
|
|
58
|
-
---
|
|
59
|
-
|
|
60
|
-
## Layer 7 — Watched Query Intelligence
|
|
61
|
-
|
|
62
|
-
**Status: Data accumulating, intelligence layer not yet built**
|
|
63
|
-
|
|
64
|
-
Every query run leaves a result in `scrape_results`. Over time this becomes a dataset with genuine historical value. The intelligence layer turns it into signal:
|
|
65
|
-
|
|
66
|
-
- **Relevance scoring** — each result is scored against the user profile (0–100) before inclusion in briefings
|
|
67
|
-
- **Deduplication** — same story appearing on HN and Reddit counts as one signal, not two
|
|
68
|
-
- **Query performance scoring** — which watched queries are generating signal vs. noise? Surface the top performers.
|
|
69
|
-
- **Smart suggestions** — "Based on your profile, you should also watch: mcp server rust, cloudflare workers ai"
|
|
70
|
-
- **Trend detection** — alert when a topic spikes across multiple adapters simultaneously
|
|
71
|
-
|
|
72
|
-
---
|
|
73
|
-
|
|
74
|
-
## Layer 8 — New Adapters
|
|
75
|
-
|
|
76
|
-
**Status: Planned, prioritised by acquisition value**
|
|
77
|
-
|
|
78
|
-
These adapters extend FreshContext into new intelligence categories with zero API key requirements:
|
|
79
|
-
|
|
80
|
-
| Adapter | Source | What it adds |
|
|
81
|
-
|---|---|---|
|
|
82
|
-
| `extract_devto` | dev.to public API | Developer article sentiment with clean publish dates |
|
|
83
|
-
| `extract_changelog` | Any `/changelog` or `/releases` URL | Track any product's update cadence |
|
|
84
|
-
| `extract_crunchbase_free` | Crunchbase public feed | Funding announcements with date signals |
|
|
85
|
-
| `extract_govcontracts` | USASpending.gov API | Government contract awards — unique GTM signal |
|
|
86
|
-
| `extract_npm_releases` | npm registry API | Package release velocity and adoption signals |
|
|
87
|
-
| `extract_twitter_trends` | Nitter public endpoints | Real-time trending topics with no auth |
|
|
88
|
-
| `extract_linkedin_jobs` | LinkedIn public job search | Job freshness — the origin story, completed |
|
|
89
|
-
|
|
90
|
-
The `extract_changelog` and `extract_govcontracts` adapters are not available in any other MCP server. They represent a genuine capability gap in the market.
|
|
91
|
-
|
|
92
|
-
---
|
|
93
|
-
|
|
94
|
-
## Layer 9 — The Freshness Score Standard
|
|
95
|
-
|
|
96
|
-
**Status: Spec written (FRESHCONTEXT_SPEC.md), numeric score not yet implemented**
|
|
97
|
-
|
|
98
|
-
The FreshContext Specification v1.0 defines an optional `freshness_score` field (0–100) calculated as:
|
|
99
|
-
|
|
100
|
-
```
|
|
101
|
-
freshness_score = max(0, 100 - (days_since_retrieved × decay_rate))
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
Domain-specific decay rates will allow different categories of data to age at appropriate speeds:
|
|
105
|
-
|
|
106
|
-
| Category | Decay Rate | Half-life |
|
|
107
|
-
|---|---|---|
|
|
108
|
-
| Financial data | 5.0 | ~10 days |
|
|
109
|
-
| Job listings | 3.0 | ~17 days |
|
|
110
|
-
| News / HN | 2.0 | ~25 days |
|
|
111
|
-
| GitHub repos | 1.0 | ~50 days |
|
|
112
|
-
| Academic papers | 0.3 | ~167 days |
|
|
113
|
-
|
|
114
|
-
Once implemented, agents can filter results by `freshness_score > threshold` instead of relying on string confidence levels. This makes FreshContext usable as a query parameter, not just a label.
|
|
115
|
-
|
|
116
|
-
---
|
|
117
|
-
|
|
118
|
-
## Layer 10 — API + Monetization Infrastructure
|
|
119
|
-
|
|
120
|
-
**Status: Pricing designed, billing not yet built**
|
|
121
|
-
|
|
122
|
-
The monetization architecture planned for FreshContext:
|
|
123
|
-
|
|
124
|
-
**Free tier**
|
|
125
|
-
- 1 user profile
|
|
126
|
-
- 5 watched queries
|
|
127
|
-
- Daily briefings
|
|
128
|
-
- All 11 adapters via MCP
|
|
129
|
-
|
|
130
|
-
**Pro ($19/month)**
|
|
131
|
-
- Unlimited watched queries
|
|
132
|
-
- 6-hour briefings
|
|
133
|
-
- All adapters including new ones
|
|
134
|
-
- Freshness score on every result
|
|
135
|
-
- API access (100k calls/month)
|
|
136
|
-
|
|
137
|
-
**Team ($79/month)**
|
|
138
|
-
- Multiple user profiles
|
|
139
|
-
- Shared briefing feed
|
|
140
|
-
- Slack / email delivery
|
|
141
|
-
- 500k API calls/month
|
|
142
|
-
- Priority support
|
|
143
|
-
|
|
144
|
-
**Enterprise (custom)**
|
|
145
|
-
- Dedicated Cloudflare Worker deployment
|
|
146
|
-
- Custom adapter development
|
|
147
|
-
- SLA-backed uptime
|
|
148
|
-
- White-label briefing output
|
|
149
|
-
|
|
150
|
-
**Billing implementation:** Lemon Squeezy (Namibia-compatible, merchant-of-record, no Stripe required)
|
|
151
|
-
|
|
152
|
-
---
|
|
153
|
-
|
|
154
|
-
## The Bigger Picture
|
|
155
|
-
|
|
156
|
-
FreshContext started as a fix for a personal problem — AI giving stale job listings with no warning. It's becoming something more structural: a **data freshness layer for the AI agent ecosystem.**
|
|
157
|
-
|
|
158
|
-
Every agent needs to know how old its data is. Right now, none of them do — not reliably, not with a standard format, not with a confidence signal. FreshContext is the first project to address this as a named, specified, open standard with a working reference implementation.
|
|
159
|
-
|
|
160
|
-
The opportunity is to become the layer that other AI tools plug into when they need grounded, timestamped intelligence — not a scraper, not a search engine, but the envelope that makes retrieved data trustworthy.
|
|
161
|
-
|
|
162
|
-
**The unfair advantage:** One developer, Cloudflare's global edge, a working spec, and a dataset that grows every six hours whether or not anyone is watching. The longer FreshContext runs, the more historical signal accumulates, and the harder it becomes to replicate from scratch.
|
|
163
|
-
|
|
164
|
-
---
|
|
165
|
-
|
|
166
|
-
## Contribution
|
|
167
|
-
|
|
168
|
-
The FreshContext Specification is open. New adapters are the highest-value contribution — see `src/adapters/` for the pattern and `FRESHCONTEXT_SPEC.md` for the contract any adapter must fulfill.
|
|
169
|
-
|
|
170
|
-
If you're building something FreshContext-compatible, open an issue and we'll add you to the ecosystem list.
|
|
171
|
-
|
|
172
|
-
---
|
|
173
|
-
|
|
174
|
-
*"The work isn't gone. It's just waiting to be continued."*
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
# FreshContext — Architecture Upgrade Session V1
|
|
2
|
-
**Date:** 2026-03-19
|
|
3
|
-
**Session type:** Infrastructure hardening + automation
|
|
4
|
-
**Status:** 13 tools live. GitHub Actions CI/CD live. Apify Actor published. govcontracts fixed.
|
|
5
|
-
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
## What Was Accomplished This Session
|
|
9
|
-
|
|
10
|
-
### 1. extract_govcontracts — fully repaired
|
|
11
|
-
The adapter was sending wrong field names to USASpending.gov on every call. Root cause:
|
|
12
|
-
every field used underscores ("Award_ID", "Recipient_Name") while the API requires
|
|
13
|
-
space-separated names ("Award ID", "Recipient Name"). After three rounds of diagnosis,
|
|
14
|
-
the correct fix was a full rewrite of govcontracts.ts. Confirmed working — Palantir
|
|
15
|
-
query returned $1.29B across 10 contracts live from the US Treasury.
|
|
16
|
-
|
|
17
|
-
### 2. README updated to 13 tools
|
|
18
|
-
Updated from "11 tools" to "13 tools". extract_changelog and extract_govcontracts given
|
|
19
|
-
their own dedicated sections with separate headings. Two new usage examples added.
|
|
20
|
-
Roadmap updated to mark both adapters complete and add extract_devto + extract_npm_releases
|
|
21
|
-
as next planned work.
|
|
22
|
-
|
|
23
|
-
### 3. Apify Actor — Dockerfile added
|
|
24
|
-
Actor was timing out because .actor/actor.json had no Dockerfile reference, so Apify
|
|
25
|
-
launched dist/server.js — the MCP stdio server that waits forever and never exits.
|
|
26
|
-
Fixed by creating .actor/Dockerfile using apify/actor-node:18, installing all deps
|
|
27
|
-
including apify SDK, and running dist/apify.js as the CMD. apify added to dependencies
|
|
28
|
-
in package.json. The apify.ts file was already complete — it just had no path to get called.
|
|
29
|
-
|
|
30
|
-
### 4. GitHub Actions CI/CD — live and confirmed
|
|
31
|
-
.github/workflows/publish.yml created, triggers on every push to main. Runs npm ci,
|
|
32
|
-
npm run build, npm publish. Uses NPM_TOKEN secret. First run: green checkmark, 23 seconds.
|
|
33
|
-
Manual PowerShell build/publish commands are no longer needed. Bump version, git push, done.
|
|
34
|
-
|
|
35
|
-
### 5. Outreach — 3 new Gmail drafts
|
|
36
|
-
Apollo.io — government contracts as missing GTM signal.
|
|
37
|
-
Harmonic.ai — contracts + changelog velocity as VC signals.
|
|
38
|
-
GitHub Partnerships — Releases API use case via extract_changelog.
|
|
39
|
-
|
|
40
|
-
---
|
|
41
|
-
|
|
42
|
-
## Current Stack State
|
|
43
|
-
|
|
44
|
-
| Layer | Status | Notes |
|
|
45
|
-
|---|---|---|
|
|
46
|
-
| npm | freshcontext-mcp@0.3.10 | 13 tools, published |
|
|
47
|
-
| Cloudflare Worker | Live | Global edge, KV rate limiting |
|
|
48
|
-
| D1 Database | Live | 18 watched queries, 6h cron |
|
|
49
|
-
| Synthesis | PAUSED | Needs $5 Anthropic credits |
|
|
50
|
-
| Apify Actor | Published | Dockerfile pushed, needs rebuild + test |
|
|
51
|
-
| GitHub Actions | LIVE | Green, 23s |
|
|
52
|
-
| MCP Registry | Listed | server.json version may need update |
|
|
53
|
-
| Payoneer | Approved | Customer ID 102746504 |
|
|
54
|
-
|
|
55
|
-
---
|
|
56
|
-
|
|
57
|
-
## Pending Action Items
|
|
58
|
-
|
|
59
|
-
Apify: Source tab → Build now → test with {"tool":"extract_hackernews","query":"mcp server 2026"}.
|
|
60
|
-
Then test extract_govcontracts with "Palantir" to confirm full end-to-end on Apify.
|
|
61
|
-
Increase Apify Actor timeout from 300s to 3600s in Settings (free, needed for Playwright tools).
|
|
62
|
-
Send three Gmail drafts: Apollo.io, Harmonic.ai, GitHub Partnerships.
|
|
63
|
-
Top up $5 Anthropic credits to re-enable /briefing/now synthesis endpoint.
|
|
64
|
-
|
|
65
|
-
---
|
|
66
|
-
|
|
67
|
-
## Next Architecture Upgrades (see ARCHITECTURE_UPGRADE_ROADMAP_V1.md)
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
# FreshContext — Architecture Session V2 Save
|
|
2
|
-
**Date:** 2026-03-19
|
|
3
|
-
**Session type:** Architecture upgrades complete + new composite adapters planned
|
|
4
|
-
**npm version:** 0.3.10 (GitHub Actions publishes automatically on every push now)
|
|
5
|
-
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
## What Was Completed This Session
|
|
9
|
-
|
|
10
|
-
### All 7 Architecture Upgrades — DONE
|
|
11
|
-
|
|
12
|
-
| # | Upgrade | Status | Notes |
|
|
13
|
-
|---|---|---|---|
|
|
14
|
-
| 1 | freshness_score numeric field | DONE | Implemented in src/tools/freshnessStamp.ts |
|
|
15
|
-
| 2 | Cloudflare KV response caching | DONE | Already in worker.ts — discovered not missing |
|
|
16
|
-
| 3 | Apify Actor timeout increase | DONE | Changed to 3600s in Apify UI |
|
|
17
|
-
| 4 | D1 deduplication in cron job | DONE | Already in runScheduledScrape as hash-based dedup |
|
|
18
|
-
| 5 | Structured JSON response form | DONE | FRESHCONTEXT_JSON block appended to every response |
|
|
19
|
-
| 6 | GitHub Actions CI/CD | DONE | .github/workflows/publish.yml live, 23s green run |
|
|
20
|
-
| 7 | server.json version sync | DONE | Updated to 0.3.10, description to 13 tools |
|
|
21
|
-
|
|
22
|
-
### Key implementation details
|
|
23
|
-
|
|
24
|
-
Upgrade 1 — freshnessStamp.ts now calculates max(0, 100 - (days × decayRate)) per adapter.
|
|
25
|
-
Decay rates: finance=5.0, jobs=3.0, hackernews/reddit/producthunt=2.0, yc/govcontracts=1.5,
|
|
26
|
-
github/repoSearch/packageTrends/changelog=1.0, scholar/arxiv=0.3, default=1.5.
|
|
27
|
-
Returns null when content_date is unknown. Returns 0 when score would go negative.
|
|
28
|
-
Score label added: current (90+), reliable (70+), verify before acting (50+), use with caution (<50).
|
|
29
|
-
|
|
30
|
-
Upgrade 5 — Every response now emits both:
|
|
31
|
-
[FRESHCONTEXT]...[/FRESHCONTEXT] ← text envelope for AI agents
|
|
32
|
-
[FRESHCONTEXT_JSON]...{...}...[/FRESHCONTEXT_JSON] ← structured JSON for programmatic use
|
|
33
|
-
JSON form contains: source_url, content_date, retrieved_at, freshness_confidence,
|
|
34
|
-
freshness_score, adapter, content. toStructuredJSON() is exported from freshnessStamp.ts.
|
|
35
|
-
|
|
36
|
-
### Command reference HTML cheat sheet
|
|
37
|
-
FRESHCONTEXT_COMMANDS.html was created and delivered as a downloadable file.
|
|
38
|
-
Dark theme, click-to-copy cards, organized by: Landscape, Intelligence, Competitive,
|
|
39
|
-
Market data, Unique adapters, Power combos. Open in any browser, click a card to copy
|
|
40
|
-
the command, paste into Claude.
|
|
41
|
-
|
|
42
|
-
---
|
|
43
|
-
|
|
44
|
-
## Next Session — Two New Composite Adapters
|
|
45
|
-
|
|
46
|
-
### Adapter 1: extract_gov_landscape
|
|
47
|
-
"Gov contracts for developers"
|
|
48
|
-
|
|
49
|
-
The idea: a single call that gives a complete government intelligence picture on a
|
|
50
|
-
company or keyword. Not just the contract data, but whether the companies winning
|
|
51
|
-
those contracts are actually shipping code and whether the developer community knows
|
|
52
|
-
about them.
|
|
53
|
-
|
|
54
|
-
Sources to combine in parallel:
|
|
55
|
-
- extract_govcontracts — who won, how much, which agency, when
|
|
56
|
-
- extract_github — are the winning companies actually building (stars, last commit, language)
|
|
57
|
-
- extract_hackernews — does the dev community know about them
|
|
58
|
-
- extract_changelog — are they shipping product (release velocity as a health signal)
|
|
59
|
-
|
|
60
|
-
Input: company name, keyword, or NAICS code (same as extract_govcontracts)
|
|
61
|
-
Output: unified FreshContext envelope with sections for each source, all timestamped
|
|
62
|
-
|
|
63
|
-
Why it matters: A $50M DoD contract winner with no GitHub commits in 6 months and
|
|
64
|
-
zero HN mentions is a very different company from one that's been pushing code weekly
|
|
65
|
-
and has 3 HN front-page mentions. This composite surfaces that difference in one call.
|
|
66
|
-
|
|
67
|
-
Location: src/adapters/govLandscape.ts
|
|
68
|
-
Tool name: extract_gov_landscape
|
|
69
|
-
|
|
70
|
-
### Adapter 2: extract_finance_landscape
|
|
71
|
-
"Finance for developers"
|
|
72
|
-
|
|
73
|
-
The idea: a stock price is a backward-looking lagging indicator. What a technical
|
|
74
|
-
investor or developer actually needs is price combined with the signals only FreshContext
|
|
75
|
-
can surface — developer community sentiment, engineering velocity, ecosystem activity.
|
|
76
|
-
|
|
77
|
-
Sources to combine in parallel:
|
|
78
|
-
- extract_finance — live price, market cap, P/E, 52w range (Yahoo Finance)
|
|
79
|
-
- extract_hackernews — what are developers saying about this company right now
|
|
80
|
-
- extract_reddit — investor and developer community sentiment (r/investing + tech subs)
|
|
81
|
-
- search_repos — how many GitHub repos orbit this company's ecosystem
|
|
82
|
-
- extract_changelog — is the company actually shipping product (release velocity)
|
|
83
|
-
|
|
84
|
-
Input: ticker symbol(s) e.g. "PLTR" or "PLTR,MSFT"
|
|
85
|
-
Output: unified FreshContext envelope with sections for each source, all timestamped
|
|
86
|
-
|
|
87
|
-
Why it matters: Bloomberg Terminal doesn't read GitHub commit history as a company
|
|
88
|
-
health signal. FreshContext does. This composite is something no existing financial
|
|
89
|
-
tool offers — developer-native market intelligence with freshness scores on every source.
|
|
90
|
-
|
|
91
|
-
Location: src/adapters/financeLandscape.ts
|
|
92
|
-
Tool name: extract_finance_landscape
|
|
93
|
-
|
|
94
|
-
### Pattern to follow
|
|
95
|
-
Both adapters should follow the exact same structure as extract_landscape in
|
|
96
|
-
src/adapters/landscape.ts — use Promise.allSettled for parallel calls, handle
|
|
97
|
-
partial failures gracefully (if one source fails, the others still return),
|
|
98
|
-
wrap the combined output in a single FreshContext envelope with sections clearly
|
|
99
|
-
labelled per source.
|
|
100
|
-
|
|
101
|
-
---
|
|
102
|
-
|
|
103
|
-
## Current Stack State
|
|
104
|
-
|
|
105
|
-
| Layer | Status |
|
|
106
|
-
|---|---|
|
|
107
|
-
| npm | freshcontext-mcp@0.3.10, auto-publishes via GitHub Actions |
|
|
108
|
-
| Cloudflare Worker | Live, KV caching active, rate limiting active |
|
|
109
|
-
| D1 Database | 18 watched queries, 6h cron, hash-based dedup |
|
|
110
|
-
| Synthesis | PAUSED — needs $5 Anthropic credits at console.anthropic.com |
|
|
111
|
-
| Apify Actor | Published, Dockerfile fixed, timeout 3600s |
|
|
112
|
-
| GitHub Actions | Live — push to main = auto build + publish |
|
|
113
|
-
| MCP Registry | server.json v0.3.10, 13 tools description |
|
|
114
|
-
| Payoneer | Approved — Customer ID 102746504 |
|
|
115
|
-
|
|
116
|
-
## Outreach Status
|
|
117
|
-
|
|
118
|
-
| Target | Email | Status |
|
|
119
|
-
|---|---|---|
|
|
120
|
-
| Apify | jan@apify.com | Sent |
|
|
121
|
-
| Clay | kareem@clay.com | Sent |
|
|
122
|
-
| n8n | jan@n8n.io | Sent |
|
|
123
|
-
| Cloudflare Startups | startups@cloudflare.com | Sent — awaiting reply (10 business days) |
|
|
124
|
-
| Anthropic | partnerships@anthropic.com | Sent |
|
|
125
|
-
| Apollo.io | hello@apollo.io | Sent this session |
|
|
126
|
-
| Harmonic.ai | hello@harmonic.ai | Sent this session |
|
|
127
|
-
| GitHub Partnerships | partnerships@github.com | Sent this session |
|
|
128
|
-
|
|
129
|
-
---
|
|
130
|
-
|
|
131
|
-
## Resume Prompt for Next Session
|
|
132
|
-
|
|
133
|
-
"I'm building freshcontext-mcp — 13-tool web intelligence MCP server, fully
|
|
134
|
-
spec-compliant, GitHub Actions CI/CD live, all 7 architecture upgrades complete.
|
|
135
|
-
Next task: build two new composite adapters — extract_gov_landscape (govcontracts +
|
|
136
|
-
github + hackernews + changelog in parallel) and extract_finance_landscape (finance
|
|
137
|
-
+ hackernews + reddit + search_repos + changelog in parallel). Both follow the
|
|
138
|
-
extract_landscape pattern in src/adapters/landscape.ts. See SESSION_SAVE_ARCHITECTURE_V2.md
|
|
139
|
-
for full spec."
|
|
140
|
-
|
|
141
|
-
*"The work isn't gone. It's just waiting to be continued."*
|
|
142
|
-
*— Prince Gabriel, Grootfontein, Namibia*
|
package/SESSION_SAVE_V4.md
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
# FreshContext — Session Save V4
|
|
2
|
-
**Date:** 2026-03-20
|
|
3
|
-
**npm:** freshcontext-mcp@0.3.11
|
|
4
|
-
**Tools:** 15 live → building to 18
|
|
5
|
-
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
## What Was Done This Session
|
|
9
|
-
|
|
10
|
-
- Apify Actor fixed: Node 20 base image, clean build confirmed
|
|
11
|
-
- HANDOFF.md created and pushed
|
|
12
|
-
- Command reference HTML updated with example output section
|
|
13
|
-
- Intelligence report (Anthropic/OpenAI/Palantir) confirmed as best product demo asset
|
|
14
|
-
- SESSION_SAVE_V3.md written
|
|
15
|
-
- Strategic discussion: keep the niche, deepen it — spec adoption > more tools
|
|
16
|
-
- Identified two new unique adapters: extract_sec_filings + extract_gdelt
|
|
17
|
-
- Composite: extract_company_landscape (5 sources: SEC + govcontracts + GDELT + changelog + finance)
|
|
18
|
-
|
|
19
|
-
---
|
|
20
|
-
|
|
21
|
-
## Next Build — NOW IN PROGRESS
|
|
22
|
-
|
|
23
|
-
### extract_sec_filings
|
|
24
|
-
Source: SEC EDGAR full-text search (efts.sec.gov/LATEST/search-index)
|
|
25
|
-
No auth. Free. Real-time.
|
|
26
|
-
Returns: 8-K filings — legally mandated material event disclosures
|
|
27
|
-
CEO changes, major contracts, acquisitions, breaches, regulatory actions
|
|
28
|
-
File: src/adapters/secFilings.ts
|
|
29
|
-
|
|
30
|
-
### extract_gdelt
|
|
31
|
-
Source: GDELT Project (api.gdeltproject.org/api/v2/doc/doc)
|
|
32
|
-
No auth. Free. Updated every 15 minutes.
|
|
33
|
-
Returns: Structured global news events with tone, goldstein scale, actor tags
|
|
34
|
-
File: src/adapters/gdelt.ts
|
|
35
|
-
|
|
36
|
-
### extract_company_landscape (composite)
|
|
37
|
-
5 sources in parallel:
|
|
38
|
-
1. extract_sec_filings — legal disclosures
|
|
39
|
-
2. extract_govcontracts — federal contract footprint
|
|
40
|
-
3. extract_gdelt — global news events
|
|
41
|
-
4. extract_changelog — shipping velocity
|
|
42
|
-
5. extract_finance — market pricing
|
|
43
|
-
File: register in src/server.ts
|
|
44
|
-
|
|
45
|
-
---
|
|
46
|
-
|
|
47
|
-
## Moat Summary (all 4 unique adapters)
|
|
48
|
-
extract_changelog — release history from any repo/package/site
|
|
49
|
-
extract_govcontracts — US federal contract awards (USASpending.gov)
|
|
50
|
-
extract_sec_filings — 8-K material event disclosures (SEC EDGAR)
|
|
51
|
-
extract_gdelt — global structured news events (GDELT Project)
|
|
52
|
-
|
|
53
|
-
These 4 exist in no other MCP server. All free. All no-auth.
|
|
54
|
-
|
|
55
|
-
---
|
|
56
|
-
|
|
57
|
-
## Resume Prompt
|
|
58
|
-
"I'm building freshcontext-mcp. Just built extract_sec_filings and extract_gdelt.
|
|
59
|
-
Need to register them in server.ts and build extract_company_landscape composite.
|
|
60
|
-
See SESSION_SAVE_V4.md."
|