evidence-report-mcp 0.0.0-stage β 0.2.0
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/CHANGELOG.md +55 -0
- package/LICENSE +21 -0
- package/README.md +126 -2
- package/dist/checkers.d.ts +38 -0
- package/dist/checkers.d.ts.map +1 -0
- package/dist/checkers.js +306 -0
- package/dist/checkers.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +5 -0
- package/dist/cli.js.map +1 -0
- package/dist/server.d.ts +14 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +64 -0
- package/dist/server.js.map +1 -0
- package/dist/severity.d.ts +32 -0
- package/dist/severity.d.ts.map +1 -0
- package/dist/severity.js +86 -0
- package/dist/severity.js.map +1 -0
- package/dist/types.d.ts +102 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +45 -0
- package/dist/types.js.map +1 -0
- package/package.json +82 -4
- package/src/checkers.ts +411 -0
- package/src/cli.ts +6 -0
- package/src/server.ts +106 -0
- package/src/severity.ts +120 -0
- package/src/types.ts +103 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [0.2.0](https://github.com/phun-ky/evidence-report-mcp/compare/0.1.0...0.2.0) (2026-11-19)
|
|
4
|
+
|
|
5
|
+
### Tasks
|
|
6
|
+
|
|
7
|
+
* π€ leave the generated changelog out of lint and format ([9d34b0e](https://github.com/phun-ky/evidence-report-mcp/commit/9d34b0e4fa596eec3400b993ae8f31e8e653daa1))
|
|
8
|
+
* π€ render the logo PNGs from the marks with Work Sans ([794b99a](https://github.com/phun-ky/evidence-report-mcp/commit/794b99a2d4cc4d0c033aaeb5f7f3b89d0c9c0f70))
|
|
9
|
+
|
|
10
|
+
### Documentation
|
|
11
|
+
|
|
12
|
+
* βοΈ add the design tokens, the logo set, the README banner and the social card ([a15d858](https://github.com/phun-ky/evidence-report-mcp/commit/a15d858e8226cbab4c93da170d408174a987fd2a))
|
|
13
|
+
* βοΈ describe the project as it is now and link the talk's slides ([91e5878](https://github.com/phun-ky/evidence-report-mcp/commit/91e5878d458c3046bdd1ee01d61cc24f974999c3))
|
|
14
|
+
|
|
15
|
+
### Feature
|
|
16
|
+
|
|
17
|
+
* πΈ export the report types from the package entry ([04a0034](https://github.com/phun-ky/evidence-report-mcp/commit/04a0034baaeb1faae180287ea1853339d44ad1b2))
|
|
18
|
+
|
|
19
|
+
## 0.1.0 (2026-11-19)
|
|
20
|
+
|
|
21
|
+
### Tasks
|
|
22
|
+
|
|
23
|
+
* π€ add release-it, the conventional changelog and the release guard ([8df3acb](https://github.com/phun-ky/evidence-report-mcp/commit/8df3acbb90aa636c976496e9d463ba7785ede2ae))
|
|
24
|
+
* π€ add the sign-off hook and the AI attribution block ([944dfb8](https://github.com/phun-ky/evidence-report-mcp/commit/944dfb8910eb071eaf919c6edd2bceb695a74b1c)), references [#6](https://github.com/phun-ky/evidence-report-mcp/issues/6)
|
|
25
|
+
* π€ fit the ESLint rules to a Node package ([6f5c989](https://github.com/phun-ky/evidence-report-mcp/commit/6f5c9892c4114e37a2a5cd608a389ded3037d1e2)), references [#3](https://github.com/phun-ky/evidence-report-mcp/issues/3)
|
|
26
|
+
* π€ ignore CLAUDE.md ([108c50a](https://github.com/phun-ky/evidence-report-mcp/commit/108c50afc8b049379c6337274ae3dda5f8891ab3)), references [#1](https://github.com/phun-ky/evidence-report-mcp/issues/1)
|
|
27
|
+
* π€ lint and format with eslint-config-phun-ky ([26fa865](https://github.com/phun-ky/evidence-report-mcp/commit/26fa865506dfb9de33afab9846bac78c31dae645)), references [#3](https://github.com/phun-ky/evidence-report-mcp/issues/3)
|
|
28
|
+
* π€ set the licence to MIT and read the version from package.json ([5f4f0ba](https://github.com/phun-ky/evidence-report-mcp/commit/5f4f0ba733c2de890b4d961e74e15e05da1c7dd5)), references [#1](https://github.com/phun-ky/evidence-report-mcp/issues/1)
|
|
29
|
+
* π€ upgrade the MCP SDK, ajv and zod ([2b0750f](https://github.com/phun-ky/evidence-report-mcp/commit/2b0750f8ac6705846427798e234a9476a2ebb67d)), references [#1](https://github.com/phun-ky/evidence-report-mcp/issues/1)
|
|
30
|
+
* π€ upgrade TypeScript to 6.0.3 ([5603adc](https://github.com/phun-ky/evidence-report-mcp/commit/5603adcdde50fc270b12022cde4be8881763404e)), references [#4](https://github.com/phun-ky/evidence-report-mcp/issues/4)
|
|
31
|
+
* **deps-dev:** Bump @types/node ([cae320a](https://github.com/phun-ky/evidence-report-mcp/commit/cae320ab3da285e2c0a84bb78f681c2a42a4b48c))
|
|
32
|
+
|
|
33
|
+
### Documentation
|
|
34
|
+
|
|
35
|
+
* βοΈ add the security policy and security insights ([423cf3e](https://github.com/phun-ky/evidence-report-mcp/commit/423cf3ece8c07fb9ab9b9157d6e01c6bf058ea2f))
|
|
36
|
+
* βοΈ describe verifying releases and the release secret ([59095ed](https://github.com/phun-ky/evidence-report-mcp/commit/59095edf7a95e1d993f14755befaa2a499f55e19))
|
|
37
|
+
* βοΈ document x-unit and c2patool ([de7d026](https://github.com/phun-ky/evidence-report-mcp/commit/de7d026da870f71343b229a89e386c001de5b83f)), references [#1](https://github.com/phun-ky/evidence-report-mcp/issues/1)
|
|
38
|
+
* βοΈ say that a breaking change releases a new major version ([15440d5](https://github.com/phun-ky/evidence-report-mcp/commit/15440d562d208c46c3e38ea5cdfe79610521898e))
|
|
39
|
+
|
|
40
|
+
### Feature
|
|
41
|
+
|
|
42
|
+
* πΈ add the verify tool sketch ([3267d0e](https://github.com/phun-ky/evidence-report-mcp/commit/3267d0e55520bf3c820f86cb2ab73069578bc451)), references [#1](https://github.com/phun-ky/evidence-report-mcp/issues/1)
|
|
43
|
+
* πΈ add the x-unit keyword and strict schema checks ([63c926a](https://github.com/phun-ky/evidence-report-mcp/commit/63c926aec91654f99d8acca0e34cd143b351989b)), references [#1](https://github.com/phun-ky/evidence-report-mcp/issues/1)
|
|
44
|
+
* πΈ check C2PA manifests with c2patool ([6715bf2](https://github.com/phun-ky/evidence-report-mcp/commit/6715bf296dcc098b84bc35033133777189868812)), references [#1](https://github.com/phun-ky/evidence-report-mcp/issues/1)
|
|
45
|
+
* πΈ package as evidence-report-mcp ([8c4de1f](https://github.com/phun-ky/evidence-report-mcp/commit/8c4de1fe5c05949516c3ae9730728293df8b7b65))
|
|
46
|
+
* πΈ parse OSV severity from labels and CVSS vectors ([c6ab427](https://github.com/phun-ky/evidence-report-mcp/commit/c6ab427411df5da11a6128d4e4ef02523df54ea0)), references [#1](https://github.com/phun-ky/evidence-report-mcp/issues/1)
|
|
47
|
+
|
|
48
|
+
### Bug
|
|
49
|
+
|
|
50
|
+
* π drop the trailing colon from C2PA findings without an explanation ([66f4b3c](https://github.com/phun-ky/evidence-report-mcp/commit/66f4b3c3886b904a5162d9e5bb26eb91712de3c2))
|
|
51
|
+
* π start the server from a separate bin entry ([e25980b](https://github.com/phun-ky/evidence-report-mcp/commit/e25980b3d804d2b0b7a2500cb9ed0b009a1d4e21)), references [#1](https://github.com/phun-ky/evidence-report-mcp/issues/1)
|
|
52
|
+
|
|
53
|
+
### Refactoring
|
|
54
|
+
|
|
55
|
+
* π‘ replace nested ternaries with early returns ([775490d](https://github.com/phun-ky/evidence-report-mcp/commit/775490dc49e486c72fdb90e52604d24d968a4d66))
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Alexander Vassbotn RΓΈyne-Helgesen
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,127 @@
|
|
|
1
|
-
#
|
|
1
|
+
# evidence-report-mcp
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<picture>
|
|
4
|
+
<source media="(prefers-color-scheme: dark)" srcset="./docs/public/logo/banner-dark.png">
|
|
5
|
+
<img alt="evidence-report-mcp: Evidence, not verdicts. Beside it, a report for lodash 4.17.20 that failed with two high findings from OSV.dev and lists what was not checked." src="./docs/public/logo/banner-light.png">
|
|
6
|
+
</picture>
|
|
7
|
+
|
|
8
|
+
A "trust layer" MCP server: one `verify` tool an agent calls _before_ acting on
|
|
9
|
+
data it did not produce, such as a package, a dataset, a media file or a claim.
|
|
10
|
+
It returns an evidence report, not a checkmark: what was checked, where each
|
|
11
|
+
result came from and when, and what was not checked.
|
|
12
|
+
|
|
13
|
+
Companion to the talk
|
|
14
|
+
[_Invisible Data: Building Trust in the Age of AI_](https://slides.com/phun-ky/invisible-data-building-trust-in-the-age-of-ai).
|
|
15
|
+
|
|
16
|
+
## Install
|
|
17
|
+
|
|
18
|
+
Needs Node.js 22.12.0 or later.
|
|
19
|
+
|
|
20
|
+
```sh
|
|
21
|
+
claude mcp add evidence-report -- npx -y evidence-report-mcp
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
From a clone instead:
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
npm install
|
|
28
|
+
npm run build
|
|
29
|
+
claude mcp add evidence-report -- node /path/to/evidence-report-mcp/dist/cli.js
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
The package also exports `verify`, `aggregate` and `createServer`, for use
|
|
33
|
+
without MCP, and the types of the report and its input (`EvidenceReport`,
|
|
34
|
+
`CheckResult`, `Finding`, `Verdict`, `CheckKind`, `CheckStatus` and `Target`):
|
|
35
|
+
|
|
36
|
+
```ts
|
|
37
|
+
import { verify, type EvidenceReport } from 'evidence-report-mcp';
|
|
38
|
+
|
|
39
|
+
const report: EvidenceReport = await verify({
|
|
40
|
+
kind: 'package',
|
|
41
|
+
ecosystem: 'npm',
|
|
42
|
+
name: 'left-pad',
|
|
43
|
+
version: '1.3.0'
|
|
44
|
+
});
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## The tool
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
verify({ target });
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
`target` is one of:
|
|
54
|
+
|
|
55
|
+
| kind | example input | checks |
|
|
56
|
+
| --------- | ------------------------------------- | ------------------------------------------------------------ |
|
|
57
|
+
| `package` | `{ ecosystem: "npm", name, version }` | OSV.dev advisories |
|
|
58
|
+
| `dataset` | `{ schema, records, assetId? }` | JSON Schema contract (incl. `x-unit`), observability adapter |
|
|
59
|
+
| `file` | `{ path }` | C2PA manifest (c2patool) |
|
|
60
|
+
| `claim` | `{ text, sources: [url, β¦] }` | independent-source corroboration (heuristic) |
|
|
61
|
+
|
|
62
|
+
### Units: `x-unit`
|
|
63
|
+
|
|
64
|
+
A property with `"x-unit": "N*s"` must be sent as
|
|
65
|
+
`{ "value": 4.45, "unit": "N*s" }`. A different unit (`lbf*s`) or a bare number
|
|
66
|
+
is a `high` finding. Only separators are normalised (`NΒ·s` = `N*s` = `N s`);
|
|
67
|
+
there are no aliases and no conversion.
|
|
68
|
+
|
|
69
|
+
Schemas are compiled in Ajv strict mode: an unknown or misspelled keyword makes
|
|
70
|
+
the check `error` instead of silently passing. `x-*` keys are allowed as
|
|
71
|
+
annotations.
|
|
72
|
+
|
|
73
|
+
### C2PA: `c2patool`
|
|
74
|
+
|
|
75
|
+
Install [c2patool](https://github.com/contentauth/c2pa-rs/releases) (tested with
|
|
76
|
+
0.27.23, verify the release checksum) and point the server at it:
|
|
77
|
+
|
|
78
|
+
```sh
|
|
79
|
+
claude mcp add evidence-report \
|
|
80
|
+
-e EVIDENCE_REPORT_MCP_C2PATOOL=/path/to/c2patool \
|
|
81
|
+
-e C2PATOOL_TRUST_ANCHORS=/path/to/anchors.pem \
|
|
82
|
+
-- npx -y evidence-report-mcp
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
`C2PATOOL_TRUST_ANCHORS`, `C2PATOOL_TRUST_CONFIG` and `C2PATOOL_ALLOWED_LIST`
|
|
86
|
+
are c2patool's own settings. Only a `Trusted` manifest passes; `Invalid` fails;
|
|
87
|
+
a manifest from an untrusted signer, or no manifest at all, is `skipped`, so the
|
|
88
|
+
verdict stays `unknown`.
|
|
89
|
+
|
|
90
|
+
## The report
|
|
91
|
+
|
|
92
|
+
```jsonc
|
|
93
|
+
{
|
|
94
|
+
"verdict": "pass" | "fail" | "unknown",
|
|
95
|
+
"summary": "Failed: 1/2 checks completed, 2 finding(s).",
|
|
96
|
+
"checks": [{ "id", "kind", "status", "source": { "name", "retrievedAt" }, "findings", "reason" }],
|
|
97
|
+
"notChecked": ["Whether values are true, only whether they are well-formed", "β¦"],
|
|
98
|
+
"generatedAt": "β¦",
|
|
99
|
+
"verifier": { "name": "evidence-report-mcp", "version": "0.1.0" }
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## Rules baked in
|
|
104
|
+
|
|
105
|
+
1. **Evidence, not verdicts.** Every check lists its source and timestamp.
|
|
106
|
+
`notChecked` is always present, so limits are never silent.
|
|
107
|
+
2. **Deterministic first.** Checks are labelled `deterministic` or `heuristic`.
|
|
108
|
+
Heuristics can fail a target but can never pass it alone.
|
|
109
|
+
3. **Independent checks.** No LLM "plausibility" scoring. The verifier never
|
|
110
|
+
asks the generator to grade itself.
|
|
111
|
+
4. **Unknown β verified.** A required check that errors or is skipped makes the
|
|
112
|
+
verdict `unknown`. Exceptions become `error`, never a crash or a pass.
|
|
113
|
+
5. **Verify the verifier.** This server is a dependency too: pin it, scan it,
|
|
114
|
+
and keep it read-only (`readOnlyHint: true`).
|
|
115
|
+
|
|
116
|
+
## What's stubbed
|
|
117
|
+
|
|
118
|
+
- `checkObservability`: wire to Monte Carlo, Soda, Elementary, etc. (their API,
|
|
119
|
+
or act as an MCP client to their MCP server).
|
|
120
|
+
- `checkCorroboration`: fetches nothing yet; only enforces two distinct source
|
|
121
|
+
domains.
|
|
122
|
+
|
|
123
|
+
## Ideas
|
|
124
|
+
|
|
125
|
+
- `verify` over a lockfile or SBOM (OSV batch API).
|
|
126
|
+
- A signed report (Sigstore) so downstream systems can trust the verifier's
|
|
127
|
+
output, not just the agent's summary of it.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { CheckResult, Target } from './types.js';
|
|
2
|
+
type Of<K extends Target['kind']> = Extract<Target, {
|
|
3
|
+
kind: K;
|
|
4
|
+
}>;
|
|
5
|
+
export declare function checkOsv(t: Of<'package'>): Promise<CheckResult>;
|
|
6
|
+
export declare function checkSchema(t: Of<'dataset'>): Promise<CheckResult>;
|
|
7
|
+
/**
|
|
8
|
+
* Adapter point for Monte Carlo, Soda, Elementary, etc. Either call their
|
|
9
|
+
* API directly, or have this server act as an MCP *client* to their server.
|
|
10
|
+
* Until configured, this reports "skipped" (which keeps the verdict "unknown").
|
|
11
|
+
*/
|
|
12
|
+
export declare function checkObservability(t: Of<'dataset'>): Promise<CheckResult>;
|
|
13
|
+
/**
|
|
14
|
+
* Runs c2patool (from c2pa-rs) read-only. EVIDENCE_REPORT_MCP_C2PATOOL is the binary's path. Trust
|
|
15
|
+
* anchors come from c2patool's own env (C2PATOOL_TRUST_ANCHORS, C2PATOOL_TRUST_CONFIG,
|
|
16
|
+
* C2PATOOL_ALLOWED_LIST), which it only reads under the `trust` subcommand.
|
|
17
|
+
*
|
|
18
|
+
* Only a trusted signer passes. A missing manifest is NOT a fail (absence of credentials
|
|
19
|
+
* proves nothing) and a valid manifest from an untrusted signer proves only that someone
|
|
20
|
+
* signed it, so both stay "skipped" and keep the verdict "unknown".
|
|
21
|
+
*/
|
|
22
|
+
export declare function checkC2pa(t: Of<'file'>): Promise<CheckResult>;
|
|
23
|
+
/**
|
|
24
|
+
* Heuristic by design. Deliberately does not ask an LLM whether the claim is
|
|
25
|
+
* "plausible": that is the generator grading its own homework.
|
|
26
|
+
* A real version would fetch each source and check it independently.
|
|
27
|
+
*/
|
|
28
|
+
export declare function checkCorroboration(t: Of<'claim'>): Promise<CheckResult>;
|
|
29
|
+
export interface Plan {
|
|
30
|
+
checks: Promise<CheckResult>[];
|
|
31
|
+
/** Ids that must pass for an overall "pass". */
|
|
32
|
+
required: string[];
|
|
33
|
+
/** Honest limits for this kind of target. */
|
|
34
|
+
notChecked: string[];
|
|
35
|
+
}
|
|
36
|
+
export declare function plan(t: Target): Plan;
|
|
37
|
+
export {};
|
|
38
|
+
//# sourceMappingURL=checkers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkers.d.ts","sourceRoot":"","sources":["../src/checkers.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAW,MAAM,EAAE,MAAM,YAAY,CAAC;AAI/D,KAAK,EAAE,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,CAAC,IAAI,OAAO,CAAC,MAAM,EAAE;IAAE,IAAI,EAAE,CAAC,CAAA;CAAE,CAAC,CAAC;AA0CjE,wBAAgB,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,CAyD/D;AAgED,wBAAgB,WAAW,CAAC,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,CAiClE;AAID;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,CAYzE;AAUD;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,CAoE7D;AAID;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,CA+BvE;AAID,MAAM,WAAW,IAAI;IACnB,MAAM,EAAE,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC;IAC/B,gDAAgD;IAChD,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,6CAA6C;IAC7C,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,wBAAgB,IAAI,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,CA2CpC"}
|
package/dist/checkers.js
ADDED
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
import { Ajv } from 'ajv';
|
|
2
|
+
import { execFile } from 'node:child_process';
|
|
3
|
+
import { resolve } from 'node:path';
|
|
4
|
+
import { promisify } from 'node:util';
|
|
5
|
+
import { osvSeverity } from './severity.js';
|
|
6
|
+
const execFileP = promisify(execFile);
|
|
7
|
+
const now = () => new Date().toISOString();
|
|
8
|
+
/** Wrap a check so exceptions become status "error" instead of crashing (fail closed). */
|
|
9
|
+
async function timed(base, run) {
|
|
10
|
+
const t0 = Date.now();
|
|
11
|
+
try {
|
|
12
|
+
const r = await run();
|
|
13
|
+
return {
|
|
14
|
+
...base,
|
|
15
|
+
source: { ...base.source, retrievedAt: now() },
|
|
16
|
+
status: r.status,
|
|
17
|
+
findings: r.findings ?? [],
|
|
18
|
+
reason: r.reason,
|
|
19
|
+
durationMs: Date.now() - t0
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
catch (err) {
|
|
23
|
+
return {
|
|
24
|
+
...base,
|
|
25
|
+
source: { ...base.source, retrievedAt: now() },
|
|
26
|
+
status: 'error',
|
|
27
|
+
findings: [],
|
|
28
|
+
reason: err instanceof Error ? err.message : String(err),
|
|
29
|
+
durationMs: Date.now() - t0
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/* ---------------- package: known vulnerabilities (OSV.dev) ---------------- */
|
|
34
|
+
export function checkOsv(t) {
|
|
35
|
+
return timed({
|
|
36
|
+
id: 'osv.vulnerabilities',
|
|
37
|
+
kind: 'deterministic',
|
|
38
|
+
source: { name: 'OSV.dev', url: 'https://osv.dev' }
|
|
39
|
+
}, async () => {
|
|
40
|
+
const vulns = [];
|
|
41
|
+
let pageToken;
|
|
42
|
+
for (let page = 0;; page++) {
|
|
43
|
+
// Fail closed rather than report a partial list as complete.
|
|
44
|
+
if (page === 10)
|
|
45
|
+
throw new Error('OSV returned more than 10 pages of results');
|
|
46
|
+
const res = await fetch('https://api.osv.dev/v1/query', {
|
|
47
|
+
method: 'POST',
|
|
48
|
+
headers: { 'content-type': 'application/json' },
|
|
49
|
+
body: JSON.stringify({
|
|
50
|
+
package: { name: t.name, ecosystem: t.ecosystem },
|
|
51
|
+
version: t.version,
|
|
52
|
+
...(pageToken ? { page_token: pageToken } : {})
|
|
53
|
+
}),
|
|
54
|
+
signal: AbortSignal.timeout(10_000)
|
|
55
|
+
});
|
|
56
|
+
if (!res.ok)
|
|
57
|
+
throw new Error(`OSV responded ${res.status}`);
|
|
58
|
+
const body = (await res.json());
|
|
59
|
+
vulns.push(...(body.vulns ?? []));
|
|
60
|
+
pageToken = body.next_page_token;
|
|
61
|
+
if (!pageToken)
|
|
62
|
+
break;
|
|
63
|
+
}
|
|
64
|
+
return {
|
|
65
|
+
status: vulns.length ? 'fail' : 'pass',
|
|
66
|
+
findings: vulns.map((v) => {
|
|
67
|
+
const severity = osvSeverity(v);
|
|
68
|
+
return {
|
|
69
|
+
severity: severity ?? 'high',
|
|
70
|
+
message: (v.summary ?? 'Known vulnerability') +
|
|
71
|
+
(severity ? '' : ' (severity not provided; assumed high)'),
|
|
72
|
+
ref: v.id
|
|
73
|
+
};
|
|
74
|
+
})
|
|
75
|
+
};
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
/* ---------------- dataset: contract conformance (JSON Schema) ---------------- */
|
|
79
|
+
// strictSchema: unknown or misspelled keywords make the check error instead of silently passing.
|
|
80
|
+
const ajv = new Ajv({
|
|
81
|
+
allErrors: true,
|
|
82
|
+
strictSchema: true,
|
|
83
|
+
strictTypes: false,
|
|
84
|
+
strictTuples: false
|
|
85
|
+
});
|
|
86
|
+
/** "NΒ·s", "N*s" and "N s" are the same unit. Case matters: mN is not MN. */
|
|
87
|
+
// shortcut: separator normalisation only, no aliases ("newton-second") or conversion; add a unit table if agents need it.
|
|
88
|
+
const canonicalUnit = (u) => u.trim().replace(/\s*[Β·β
*\s]\s*/g, '*');
|
|
89
|
+
/**
|
|
90
|
+
* `"x-unit": "N*s"` requires the value to be `{ value: number, unit: "N*s" }`.
|
|
91
|
+
* A bare number has no unit to check, so it fails too (Mars Climate Orbiter: lbfΒ·s sent where NΒ·s was expected).
|
|
92
|
+
*/
|
|
93
|
+
function unitError(expected, data) {
|
|
94
|
+
const d = data;
|
|
95
|
+
if (typeof d !== 'object' ||
|
|
96
|
+
d === null ||
|
|
97
|
+
typeof d.value !== 'number' ||
|
|
98
|
+
typeof d.unit !== 'string')
|
|
99
|
+
return `has no declared unit (expected { value: number, unit: "${expected}" })`;
|
|
100
|
+
if (canonicalUnit(d.unit) !== canonicalUnit(expected))
|
|
101
|
+
return `unit "${d.unit}" does not match required "${expected}"`;
|
|
102
|
+
return undefined;
|
|
103
|
+
}
|
|
104
|
+
const xUnit = (expected, data) => {
|
|
105
|
+
const message = unitError(expected, data);
|
|
106
|
+
xUnit.errors = message
|
|
107
|
+
? [{ keyword: 'x-unit', message, params: { unit: expected } }]
|
|
108
|
+
: [];
|
|
109
|
+
return message === undefined;
|
|
110
|
+
};
|
|
111
|
+
ajv.addKeyword({
|
|
112
|
+
keyword: 'x-unit',
|
|
113
|
+
schemaType: 'string',
|
|
114
|
+
errors: true,
|
|
115
|
+
validate: xUnit
|
|
116
|
+
});
|
|
117
|
+
/** Strict mode still allows "x-*" extension keys: register each unknown one as a no-op annotation. */
|
|
118
|
+
function allowExtensions(schema) {
|
|
119
|
+
if (typeof schema !== 'object' || schema === null)
|
|
120
|
+
return;
|
|
121
|
+
for (const [k, v] of Object.entries(schema)) {
|
|
122
|
+
if (k.startsWith('x-') && !ajv.getKeyword(k))
|
|
123
|
+
ajv.addKeyword(k);
|
|
124
|
+
allowExtensions(v);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
export function checkSchema(t) {
|
|
128
|
+
return timed({
|
|
129
|
+
id: 'schema.conformance',
|
|
130
|
+
kind: 'deterministic',
|
|
131
|
+
source: { name: 'JSON Schema (ajv)' }
|
|
132
|
+
}, async () => {
|
|
133
|
+
allowExtensions(t.schema);
|
|
134
|
+
const validate = ajv.compile(t.schema);
|
|
135
|
+
const findings = [];
|
|
136
|
+
try {
|
|
137
|
+
t.records.forEach((rec, i) => {
|
|
138
|
+
if (!validate(rec)) {
|
|
139
|
+
for (const e of validate.errors ?? []) {
|
|
140
|
+
findings.push({
|
|
141
|
+
severity: e.keyword === 'x-unit' ? 'high' : 'medium',
|
|
142
|
+
message: `record ${i}: ${e.instancePath || '/'} ${e.message ?? 'invalid'}`,
|
|
143
|
+
ref: `/${i}${e.instancePath}`
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
finally {
|
|
150
|
+
// Ajv caches every compiled schema: without this the cache grows per call and a repeated $id throws.
|
|
151
|
+
ajv.removeSchema(t.schema);
|
|
152
|
+
}
|
|
153
|
+
return { status: findings.length ? 'fail' : 'pass', findings };
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
/* ---------------- dataset: freshness/volume/lineage (observability) ---------------- */
|
|
157
|
+
/**
|
|
158
|
+
* Adapter point for Monte Carlo, Soda, Elementary, etc. Either call their
|
|
159
|
+
* API directly, or have this server act as an MCP *client* to their server.
|
|
160
|
+
* Until configured, this reports "skipped" (which keeps the verdict "unknown").
|
|
161
|
+
*/
|
|
162
|
+
export function checkObservability(t) {
|
|
163
|
+
return timed({
|
|
164
|
+
id: 'observability.health',
|
|
165
|
+
kind: 'deterministic',
|
|
166
|
+
source: { name: 'observability adapter' }
|
|
167
|
+
}, async () => t.assetId
|
|
168
|
+
? { status: 'skipped', reason: 'No observability provider configured' }
|
|
169
|
+
: { status: 'skipped', reason: 'No assetId given' });
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Runs c2patool (from c2pa-rs) read-only. EVIDENCE_REPORT_MCP_C2PATOOL is the binary's path. Trust
|
|
173
|
+
* anchors come from c2patool's own env (C2PATOOL_TRUST_ANCHORS, C2PATOOL_TRUST_CONFIG,
|
|
174
|
+
* C2PATOOL_ALLOWED_LIST), which it only reads under the `trust` subcommand.
|
|
175
|
+
*
|
|
176
|
+
* Only a trusted signer passes. A missing manifest is NOT a fail (absence of credentials
|
|
177
|
+
* proves nothing) and a valid manifest from an untrusted signer proves only that someone
|
|
178
|
+
* signed it, so both stay "skipped" and keep the verdict "unknown".
|
|
179
|
+
*/
|
|
180
|
+
export function checkC2pa(t) {
|
|
181
|
+
const tool = process.env.EVIDENCE_REPORT_MCP_C2PATOOL;
|
|
182
|
+
return timed({
|
|
183
|
+
id: 'c2pa.manifest',
|
|
184
|
+
kind: 'deterministic',
|
|
185
|
+
source: { name: tool ? 'c2patool' : 'C2PA validator' }
|
|
186
|
+
}, async () => {
|
|
187
|
+
if (!tool)
|
|
188
|
+
return {
|
|
189
|
+
status: 'skipped',
|
|
190
|
+
reason: 'C2PA validator not configured (set EVIDENCE_REPORT_MCP_C2PATOOL)'
|
|
191
|
+
};
|
|
192
|
+
let stdout;
|
|
193
|
+
try {
|
|
194
|
+
// Absolute path, so a target like "-o/x" can never be parsed as a c2patool flag.
|
|
195
|
+
({ stdout } = await execFileP(tool, [resolve(t.path), 'trust'], {
|
|
196
|
+
timeout: 30_000,
|
|
197
|
+
maxBuffer: 16 * 1024 * 1024
|
|
198
|
+
}));
|
|
199
|
+
}
|
|
200
|
+
catch (err) {
|
|
201
|
+
if (/No claim found/.test(String(err.stderr))) {
|
|
202
|
+
return {
|
|
203
|
+
status: 'skipped',
|
|
204
|
+
reason: 'No C2PA manifest found; absence of credentials proves nothing'
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
throw err;
|
|
208
|
+
}
|
|
209
|
+
const report = JSON.parse(stdout);
|
|
210
|
+
const findings = (report.validation_status ?? []).map((s) => ({
|
|
211
|
+
severity: s.code === 'signingCredential.untrusted' ? 'medium' : 'high',
|
|
212
|
+
message: s.explanation ? `${s.code}: ${s.explanation}` : s.code,
|
|
213
|
+
ref: s.url
|
|
214
|
+
}));
|
|
215
|
+
switch (report.validation_state) {
|
|
216
|
+
case 'Trusted':
|
|
217
|
+
return { status: 'pass', findings };
|
|
218
|
+
case 'Invalid':
|
|
219
|
+
return { status: 'fail', findings };
|
|
220
|
+
case 'Valid':
|
|
221
|
+
return {
|
|
222
|
+
status: 'skipped',
|
|
223
|
+
reason: 'Manifest is intact but its signer is not trusted (configure C2PATOOL_TRUST_ANCHORS)',
|
|
224
|
+
findings
|
|
225
|
+
};
|
|
226
|
+
default:
|
|
227
|
+
throw new Error(`Unexpected c2patool validation_state: ${String(report.validation_state)}`);
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
/* ---------------- claim: independent corroboration ---------------- */
|
|
232
|
+
/**
|
|
233
|
+
* Heuristic by design. Deliberately does not ask an LLM whether the claim is
|
|
234
|
+
* "plausible": that is the generator grading its own homework.
|
|
235
|
+
* A real version would fetch each source and check it independently.
|
|
236
|
+
*/
|
|
237
|
+
export function checkCorroboration(t) {
|
|
238
|
+
return timed({
|
|
239
|
+
id: 'claim.corroboration',
|
|
240
|
+
kind: 'heuristic',
|
|
241
|
+
source: { name: 'provided sources' }
|
|
242
|
+
}, async () => {
|
|
243
|
+
const domains = new Set(t.sources.map((s) => new URL(s).hostname.replace(/^www\./, '')));
|
|
244
|
+
if (domains.size < 2) {
|
|
245
|
+
return {
|
|
246
|
+
status: 'fail',
|
|
247
|
+
reason: 'Fewer than two independent source domains',
|
|
248
|
+
findings: [
|
|
249
|
+
{
|
|
250
|
+
severity: 'medium',
|
|
251
|
+
message: `Only ${domains.size} distinct source domain(s)`
|
|
252
|
+
}
|
|
253
|
+
]
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
return {
|
|
257
|
+
status: 'skipped',
|
|
258
|
+
reason: 'Source fetching and matching not implemented'
|
|
259
|
+
};
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
export function plan(t) {
|
|
263
|
+
switch (t.kind) {
|
|
264
|
+
case 'package':
|
|
265
|
+
return {
|
|
266
|
+
checks: [checkOsv(t)],
|
|
267
|
+
required: ['osv.vulnerabilities'],
|
|
268
|
+
notChecked: [
|
|
269
|
+
'Unpublished or zero-day vulnerabilities',
|
|
270
|
+
'Malicious behaviour without an advisory (typosquats, install scripts)',
|
|
271
|
+
'Whether this package is the right one for the job'
|
|
272
|
+
]
|
|
273
|
+
};
|
|
274
|
+
case 'dataset':
|
|
275
|
+
return {
|
|
276
|
+
checks: [checkSchema(t), checkObservability(t)],
|
|
277
|
+
required: ['schema.conformance', 'observability.health'],
|
|
278
|
+
notChecked: [
|
|
279
|
+
'Whether values are true, only whether they are well-formed',
|
|
280
|
+
'Meaning of units and labels beyond what the schema encodes',
|
|
281
|
+
'Records outside the provided sample'
|
|
282
|
+
]
|
|
283
|
+
};
|
|
284
|
+
case 'file':
|
|
285
|
+
return {
|
|
286
|
+
checks: [checkC2pa(t)],
|
|
287
|
+
required: ['c2pa.manifest'],
|
|
288
|
+
notChecked: [
|
|
289
|
+
'Whether the depicted content is true or in context',
|
|
290
|
+
'Files whose credentials were stripped in transit',
|
|
291
|
+
'Signers outside the configured trust anchors',
|
|
292
|
+
'Ingredient manifests (earlier edits), only the active manifest'
|
|
293
|
+
]
|
|
294
|
+
};
|
|
295
|
+
case 'claim':
|
|
296
|
+
return {
|
|
297
|
+
checks: [checkCorroboration(t)],
|
|
298
|
+
required: ['claim.corroboration'],
|
|
299
|
+
notChecked: [
|
|
300
|
+
'Interpretation: what the claim means to its audience',
|
|
301
|
+
'Whether the cited sources are themselves reliable'
|
|
302
|
+
]
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
//# sourceMappingURL=checkers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkers.js","sourceRoot":"","sources":["../src/checkers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAA+B,MAAM,KAAK,CAAC;AAEvD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,EAAE,WAAW,EAAgB,MAAM,eAAe,CAAC;AAG1D,MAAM,SAAS,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AAItC,MAAM,GAAG,GAAG,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;AAE3C,0FAA0F;AAC1F,KAAK,UAAU,KAAK,CAClB,IAEC,EACD,GAIE;IAE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","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
|
package/dist/cli.js
ADDED
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAEjF,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,MAAM,YAAY,EAAE,CAAC,OAAO,CAAC,IAAI,oBAAoB,EAAE,CAAC,CAAC"}
|
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
+
import { Target, type CheckResult, type EvidenceReport, type Verdict } from './types.js';
|
|
3
|
+
export type { CheckKind, CheckResult, CheckStatus, EvidenceReport, Finding, Target, Verdict } from './types.js';
|
|
4
|
+
/**
|
|
5
|
+
* Fail closed:
|
|
6
|
+
* 1. Any failed check -> "fail"
|
|
7
|
+
* 2. Any required check not run -> "unknown" (unknown is not zero)
|
|
8
|
+
* 3. Only heuristics passed -> "unknown" (judgment can't certify)
|
|
9
|
+
* 4. Otherwise -> "pass"
|
|
10
|
+
*/
|
|
11
|
+
export declare function aggregate(checks: CheckResult[], required: string[]): Verdict;
|
|
12
|
+
export declare function verify(target: Target): Promise<EvidenceReport>;
|
|
13
|
+
export declare function createServer(): McpServer;
|
|
14
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAKpE,OAAO,EACL,MAAM,EACN,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,OAAO,EACb,MAAM,YAAY,CAAC;AAGpB,YAAY,EACV,SAAS,EACT,WAAW,EACX,WAAW,EACX,cAAc,EACd,OAAO,EACP,MAAM,EACN,OAAO,EACR,MAAM,YAAY,CAAC;AAUpB;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,WAAW,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAW5E;AAcD,wBAAsB,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAcpE;AAED,wBAAgB,YAAY,IAAI,SAAS,CA0BxC"}
|