Freshcontext MCP agent

No longer developed.

by PrinceGabriel-lgtm·MIT license·★ 12 Stars on the repo·GitHub ↗

Files of Freshcontext MCP

PrinceGabriel-lgtm/main1 file
README.md
Show the full text573 lines

FreshContext

This package is no longer developed. 0.5.3 is the last release of freshcontext-mcp. It and every earlier release stay available under the MIT License, as is; there will be no further feature releases. For FreshContext services, see https://freshcontext.dev. Security reports: see SECURITY.md.

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.

Claude had no idea. It presented everything with the same confidence.

That's the problem freshcontext fixes.

This repository is the integrated FreshContext Core/MCP package.

Category: context integrity infrastructure. FreshContext sits between context acquisition and agent action. Its job is to decide whether information entering an AI workflow is still fresh, attributable and coherent enough for the system to rely on. Core is the reusable engine that scores, ranks, explains and turns candidate context into decision-ready context, with signed verdicts recorded in a verifiable ledger. MCP is the first live host interface over that engine — one interface over the methodology, not the product itself.

npm version License: MIT MCP Registry

Live demo: api.freshcontext.dev/demo — same model, same query, two completely different answers. Only the temporal layer changed.

Integrate it into an existing stack: freshcontext.dev/integration — start with one bounded RAG, agent, retrieval, or governance workflow and objective acceptance criteria.


The problem

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.

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.

That's not hallucination. That's correct summarization of corrupted retrieval.

Most RAG pipelines rank context correctly semantically but incorrectly temporally.


The layer

FreshContext is context integrity infrastructure for AI agents and retrieval systems. It sits between retrieval and reasoning:

candidate context
  -> FreshContext Core
  -> decision-ready context
  -> model / agent / app

FreshContext evaluates freshness, source profile, confidence, utility, provenance material, and failure honesty before context reaches the LLM. The temporal core uses Decay-Adjusted Relevancy:

R_t = R_0 · e^(−λt)
  • R_0 — base semantic relevancy (whatever your retriever already gives you)
  • λ — source-specific decay constant (HN ≈14h half-life, blogs ≈29d, academic papers ≈1.6y)
  • t — hours elapsed since publication
  • R_t — decay-adjusted relevancy at query time

That's the core correction. No model swap. No re-embedding. No re-indexing. The layer drops onto whatever retrieval pipeline you already have.

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.


The standard

Every FreshContext-compatible response wraps content in a structured envelope:

[FRESHCONTEXT]
Source: https://github.com/owner/repo
Published: 2024-11-03
Retrieved: 2026-03-05T09:19:00Z
Confidence: high
---
... content ...
[/FRESHCONTEXT]

When it was retrieved. Where it came from. How confident we are the date is accurate.

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 · Read the methodology


Architecture boundary

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.

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.

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.

See Architecture for the layer boundaries, the package surface, and what is not yet separated.

Core import path

FreshContext Core is also available directly from the current MCP package:

import {
  evaluateSignals,
  interpretEvaluations,
  getSourceProfile,
  normalizeSignal,
  calculateHaPriV2,
} from "freshcontext-mcp/core";

This is a Core subpath export inside freshcontext-mcp, not a standalone freshcontext-core package yet. The root package and freshcontext-mcp binary remain the MCP reference host.


Primary MCP interface

The clearest MCP path is evaluate_context.

It accepts candidate context from any retriever, agent, database, local script, note parser, or adapter output:

{
  "profile": "academic_research",
  "intent": "citation_check",
  "signals": [
    {
      "title": "Example source",
      "content": "Candidate context text...",
      "source": "https://example.com/source",
      "source_type": "arxiv",
      "published_at": "2026-05-24T12:00:00.000Z",
      "retrieved_at": "2026-05-24T13:00:00.000Z",
      "semantic_score": 0.92
    }
  ]
}

FreshContext returns decision-first output:

  • Decision
  • Meaning
  • Action
  • Warnings
  • Source
  • Freshness
  • Rank score
  • Utility
  • Confidence
  • Why

Structured results also include a readable object for humans:

{
  "decision": "cite_as_primary",
  "label": "Cite as primary",
  "readable": {
    "label": "Primary source",
    "summary": "This source is strong enough to use as main evidence.",
    "why": [
      "Strong semantic match and current freshness for arxiv.",
      "source profile academic_research uses lenient date policy",
      "intent profile citation_check selected"
    ],
    "action": "Use this as main evidence while preserving citation and provenance.",
    "warnings": [
      "FreshContext judges citation readiness and context usefulness; it does not certify truth."
    ]
  }
}

The readable object translates Core decisions into user-facing language. It does not change ranking, decision labels, utility scoring, or source intake. Utility helps explain usefulness for the current question; it remains explanatory and does not control default decision labels or ranking.

FreshContext does not certify truth. It records why context was used, supported, questioned, refreshed, watched, or excluded before it reaches a model.

evaluate_context does not fetch URLs, crawl, scrape, browse, read folders, or call adapters. It only evaluates candidate context the caller provides.

Current boundary: evaluate_context ships in the npm/local stdio MCP server. The hosted Cloudflare Worker MCP endpoint is a separate deployment surface and is verified independently — check /v1/health for its live version and tool count rather than assuming parity with the package. The Worker remains a separate deployment surface, so future package interfaces should be re-verified remotely before being claimed live.

Network Boundary

FreshContext's primary evaluate_context path does not fetch, crawl, scrape, browse, read folders, or call adapters. The MCP package also includes read-only reference adapters that use network access only when those adapter tools are invoked. Supply-chain scanners may therefore report package network access; that applies to the optional adapter surface, not to caller-provided context evaluation.


Advanced Worker/feed surface

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:

GET /v1/intel/feed/:profile_id?limit=20&min_rt=0

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.

Production endpoint: https://api.freshcontext.dev


Reference adapters

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.

Intelligence
Adapter What it returns
extract_github README, stars, forks, language, topics, last commit
extract_hackernews Top stories or search results with scores and timestamps
extract_scholar Research papers — titles, authors, years, snippets
extract_arxiv arXiv papers via official API
extract_reddit Posts and community sentiment from any subreddit
Competitive research
Adapter What it returns
extract_yc YC company listings by keyword
extract_producthunt Recent launches by topic
search_repos GitHub repos ranked by stars with activity signals
package_trends npm and PyPI metadata — version history, release cadence
Market data
Adapter What it returns
extract_finance No-key Stooq quote data — close, OHLC, volume, quote timestamp, source. Up to 5 tickers.
search_jobs Remote job listings from Remotive, RemoteOK, HN "Who is Hiring"
Composites — multiple sources, one call
Adapter Sources Purpose
extract_landscape 6 YC + GitHub + HN + Reddit + Product Hunt + npm in parallel
extract_idea_landscape 6 HN + YC + GitHub + Jobs + npm + Product Hunt — full idea validation
extract_gov_landscape 4 Gov contracts + HN + GitHub + changelog
extract_finance_landscape 5 Finance + HN + Reddit + GitHub + changelog
extract_company_landscape 5 The full picture on any company
Official, regulatory, and procurement sources
Adapter Source What it returns
extract_changelog GitHub Releases / npm / auto-discover Update history from any repo, package, or website
extract_govcontracts USASpending.gov US federal contract awards — company, amount, agency, period
extract_sec_filings SEC EDGAR 8-K filings — legally mandated material event disclosures
extract_gdelt GDELT Project Global news intelligence — 100+ languages, 15-min updates
extract_gebiz data.gov.sg Singapore Government procurement tenders — open dataset

Quick start

For Claude Desktop, Codex, npx, global npm, and source-checkout setup, see the concise client setup guide.

Cloud (no install)

Add to your Claude Desktop config and restart:

Mac: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "freshcontext": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://api.freshcontext.dev/mcp"]
    }
  }
}

Restart Claude. Done.

Prefer a guided setup? Visit freshcontext.dev — 3 steps, no terminal.

Local (full Playwright)

Requires: Node.js 20+ (nodejs.org)

git clone https://github.com/PrinceGabriel-lgtm/freshcontext-mcp
cd freshcontext-mcp
npm install
npx playwright install chromium
npm run build

Add to Claude Desktop config:

Mac:

{
  "mcpServers": {
    "freshcontext": {
      "command": "node",
      "args": ["/Users/YOUR_USERNAME/path/to/freshcontext-mcp/dist/server.js"]
    }
  }
}

Windows:

{
  "mcpServers": {
    "freshcontext": {
      "command": "node",
      "args": ["C:\\Users\\YOUR_USERNAME\\path\\to\\freshcontext-mcp\\dist\\server.js"]
    }
  }
}
Mac troubleshooting

"command not found: node" — Use the full path:

which node  # copy this output, replace "node" in config

Config file doesn't exist:

mkdir -p ~/Library/Application\ Support/Claude
touch ~/Library/Application\ Support/Claude/claude_desktop_config.json

Usage examples

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.

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.

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.

Release trust gate

Run the local release gate before a release, package review, demo, or PR review:

npm run trust:gate

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.

Generate review reports when you need a shareable summary:

npm run trust:report
npm run trust:report:json

To write a Markdown report file explicitly:

npm run trust:report -- --output TRUST_SCAN_REPORT.md
Bring your own source list

FreshContext can evaluate candidate context you provide as a local JSON file:

npm run demo:evaluate:file

To pass a different file:

npm run demo:evaluate:file -- path/to/sources.json

Included examples:

npm run demo:evaluate:file -- examples/sources.academic.example.json
npm run demo:evaluate:file -- examples/sources.jobs.example.json

Minimal shape:

{
  "profile": "academic_research",
  "intent": "citation_check",
  "signals": [
    {
      "title": "...",
      "content": "...",
      "source": "...",
      "source_type": "arxiv",
      "published_at": "...",
      "retrieved_at": "...",
      "semantic_score": 0.92
    }
  ]
}

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.

In an MCP client, use evaluate_context when you already have candidate context from another retriever, database, agent, or script:

Use evaluate_context with profile "academic_research", intent "citation_check", and these candidate signals: [...]

Use the named reference adapters when you want FreshContext's current MCP package to fetch public source examples for you.

Should I build this idea?

Use extract_idea_landscape with idea "procurement intelligence saas"

Returns funding signal, pain signal, crowding signal, market signal, ecosystem signal, and launch signal — all timestamped.

Full company intelligence in one call:

Use extract_company_landscape with company "Palantir" and ticker "PLTR"

SEC filings + federal contracts + global news + changelog + market data.

Did that company just disclose something material?

Use extract_sec_filings with url "Palantir Technologies"

8-K filings are legally mandated within 4 business days of any material event — CEO change, acquisition, breach, major contract.

Is this dependency still actively maintained?

Use extract_changelog with url "https://github.com/org/repo"

Returns the last 8 releases with exact dates. If the last release was 18 months ago, you'll know before you pin the version.


Deployment & infrastructure

The reference implementation runs on Cloudflare's global edge:

Endpoint Method Purpose
/ GET Service info + endpoint list
/health GET Liveness check
/mcp POST MCP JSON-RPC transport
/demo GET Live before/after demo (no auth token required)
/briefing GET Latest stored briefing
/v1/intel/feed/:profile_id GET DAR-scored intelligence feed
/watched-queries GET List all watched queries
/.well-known/freshcontext-signing-keys.json GET Published Ed25519 verification keys (active + retired)
  • D1 database — 18 watched queries running on 6-hour cron with relevancy scoring
  • KV-backed rate limiting — 60 req/min per IP across all edge nodes
  • Defensive valves — clock-skew rejection (5min tolerance), hard floor at R_t<5, lazy decay at read time
  • Provenance — feed signals still carry legacy Ha-Pri v1 SHA-256 provenance references; separately, ledger-backed context verdicts are signed with Ed25519 V4 and independently verifiable
  • Schema migrations — promise-gated, idempotent, run on first request after deploy

Production: https://api.freshcontext.dev


Deployment modes

The engine is deliberately separable from the interface it is reached through. The same Core runs in each of these without a rewrite:

Mode What it means
Standalone FreshContext runs as its own context-integrity service, as it does today.
Embedded subsystem Core runs inside an existing AI, data or security platform, invisible to that platform's users.
SDK / API Integrity primitives are consumed programmatically; no MCP involved.
MCP infrastructure layer FreshContext evaluates and governs context around MCP-enabled workflows — the live path in this repo.
Gateway / control-plane component Core operates at the policy boundary, before context is admitted into agent execution.
White-label The engine is surfaced under another product's branding and API.

Only the MCP and standalone modes are exercised in production today. The others are integration seams the architecture already supports, not shipped configurations.


Roadmap

Split three ways so that genuine engineering risk is never filed as optionality. Nothing outside Production core is a live product claim.

Production core — built, running, testable
  • FreshContext Specification v1.2 published (MIT, open standard)
  • DAR engine with source-specific lambda constants
  • Ha-Pri v1 provenance signatures on stored signals
  • Ha-Pri v2 Core helper and deterministic golden vectors
  • Public /v1/verify endpoint — ledger-backed verdict verification, answering for both the legacy HMAC path and Ed25519, and reporting which was used via verification_method
  • Generic MCP evaluate_context tool for caller-provided candidate context
  • Core-backed envelope generation shared by npm/MCP and the Cloudflare Worker
  • Semantic deduplication via fingerprinting
  • Named reference adapters across intelligence, competitive research, market data, and composites
  • Cloudflare Workers deployment — global edge, KV cache, atomic rate limiting
  • Live before/after demo at /demo
  • METHODOLOGY.md — methodology and engineering documentation
  • Published on npm and listed for MCP usage; Apify/feed assets separated from the MCP runtime package
  • Trusted release publishing workflow — manual workflow_dispatch only, OIDC-backed, provenance-enabled, and gated by version/verification checks. One explicit run publishes npm first, verifies it, then publishes the matching manifest to the official MCP Registry with GitHub OIDC
  • Independently verifiable Ed25519 attestation (E-2). Every new verdict row in the ledger is signed FRESHCONTEXT_HA_PRI_V4 with Ed25519. A third party can verify a verdict with no FreshContext account, no API key and no call to FreshContext — using the key document the Worker publishes at /.well-known/freshcontext-signing-keys.json and either verifier shipped in the npm tarball: scripts/verify-offline.mjs (Node, standard library) or scripts/verify_offline.py (Python, no dependencies at all). Written up for the sceptic rather than the maintainer in VERIFYING.md.
  • Signing key fc-2026-09-ceced1ab published and active. Keys are append-only, so a rotation never invalidates a verdict signed under a key that has since been retired.
  • attestation-proof.yml — obtains a live verdict, verifies it with both shipped verifiers, runs tampered-payload and tampered-signature negative controls, and confirms the stored ledger row is V4 rather than only the emitted response block. On demand and daily; every input it uses is public, so it needs no credentials to run.

In flight on the core, not an expansion surface:

  • Ha-Pri v2 Worker/D1 production enforcement for stored signals — the feed rows, which still carry Ha-Pri v1 SHA-256 stamps. This is a separate path from the verdict ledger above: verdicts are V4/Ed25519 today, signals are not. Design document complete; hard tamper enforcement on the signals path is not live.
Expansion surfaces — deliberately open, not built

These are integration seams the architecture supports and the engine does not yet implement. Stated in future tense on purpose.

  • Context safety harness. Policy enforcement before context reaches an agent: pass / warn / refresh / quarantine / block, with evidence attached to each decision. Today evaluate_context emits decisions and warnings; the enforcement state machine does not exist — quarantine and block are not implemented anywhere in the codebase.
  • Enterprise control plane. Dashboard over source health, trust score, context drift and provenance lineage. The verdict ledger is the data contract this would read from; the UI is unbuilt.
  • Observability telemetry. Historical integrity state, incidents, upstream degradation and remediation history.
  • Autonomous remediation. Automatic refresh, source substitution and re-evaluation — closed-loop rather than detection-only.
  • Vertical policy packs. Domain-specific integrity thresholds for regulated workflows.
  • Webhook triggers — push high-entropy signals on threshold
Research frontier — exploration, not commitment
  • GKG upgrade for extract_gdelt — tone scores, goldstein scale, event codes
  • Contradiction detection across concurrent sources

Future work is organized in FreshContext Future Lanes. Roadmap items are not live product claims until implemented and validated.


Contributing

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 for the compatibility contract.

If you're building something FreshContext-compatible, open an issue and we'll add you to the ecosystem list.


Trust and security


License

MIT


Built by Immanuel Gabriel — Namibia 🇳🇦 "The work isn't gone. It's just waiting to be continued."


Also on: MCP Registry · npm

1# FreshContext
2 
3> **This package is no longer developed.** 0.5.3 is the last release of `freshcontext-mcp`.
4> It and every earlier release stay available under the MIT License, as is; there will be no
5> further feature releases. For FreshContext services, see <https://freshcontext.dev>.
6> Security reports: see [SECURITY.md](SECURITY.md).
7 
8I 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.
9 
10Claude had no idea. It presented everything with the same confidence.
11 
12That's the problem freshcontext fixes.
13 
14This repository is the integrated FreshContext Core/MCP package.
15 
16**Category: context integrity infrastructure.** FreshContext sits between context acquisition and agent action. Its job is to decide whether information entering an AI workflow is still fresh, attributable and coherent enough for the system to rely on. Core is the reusable engine that scores, ranks, explains and turns candidate context into decision-ready context, with signed verdicts recorded in a verifiable ledger. MCP is the first live host interface over that engine — one interface over the methodology, not the product itself.
17 
18[![npm version](https://img.shields.io/npm/v/freshcontext-mcp)](https://www.npmjs.com/package/freshcontext-mcp)
19[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
20[![MCP Registry](https://img.shields.io/badge/MCP%20Registry-Listed-blue)](https://registry.modelcontextprotocol.io)
21 
22> **Live demo:** [api.freshcontext.dev/demo](https://api.freshcontext.dev/demo) — same model, same query, two completely different answers. Only the temporal layer changed.
23>
24> **Integrate it into an existing stack:** [freshcontext.dev/integration](https://freshcontext.dev/integration) — start with one bounded RAG, agent, retrieval, or governance workflow and objective acceptance criteria.
25 
26---
27 
28## The problem
29 
30Large 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.
31 
32So 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.
33 
34That's not hallucination. That's correct summarization of corrupted retrieval.
35 
36> **Most RAG pipelines rank context correctly semantically but incorrectly temporally.**
37 
38---
39 
40## The layer
41 
42FreshContext is **context integrity infrastructure for AI agents and retrieval systems**. It sits between retrieval and reasoning:
43 
44```text
45candidate context
46 -> FreshContext Core
47 -> decision-ready context
48 -> model / agent / app
49```
50 
51FreshContext evaluates freshness, source profile, confidence, utility, provenance material, and failure honesty before context reaches the LLM. The temporal core uses Decay-Adjusted Relevancy:
52 
53```
54R_t = R_0 · e^(−λt)
55```
56 
57- `R_0` — base semantic relevancy (whatever your retriever already gives you)
58- `λ` — source-specific decay constant (HN ≈14h half-life, blogs ≈29d, academic papers ≈1.6y)
59- `t` — hours elapsed since publication
60- `R_t` — decay-adjusted relevancy at query time
61 
62That's the core correction. No model swap. No re-embedding. No re-indexing. The layer drops onto whatever retrieval pipeline you already have.
63 
64**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.
65 
66---
67 
68## The standard
69 
70Every FreshContext-compatible response wraps content in a structured envelope:
71 
72```
73[FRESHCONTEXT]
74Source: https://github.com/owner/repo
75Published: 2024-11-03
76Retrieved: 2026-03-05T09:19:00Z
77Confidence: high
78---
79... content ...
80[/FRESHCONTEXT]
81```
82 
83**When** it was retrieved. **Where** it came from. **How confident** we are the date is accurate.
84 
85The 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)
86 
87---
88 
89## Architecture boundary
90 
91FreshContext 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.
92 
93MCP 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.
94 
95The 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.
96 
97See [Architecture](./docs/ARCHITECTURE.md) for the layer boundaries, the package surface, and what is not yet separated.
98 
99### Core import path
100 
101FreshContext Core is also available directly from the current MCP package:
102 
103```ts
104import {
105 evaluateSignals,
106 interpretEvaluations,
107 getSourceProfile,
108 normalizeSignal,
109 calculateHaPriV2,
110} from "freshcontext-mcp/core";
111```
112 
113This is a Core subpath export inside `freshcontext-mcp`, not a standalone `freshcontext-core` package yet. The root package and `freshcontext-mcp` binary remain the MCP reference host.
114 
115---
116 
117## Primary MCP interface
118 
119The clearest MCP path is `evaluate_context`.
120 
121It accepts candidate context from any retriever, agent, database, local script, note parser, or adapter output:
122 
123```json
124{
125 "profile": "academic_research",
126 "intent": "citation_check",
127 "signals": [
128 {
129 "title": "Example source",
130 "content": "Candidate context text...",
131 "source": "https://example.com/source",
132 "source_type": "arxiv",
133 "published_at": "2026-05-24T12:00:00.000Z",
134 "retrieved_at": "2026-05-24T13:00:00.000Z",
135 "semantic_score": 0.92
136 }
137 ]
138}
139```
140 
141FreshContext returns decision-first output:
142 
143- Decision
144- Meaning
145- Action
146- Warnings
147- Source
148- Freshness
149- Rank score
150- Utility
151- Confidence
152- Why
153 
154Structured results also include a `readable` object for humans:
155 
156```json
157{
158 "decision": "cite_as_primary",
159 "label": "Cite as primary",
160 "readable": {
161 "label": "Primary source",
162 "summary": "This source is strong enough to use as main evidence.",
163 "why": [
164 "Strong semantic match and current freshness for arxiv.",
165 "source profile academic_research uses lenient date policy",
166 "intent profile citation_check selected"
167 ],
168 "action": "Use this as main evidence while preserving citation and provenance.",
169 "warnings": [
170 "FreshContext judges citation readiness and context usefulness; it does not certify truth."
171 ]
172 }
173}
174```
175 
176The readable object translates Core decisions into user-facing language. It does not change ranking, decision labels, utility scoring, or source intake. Utility helps explain usefulness for the current question; it remains explanatory and does not control default decision labels or ranking.
177 
178FreshContext does not certify truth. It records why context was used, supported, questioned, refreshed, watched, or excluded before it reaches a model.
179 
180`evaluate_context` does not fetch URLs, crawl, scrape, browse, read folders, or call adapters. It only evaluates candidate context the caller provides.
181 
182Current boundary: `evaluate_context` ships in the npm/local stdio MCP server. The hosted Cloudflare Worker MCP endpoint is a separate deployment surface and is verified independently — check `/v1/health` for its live version and tool count rather than assuming parity with the package. The Worker remains a separate deployment surface, so future package interfaces should be re-verified remotely before being claimed live.
183 
184### Network Boundary
185 
186FreshContext's primary `evaluate_context` path does not fetch, crawl, scrape, browse, read folders, or call adapters. The MCP package also includes read-only reference adapters that use network access only when those adapter tools are invoked. Supply-chain scanners may therefore report package network access; that applies to the optional adapter surface, not to caller-provided context evaluation.
187 
188---
189 
190## Advanced Worker/feed surface
191 
192Beyond 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:
193 
194```
195GET /v1/intel/feed/:profile_id?limit=20&min_rt=0
196```
197 
198Every 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.
199 
200Production endpoint: `https://api.freshcontext.dev`
201 
202---
203 
204## Reference adapters
205 
206The 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.
207 
208### Intelligence
209| Adapter | What it returns |
210|---|---|
211| `extract_github` | README, stars, forks, language, topics, last commit |
212| `extract_hackernews` | Top stories or search results with scores and timestamps |
213| `extract_scholar` | Research papers — titles, authors, years, snippets |
214| `extract_arxiv` | arXiv papers via official API |
215| `extract_reddit` | Posts and community sentiment from any subreddit |
216 
217### Competitive research
218| Adapter | What it returns |
219|---|---|
220| `extract_yc` | YC company listings by keyword |
221| `extract_producthunt` | Recent launches by topic |
222| `search_repos` | GitHub repos ranked by stars with activity signals |
223| `package_trends` | npm and PyPI metadata — version history, release cadence |
224 
225### Market data
226| Adapter | What it returns |
227|---|---|
228| `extract_finance` | No-key Stooq quote data — close, OHLC, volume, quote timestamp, source. Up to 5 tickers. |
229| `search_jobs` | Remote job listings from Remotive, RemoteOK, HN "Who is Hiring" |
230 
231### Composites — multiple sources, one call
232| Adapter | Sources | Purpose |
233|---|---|---|
234| `extract_landscape` | 6 | YC + GitHub + HN + Reddit + Product Hunt + npm in parallel |
235| `extract_idea_landscape` | 6 | HN + YC + GitHub + Jobs + npm + Product Hunt — full idea validation |
236| `extract_gov_landscape` | 4 | Gov contracts + HN + GitHub + changelog |
237| `extract_finance_landscape` | 5 | Finance + HN + Reddit + GitHub + changelog |
238| `extract_company_landscape` | 5 | The full picture on any company |
239 
240### Official, regulatory, and procurement sources
241| Adapter | Source | What it returns |
242|---|---|---|
243| `extract_changelog` | GitHub Releases / npm / auto-discover | Update history from any repo, package, or website |
244| `extract_govcontracts` | USASpending.gov | US federal contract awards — company, amount, agency, period |
245| `extract_sec_filings` | SEC EDGAR | 8-K filings — legally mandated material event disclosures |
246| `extract_gdelt` | GDELT Project | Global news intelligence — 100+ languages, 15-min updates |
247| `extract_gebiz` | data.gov.sg | Singapore Government procurement tenders — open dataset |
248 
249---
250 
251## Quick start
252 
253For Claude Desktop, Codex, `npx`, global npm, and source-checkout setup, see the concise [client setup guide](./docs/CLIENT_SETUP.md).
254 
255### Cloud (no install)
256 
257Add to your Claude Desktop config and restart:
258 
259**Mac:** `~/Library/Application Support/Claude/claude_desktop_config.json`
260**Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
261 
262```json
263{
264 "mcpServers": {
265 "freshcontext": {
266 "command": "npx",
267 "args": ["-y", "mcp-remote", "https://api.freshcontext.dev/mcp"]
268 }
269 }
270}
271```
272 
273Restart Claude. Done.
274 
275> Prefer a guided setup? Visit **[freshcontext.dev](https://freshcontext.dev)** — 3 steps, no terminal.
276 
277### Local (full Playwright)
278 
279**Requires:** Node.js 20+ ([nodejs.org](https://nodejs.org))
280 
281```bash
282git clone https://github.com/PrinceGabriel-lgtm/freshcontext-mcp
283cd freshcontext-mcp
284npm install
285npx playwright install chromium
286npm run build
287```
288 
289Add to Claude Desktop config:
290 
291**Mac:**
292```json
293{
294 "mcpServers": {
295 "freshcontext": {
296 "command": "node",
297 "args": ["/Users/YOUR_USERNAME/path/to/freshcontext-mcp/dist/server.js"]
298 }
299 }
300}
301```
302 
303**Windows:**
304```json
305{
306 "mcpServers": {
307 "freshcontext": {
308 "command": "node",
309 "args": ["C:\\Users\\YOUR_USERNAME\\path\\to\\freshcontext-mcp\\dist\\server.js"]
310 }
311 }
312}
313```
314 
315#### Mac troubleshooting
316 
317**"command not found: node"** — Use the full path:
318```bash
319which node # copy this output, replace "node" in config
320```
321 
322**Config file doesn't exist:**
323```bash
324mkdir -p ~/Library/Application\ Support/Claude
325touch ~/Library/Application\ Support/Claude/claude_desktop_config.json
326```
327 
328---
329 
330## Usage examples
331 
332The `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.
333 
334From 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.
335 
336The 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.
337 
338### Release trust gate
339 
340Run the local release gate before a release, package review, demo, or PR review:
341 
342```bash
343npm run trust:gate
344```
345 
346The 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.
347 
348Generate review reports when you need a shareable summary:
349 
350```bash
351npm run trust:report
352npm run trust:report:json
353```
354 
355To write a Markdown report file explicitly:
356 
357```bash
358npm run trust:report -- --output TRUST_SCAN_REPORT.md
359```
360 
361### Bring your own source list
362 
363FreshContext can evaluate candidate context you provide as a local JSON file:
364 
365```bash
366npm run demo:evaluate:file
367```
368 
369To pass a different file:
370 
371```bash
372npm run demo:evaluate:file -- path/to/sources.json
373```
374 
375Included examples:
376 
377```bash
378npm run demo:evaluate:file -- examples/sources.academic.example.json
379npm run demo:evaluate:file -- examples/sources.jobs.example.json
380```
381 
382Minimal shape:
383 
384```json
385{
386 "profile": "academic_research",
387 "intent": "citation_check",
388 "signals": [
389 {
390 "title": "...",
391 "content": "...",
392 "source": "...",
393 "source_type": "arxiv",
394 "published_at": "...",
395 "retrieved_at": "...",
396 "semantic_score": 0.92
397 }
398 ]
399}
400```
401 
402This 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.
403 
404In an MCP client, use `evaluate_context` when you already have candidate context from another retriever, database, agent, or script:
405 
406```text
407Use evaluate_context with profile "academic_research", intent "citation_check", and these candidate signals: [...]
408```
409 
410Use the named reference adapters when you want FreshContext's current MCP package to fetch public source examples for you.
411 
412**Should I build this idea?**
413```
414Use extract_idea_landscape with idea "procurement intelligence saas"
415```
416Returns funding signal, pain signal, crowding signal, market signal, ecosystem signal, and launch signal — all timestamped.
417 
418**Full company intelligence in one call:**
419```
420Use extract_company_landscape with company "Palantir" and ticker "PLTR"
421```
422SEC filings + federal contracts + global news + changelog + market data.
423 
424**Did that company just disclose something material?**
425```
426Use extract_sec_filings with url "Palantir Technologies"
427```
4288-K filings are legally mandated within 4 business days of any material event — CEO change, acquisition, breach, major contract.
429 
430**Is this dependency still actively maintained?**
431```
432Use extract_changelog with url "https://github.com/org/repo"
433```
434Returns the last 8 releases with exact dates. If the last release was 18 months ago, you'll know before you pin the version.
435 
436---
437 
438## Deployment & infrastructure
439 
440The reference implementation runs on Cloudflare's global edge:
441 
442| Endpoint | Method | Purpose |
443|---|---|---|
444| `/` | GET | Service info + endpoint list |
445| `/health` | GET | Liveness check |
446| `/mcp` | POST | MCP JSON-RPC transport |
447| `/demo` | GET | Live before/after demo (no auth token required) |
448| `/briefing` | GET | Latest stored briefing |
449| `/v1/intel/feed/:profile_id` | GET | DAR-scored intelligence feed |
450| `/watched-queries` | GET | List all watched queries |
451| `/.well-known/freshcontext-signing-keys.json` | GET | Published Ed25519 verification keys (active + retired) |
452 
453- **D1 database** — 18 watched queries running on 6-hour cron with relevancy scoring
454- **KV-backed rate limiting** — 60 req/min per IP across all edge nodes
455- **Defensive valves** — clock-skew rejection (5min tolerance), hard floor at R_t<5, lazy decay at read time
456- **Provenance** — feed signals still carry legacy Ha-Pri v1 SHA-256 provenance references; separately, ledger-backed context verdicts are signed with Ed25519 V4 and independently verifiable
457- **Schema migrations** — promise-gated, idempotent, run on first request after deploy
458 
459Production: `https://api.freshcontext.dev`
460 
461---
462 
463## Deployment modes
464 
465The engine is deliberately separable from the interface it is reached through. The same Core runs in each of these without a rewrite:
466 
467| Mode | What it means |
468|---|---|
469| Standalone | FreshContext runs as its own context-integrity service, as it does today. |
470| Embedded subsystem | Core runs inside an existing AI, data or security platform, invisible to that platform's users. |
471| SDK / API | Integrity primitives are consumed programmatically; no MCP involved. |
472| MCP infrastructure layer | FreshContext evaluates and governs context around MCP-enabled workflows — the live path in this repo. |
473| Gateway / control-plane component | Core operates at the policy boundary, before context is admitted into agent execution. |
474| White-label | The engine is surfaced under another product's branding and API. |
475 
476Only the MCP and standalone modes are exercised in production today. The others are integration seams the architecture already supports, not shipped configurations.
477 
478---
479 
480## Roadmap
481 
482Split three ways so that genuine engineering risk is never filed as optionality. Nothing outside **Production core** is a live product claim.
483 
484### Production core — built, running, testable
485 
486- [x] FreshContext Specification v1.2 published (MIT, open standard)
487- [x] DAR engine with source-specific lambda constants
488- [x] Ha-Pri v1 provenance signatures on stored signals
489- [x] Ha-Pri v2 Core helper and deterministic golden vectors
490- [x] Public `/v1/verify` endpoint — ledger-backed verdict verification, answering for both the legacy HMAC path and Ed25519, and reporting which was used via `verification_method`
491- [x] Generic MCP `evaluate_context` tool for caller-provided candidate context
492- [x] Core-backed envelope generation shared by npm/MCP and the Cloudflare Worker
493- [x] Semantic deduplication via fingerprinting
494- [x] Named reference adapters across intelligence, competitive research, market data, and composites
495- [x] Cloudflare Workers deployment — global edge, KV cache, atomic rate limiting
496- [x] Live before/after demo at `/demo`
497- [x] METHODOLOGY.md — methodology and engineering documentation
498- [x] Published on npm and listed for MCP usage; Apify/feed assets separated from the MCP runtime package
499- [x] Trusted release publishing workflow — manual `workflow_dispatch` only, OIDC-backed, provenance-enabled, and gated by version/verification checks. One explicit run publishes npm first, verifies it, then publishes the matching manifest to the official MCP Registry with GitHub OIDC
500- [x] **Independently verifiable Ed25519 attestation (E-2).** Every new verdict row in the
501 ledger is signed `FRESHCONTEXT_HA_PRI_V4` with Ed25519. A third party can verify a verdict
502 with no FreshContext account, no API key and no call to FreshContext — using the key
503 document the Worker publishes at `/.well-known/freshcontext-signing-keys.json` and either
504 verifier shipped in the npm tarball: `scripts/verify-offline.mjs` (Node, standard library)
505 or `scripts/verify_offline.py` (Python, no dependencies at all). Written up for the
506 sceptic rather than the maintainer in [VERIFYING.md](./docs/VERIFYING.md).
507- [x] Signing key `fc-2026-09-ceced1ab` published and active. Keys are append-only, so a
508 rotation never invalidates a verdict signed under a key that has since been retired.
509- [x] `attestation-proof.yml` — obtains a live verdict, verifies it with **both** shipped
510 verifiers, runs tampered-payload and tampered-signature negative controls, and confirms
511 the stored ledger row is V4 rather than only the emitted response block. On demand and
512 daily; every input it uses is public, so it needs no credentials to run.
513 
514In flight on the core, not an expansion surface:
515 
516- [ ] Ha-Pri v2 Worker/D1 production enforcement for stored **signals** — the feed rows,
517 which still carry Ha-Pri v1 SHA-256 stamps. This is a separate path from the verdict
518 ledger above: verdicts are V4/Ed25519 today, signals are not. Design document complete;
519 hard tamper enforcement on the signals path is not live.
520 
521### Expansion surfaces — deliberately open, not built
522 
523These are integration seams the architecture supports and the engine does not yet implement. Stated in future tense on purpose.
524 
525- [ ] **Context safety harness.** Policy enforcement before context reaches an agent: pass / warn / refresh / quarantine / block, with evidence attached to each decision. Today `evaluate_context` emits decisions and warnings; **the enforcement state machine does not exist** — `quarantine` and `block` are not implemented anywhere in the codebase.
526- [ ] **Enterprise control plane.** Dashboard over source health, trust score, context drift and provenance lineage. The verdict ledger is the data contract this would read from; the UI is unbuilt.
527- [ ] **Observability telemetry.** Historical integrity state, incidents, upstream degradation and remediation history.
528- [ ] **Autonomous remediation.** Automatic refresh, source substitution and re-evaluation — closed-loop rather than detection-only.
529- [ ] **Vertical policy packs.** Domain-specific integrity thresholds for regulated workflows.
530- [ ] Webhook triggers — push high-entropy signals on threshold
531 
532### Research frontier — exploration, not commitment
533 
534- [ ] GKG upgrade for `extract_gdelt` — tone scores, goldstein scale, event codes
535- [ ] Contradiction detection across concurrent sources
536 
537Future work is organized in [FreshContext Future Lanes](./docs/FUTURE_LANES.md). Roadmap items are not live product claims until implemented and validated.
538 
539---
540 
541## Contributing
542 
543PRs 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.
544 
545If you're building something FreshContext-compatible, open an issue and we'll add you to the ecosystem list.
546 
547---
548 
549## Trust and security
550 
551- [LICENSE](./LICENSE)
552- [SECURITY.md](./SECURITY.md)
553- [NOTICE.md](./NOTICE.md)
554- [TRADEMARKS.md](./TRADEMARKS.md)
555- [Dependency diligence notes](./docs/DEPENDENCY_DILIGENCE.md)
556- [Release integrity notes](./docs/RELEASE_INTEGRITY.md)
557- [Release notes](./docs/RELEASE_NOTES.md)
558 
559---
560 
561## License
562 
563MIT
564 
565---
566 
567*Built by Immanuel Gabriel — Namibia 🇳🇦*
568*"The work isn't gone. It's just waiting to be continued."*
569 
570---
571 
572**Also on:** [MCP Registry](https://registry.modelcontextprotocol.io) · [npm](https://www.npmjs.com/package/freshcontext-mcp)
573 

Discussion

Alternatives