freshcontext-mcp 0.3.17 → 0.3.19

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.
Files changed (42) hide show
  1. package/LICENSE +21 -0
  2. package/NOTICE.md +17 -0
  3. package/README.md +459 -296
  4. package/SECURITY.md +34 -0
  5. package/TRADEMARKS.md +9 -0
  6. package/dist/adapters/arxiv.js +92 -48
  7. package/dist/adapters/hackernews.js +16 -16
  8. package/dist/adapters/registry.js +232 -0
  9. package/dist/core/decay.js +61 -0
  10. package/dist/core/decision.js +176 -0
  11. package/dist/core/envelope.js +59 -0
  12. package/dist/core/explain.js +28 -0
  13. package/dist/core/guards.js +17 -0
  14. package/dist/core/index.js +11 -0
  15. package/dist/core/pipeline.js +101 -0
  16. package/dist/core/provenance.js +73 -0
  17. package/dist/core/rank.js +84 -0
  18. package/dist/core/signal.js +101 -0
  19. package/dist/core/sourceProfiles.js +126 -0
  20. package/dist/core/types.js +1 -0
  21. package/dist/core/utility.js +90 -0
  22. package/dist/rest/handler.js +126 -0
  23. package/dist/server.js +40 -2
  24. package/dist/tools/evaluateContext.js +127 -0
  25. package/dist/tools/freshnessStamp.js +1 -137
  26. package/dist/types.js +0 -1
  27. package/docs/API_DESIGN.md +434 -0
  28. package/docs/CODEX_MCP_USAGE.md +116 -0
  29. package/docs/CORE_API.md +226 -0
  30. package/docs/CORE_MCP_BOUNDARY.md +106 -0
  31. package/docs/DEPENDENCY_DILIGENCE.md +63 -0
  32. package/docs/FUTURE_LANES.md +173 -0
  33. package/docs/HA_PRI_V2_DESIGN.md +279 -0
  34. package/docs/RELEASE_INTEGRITY.md +55 -0
  35. package/docs/RELEASE_NOTES.md +55 -0
  36. package/docs/SIGNAL_CONTRACT.md +89 -0
  37. package/docs/SOURCE_PROFILES.md +427 -0
  38. package/freshcontext.schema.json +103 -103
  39. package/package-script-guard.mjs +141 -0
  40. package/package.json +94 -59
  41. package/server.json +27 -28
  42. package/dist/apify.js +0 -133
package/README.md CHANGED
@@ -1,296 +1,459 @@
1
- # freshcontext-mcp
2
-
3
- I asked Claude to help me find a job. It gave me a list of openings. I applied to three of them. Two didn't exist anymore. One had been closed for two years.
4
-
5
- Claude had no idea. It presented everything with the same confidence.
6
-
7
- That's the problem freshcontext fixes.
8
-
9
- [![npm version](https://img.shields.io/npm/v/freshcontext-mcp)](https://www.npmjs.com/package/freshcontext-mcp)
10
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
11
- [![MCP Registry](https://img.shields.io/badge/MCP%20Registry-Listed-blue)](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 21 tools 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.
45
-
46
- ---
47
-
48
- ## The standard
49
-
50
- Every FreshContext-compatible response wraps content in a structured envelope:
51
-
52
- ```
53
- [FRESHCONTEXT]
54
- Source: https://github.com/owner/repo
55
- Published: 2024-11-03
56
- Retrieved: 2026-03-05T09:19:00Z
57
- Confidence: high
58
- ---
59
- ... content ...
60
- [/FRESHCONTEXT]
61
- ```
62
-
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`
80
-
81
- ---
82
-
83
- ## Reference adapters
84
-
85
- The repo ships 21 tools demonstrating how to make any data source FreshContext-compatible. Useful as drop-in tools, but the value is the layer above them.
86
-
87
- ### Intelligence
88
- | Adapter | What it returns |
89
- |---|---|
90
- | `extract_github` | README, stars, forks, language, topics, last commit |
91
- | `extract_hackernews` | Top stories or search results with scores and timestamps |
92
- | `extract_scholar` | Research papers — titles, authors, years, snippets |
93
- | `extract_arxiv` | arXiv papers via official API |
94
- | `extract_reddit` | Posts and community sentiment from any subreddit |
95
-
96
- ### Competitive research
97
- | Adapter | What it returns |
98
- |---|---|
99
- | `extract_yc` | YC company listings by keyword |
100
- | `extract_producthunt` | Recent launches by topic |
101
- | `search_repos` | GitHub repos ranked by stars with activity signals |
102
- | `package_trends` | npm and PyPI metadata — version history, release cadence |
103
-
104
- ### Market data
105
- | Adapter | What it returns |
106
- |---|---|
107
- | `extract_finance` | No-key Stooq quote data — close, OHLC, volume, quote timestamp, source. Up to 5 tickers. |
108
- | `search_jobs` | Remote job listings from Remotive, RemoteOK, HN "Who is Hiring" |
109
-
110
- ### Composites — multiple sources, one call
111
- | Adapter | Sources | Purpose |
112
- |---|---|---|
113
- | `extract_landscape` | 6 | YC + GitHub + HN + Reddit + Product Hunt + npm in parallel |
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 |
116
- | `extract_finance_landscape` | 5 | Finance + HN + Reddit + GitHub + changelog |
117
- | `extract_company_landscape` | 5 | The full picture on any company |
118
-
119
- ### Unique — not available in any other MCP server
120
- | Adapter | Source | What it returns |
121
- |---|---|---|
122
- | `extract_changelog` | GitHub Releases / npm / auto-discover | Update history from any repo, package, or website |
123
- | `extract_govcontracts` | USASpending.gov | US federal contract awards — company, amount, agency, period |
124
- | `extract_sec_filings` | SEC EDGAR | 8-K filings — legally mandated material event disclosures |
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 |
127
-
128
- ---
129
-
130
- ## Quick start
131
-
132
- ### Cloud (no install)
133
-
134
- Add to your Claude Desktop config and restart:
135
-
136
- **Mac:** `~/Library/Application Support/Claude/claude_desktop_config.json`
137
- **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
138
-
139
- ```json
140
- {
141
- "mcpServers": {
142
- "freshcontext": {
143
- "command": "npx",
144
- "args": ["-y", "mcp-remote", "https://freshcontext-mcp.gimmanuel73.workers.dev/mcp"]
145
- }
146
- }
147
- }
148
- ```
149
-
150
- Restart Claude. Done.
151
-
152
- > Prefer a guided setup? Visit **[freshcontext-site.pages.dev](https://freshcontext-site.pages.dev)** — 3 steps, no terminal.
153
-
154
- ### Local (full Playwright)
155
-
156
- **Requires:** Node.js 20+ ([nodejs.org](https://nodejs.org))
157
-
158
- ```bash
159
- git clone https://github.com/PrinceGabriel-lgtm/freshcontext-mcp
160
- cd freshcontext-mcp
161
- npm install
162
- npx playwright install chromium
163
- npm run build
164
- ```
165
-
166
- Add to Claude Desktop config:
167
-
168
- **Mac:**
169
- ```json
170
- {
171
- "mcpServers": {
172
- "freshcontext": {
173
- "command": "node",
174
- "args": ["/Users/YOUR_USERNAME/path/to/freshcontext-mcp/dist/server.js"]
175
- }
176
- }
177
- }
178
- ```
179
-
180
- **Windows:**
181
- ```json
182
- {
183
- "mcpServers": {
184
- "freshcontext": {
185
- "command": "node",
186
- "args": ["C:\\Users\\YOUR_USERNAME\\path\\to\\freshcontext-mcp\\dist\\server.js"]
187
- }
188
- }
189
- }
190
- ```
191
-
192
- #### Mac troubleshooting
193
-
194
- **"command not found: node"** — Use the full path:
195
- ```bash
196
- which node # copy this output, replace "node" in config
197
- ```
198
-
199
- **Config file doesn't exist:**
200
- ```bash
201
- mkdir -p ~/Library/Application\ Support/Claude
202
- touch ~/Library/Application\ Support/Claude/claude_desktop_config.json
203
- ```
204
-
205
- ---
206
-
207
- ## Usage examples
208
-
209
- **Should I build this idea?**
210
- ```
211
- Use extract_idea_landscape with idea "procurement intelligence saas"
212
- ```
213
- Returns funding signal, pain signal, crowding signal, market signal, ecosystem signal, and launch signal — all timestamped.
214
-
215
- **Full company intelligence in one call:**
216
- ```
217
- Use extract_company_landscape with company "Palantir" and ticker "PLTR"
218
- ```
219
- SEC filings + federal contracts + global news + changelog + market data.
220
-
221
- **Did that company just disclose something material?**
222
- ```
223
- Use extract_sec_filings with url "Palantir Technologies"
224
- ```
225
- 8-K filings are legally mandated within 4 business days of any material event — CEO change, acquisition, breach, major contract.
226
-
227
- **Is this dependency still actively maintained?**
228
- ```
229
- Use extract_changelog with url "https://github.com/org/repo"
230
- ```
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.
232
-
233
- ---
234
-
235
- ## Deployment & infrastructure
236
-
237
- The reference implementation runs on Cloudflare's global edge:
238
-
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`
256
-
257
- ---
258
-
259
- ## Roadmap
260
-
261
- - [x] FreshContext Specification v1.1 published (MIT, open standard)
262
- - [x] DAR engine with proprietary λ constants (v0.3.17)
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] 21 reference tools 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
272
- - [ ] Dashboard — React frontend for the D1 intelligence pipeline
273
- - [ ] GKG upgrade for `extract_gdelt` — tone scores, goldstein scale, event codes
274
-
275
- ---
276
-
277
- ## Contributing
278
-
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.
282
-
283
- ---
284
-
285
- ## License
286
-
287
- MIT
288
-
289
- ---
290
-
291
- *Built by Prince Gabriel Grootfontein, Namibia 🇳🇦*
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)
1
+ # FreshContext
2
+
3
+ I asked Claude to help me find a job. It gave me a list of openings. I applied to three of them. Two didn't exist anymore. One had been closed for two years.
4
+
5
+ Claude had no idea. It presented everything with the same confidence.
6
+
7
+ That's the problem freshcontext fixes.
8
+
9
+ This repository is the integrated FreshContext Core/MCP package. FreshContext is the context judgment layer between retrieval and reasoning. Core is the reusable engine that scores, ranks, explains, and turns candidate context into decision-ready context; MCP is the first live host/interface over that engine.
10
+
11
+ [![npm version](https://img.shields.io/npm/v/freshcontext-mcp)](https://www.npmjs.com/package/freshcontext-mcp)
12
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
13
+ [![MCP Registry](https://img.shields.io/badge/MCP%20Registry-Listed-blue)](https://registry.modelcontextprotocol.io)
14
+
15
+ > **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.
16
+
17
+ ---
18
+
19
+ ## The problem
20
+
21
+ 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.
22
+
23
+ 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.
24
+
25
+ That's not hallucination. That's correct summarization of corrupted retrieval.
26
+
27
+ > **Most RAG pipelines rank context correctly semantically but incorrectly temporally.**
28
+
29
+ ---
30
+
31
+ ## The layer
32
+
33
+ FreshContext is **context integrity infrastructure for AI agents and retrieval systems**. It sits between retrieval and reasoning:
34
+
35
+ ```text
36
+ candidate context
37
+ -> FreshContext Core
38
+ -> decision-ready context
39
+ -> model / agent / app
40
+ ```
41
+
42
+ FreshContext evaluates freshness, source profile, confidence, utility, provenance material, and failure honesty before context reaches the LLM. The temporal core uses Decay-Adjusted Relevancy:
43
+
44
+ ```
45
+ R_t = R_0 · e^(−λt)
46
+ ```
47
+
48
+ - `R_0` — base semantic relevancy (whatever your retriever already gives you)
49
+ - `λ` — source-specific decay constant (HN ≈14h half-life, blogs ≈29d, academic papers ≈1.6y)
50
+ - `t` hours elapsed since publication
51
+ - `R_t` — decay-adjusted relevancy at query time
52
+
53
+ That's the core correction. No model swap. No re-embedding. No re-indexing. The layer drops onto whatever retrieval pipeline you already have.
54
+
55
+ **The layer is the product.** The named adapters shipped with this repo demonstrate compatibility across different source classes. The DAR engine, the freshness envelope, Source Profiles, and the FreshContext Specification are the moat.
56
+
57
+ ---
58
+
59
+ ## The standard
60
+
61
+ Every FreshContext-compatible response wraps content in a structured envelope:
62
+
63
+ ```
64
+ [FRESHCONTEXT]
65
+ Source: https://github.com/owner/repo
66
+ Published: 2024-11-03
67
+ Retrieved: 2026-03-05T09:19:00Z
68
+ Confidence: high
69
+ ---
70
+ ... content ...
71
+ [/FRESHCONTEXT]
72
+ ```
73
+
74
+ **When** it was retrieved. **Where** it came from. **How confident** we are the date is accurate.
75
+
76
+ The FreshContext Specification v1.2 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)
77
+
78
+ ---
79
+
80
+ ## Architecture boundary
81
+
82
+ FreshContext Core is the reusable center of the current integrated package. It owns signal normalization, freshness scoring, Source Profiles, decision output, envelope formatting, failure guards, shared types, rank/explain primitives, and the context-conditioned utility primitive.
83
+
84
+ MCP is the primary reference/interface implementation over Core. Claude Desktop is supported, but not required. The MCP tool surface exposes named reference adapters and a live interface for using the system.
85
+
86
+ The production Cloudflare Worker now uses Core-backed envelope generation. Worker-specific concerns remain outside Core: MCP transport, runtime guards, KV cache policy, cache metadata injection, JSON parse/replace cache helpers, D1 feeds, cron, rate limiting, and Store/feed scoring/provenance.
87
+
88
+ See [Core / MCP Boundary](./docs/CORE_MCP_BOUNDARY.md) for the current package boundary and the staged path toward a future standalone Core package.
89
+
90
+ ---
91
+
92
+ ## Primary MCP interface
93
+
94
+ The clearest MCP path is `evaluate_context`.
95
+
96
+ It accepts candidate context from any retriever, agent, database, local script, note parser, or adapter output:
97
+
98
+ ```json
99
+ {
100
+ "profile": "academic_research",
101
+ "intent": "citation_check",
102
+ "signals": [
103
+ {
104
+ "title": "Example source",
105
+ "content": "Candidate context text...",
106
+ "source": "https://example.com/source",
107
+ "source_type": "arxiv",
108
+ "published_at": "2026-05-24T12:00:00.000Z",
109
+ "retrieved_at": "2026-05-24T13:00:00.000Z",
110
+ "semantic_score": 0.92
111
+ }
112
+ ]
113
+ }
114
+ ```
115
+
116
+ FreshContext returns decision-first output:
117
+
118
+ - Decision
119
+ - Meaning
120
+ - Action
121
+ - Warnings
122
+ - Source
123
+ - Freshness
124
+ - Rank score
125
+ - Utility
126
+ - Confidence
127
+ - Why
128
+
129
+ `evaluate_context` does not fetch URLs, crawl, scrape, browse, read folders, or call adapters. It only evaluates candidate context the caller provides.
130
+
131
+ Current boundary: `evaluate_context` is part of the published npm/local stdio MCP server. The hosted Cloudflare Worker endpoint is a separate deployment surface and may lag npm package interfaces until a dedicated Worker sync pass.
132
+
133
+ ---
134
+
135
+ ## Advanced Worker/feed surface
136
+
137
+ Beyond the per-call Core/MCP paths, the production Worker deployment exposes a continuous, decay-scored, deduplicated feed. This is an advanced deployment surface, not the required way to use FreshContext Core:
138
+
139
+ ```
140
+ GET /v1/intel/feed/:profile_id?limit=20&min_rt=0
141
+ ```
142
+
143
+ Every signal is stamped with `base_score`, `rt_score`, `entropy_level` (low / stable / high), `ha_pri_sig` (Ha-Pri v1 SHA-256 provenance reference), `semantic_fingerprint` (cross-adapter dedup), and `published_at`. Ready for direct LLM or agent consumption — no synthesis required.
144
+
145
+ Production endpoint: `https://freshcontext-mcp.gimmanuel73.workers.dev`
146
+
147
+ ---
148
+
149
+ ## Reference adapters
150
+
151
+ The repo ships named reference adapters that demonstrate how different source classes can become FreshContext-compatible. Each adapter keeps its own name because it represents a source boundary; the adapter count is operational proof, not the product headline.
152
+
153
+ ### Intelligence
154
+ | Adapter | What it returns |
155
+ |---|---|
156
+ | `extract_github` | README, stars, forks, language, topics, last commit |
157
+ | `extract_hackernews` | Top stories or search results with scores and timestamps |
158
+ | `extract_scholar` | Research papers — titles, authors, years, snippets |
159
+ | `extract_arxiv` | arXiv papers via official API |
160
+ | `extract_reddit` | Posts and community sentiment from any subreddit |
161
+
162
+ ### Competitive research
163
+ | Adapter | What it returns |
164
+ |---|---|
165
+ | `extract_yc` | YC company listings by keyword |
166
+ | `extract_producthunt` | Recent launches by topic |
167
+ | `search_repos` | GitHub repos ranked by stars with activity signals |
168
+ | `package_trends` | npm and PyPI metadata — version history, release cadence |
169
+
170
+ ### Market data
171
+ | Adapter | What it returns |
172
+ |---|---|
173
+ | `extract_finance` | No-key Stooq quote data — close, OHLC, volume, quote timestamp, source. Up to 5 tickers. |
174
+ | `search_jobs` | Remote job listings from Remotive, RemoteOK, HN "Who is Hiring" |
175
+
176
+ ### Composites — multiple sources, one call
177
+ | Adapter | Sources | Purpose |
178
+ |---|---|---|
179
+ | `extract_landscape` | 6 | YC + GitHub + HN + Reddit + Product Hunt + npm in parallel |
180
+ | `extract_idea_landscape` | 6 | HN + YC + GitHub + Jobs + npm + Product Hunt — full idea validation |
181
+ | `extract_gov_landscape` | 4 | Gov contracts + HN + GitHub + changelog |
182
+ | `extract_finance_landscape` | 5 | Finance + HN + Reddit + GitHub + changelog |
183
+ | `extract_company_landscape` | 5 | The full picture on any company |
184
+
185
+ ### Official, regulatory, and procurement sources
186
+ | Adapter | Source | What it returns |
187
+ |---|---|---|
188
+ | `extract_changelog` | GitHub Releases / npm / auto-discover | Update history from any repo, package, or website |
189
+ | `extract_govcontracts` | USASpending.gov | US federal contract awards — company, amount, agency, period |
190
+ | `extract_sec_filings` | SEC EDGAR | 8-K filings — legally mandated material event disclosures |
191
+ | `extract_gdelt` | GDELT Project | Global news intelligence — 100+ languages, 15-min updates |
192
+ | `extract_gebiz` | data.gov.sg | Singapore Government procurement tenders — open dataset |
193
+
194
+ ---
195
+
196
+ ## Quick start
197
+
198
+ ### Cloud (no install)
199
+
200
+ Add to your Claude Desktop config and restart:
201
+
202
+ **Mac:** `~/Library/Application Support/Claude/claude_desktop_config.json`
203
+ **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
204
+
205
+ ```json
206
+ {
207
+ "mcpServers": {
208
+ "freshcontext": {
209
+ "command": "npx",
210
+ "args": ["-y", "mcp-remote", "https://freshcontext-mcp.gimmanuel73.workers.dev/mcp"]
211
+ }
212
+ }
213
+ }
214
+ ```
215
+
216
+ Restart Claude. Done.
217
+
218
+ > Prefer a guided setup? Visit **[freshcontext-site.pages.dev](https://freshcontext-site.pages.dev)** — 3 steps, no terminal.
219
+
220
+ ### Local (full Playwright)
221
+
222
+ **Requires:** Node.js 20+ ([nodejs.org](https://nodejs.org))
223
+
224
+ ```bash
225
+ git clone https://github.com/PrinceGabriel-lgtm/freshcontext-mcp
226
+ cd freshcontext-mcp
227
+ npm install
228
+ npx playwright install chromium
229
+ npm run build
230
+ ```
231
+
232
+ Add to Claude Desktop config:
233
+
234
+ **Mac:**
235
+ ```json
236
+ {
237
+ "mcpServers": {
238
+ "freshcontext": {
239
+ "command": "node",
240
+ "args": ["/Users/YOUR_USERNAME/path/to/freshcontext-mcp/dist/server.js"]
241
+ }
242
+ }
243
+ }
244
+ ```
245
+
246
+ **Windows:**
247
+ ```json
248
+ {
249
+ "mcpServers": {
250
+ "freshcontext": {
251
+ "command": "node",
252
+ "args": ["C:\\Users\\YOUR_USERNAME\\path\\to\\freshcontext-mcp\\dist\\server.js"]
253
+ }
254
+ }
255
+ }
256
+ ```
257
+
258
+ #### Mac troubleshooting
259
+
260
+ **"command not found: node"** — Use the full path:
261
+ ```bash
262
+ which node # copy this output, replace "node" in config
263
+ ```
264
+
265
+ **Config file doesn't exist:**
266
+ ```bash
267
+ mkdir -p ~/Library/Application\ Support/Claude
268
+ touch ~/Library/Application\ Support/Claude/claude_desktop_config.json
269
+ ```
270
+
271
+ ---
272
+
273
+ ## Usage examples
274
+
275
+ The `npm run demo:*` commands below are source-checkout workflows for contributors and evaluators using a cloned repository. The published npm package is the MCP server/runtime package and does not include repo-only source examples or tests.
276
+
277
+ From an installed npm package, the supported runtime entrypoints are `npm start` and the `freshcontext-mcp` binary. Repo-only scripts such as tests, demos, smoke checks, and trust scans print a source-checkout notice when their source files are not present.
278
+
279
+ The Apify Actor entrypoint remains available in the source checkout for separate actor packaging, but it is intentionally not part of the published MCP npm runtime package.
280
+
281
+ ### Release trust gate
282
+
283
+ Run the local release gate before a release, package review, demo, or PR review:
284
+
285
+ ```bash
286
+ npm run trust:gate
287
+ ```
288
+
289
+ The gate runs the Trust Scanner with repo-map reporting, npm package-boundary inspection, deterministic claim checks, and `--fail-on fail`. It is local-only, does not publish or deploy, does not send telemetry, and does not replace dedicated security scanners.
290
+
291
+ Generate review reports when you need a shareable summary:
292
+
293
+ ```bash
294
+ npm run trust:report
295
+ npm run trust:report:json
296
+ ```
297
+
298
+ To write a Markdown report file explicitly:
299
+
300
+ ```bash
301
+ npm run trust:report -- --output TRUST_SCAN_REPORT.md
302
+ ```
303
+
304
+ ### Bring your own source list
305
+
306
+ FreshContext can evaluate candidate context you provide as a local JSON file:
307
+
308
+ ```bash
309
+ npm run demo:evaluate:file
310
+ ```
311
+
312
+ To pass a different file:
313
+
314
+ ```bash
315
+ npm run demo:evaluate:file -- path/to/sources.json
316
+ ```
317
+
318
+ Included examples:
319
+
320
+ ```bash
321
+ npm run demo:evaluate:file -- examples/sources.academic.example.json
322
+ npm run demo:evaluate:file -- examples/sources.jobs.example.json
323
+ ```
324
+
325
+ Minimal shape:
326
+
327
+ ```json
328
+ {
329
+ "profile": "academic_research",
330
+ "intent": "citation_check",
331
+ "signals": [
332
+ {
333
+ "title": "...",
334
+ "content": "...",
335
+ "source": "...",
336
+ "source_type": "arxiv",
337
+ "published_at": "...",
338
+ "retrieved_at": "...",
339
+ "semantic_score": 0.92
340
+ }
341
+ ]
342
+ }
343
+ ```
344
+
345
+ This local demo does not fetch URLs, crawl, or read folders. It evaluates candidate context you provide and returns decision-first output: Decision, Meaning, Action, Warnings, and supporting metrics.
346
+
347
+ In an MCP client, use `evaluate_context` when you already have candidate context from another retriever, database, agent, or script:
348
+
349
+ ```text
350
+ Use evaluate_context with profile "academic_research", intent "citation_check", and these candidate signals: [...]
351
+ ```
352
+
353
+ Use the named reference adapters when you want FreshContext's current MCP package to fetch public source examples for you.
354
+
355
+ **Should I build this idea?**
356
+ ```
357
+ Use extract_idea_landscape with idea "procurement intelligence saas"
358
+ ```
359
+ Returns funding signal, pain signal, crowding signal, market signal, ecosystem signal, and launch signal — all timestamped.
360
+
361
+ **Full company intelligence in one call:**
362
+ ```
363
+ Use extract_company_landscape with company "Palantir" and ticker "PLTR"
364
+ ```
365
+ SEC filings + federal contracts + global news + changelog + market data.
366
+
367
+ **Did that company just disclose something material?**
368
+ ```
369
+ Use extract_sec_filings with url "Palantir Technologies"
370
+ ```
371
+ 8-K filings are legally mandated within 4 business days of any material event — CEO change, acquisition, breach, major contract.
372
+
373
+ **Is this dependency still actively maintained?**
374
+ ```
375
+ Use extract_changelog with url "https://github.com/org/repo"
376
+ ```
377
+ Returns the last 8 releases with exact dates. If the last release was 18 months ago, you'll know before you pin the version.
378
+
379
+ ---
380
+
381
+ ## Deployment & infrastructure
382
+
383
+ The reference implementation runs on Cloudflare's global edge:
384
+
385
+ | Endpoint | Method | Purpose |
386
+ |---|---|---|
387
+ | `/` | GET | Service info + endpoint list |
388
+ | `/health` | GET | Liveness check |
389
+ | `/mcp` | POST | MCP JSON-RPC transport |
390
+ | `/demo` | GET | Live before/after demo (no API key required) |
391
+ | `/briefing` | GET | Latest stored briefing |
392
+ | `/v1/intel/feed/:profile_id` | GET | DAR-scored intelligence feed |
393
+ | `/watched-queries` | GET | List all watched queries |
394
+
395
+ - **D1 database** — 18 watched queries running on 6-hour cron with relevancy scoring
396
+ - **KV-backed rate limiting** — 60 req/min per IP across all edge nodes
397
+ - **Defensive valves** — clock-skew rejection (5min tolerance), hard floor at R_t<5, lazy decay at read time
398
+ - **Provenance** — Ha-Pri v1 SHA-256 provenance stamps on stored signals; hard tamper enforcement is a future Ha-Pri v2 path
399
+ - **Schema migrations** — promise-gated, idempotent, run on first request after deploy
400
+
401
+ Production: `https://freshcontext-mcp.gimmanuel73.workers.dev`
402
+
403
+ ---
404
+
405
+ ## Roadmap
406
+
407
+ - [x] FreshContext Specification v1.2 published (MIT, open standard)
408
+ - [x] DAR engine with proprietary λ constants (v0.3.19)
409
+ - [x] Ha-Pri v1 provenance signatures on stored signals
410
+ - [x] Semantic deduplication via fingerprinting
411
+ - [x] Live before/after demo at `/demo`
412
+ - [x] METHODOLOGY.md — formal IP and engineering documentation
413
+ - [x] Named reference adapters across intelligence, competitive research, market data, and composites
414
+ - [x] Generic MCP `evaluate_context` tool for caller-provided candidate context
415
+ - [x] Core-backed envelope generation shared by npm/MCP and the Cloudflare Worker
416
+ - [x] Cloudflare Workers deployment — global edge, KV cache, KV rate limiting
417
+ - [x] Published on npm and listed for MCP usage; Apify/feed assets are separated from the normal MCP runtime package
418
+ - [ ] Ha-Pri v2 hardened canonical content hash verification
419
+ - [x] GitHub Actions release workflow — manual or `v*` tag-triggered npm publish path
420
+ - [ ] Webhook triggers — push high-entropy signals on threshold
421
+ - [ ] Dashboard — React frontend for the D1 intelligence pipeline
422
+ - [ ] GKG upgrade for `extract_gdelt` — tone scores, goldstein scale, event codes
423
+
424
+ Future work is organized in [FreshContext Future Lanes](./docs/FUTURE_LANES.md). Roadmap items are not live product claims until implemented and validated.
425
+
426
+ ---
427
+
428
+ ## Contributing
429
+
430
+ PRs welcome. The highest-value contributions improve the caller-provided context path, decision output, host integrations, and FreshContext-compatible signal quality. New reference adapters are useful when they preserve source boundaries and emit timestamped, failure-honest context — see `src/adapters/` for examples and [`FRESHCONTEXT_SPEC.md`](./FRESHCONTEXT_SPEC.md) for the compatibility contract.
431
+
432
+ If you're building something FreshContext-compatible, open an issue and we'll add you to the ecosystem list.
433
+
434
+ ---
435
+
436
+ ## Trust and security
437
+
438
+ - [LICENSE](./LICENSE)
439
+ - [SECURITY.md](./SECURITY.md)
440
+ - [NOTICE.md](./NOTICE.md)
441
+ - [TRADEMARKS.md](./TRADEMARKS.md)
442
+ - [Dependency diligence notes](./docs/DEPENDENCY_DILIGENCE.md)
443
+ - [Release integrity notes](./docs/RELEASE_INTEGRITY.md)
444
+ - [Release notes](./docs/RELEASE_NOTES.md)
445
+
446
+ ---
447
+
448
+ ## License
449
+
450
+ MIT
451
+
452
+ ---
453
+
454
+ *Built by Prince Gabriel — Grootfontein, Namibia 🇳🇦*
455
+ *"The work isn't gone. It's just waiting to be continued."*
456
+
457
+ ---
458
+
459
+ **Also on:** [MCP Registry](https://registry.modelcontextprotocol.io) · [npm](https://www.npmjs.com/package/freshcontext-mcp)