@primitivehub/mcp-server 0.1.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.
@@ -0,0 +1,167 @@
1
+ /**
2
+ * MCP tool: `verify_before_load`
3
+ *
4
+ * The composite runtime gate. Per ADR-0029, every agent runtime that
5
+ * loads agent-context primitives MUST consult this tool before reading
6
+ * the content. Refuses-by-default for:
7
+ * - missing lock (operator hasn't sealed anything)
8
+ * - lock spec-version mismatch (Top 10 ratcheted; re-seal required)
9
+ * - drift (working tree differs from lock)
10
+ * - unattested artifacts (with requireAttestation set)
11
+ * - scanner findings (T1/T2/T5 at v0.1)
12
+ * - invalid Trust Bundle (when one is provided)
13
+ *
14
+ * Pure transport per ADR-0031 § 2 rule #1. Combines two existing
15
+ * primitives:
16
+ * - `verifyBeforeLoad` from @primitivehub/phub (workspace + lock + scan)
17
+ * - `verifyBundle` from @primitivehub/verify (cryptographic bundle)
18
+ *
19
+ * If a future ADR changes any check semantics, it changes in phub /
20
+ * verify; this file inherits the new behavior with zero edits.
21
+ */
22
+ import { verifyBundle } from "@primitivehub/verify";
23
+ import { verifyBeforeLoad } from "@primitivehub/phub";
24
+ export const VERIFY_BEFORE_LOAD_TOOL = {
25
+ name: "verify_before_load",
26
+ description: "Composite runtime gate. Call this BEFORE loading any agent-context primitive — refuses-by-default for drift, unattested artifacts, scanner findings, or invalid Trust Bundles. Returns {safe, reasons[], checks}. The composite of check_lock + scan_text + (optional) verify_bundle.",
27
+ inputSchema: {
28
+ type: "object",
29
+ additionalProperties: false,
30
+ required: ["path"],
31
+ properties: {
32
+ path: {
33
+ type: "string",
34
+ description: "The artifact path to gate (relative to workspace_root, or absolute). The agent's 'I'm about to read this file' anchor.",
35
+ },
36
+ workspace_root: {
37
+ type: "string",
38
+ description: "Workspace root. Defaults to the server's cwd.",
39
+ },
40
+ policy_path: {
41
+ type: "string",
42
+ description: "Path to .primitivehub/policy.yaml. Auto-discover if absent.",
43
+ },
44
+ lock_path: {
45
+ type: "string",
46
+ description: "Explicit lock path. Auto-discover if absent.",
47
+ },
48
+ require_attestation: {
49
+ type: "boolean",
50
+ description: "If true, an 'unattested' lock entry counts as unsafe. Use when consuming registry primitives that should carry rekor:* or registry:* attestations. Default false (matches v0.1 lock semantics).",
51
+ },
52
+ bundle: {
53
+ description: "Optional Trust Bundle (JSON string OR parsed object). When provided, verify_bundle runs at the requested level and contributes its failures to the unsafe reasons.",
54
+ oneOf: [{ type: "string" }, { type: "object" }],
55
+ },
56
+ level: {
57
+ type: "string",
58
+ enum: ["structural", "policy", "full"],
59
+ description: "Bundle verification depth. Only meaningful when 'bundle' is provided. Default 'policy'.",
60
+ },
61
+ },
62
+ },
63
+ };
64
+ export async function callVerifyBeforeLoad(rawArgs) {
65
+ const args = (rawArgs ?? {});
66
+ if (typeof args.path !== "string" || args.path.length === 0) {
67
+ return errorResponse("path argument is required (non-empty string)");
68
+ }
69
+ // Run the workspace/lock/scan gate first.
70
+ let phubResult;
71
+ try {
72
+ const opts = {
73
+ workspaceRoot: args.workspace_root ?? process.cwd(),
74
+ path: args.path,
75
+ };
76
+ if (args.policy_path !== undefined)
77
+ opts.policyPath = args.policy_path;
78
+ if (args.lock_path !== undefined)
79
+ opts.lockPath = args.lock_path;
80
+ if (args.require_attestation !== undefined)
81
+ opts.requireAttestation = args.require_attestation;
82
+ phubResult = verifyBeforeLoad(opts);
83
+ }
84
+ catch (err) {
85
+ const msg = err instanceof Error ? err.message : String(err);
86
+ return errorResponse(`workspace gate failed: ${msg}`);
87
+ }
88
+ let safe = phubResult.safe;
89
+ const reasons = [...phubResult.reasons];
90
+ let bundleCheck = null;
91
+ // Optional bundle verification.
92
+ if (args.bundle !== undefined) {
93
+ let parsedBundle;
94
+ if (typeof args.bundle === "string") {
95
+ try {
96
+ parsedBundle = JSON.parse(args.bundle);
97
+ }
98
+ catch (err) {
99
+ const msg = err instanceof Error ? err.message : String(err);
100
+ reasons.push({
101
+ code: "BUNDLE_PARSE_ERROR",
102
+ message: `bundle string is not valid JSON: ${msg}`,
103
+ });
104
+ safe = false;
105
+ bundleCheck = { provided: true, parsed: false };
106
+ }
107
+ }
108
+ else if (typeof args.bundle === "object" && args.bundle !== null) {
109
+ parsedBundle = args.bundle;
110
+ }
111
+ else {
112
+ reasons.push({
113
+ code: "BUNDLE_PARSE_ERROR",
114
+ message: "bundle must be a JSON string or parsed object",
115
+ });
116
+ safe = false;
117
+ bundleCheck = { provided: true, parsed: false };
118
+ }
119
+ if (parsedBundle !== undefined) {
120
+ const verifyResult = await verifyBundle(parsedBundle, { level: args.level ?? "policy" });
121
+ bundleCheck = {
122
+ provided: true,
123
+ parsed: true,
124
+ valid: verifyResult.valid,
125
+ level: verifyResult.level,
126
+ failureCodes: verifyResult.failures.map((f) => f.code),
127
+ deferredSteps: verifyResult.deferredSteps,
128
+ };
129
+ if (!verifyResult.valid) {
130
+ safe = false;
131
+ for (const f of verifyResult.failures) {
132
+ reasons.push({
133
+ code: `BUNDLE_${f.code}`,
134
+ message: f.message + (f.path ? ` (at ${f.path})` : ""),
135
+ });
136
+ }
137
+ }
138
+ }
139
+ }
140
+ else {
141
+ bundleCheck = { provided: false };
142
+ }
143
+ const payload = {
144
+ safe,
145
+ reasons,
146
+ checks: {
147
+ ...phubResult.checks,
148
+ bundle: bundleCheck,
149
+ },
150
+ };
151
+ return {
152
+ content: [{ type: "text", text: JSON.stringify(payload, null, 2) }],
153
+ isError: !safe,
154
+ };
155
+ }
156
+ function errorResponse(message) {
157
+ return {
158
+ content: [
159
+ {
160
+ type: "text",
161
+ text: JSON.stringify({ safe: false, reasons: [{ code: "USAGE_ERROR", message }], checks: null }, null, 2),
162
+ },
163
+ ],
164
+ isError: true,
165
+ };
166
+ }
167
+ //# sourceMappingURL=verify-before-load.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verify-before-load.js","sourceRoot":"","sources":["../../src/tools/verify-before-load.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;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AACH,CAAC"}
@@ -0,0 +1,56 @@
1
+ /**
2
+ * MCP tool: `verify_bundle`
3
+ *
4
+ * Thin wrapper around `@primitivehub/verify`'s `verifyBundle`.
5
+ * Zero custom trust logic — every behavioral question is delegated
6
+ * to the verify reference implementation (ADR-0020).
7
+ *
8
+ * Tool input/output schemas mirror the verify library's public types.
9
+ * When verify v0.2 unstubs cryptographic steps 3-6, this tool gets
10
+ * the new behavior for free.
11
+ */
12
+ export declare const VERIFY_BUNDLE_TOOL: {
13
+ readonly name: "verify_bundle";
14
+ readonly description: "Verify a PrimitiveHub Trust Bundle against the v0.1 wire format. Runs schema validation, content-digest verification, and Context CI policy evaluation. Steps 3-6 (signature/cert/Rekor) are stubbed in v0.1 — pass level: 'full' to see DEFERRED failures. All verification runs locally; no network calls.";
15
+ readonly inputSchema: {
16
+ readonly type: "object";
17
+ readonly additionalProperties: false;
18
+ readonly required: readonly ["bundle"];
19
+ readonly properties: {
20
+ readonly bundle: {
21
+ readonly description: "The Trust Bundle as a JSON string OR a pre-parsed JSON object. Strings are JSON.parse'd before verification.";
22
+ readonly oneOf: readonly [{
23
+ readonly type: "string";
24
+ }, {
25
+ readonly type: "object";
26
+ }];
27
+ };
28
+ readonly level: {
29
+ readonly type: "string";
30
+ readonly enum: readonly ["structural", "policy", "full"];
31
+ readonly description: "Verification depth. 'structural' = schema + digest (steps 1+2). 'policy' (default) = + Context CI policy (steps 1+2+7). 'full' = + signature/cert/Rekor (steps 1-7; steps 3-6 stubbed in v0.1).";
32
+ };
33
+ readonly strict: {
34
+ readonly type: "boolean";
35
+ readonly description: "Treat predicate WARN verdicts as FAIL during policy evaluation.";
36
+ };
37
+ readonly allow_fail_for: {
38
+ readonly type: "array";
39
+ readonly items: {
40
+ readonly type: "string";
41
+ };
42
+ readonly description: "Detector names, CCI IDs, or threat categories that are permitted to FAIL without rejecting the bundle.";
43
+ };
44
+ };
45
+ };
46
+ };
47
+ export interface VerifyBundleResultText {
48
+ type: "text";
49
+ text: string;
50
+ }
51
+ /** Call shape for the MCP server's CallToolRequestSchema handler. */
52
+ export declare function callVerifyBundle(rawArgs: unknown): Promise<{
53
+ content: VerifyBundleResultText[];
54
+ isError: boolean;
55
+ }>;
56
+ //# sourceMappingURL=verify-bundle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verify-bundle.d.ts","sourceRoot":"","sources":["../../src/tools/verify-bundle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BrB,CAAA;AASV,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;CACb;AAED,qEAAqE;AACrE,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,OAAO,GACf,OAAO,CAAC;IAAE,OAAO,EAAE,sBAAsB,EAAE,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,CAkClE"}
@@ -0,0 +1,84 @@
1
+ /**
2
+ * MCP tool: `verify_bundle`
3
+ *
4
+ * Thin wrapper around `@primitivehub/verify`'s `verifyBundle`.
5
+ * Zero custom trust logic — every behavioral question is delegated
6
+ * to the verify reference implementation (ADR-0020).
7
+ *
8
+ * Tool input/output schemas mirror the verify library's public types.
9
+ * When verify v0.2 unstubs cryptographic steps 3-6, this tool gets
10
+ * the new behavior for free.
11
+ */
12
+ import { verifyBundle } from "@primitivehub/verify";
13
+ export const VERIFY_BUNDLE_TOOL = {
14
+ name: "verify_bundle",
15
+ description: "Verify a PrimitiveHub Trust Bundle against the v0.1 wire format. Runs schema validation, content-digest verification, and Context CI policy evaluation. Steps 3-6 (signature/cert/Rekor) are stubbed in v0.1 — pass level: 'full' to see DEFERRED failures. All verification runs locally; no network calls.",
16
+ inputSchema: {
17
+ type: "object",
18
+ additionalProperties: false,
19
+ required: ["bundle"],
20
+ properties: {
21
+ bundle: {
22
+ description: "The Trust Bundle as a JSON string OR a pre-parsed JSON object. Strings are JSON.parse'd before verification.",
23
+ oneOf: [{ type: "string" }, { type: "object" }],
24
+ },
25
+ level: {
26
+ type: "string",
27
+ enum: ["structural", "policy", "full"],
28
+ description: "Verification depth. 'structural' = schema + digest (steps 1+2). 'policy' (default) = + Context CI policy (steps 1+2+7). 'full' = + signature/cert/Rekor (steps 1-7; steps 3-6 stubbed in v0.1).",
29
+ },
30
+ strict: {
31
+ type: "boolean",
32
+ description: "Treat predicate WARN verdicts as FAIL during policy evaluation.",
33
+ },
34
+ allow_fail_for: {
35
+ type: "array",
36
+ items: { type: "string" },
37
+ description: "Detector names, CCI IDs, or threat categories that are permitted to FAIL without rejecting the bundle.",
38
+ },
39
+ },
40
+ },
41
+ };
42
+ /** Call shape for the MCP server's CallToolRequestSchema handler. */
43
+ export async function callVerifyBundle(rawArgs) {
44
+ const args = (rawArgs ?? {});
45
+ let parsedBundle;
46
+ if (typeof args.bundle === "string") {
47
+ try {
48
+ parsedBundle = JSON.parse(args.bundle);
49
+ }
50
+ catch (err) {
51
+ const msg = err instanceof Error ? err.message : String(err);
52
+ return errorResponse(`bundle string is not valid JSON: ${msg}`);
53
+ }
54
+ }
55
+ else if (typeof args.bundle === "object" && args.bundle !== null) {
56
+ parsedBundle = args.bundle;
57
+ }
58
+ else {
59
+ return errorResponse("bundle argument is required (string or object)");
60
+ }
61
+ const result = await verifyBundle(parsedBundle, {
62
+ level: args.level ?? "policy",
63
+ policy: {
64
+ strict: args.strict ?? false,
65
+ allowFailFor: args.allow_fail_for ?? [],
66
+ },
67
+ });
68
+ return {
69
+ content: [
70
+ {
71
+ type: "text",
72
+ text: JSON.stringify(result, null, 2),
73
+ },
74
+ ],
75
+ isError: !result.valid,
76
+ };
77
+ }
78
+ function errorResponse(message) {
79
+ return {
80
+ content: [{ type: "text", text: JSON.stringify({ valid: false, error: message }, null, 2) }],
81
+ isError: true,
82
+ };
83
+ }
84
+ //# sourceMappingURL=verify-bundle.js.map
@@ -0,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0",
4
+ "description": "MCP server exposing PrimitiveHub verification + scanning to AI agents (Claude, Cursor, Aider, …). Pure transport over @primitivehub/verify + @primitivehub/phub — zero custom trust logic.",
5
+ "license": "MIT",
6
+ "author": "PrimitiveHub AI / CyberOrca Labs",
7
+ "homepage": "https://primitivehub.ai",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/PrimitiveHub-AI/context-ci.git",
11
+ "directory": "packages/mcp-server"
12
+ },
13
+ "bugs": {
14
+ "url": "https://github.com/PrimitiveHub-AI/context-ci/issues"
15
+ },
16
+ "type": "module",
17
+ "bin": {
18
+ "primitivehub-mcp": "./bin/primitivehub-mcp.js"
19
+ },
20
+ "main": "./dist/index.js",
21
+ "types": "./dist/index.d.ts",
22
+ "exports": {
23
+ ".": {
24
+ "types": "./dist/index.d.ts",
25
+ "import": "./dist/index.js"
26
+ }
27
+ },
28
+ "sideEffects": false,
29
+ "files": [
30
+ "bin",
31
+ "dist",
32
+ "README.md",
33
+ "LICENSE",
34
+ "CHANGELOG.md"
35
+ ],
36
+ "publishConfig": {
37
+ "access": "public",
38
+ "provenance": true
39
+ },
40
+ "engines": {
41
+ "node": ">=20"
42
+ },
43
+ "dependencies": {
44
+ "@modelcontextprotocol/sdk": "^1.0.0",
45
+ "@primitivehub/verify": "^0.1.0",
46
+ "@primitivehub/phub": "^0.1.0"
47
+ },
48
+ "devDependencies": {
49
+ "@types/node": "^22",
50
+ "typescript": "5.7.3",
51
+ "vitest": "^2.1.0"
52
+ },
53
+ "keywords": [
54
+ "primitivehub",
55
+ "mcp",
56
+ "model-context-protocol",
57
+ "ai-agent",
58
+ "context-ci",
59
+ "trust-bundle",
60
+ "verifier",
61
+ "supply-chain-security",
62
+ "claude",
63
+ "cursor"
64
+ ],
65
+ "scripts": {
66
+ "build": "tsc",
67
+ "test": "vitest run",
68
+ "test:watch": "vitest",
69
+ "typecheck": "tsc --noEmit"
70
+ }
71
+ }