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/.env.example
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# freshcontext-mcp environment variables
|
|
2
|
+
# Copy to .env and fill in
|
|
3
|
+
|
|
4
|
+
# Optional: GitHub Personal Access Token (increases rate limits for GitHub API fallback)
|
|
5
|
+
GITHUB_TOKEN=
|
|
6
|
+
|
|
7
|
+
# Optional: Proxy URL if needed for certain extractions
|
|
8
|
+
# PROXY_URL=http://user:pass@host:port
|
package/README.md
CHANGED
|
@@ -8,12 +8,46 @@ That's the problem freshcontext fixes.
|
|
|
8
8
|
|
|
9
9
|
[](https://www.npmjs.com/package/freshcontext-mcp)
|
|
10
10
|
[](https://opensource.org/licenses/MIT)
|
|
11
|
+
[](https://registry.modelcontextprotocol.io)
|
|
12
|
+
|
|
13
|
+
> **Live demo:** [freshcontext-mcp.gimmanuel73.workers.dev/demo](https://freshcontext-mcp.gimmanuel73.workers.dev/demo) — same model, same query, two completely different answers. Only the temporal layer changed.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## The problem
|
|
18
|
+
|
|
19
|
+
Large language models retrieve web data semantically. Cosine similarity finds the documents that match a query best — but cosine doesn't know when a document was written.
|
|
20
|
+
|
|
21
|
+
So a 2022 blog post and a 2026 paper can score nearly identically. The model gets a context window full of stale documents and faithfully summarizes 2022 advice for a 2026 question.
|
|
22
|
+
|
|
23
|
+
That's not hallucination. That's correct summarization of corrupted retrieval.
|
|
24
|
+
|
|
25
|
+
> **Most RAG pipelines rank context correctly semantically but incorrectly temporally.**
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## The layer
|
|
30
|
+
|
|
31
|
+
FreshContext is a **temporal correction layer for retrieval systems**. One math correction applied before context reaches the LLM:
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
R_t = R_0 · e^(−λt)
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
- `R_0` — base semantic relevancy (whatever your retriever already gives you)
|
|
38
|
+
- `λ` — source-specific decay constant (HN ≈14h half-life, blogs ≈29d, academic papers ≈1.6y)
|
|
39
|
+
- `t` — hours elapsed since publication
|
|
40
|
+
- `R_t` — decay-adjusted relevancy at query time
|
|
41
|
+
|
|
42
|
+
That's the whole fix. No model swap. No re-embedding. No re-indexing. The layer drops onto whatever retrieval pipeline you already have.
|
|
43
|
+
|
|
44
|
+
**The layer is the product.** The 20 adapters shipped with this repo are reference implementations demonstrating compatibility — useful, but commodity. The DAR engine, the freshness envelope, and the FreshContext Specification are the moat.
|
|
11
45
|
|
|
12
46
|
---
|
|
13
47
|
|
|
14
|
-
##
|
|
48
|
+
## The standard
|
|
15
49
|
|
|
16
|
-
Every
|
|
50
|
+
Every FreshContext-compatible response wraps content in a structured envelope:
|
|
17
51
|
|
|
18
52
|
```
|
|
19
53
|
[FRESHCONTEXT]
|
|
@@ -26,83 +60,76 @@ Confidence: high
|
|
|
26
60
|
[/FRESHCONTEXT]
|
|
27
61
|
```
|
|
28
62
|
|
|
29
|
-
|
|
63
|
+
**When** it was retrieved. **Where** it came from. **How confident** we are the date is accurate.
|
|
64
|
+
|
|
65
|
+
The FreshContext Specification v1.1 is published as an open standard under MIT licence. Any tool, agent, or system that wraps retrieved data in this envelope is FreshContext-compatible. → [Read the spec](./FRESHCONTEXT_SPEC.md) · [Read the methodology](./METHODOLOGY.md)
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## The intelligence feed
|
|
70
|
+
|
|
71
|
+
Beyond the per-call envelope, the production FreshContext deployment exposes a continuous, decay-scored, deduplicated feed:
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
GET /v1/intel/feed/:profile_id?limit=20&min_rt=0
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Every signal is stamped with `base_score`, `rt_score`, `entropy_level` (low / stable / high), `ha_pri_sig` (SHA-256 provenance), `semantic_fingerprint` (cross-adapter dedup), and `published_at`. Ready for direct LLM or agent consumption — no synthesis required.
|
|
78
|
+
|
|
79
|
+
Production endpoint: `https://freshcontext-mcp.gimmanuel73.workers.dev`
|
|
30
80
|
|
|
31
81
|
---
|
|
32
82
|
|
|
33
|
-
##
|
|
83
|
+
## Reference adapters
|
|
84
|
+
|
|
85
|
+
The repo ships 20 adapters demonstrating how to make any data source FreshContext-compatible. Useful as drop-in tools, but the value is the layer above them.
|
|
34
86
|
|
|
35
87
|
### Intelligence
|
|
36
|
-
|
|
|
88
|
+
| Adapter | What it returns |
|
|
37
89
|
|---|---|
|
|
38
90
|
| `extract_github` | README, stars, forks, language, topics, last commit |
|
|
39
91
|
| `extract_hackernews` | Top stories or search results with scores and timestamps |
|
|
40
92
|
| `extract_scholar` | Research papers — titles, authors, years, snippets |
|
|
41
|
-
| `extract_arxiv` | arXiv papers via official API
|
|
93
|
+
| `extract_arxiv` | arXiv papers via official API |
|
|
42
94
|
| `extract_reddit` | Posts and community sentiment from any subreddit |
|
|
43
95
|
|
|
44
96
|
### Competitive research
|
|
45
|
-
|
|
|
97
|
+
| Adapter | What it returns |
|
|
46
98
|
|---|---|
|
|
47
|
-
| `extract_yc` | YC company listings by keyword
|
|
99
|
+
| `extract_yc` | YC company listings by keyword |
|
|
48
100
|
| `extract_producthunt` | Recent launches by topic |
|
|
49
101
|
| `search_repos` | GitHub repos ranked by stars with activity signals |
|
|
50
102
|
| `package_trends` | npm and PyPI metadata — version history, release cadence |
|
|
51
103
|
|
|
52
104
|
### Market data
|
|
53
|
-
|
|
|
105
|
+
| Adapter | What it returns |
|
|
54
106
|
|---|---|
|
|
55
107
|
| `extract_finance` | Live stock data — price, market cap, P/E, 52w range. Up to 5 tickers. |
|
|
56
|
-
| `search_jobs` | Remote job listings from Remotive
|
|
108
|
+
| `search_jobs` | Remote job listings from Remotive, RemoteOK, HN "Who is Hiring" |
|
|
57
109
|
|
|
58
110
|
### Composites — multiple sources, one call
|
|
59
|
-
|
|
|
111
|
+
| Adapter | Sources | Purpose |
|
|
60
112
|
|---|---|---|
|
|
61
113
|
| `extract_landscape` | 6 | YC + GitHub + HN + Reddit + Product Hunt + npm in parallel |
|
|
62
|
-
| `
|
|
114
|
+
| `extract_idea_landscape` | 6 | HN + YC + GitHub + Jobs + npm + Product Hunt — full idea validation |
|
|
115
|
+
| `extract_gov_landscape` | 4 | Gov contracts + HN + GitHub + changelog |
|
|
63
116
|
| `extract_finance_landscape` | 5 | Finance + HN + Reddit + GitHub + changelog |
|
|
64
|
-
| `extract_company_landscape` | 5 |
|
|
117
|
+
| `extract_company_landscape` | 5 | The full picture on any company |
|
|
65
118
|
|
|
66
119
|
### Unique — not available in any other MCP server
|
|
67
|
-
|
|
|
120
|
+
| Adapter | Source | What it returns |
|
|
68
121
|
|---|---|---|
|
|
69
|
-
| `extract_changelog` | GitHub Releases
|
|
122
|
+
| `extract_changelog` | GitHub Releases / npm / auto-discover | Update history from any repo, package, or website |
|
|
70
123
|
| `extract_govcontracts` | USASpending.gov | US federal contract awards — company, amount, agency, period |
|
|
71
124
|
| `extract_sec_filings` | SEC EDGAR | 8-K filings — legally mandated material event disclosures |
|
|
72
|
-
| `extract_gdelt` | GDELT Project | Global news intelligence — 100+ languages,
|
|
73
|
-
| `extract_gebiz` | data.gov.sg | Singapore Government procurement tenders — open dataset
|
|
74
|
-
|
|
75
|
-
---
|
|
76
|
-
|
|
77
|
-
## extract_company_landscape
|
|
78
|
-
|
|
79
|
-
The most complete single-call company analysis available in any MCP server. Five sources fired in parallel:
|
|
80
|
-
|
|
81
|
-
1. **SEC EDGAR** — what did they legally just disclose (8-K filings)
|
|
82
|
-
2. **USASpending.gov** — who is giving them government money
|
|
83
|
-
3. **GDELT** — what is global news saying right now
|
|
84
|
-
4. **Changelog** — are they actually shipping product
|
|
85
|
-
5. **Yahoo Finance** — what is the market pricing in
|
|
86
|
-
|
|
87
|
-
```
|
|
88
|
-
Use extract_company_landscape with company "Palantir" and ticker "PLTR"
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
Real output from March 26, 2026:
|
|
92
|
-
|
|
93
|
-
> **Q4 2025:** Revenue $1.407B (+70% YoY). US commercial +137%. Rule of 40 score: **127%**.
|
|
94
|
-
> **Federal contracts:** $292.7M Army Maven Smart System · $252.5M CDAO · $145M ICE · $130M Air Force · more
|
|
95
|
-
> **SEC filing:** Q4 earnings 8-K filed Feb 3, 2026 — GAAP net income $609M, 43% margin
|
|
96
|
-
> **GDELT:** ICE/Medicaid data controversy, UK MoD security warning, NHS opposition — all timestamped
|
|
97
|
-
> **PLTR:** ~$154–157 · Market cap ~$370B · P/E 244x · 52w range $66 → $207
|
|
98
|
-
|
|
99
|
-
Bloomberg Terminal doesn't read commit history as a company health signal. This does.
|
|
125
|
+
| `extract_gdelt` | GDELT Project | Global news intelligence — 100+ languages, 15-min updates |
|
|
126
|
+
| `extract_gebiz` | data.gov.sg | Singapore Government procurement tenders — open dataset |
|
|
100
127
|
|
|
101
128
|
---
|
|
102
129
|
|
|
103
|
-
## Quick
|
|
130
|
+
## Quick start
|
|
104
131
|
|
|
105
|
-
###
|
|
132
|
+
### Cloud (no install)
|
|
106
133
|
|
|
107
134
|
Add to your Claude Desktop config and restart:
|
|
108
135
|
|
|
@@ -124,9 +151,7 @@ Restart Claude. Done.
|
|
|
124
151
|
|
|
125
152
|
> Prefer a guided setup? Visit **[freshcontext-site.pages.dev](https://freshcontext-site.pages.dev)** — 3 steps, no terminal.
|
|
126
153
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
### Option B — Local (full Playwright)
|
|
154
|
+
### Local (full Playwright)
|
|
130
155
|
|
|
131
156
|
**Requires:** Node.js 18+ ([nodejs.org](https://nodejs.org))
|
|
132
157
|
|
|
@@ -164,16 +189,14 @@ Add to Claude Desktop config:
|
|
|
164
189
|
}
|
|
165
190
|
```
|
|
166
191
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
### Troubleshooting (Mac)
|
|
192
|
+
#### Mac troubleshooting
|
|
170
193
|
|
|
171
194
|
**"command not found: node"** — Use the full path:
|
|
172
195
|
```bash
|
|
173
196
|
which node # copy this output, replace "node" in config
|
|
174
197
|
```
|
|
175
198
|
|
|
176
|
-
**Config file doesn't exist
|
|
199
|
+
**Config file doesn't exist:**
|
|
177
200
|
```bash
|
|
178
201
|
mkdir -p ~/Library/Application\ Support/Claude
|
|
179
202
|
touch ~/Library/Application\ Support/Claude/claude_desktop_config.json
|
|
@@ -183,23 +206,17 @@ touch ~/Library/Application\ Support/Claude/claude_desktop_config.json
|
|
|
183
206
|
|
|
184
207
|
## Usage examples
|
|
185
208
|
|
|
186
|
-
**
|
|
209
|
+
**Should I build this idea?**
|
|
187
210
|
```
|
|
188
|
-
Use
|
|
211
|
+
Use extract_idea_landscape with idea "procurement intelligence saas"
|
|
189
212
|
```
|
|
190
|
-
Returns
|
|
213
|
+
Returns funding signal, pain signal, crowding signal, market signal, ecosystem signal, and launch signal — all timestamped.
|
|
191
214
|
|
|
192
215
|
**Full company intelligence in one call:**
|
|
193
216
|
```
|
|
194
217
|
Use extract_company_landscape with company "Palantir" and ticker "PLTR"
|
|
195
218
|
```
|
|
196
|
-
SEC filings + federal contracts + global news + changelog + market data.
|
|
197
|
-
|
|
198
|
-
**What's Singapore's government procuring right now?**
|
|
199
|
-
```
|
|
200
|
-
Use extract_gebiz with url "artificial intelligence"
|
|
201
|
-
```
|
|
202
|
-
Returns live tenders from the Ministry of Finance open dataset — agency, amount, closing date, all timestamped.
|
|
219
|
+
SEC filings + federal contracts + global news + changelog + market data.
|
|
203
220
|
|
|
204
221
|
**Did that company just disclose something material?**
|
|
205
222
|
```
|
|
@@ -207,90 +224,61 @@ Use extract_sec_filings with url "Palantir Technologies"
|
|
|
207
224
|
```
|
|
208
225
|
8-K filings are legally mandated within 4 business days of any material event — CEO change, acquisition, breach, major contract.
|
|
209
226
|
|
|
210
|
-
**What is global news saying about a company?**
|
|
211
|
-
```
|
|
212
|
-
Use extract_gdelt with url "Palantir"
|
|
213
|
-
```
|
|
214
|
-
100+ languages, every country, updated every 15 minutes. Surfaces what Western sources miss.
|
|
215
|
-
|
|
216
|
-
**What's the community actually saying right now?**
|
|
217
|
-
```
|
|
218
|
-
Use extract_reddit on r/MachineLearning
|
|
219
|
-
Use extract_hackernews to search "mcp server 2026"
|
|
220
|
-
```
|
|
221
|
-
|
|
222
227
|
**Is this dependency still actively maintained?**
|
|
223
228
|
```
|
|
224
229
|
Use extract_changelog with url "https://github.com/org/repo"
|
|
225
230
|
```
|
|
226
231
|
Returns the last 8 releases with exact dates. If the last release was 18 months ago, you'll know before you pin the version.
|
|
227
232
|
|
|
228
|
-
**Which companies just won government contracts in AI?**
|
|
229
|
-
```
|
|
230
|
-
Use extract_govcontracts with url "artificial intelligence"
|
|
231
|
-
```
|
|
232
|
-
Largest recent federal contract awards matching that keyword — company, amount, agency, award date.
|
|
233
|
-
|
|
234
233
|
---
|
|
235
234
|
|
|
236
|
-
##
|
|
237
|
-
|
|
238
|
-
Most AI tools retrieve data silently. No timestamp, no signal, no way for the agent to know how old it is.
|
|
239
|
-
|
|
240
|
-
freshcontext treats **retrieval time as first-class metadata**. Every adapter returns:
|
|
241
|
-
|
|
242
|
-
- `retrieved_at` — exact ISO timestamp of the fetch
|
|
243
|
-
- `content_date` — best estimate of when the content was originally published
|
|
244
|
-
- `freshness_confidence` — `high`, `medium`, or `low` based on signal quality
|
|
245
|
-
- `freshness_score` — numeric 0–100 score with domain-specific decay rates
|
|
246
|
-
- `adapter` — which source the data came from
|
|
247
|
-
|
|
248
|
-
When confidence is `high`, the date came from a structured field (API, metadata). When it's `medium` or `low`, freshcontext tells you why.
|
|
249
|
-
|
|
250
|
-
The FreshContext Specification v1.0 is published as an open standard under MIT license. Any tool or agent that wraps retrieved data in the `[FRESHCONTEXT]` envelope is FreshContext-compatible.
|
|
251
|
-
|
|
252
|
-
→ [Read the spec](./FRESHCONTEXT_SPEC.md)
|
|
235
|
+
## Deployment & infrastructure
|
|
253
236
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
## Security
|
|
237
|
+
The reference implementation runs on Cloudflare's global edge:
|
|
257
238
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
239
|
+
| Endpoint | Method | Purpose |
|
|
240
|
+
|---|---|---|
|
|
241
|
+
| `/` | GET | Service info + endpoint list |
|
|
242
|
+
| `/health` | GET | Liveness check |
|
|
243
|
+
| `/mcp` | POST | MCP JSON-RPC transport |
|
|
244
|
+
| `/demo` | GET | Live before/after demo (no API key required) |
|
|
245
|
+
| `/briefing` | GET | Latest stored briefing |
|
|
246
|
+
| `/v1/intel/feed/:profile_id` | GET | DAR-scored intelligence feed |
|
|
247
|
+
| `/watched-queries` | GET | List all watched queries |
|
|
248
|
+
|
|
249
|
+
- **D1 database** — 18 watched queries running on 6-hour cron with relevancy scoring
|
|
250
|
+
- **KV-backed rate limiting** — 60 req/min per IP across all edge nodes
|
|
251
|
+
- **Defensive valves** — clock-skew rejection (5min tolerance), hard floor at R_t<5, lazy decay at read time
|
|
252
|
+
- **Provenance** — Ha-Pri SHA-256 audit signatures on every signal
|
|
253
|
+
- **Schema migrations** — promise-gated, idempotent, run on first request after deploy
|
|
254
|
+
|
|
255
|
+
Production: `https://freshcontext-mcp.gimmanuel73.workers.dev`
|
|
262
256
|
|
|
263
257
|
---
|
|
264
258
|
|
|
265
259
|
## Roadmap
|
|
266
260
|
|
|
267
|
-
- [x]
|
|
268
|
-
- [x]
|
|
269
|
-
- [x]
|
|
270
|
-
- [x]
|
|
271
|
-
- [x]
|
|
272
|
-
- [x]
|
|
273
|
-
- [x]
|
|
274
|
-
- [x]
|
|
275
|
-
- [x]
|
|
276
|
-
- [x]
|
|
277
|
-
- [
|
|
278
|
-
- [x] Cloudflare Workers deployment — global edge with KV caching
|
|
279
|
-
- [x] D1 database — 18 watched queries running on 6-hour cron
|
|
280
|
-
- [x] Listed on official MCP Registry
|
|
281
|
-
- [x] Listed on Apify Store
|
|
282
|
-
- [x] FreshContext Specification v1.0 published
|
|
283
|
-
- [x] GitHub Actions CI/CD — auto-publish to npm on every push
|
|
284
|
-
- [ ] GKG upgrade for `extract_gdelt` — tone scores, goldstein scale, event codes
|
|
285
|
-
- [ ] TTL-based caching layer
|
|
261
|
+
- [x] FreshContext Specification v1.1 published (MIT, open standard)
|
|
262
|
+
- [x] DAR engine with proprietary λ constants (v0.3.15)
|
|
263
|
+
- [x] Ha-Pri audit signatures on every signal
|
|
264
|
+
- [x] Semantic deduplication via fingerprinting
|
|
265
|
+
- [x] Live before/after demo at `/demo`
|
|
266
|
+
- [x] METHODOLOGY.md — formal IP and engineering documentation
|
|
267
|
+
- [x] 20 reference adapters across intelligence, competitive research, market data, and composites
|
|
268
|
+
- [x] Cloudflare Workers deployment — global edge, KV cache, KV rate limiting
|
|
269
|
+
- [x] Listed on official MCP Registry, Apify Store, npm
|
|
270
|
+
- [x] GitHub Actions CI/CD — auto-publish on every push
|
|
271
|
+
- [ ] Webhook triggers — push high-entropy signals on threshold
|
|
286
272
|
- [ ] Dashboard — React frontend for the D1 intelligence pipeline
|
|
287
|
-
- [ ]
|
|
273
|
+
- [ ] GKG upgrade for `extract_gdelt` — tone scores, goldstein scale, event codes
|
|
288
274
|
|
|
289
275
|
---
|
|
290
276
|
|
|
291
277
|
## Contributing
|
|
292
278
|
|
|
293
|
-
PRs welcome. New adapters are the highest-value contribution — see `src/adapters/` for the pattern and `FRESHCONTEXT_SPEC.md` for the contract any adapter must
|
|
279
|
+
PRs welcome. New adapters are the highest-value contribution — see `src/adapters/` for the pattern and [`FRESHCONTEXT_SPEC.md`](./FRESHCONTEXT_SPEC.md) for the contract any adapter must fulfil.
|
|
280
|
+
|
|
281
|
+
If you're building something FreshContext-compatible, open an issue and we'll add you to the ecosystem list.
|
|
294
282
|
|
|
295
283
|
---
|
|
296
284
|
|
|
@@ -302,3 +290,7 @@ MIT
|
|
|
302
290
|
|
|
303
291
|
*Built by Prince Gabriel — Grootfontein, Namibia 🇳🇦*
|
|
304
292
|
*"The work isn't gone. It's just waiting to be continued."*
|
|
293
|
+
|
|
294
|
+
---
|
|
295
|
+
|
|
296
|
+
**Also on:** [Apify Store](https://apify.com/prince_gabriel/freshcontext-mcp) · [MCP Registry](https://registry.modelcontextprotocol.io) · [npm](https://www.npmjs.com/package/freshcontext-mcp)
|