freshcontext-mcp 0.3.16 → 0.3.18
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 +3 -0
- package/LICENSE +21 -0
- package/NOTICE.md +17 -0
- package/README.md +395 -296
- package/SECURITY.md +34 -0
- package/TRADEMARKS.md +9 -0
- package/dist/adapters/arxiv.js +92 -48
- package/dist/adapters/finance.js +87 -101
- package/dist/adapters/gdelt.js +1 -1
- package/dist/adapters/gebiz.js +1 -1
- package/dist/adapters/hackernews.js +59 -29
- package/dist/adapters/productHunt.js +8 -4
- package/dist/adapters/registry.js +232 -0
- package/dist/adapters/repoSearch.js +1 -1
- package/dist/adapters/secFilings.js +1 -1
- package/dist/core/decay.js +61 -0
- package/dist/core/decision.js +176 -0
- package/dist/core/envelope.js +59 -0
- package/dist/core/explain.js +28 -0
- package/dist/core/guards.js +17 -0
- package/dist/core/index.js +11 -0
- package/dist/core/pipeline.js +101 -0
- package/dist/core/provenance.js +73 -0
- package/dist/core/rank.js +84 -0
- package/dist/core/signal.js +101 -0
- package/dist/core/sourceProfiles.js +126 -0
- package/dist/core/types.js +1 -0
- package/dist/core/utility.js +90 -0
- package/dist/rest/handler.js +126 -0
- package/dist/security.js +1 -1
- package/dist/server.js +10 -10
- package/dist/tools/freshnessStamp.js +1 -117
- package/dist/types.js +0 -1
- package/docs/API_DESIGN.md +434 -0
- package/docs/CODEX_MCP_USAGE.md +116 -0
- package/docs/CORE_API.md +224 -0
- package/docs/DEPENDENCY_DILIGENCE.md +63 -0
- package/docs/HA_PRI_V2_DESIGN.md +279 -0
- package/docs/OPERATIONAL_DEMO_RUNBOOK.md +458 -0
- package/docs/RELEASE_INTEGRITY.md +53 -0
- package/docs/RELEASE_NOTES.md +38 -0
- package/docs/SIGNAL_CONTRACT.md +89 -0
- package/docs/SOURCE_PROFILES.md +427 -0
- package/freshcontext.schema.json +103 -103
- package/package-script-guard.mjs +140 -0
- package/package.json +92 -52
- package/server.json +27 -28
- package/.github/workflows/publish.yml +0 -32
- package/RESEARCH.md +0 -487
- package/RISKS.md +0 -137
- package/cleanup.ps1 +0 -99
- package/demo/README.md +0 -70
- package/demo/data.json +0 -88
- package/demo/generate.mjs +0 -199
- package/demo/index.html +0 -513
- package/demo/logo-export.html +0 -61
- package/demo/logo.svg +0 -23
- package/dist/apify.js +0 -133
- package/freshcontext-validate.js +0 -196
- package/time-check.ps1 +0 -46
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { existsSync } from "node:fs";
|
|
3
|
+
import { spawnSync } from "node:child_process";
|
|
4
|
+
|
|
5
|
+
const SOURCE_CHECKOUT_MESSAGE = [
|
|
6
|
+
"This npm script is for the FreshContext source checkout.",
|
|
7
|
+
"The installed npm package supports `npm start` and the `freshcontext-mcp` binary.",
|
|
8
|
+
"Clone the repository to run tests, demos, trust scans, smoke checks, or development scripts.",
|
|
9
|
+
].join(" ");
|
|
10
|
+
|
|
11
|
+
const commands = {
|
|
12
|
+
build: {
|
|
13
|
+
required: ["src", "tsconfig.json"],
|
|
14
|
+
command: "tsc",
|
|
15
|
+
args: [],
|
|
16
|
+
},
|
|
17
|
+
dev: {
|
|
18
|
+
required: ["src/server.ts"],
|
|
19
|
+
command: "tsx",
|
|
20
|
+
args: ["watch", "src/server.ts"],
|
|
21
|
+
},
|
|
22
|
+
inspect: {
|
|
23
|
+
required: ["src/server.ts"],
|
|
24
|
+
command: "npx",
|
|
25
|
+
args: ["@modelcontextprotocol/inspector", "tsx", "src/server.ts"],
|
|
26
|
+
},
|
|
27
|
+
"example:ha-pri-v2": {
|
|
28
|
+
required: ["examples/ha-pri-v2-example.ts"],
|
|
29
|
+
command: "tsx",
|
|
30
|
+
args: ["examples/ha-pri-v2-example.ts"],
|
|
31
|
+
},
|
|
32
|
+
"demo:arxiv": {
|
|
33
|
+
required: ["examples/evaluate-arxiv-signals.ts"],
|
|
34
|
+
command: "tsx",
|
|
35
|
+
args: ["examples/evaluate-arxiv-signals.ts"],
|
|
36
|
+
},
|
|
37
|
+
"demo:evaluate": {
|
|
38
|
+
required: ["examples/evaluate-with-source-profile.ts"],
|
|
39
|
+
command: "tsx",
|
|
40
|
+
args: ["examples/evaluate-with-source-profile.ts"],
|
|
41
|
+
},
|
|
42
|
+
"demo:evaluate:file": {
|
|
43
|
+
required: ["examples/evaluate-file.ts", "examples/sources.academic.example.json"],
|
|
44
|
+
command: "tsx",
|
|
45
|
+
args: ["examples/evaluate-file.ts", "examples/sources.academic.example.json"],
|
|
46
|
+
passThroughArgs: true,
|
|
47
|
+
},
|
|
48
|
+
"smoke:stdio": {
|
|
49
|
+
required: ["scripts/smoke-stdio.mjs"],
|
|
50
|
+
command: "node",
|
|
51
|
+
args: ["scripts/smoke-stdio.mjs"],
|
|
52
|
+
},
|
|
53
|
+
"trust:gate": {
|
|
54
|
+
required: ["scripts/trust-scan.mjs"],
|
|
55
|
+
command: "node",
|
|
56
|
+
args: ["scripts/trust-scan.mjs", "--path", ".", "--repo-map", "--package-gate", "--claim-check", "--fail-on", "fail"],
|
|
57
|
+
},
|
|
58
|
+
"trust:report": {
|
|
59
|
+
required: ["scripts/trust-scan.mjs"],
|
|
60
|
+
command: "node",
|
|
61
|
+
args: ["scripts/trust-scan.mjs", "--path", ".", "--repo-map", "--package-gate", "--claim-check", "--markdown"],
|
|
62
|
+
passThroughArgs: true,
|
|
63
|
+
},
|
|
64
|
+
"trust:report:json": {
|
|
65
|
+
required: ["scripts/trust-scan.mjs"],
|
|
66
|
+
command: "node",
|
|
67
|
+
args: ["scripts/trust-scan.mjs", "--path", ".", "--repo-map", "--package-gate", "--claim-check", "--json"],
|
|
68
|
+
passThroughArgs: true,
|
|
69
|
+
},
|
|
70
|
+
"trust:scan": {
|
|
71
|
+
required: ["scripts/trust-scan.mjs"],
|
|
72
|
+
command: "node",
|
|
73
|
+
args: ["scripts/trust-scan.mjs"],
|
|
74
|
+
passThroughArgs: true,
|
|
75
|
+
},
|
|
76
|
+
"trust:scan:json": {
|
|
77
|
+
required: ["scripts/trust-scan.mjs"],
|
|
78
|
+
command: "node",
|
|
79
|
+
args: ["scripts/trust-scan.mjs", "--json"],
|
|
80
|
+
},
|
|
81
|
+
"trust:scan:markdown": {
|
|
82
|
+
required: ["scripts/trust-scan.mjs"],
|
|
83
|
+
command: "node",
|
|
84
|
+
args: ["scripts/trust-scan.mjs", "--markdown"],
|
|
85
|
+
},
|
|
86
|
+
test: {
|
|
87
|
+
required: ["tests", "tests/trustScan.test.mjs"],
|
|
88
|
+
command: "tsx",
|
|
89
|
+
args: [
|
|
90
|
+
"--test",
|
|
91
|
+
"tests/freshnessStamp.test.ts",
|
|
92
|
+
"tests/hackernews.test.ts",
|
|
93
|
+
"tests/arxivSignals.test.ts",
|
|
94
|
+
"tests/arxivDecisionIntegration.test.ts",
|
|
95
|
+
"tests/core.test.ts",
|
|
96
|
+
"tests/rank.test.ts",
|
|
97
|
+
"tests/workerEnvelope.test.ts",
|
|
98
|
+
"tests/workerCoreEnvelopeParity.test.ts",
|
|
99
|
+
"tests/coreEnvelopeOptions.test.ts",
|
|
100
|
+
"tests/mathSpine.test.ts",
|
|
101
|
+
"tests/coreApiContract.test.ts",
|
|
102
|
+
"tests/corePipeline.test.ts",
|
|
103
|
+
"tests/decision.test.ts",
|
|
104
|
+
"tests/restHandler.test.ts",
|
|
105
|
+
"tests/sourceProfiles.test.ts",
|
|
106
|
+
"tests/adapterRegistry.test.ts",
|
|
107
|
+
"tests/trustScan.test.mjs",
|
|
108
|
+
],
|
|
109
|
+
},
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
const scriptName = process.argv[2];
|
|
113
|
+
const config = commands[scriptName];
|
|
114
|
+
|
|
115
|
+
if (!config) {
|
|
116
|
+
console.error(`Unknown FreshContext package script: ${scriptName ?? "(missing)"}`);
|
|
117
|
+
process.exit(1);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
const hasSourceCheckoutFiles = config.required.every((path) => existsSync(path));
|
|
121
|
+
if (!hasSourceCheckoutFiles) {
|
|
122
|
+
console.log(SOURCE_CHECKOUT_MESSAGE);
|
|
123
|
+
process.exit(0);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
const args = [
|
|
127
|
+
...config.args,
|
|
128
|
+
...(config.passThroughArgs ? process.argv.slice(3) : []),
|
|
129
|
+
];
|
|
130
|
+
const child = spawnSync(config.command, args, {
|
|
131
|
+
stdio: "inherit",
|
|
132
|
+
shell: process.platform === "win32",
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
if (child.error) {
|
|
136
|
+
console.error(child.error.message);
|
|
137
|
+
process.exit(1);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
process.exit(child.status ?? 0);
|
package/package.json
CHANGED
|
@@ -1,52 +1,92 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "freshcontext-mcp",
|
|
3
|
-
"mcpName": "io.github.PrinceGabriel-lgtm/freshcontext",
|
|
4
|
-
"version": "0.3.
|
|
5
|
-
"description": "Real-time web intelligence for AI agents.
|
|
6
|
-
"keywords": [
|
|
7
|
-
"mcp",
|
|
8
|
-
"mcp-server",
|
|
9
|
-
"ai-agents",
|
|
10
|
-
"llm",
|
|
11
|
-
"freshness",
|
|
12
|
-
"web-scraping",
|
|
13
|
-
"github-analytics",
|
|
14
|
-
"hackernews",
|
|
15
|
-
"yc",
|
|
16
|
-
"typescript",
|
|
17
|
-
"context",
|
|
18
|
-
"model-context-protocol"
|
|
19
|
-
],
|
|
20
|
-
"homepage": "https://github.com/PrinceGabriel-lgtm/freshcontext-mcp",
|
|
21
|
-
"repository": {
|
|
22
|
-
"type": "git",
|
|
23
|
-
"url": "git+https://github.com/PrinceGabriel-lgtm/freshcontext-mcp.git"
|
|
24
|
-
},
|
|
25
|
-
"license": "MIT",
|
|
26
|
-
"type": "module",
|
|
27
|
-
"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
|
|
52
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "freshcontext-mcp",
|
|
3
|
+
"mcpName": "io.github.PrinceGabriel-lgtm/freshcontext",
|
|
4
|
+
"version": "0.3.18",
|
|
5
|
+
"description": "Real-time web intelligence for AI agents. 21 tools, no required API keys. Every result timestamped with a freshness score.",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"mcp",
|
|
8
|
+
"mcp-server",
|
|
9
|
+
"ai-agents",
|
|
10
|
+
"llm",
|
|
11
|
+
"freshness",
|
|
12
|
+
"web-scraping",
|
|
13
|
+
"github-analytics",
|
|
14
|
+
"hackernews",
|
|
15
|
+
"yc",
|
|
16
|
+
"typescript",
|
|
17
|
+
"context",
|
|
18
|
+
"model-context-protocol"
|
|
19
|
+
],
|
|
20
|
+
"homepage": "https://github.com/PrinceGabriel-lgtm/freshcontext-mcp",
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "git+https://github.com/PrinceGabriel-lgtm/freshcontext-mcp.git"
|
|
24
|
+
},
|
|
25
|
+
"license": "MIT",
|
|
26
|
+
"type": "module",
|
|
27
|
+
"engines": {
|
|
28
|
+
"node": ">=20"
|
|
29
|
+
},
|
|
30
|
+
"main": "dist/server.js",
|
|
31
|
+
"bin": {
|
|
32
|
+
"freshcontext-mcp": "dist/server.js"
|
|
33
|
+
},
|
|
34
|
+
"files": [
|
|
35
|
+
".env.example",
|
|
36
|
+
"dist/",
|
|
37
|
+
"!dist/apify.js",
|
|
38
|
+
"docs/API_DESIGN.md",
|
|
39
|
+
"docs/CODEX_MCP_USAGE.md",
|
|
40
|
+
"docs/CORE_API.md",
|
|
41
|
+
"docs/DEPENDENCY_DILIGENCE.md",
|
|
42
|
+
"docs/HA_PRI_V2_DESIGN.md",
|
|
43
|
+
"docs/OPERATIONAL_DEMO_RUNBOOK.md",
|
|
44
|
+
"docs/RELEASE_INTEGRITY.md",
|
|
45
|
+
"docs/RELEASE_NOTES.md",
|
|
46
|
+
"docs/SIGNAL_CONTRACT.md",
|
|
47
|
+
"docs/SOURCE_PROFILES.md",
|
|
48
|
+
"freshcontext.schema.json",
|
|
49
|
+
"NOTICE.md",
|
|
50
|
+
"package-script-guard.mjs",
|
|
51
|
+
"SECURITY.md",
|
|
52
|
+
"server.json",
|
|
53
|
+
"TRADEMARKS.md"
|
|
54
|
+
],
|
|
55
|
+
"scripts": {
|
|
56
|
+
"build": "node package-script-guard.mjs build",
|
|
57
|
+
"dev": "node package-script-guard.mjs dev",
|
|
58
|
+
"start": "node dist/server.js",
|
|
59
|
+
"inspect": "node package-script-guard.mjs inspect",
|
|
60
|
+
"example:ha-pri-v2": "node package-script-guard.mjs example:ha-pri-v2",
|
|
61
|
+
"demo:arxiv": "node package-script-guard.mjs demo:arxiv",
|
|
62
|
+
"demo:evaluate": "node package-script-guard.mjs demo:evaluate",
|
|
63
|
+
"demo:evaluate:file": "node package-script-guard.mjs demo:evaluate:file",
|
|
64
|
+
"smoke:stdio": "node package-script-guard.mjs smoke:stdio",
|
|
65
|
+
"trust:gate": "node package-script-guard.mjs trust:gate",
|
|
66
|
+
"trust:report": "node package-script-guard.mjs trust:report",
|
|
67
|
+
"trust:report:json": "node package-script-guard.mjs trust:report:json",
|
|
68
|
+
"trust:scan": "node package-script-guard.mjs trust:scan",
|
|
69
|
+
"trust:scan:json": "node package-script-guard.mjs trust:scan:json",
|
|
70
|
+
"trust:scan:markdown": "node package-script-guard.mjs trust:scan:markdown",
|
|
71
|
+
"test": "node package-script-guard.mjs test"
|
|
72
|
+
},
|
|
73
|
+
"dependencies": {
|
|
74
|
+
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
75
|
+
"dotenv": "^16.4.0",
|
|
76
|
+
"playwright": "^1.44.0",
|
|
77
|
+
"zod": "^3.23.0"
|
|
78
|
+
},
|
|
79
|
+
"devDependencies": {
|
|
80
|
+
"@types/jest": "^29.0.0",
|
|
81
|
+
"@types/node": "^20.0.0",
|
|
82
|
+
"apify": "^3.0.0",
|
|
83
|
+
"jest": "^29.0.0",
|
|
84
|
+
"tsx": "^4.0.0",
|
|
85
|
+
"typescript": "^5.4.0"
|
|
86
|
+
},
|
|
87
|
+
"overrides": {
|
|
88
|
+
"file-type": "21.3.4",
|
|
89
|
+
"qs": "6.15.2",
|
|
90
|
+
"ws": "8.20.1"
|
|
91
|
+
}
|
|
92
|
+
}
|
package/server.json
CHANGED
|
@@ -1,28 +1,27 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-07-09/server.schema.json",
|
|
3
|
-
"name": "io.github.PrinceGabriel-lgtm/freshcontext",
|
|
4
|
-
"description": "
|
|
5
|
-
"repository": {
|
|
6
|
-
"url": "https://github.com/PrinceGabriel-lgtm/freshcontext-mcp",
|
|
7
|
-
"source": "github"
|
|
8
|
-
},
|
|
9
|
-
"version": "0.3.
|
|
10
|
-
"website_url": "https://freshcontext-site.pages.dev",
|
|
11
|
-
"packages": [
|
|
12
|
-
{
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-07-09/server.schema.json",
|
|
3
|
+
"name": "io.github.PrinceGabriel-lgtm/freshcontext",
|
|
4
|
+
"description": "Freshness-aware AI retrieval with 21 MCP tools for timestamped, decay-ranked live signals.",
|
|
5
|
+
"repository": {
|
|
6
|
+
"url": "https://github.com/PrinceGabriel-lgtm/freshcontext-mcp",
|
|
7
|
+
"source": "github"
|
|
8
|
+
},
|
|
9
|
+
"version": "0.3.18",
|
|
10
|
+
"website_url": "https://freshcontext-site.pages.dev",
|
|
11
|
+
"packages": [
|
|
12
|
+
{
|
|
13
|
+
"registryType": "npm",
|
|
14
|
+
"identifier": "freshcontext-mcp",
|
|
15
|
+
"version": "0.3.18",
|
|
16
|
+
"transport": {
|
|
17
|
+
"type": "stdio"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"remotes": [
|
|
22
|
+
{
|
|
23
|
+
"type": "streamable-http",
|
|
24
|
+
"url": "https://freshcontext-mcp.gimmanuel73.workers.dev/mcp"
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
name: Build and Publish
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches:
|
|
6
|
-
- main
|
|
7
|
-
|
|
8
|
-
jobs:
|
|
9
|
-
build-and-publish:
|
|
10
|
-
runs-on: ubuntu-latest
|
|
11
|
-
|
|
12
|
-
steps:
|
|
13
|
-
- name: Checkout repository
|
|
14
|
-
uses: actions/checkout@v4
|
|
15
|
-
|
|
16
|
-
- name: Set up Node.js 18
|
|
17
|
-
uses: actions/setup-node@v4
|
|
18
|
-
with:
|
|
19
|
-
node-version: '18'
|
|
20
|
-
registry-url: 'https://registry.npmjs.org'
|
|
21
|
-
|
|
22
|
-
- name: Install dependencies
|
|
23
|
-
run: npm ci
|
|
24
|
-
|
|
25
|
-
- name: Build
|
|
26
|
-
run: npm run build
|
|
27
|
-
|
|
28
|
-
- name: Publish to npm
|
|
29
|
-
run: npm publish --access public
|
|
30
|
-
env:
|
|
31
|
-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
32
|
-
continue-on-error: true
|