saktum 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +2 -1
  2. package/package.json +1 -1
  3. package/saktum.mjs +66 -4
package/README.md CHANGED
@@ -59,13 +59,14 @@ grade. Every report ends with **OWASP MCP Top 10 coverage**: which categories th
59
59
  | `saktum snapshot -- <server>` | Writes `saktum.lock.json`, a lock file of your tools |
60
60
  | `saktum diff saktum.lock.json -- <server>` | Breaking changes (removed tools, new required fields, changed types), changes to review (descriptions, annotations: silent tool changes), additions, and the version bump they need; fails CI on breaking or risky changes |
61
61
  | `saktum docs -- <server>` | A Markdown tools table and ready-to-paste configuration for Claude Desktop, Cursor and VS Code |
62
+ | `saktum allowlist reports/*.json` | An allowlist for MCP firewalls and gateways: only servers meeting your grades, each pinned to the exact tools that were checked (signatures verified first) |
62
63
  | `saktum packet saktum-report.json` | A printable **security packet** for customers' security reviews, built from a verified signed result, with a section for your own statements (clearly marked as not verified) |
63
64
 
64
65
  ## In CI (GitHub Action)
65
66
 
66
67
  ```yaml
67
68
  - uses: actions/checkout@v4
68
- - uses: soodhere/saktum-check@v0.3.1
69
+ - uses: soodhere/saktum-check@v0.3.2
69
70
  with:
70
71
  target: "-- node build/index.js" # or an https URL
71
72
  args: "--active --tests saktum.tests.yaml" # optional; --active only for your own server
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "saktum",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "Test MCP servers in one command: conformance, sign-in, security (OWASP MCP Top 10), agent experience, context cost and performance.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
package/saktum.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- // Saktum Check 0.3.1 (private beta). Licensed Apache-2.0; bundled dependencies keep their own licences.
2
+ // Saktum Check 0.3.2 (private beta). Licensed Apache-2.0; bundled dependencies keep their own licences.
3
3
  import { createRequire as __saktumCreateRequire } from "node:module";
4
4
  const require = __saktumCreateRequire(import.meta.url);
5
5
  var __create = Object.create;
@@ -20463,6 +20463,48 @@ function clientCompatibility(tools) {
20463
20463
  issues.push(`${tools.length} tools: some clients limit how many tools they load or show; check your target clients and consider grouping or splitting the server`);
20464
20464
  return issues;
20465
20465
  }
20466
+ var GRADES = ["A", "B", "C", "D", "F"];
20467
+ var atLeast = (g, min) => g != null && GRADES.indexOf(g) <= GRADES.indexOf(min);
20468
+ function buildAllowlist(results, criteria) {
20469
+ const allowed = [], excluded = [];
20470
+ for (const { result: r, signedBy } of results) {
20471
+ const server = String(r.target.serverInfo?.["name"] ?? r.target.description);
20472
+ const why = [];
20473
+ if (!atLeast(r.grade, criteria.minTrust))
20474
+ why.push(`trust ${r.grade ?? "not graded"} is below ${criteria.minTrust}`);
20475
+ if (!atLeast(r.readiness?.grade, criteria.minReadiness))
20476
+ why.push(`agent readiness ${r.readiness?.grade ?? "not graded"} is below ${criteria.minReadiness}`);
20477
+ if (criteria.noFailedCritical && r.findings.some((f) => f.severity === "critical" && f.status === "fail" && !f.suppressed))
20478
+ why.push("a critical check failed");
20479
+ if (!r.target.toolsFingerprint)
20480
+ why.push("no tool fingerprint to pin");
20481
+ if (why.length) {
20482
+ excluded.push({ server, reason: why.join("; ") });
20483
+ continue;
20484
+ }
20485
+ allowed.push({
20486
+ server,
20487
+ version: r.target.serverInfo?.["version"],
20488
+ transport: r.target.transport,
20489
+ target: r.target.description,
20490
+ toolsFingerprint: r.target.toolsFingerprint,
20491
+ toolCount: r.target.toolCount,
20492
+ trustGrade: r.grade ?? null,
20493
+ readinessGrade: r.readiness?.grade ?? null,
20494
+ checkedAt: r.run.startedAt,
20495
+ checkedWith: `Saktum Check ${r.tool.version}`,
20496
+ signedBy
20497
+ });
20498
+ }
20499
+ return {
20500
+ allowlistFormat: "0.1",
20501
+ generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
20502
+ criteria,
20503
+ allowed,
20504
+ excluded,
20505
+ note: "Allow each server only while its tools match toolsFingerprint; re-check after any change (saktum diff). Self-tested evidence (assurance L1) unless stated otherwise."
20506
+ };
20507
+ }
20466
20508
 
20467
20509
  // node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/util.js
20468
20510
  var util_exports = {};
@@ -32276,7 +32318,7 @@ var StreamableHTTPClientTransport = class {
32276
32318
  };
32277
32319
 
32278
32320
  // packages/transports/dist/index.js
32279
- var USER_AGENT = "saktum-check/0.3.1 (+https://saktum.dev/check)";
32321
+ var USER_AGENT = "saktum-check/0.3.2 (+https://saktum.dev/check)";
32280
32322
  var LIMITS = { requestTimeoutMs: 1e4, connectTimeoutMs: 6e4, maxResponseChars: 5e6 };
32281
32323
  var LimitError = class extends Error {
32282
32324
  };
@@ -32411,7 +32453,7 @@ var INIT_BODY = JSON.stringify({
32411
32453
  jsonrpc: "2.0",
32412
32454
  id: 1,
32413
32455
  method: "initialize",
32414
- params: { protocolVersion: "2025-06-18", capabilities: {}, clientInfo: { name: "saktum-trust-check-probe", version: "0.3.1" } }
32456
+ params: { protocolVersion: "2025-06-18", capabilities: {}, clientInfo: { name: "saktum-trust-check-probe", version: "0.3.2" } }
32415
32457
  });
32416
32458
  async function httpRequest(url2, init = {}) {
32417
32459
  const t0 = Date.now();
@@ -33478,7 +33520,7 @@ async function measureLoad(session, op) {
33478
33520
  }
33479
33521
 
33480
33522
  // packages/testkit-core/dist/engine.js
33481
- var ENGINE_VERSION = "0.3.1";
33523
+ var ENGINE_VERSION = "0.3.2";
33482
33524
  var UNKNOWN_TOOL = "saktum_trust_check_no_such_tool";
33483
33525
  var INVALID_TOKEN = "saktum-check-deliberately-invalid-token";
33484
33526
  function isProtocolFailure(e) {
@@ -34218,6 +34260,26 @@ ${d.summary}
34218
34260
  throw new Error(`The result's signature is not valid (${v.reason}); a packet must be built from an unaltered signed result.`);
34219
34261
  writeFileSync2(o.out, renderPacket(doc, v.kid));
34220
34262
  process.stdout.write(`Wrote ${sanitizeText(o.out)}: open it in a browser and print to PDF. Send it with ${sanitizeText(file)} so customers can verify it.
34263
+ `);
34264
+ });
34265
+ program2.command("allowlist").description("Build an allowlist for MCP firewalls and gateways from signed results: only servers meeting your criteria, pinned to the tools that were checked").argument("<results...>", "signed results (saktum-report.json files)").option("--min-trust <grade>", "minimum trust grade", "A").option("--min-readiness <grade>", "minimum agent-readiness grade", "B").option("--allow-critical", "do not exclude servers with a failed critical check", false).option("--out <file>", "allowlist file", "saktum-allowlist.json").action((files, o) => {
34266
+ const inputs = files.map((f) => {
34267
+ const doc = JSON.parse(readFileSync4(f, "utf8"));
34268
+ const v = verifyDocument(doc);
34269
+ if (!v.valid)
34270
+ throw new Error(`${f}: signature not valid (${v.reason}); only unaltered signed results can be allowlisted.`);
34271
+ return { result: doc, signedBy: v.kid };
34272
+ });
34273
+ const list = buildAllowlist(inputs, { minTrust: o.minTrust.toUpperCase(), minReadiness: o.minReadiness.toUpperCase(), noFailedCritical: !o.allowCritical });
34274
+ writeFileSync2(o.out, JSON.stringify(list, null, 2) + "\n");
34275
+ for (const a of list.allowed)
34276
+ process.stdout.write(`\u2713 ${sanitizeText(a.server, 60)} ${sanitizeText(a.version ?? "", 20)} trust ${a.trustGrade} \xB7 readiness ${a.readinessGrade} \xB7 ${a.toolCount} tools pinned
34277
+ `);
34278
+ for (const x of list.excluded)
34279
+ process.stdout.write(`\u2717 ${sanitizeText(x.server, 60)}: ${sanitizeText(x.reason, 200)}
34280
+ `);
34281
+ process.stdout.write(`
34282
+ Wrote ${sanitizeText(o.out)}: ${list.allowed.length} allowed, ${list.excluded.length} excluded.
34221
34283
  `);
34222
34284
  });
34223
34285
  program2.command("doctor").description("Check your environment, and why a server will not start or connect").argument("[target...]", "optional: the same target you would pass to check").option("--env <KEY=VALUE>", "environment variable for a local server (repeatable)", collect, []).option("--header <Name: value>", "HTTP header for a remote server (repeatable)", collect, []).action(async (targetParts, o) => {