saktum 0.3.1 → 0.4.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.
Files changed (3) hide show
  1. package/README.md +83 -1
  2. package/package.json +32 -6
  3. package/saktum.mjs +15193 -11731
package/README.md CHANGED
@@ -11,6 +11,19 @@ npx saktum check https://your-server.example/mcp # a remote server (sign-in
11
11
 
12
12
  Runs on your machine. Nothing is uploaded. Your own environment variables are never passed to the server.
13
13
 
14
+ ## Start here
15
+
16
+ | I want to… | Run |
17
+ | --- | --- |
18
+ | **Test an MCP server** | `npx saktum check -- npx -y some-mcp-server` (or `npx saktum check https://your-server/mcp`) |
19
+ | **Start a new MCP server** that earns top grades from the first commit | `npx saktum init my-server --lang ts` (or `--lang py`) |
20
+ | **Let my coding agent test and fix servers** | Claude Code: `claude mcp add saktum -- npx -y saktum mcp` · Cursor and VS Code: one-click buttons at [saktum.vercel.app](https://saktum.vercel.app) |
21
+ | **Check my whole agent set-up** (cost, duplicate tools, unvetted servers) | `npx saktum scan-config` |
22
+
23
+ | **Govern MCP use across my organisation** (inventory, policy as code, evidence) | See [docs/ENTERPRISE.md](docs/ENTERPRISE.md): `saktum fleet`, `--policy`, allowlists, security packets |
24
+
25
+ Everything else (CI, test cases, lint, diff, allowlists, attestations, security packets) is below.
26
+
14
27
  ## What you get
15
28
 
16
29
  ```
@@ -51,6 +64,71 @@ grade. Every report ends with **OWASP MCP Top 10 coverage**: which categories th
51
64
  `npx saktum checks` lists every check with the standard behind it ([docs/CHECKS.md](docs/CHECKS.md)).
52
65
  - **Control:** `--ignore check.id="reason"` (shown in the report, not scored) and `--badge badge.svg` for your README.
53
66
 
67
+ ## Govern what agents do: identity, mandates, signed receipts (preview)
68
+
69
+ Testing servers is half the story; the other half is **what agents actually do with them**. Give an agent its own
70
+ identity and a mandate you sign, put Saktum between the agent and a local MCP server, and every tool call gets a
71
+ **signed, hash-chained receipt**: which tools, how often, in what order, what was blocked.
72
+
73
+ ```
74
+ npx saktum agent create --name "Billing assistant" --allow-tool get_invoice --allow-tool list_invoices # did:key + signed mandate
75
+ npx saktum proxy --mandate agent-mandate.json --enforce -- npx -y billing-mcp-server # use in place of the server command
76
+ npx saktum receipts summary # the path, not the answer: tools, order, retry storms, denials, destructive actions
77
+ npx saktum receipts verify # every signature and the chain
78
+ ```
79
+
80
+ Observe by default; `--enforce` blocks calls outside the mandate (including tools declared destructive, unless allowed),
81
+ with an honest error to the agent. Receipts follow Saktum's receipt contract and store arguments only as a digest.
82
+ Preview limits: local (stdio) servers; receipts are signed by the agent side (bilateral receipts, co-signed by the
83
+ server side, come with the Saktum gateway).
84
+
85
+ ## The trust ledger: Certificate Transparency for AI agent tools
86
+
87
+ Providers publish signed attestations to a **public, append-only, hash-chained ledger**; anyone can verify every
88
+ signature and the whole chain; firewalls, gateways and enterprises build allowlists from it.
89
+
90
+ ```
91
+ npx saktum attest saktum-report.json --publish # publish yours (opens a pre-filled issue; a bot verifies and records it)
92
+ npx saktum ledger verify # verify the public ledger: signatures and chain
93
+ npx saktum ledger find my-server # look a server up
94
+ npx saktum allowlist --from-ledger --trusted-signers signers.txt # an allowlist for your MCP firewall
95
+ ```
96
+
97
+ Entries are signed claims with their assurance level stated (L1 = self-tested); independent re-checks come later.
98
+
99
+ ## Start right, and test while you build (shift left)
100
+
101
+ | Command | What it does |
102
+ | --- | --- |
103
+ | `saktum init my-server --lang ts` (or `py`) | A new MCP server that is trustworthy by default: an annotated example tool with an output schema, test cases, CI with Saktum Check and code scanning, and `AGENTS.md` rules for coding agents. Both templates earn trust A and agent readiness A out of the box |
104
+ | `saktum lint` | Static checks on tool registrations in your source (TypeScript and Python SDKs): missing annotations, weak descriptions, names model providers reject, with file and line (`--sarif` for editors and GitHub) |
105
+ | `saktum call <tool> --args '{...}' --save-test <id> -- <server>` | Call a tool, see the result, and save it as a test case in `saktum.tests.yaml` |
106
+ | `saktum check --watch -- <server>` | Re-run on every file change while you develop |
107
+
108
+ **For coding agents:** `skills/saktum-mcp-builder/` is a Claude Code skill (copy it into `~/.claude/skills/`), and
109
+ `agents/` holds an `AGENTS.md` section and Cursor rules, so the agents writing MCP servers follow the same practices.
110
+
111
+ ## Use it from your coding agent (Saktum as an MCP server)
112
+
113
+ Add Saktum to Claude Desktop, Claude Code, Cursor or VS Code, and ask your agent to test and fix MCP servers:
114
+
115
+ ```json
116
+ { "mcpServers": { "saktum": { "command": "npx", "args": ["-y", "saktum", "mcp"] } } }
117
+ ```
118
+
119
+ Try: *"Check the MCP server started by `node build/index.js` and fix anything below A."* ·
120
+ *"Suggest annotations for my server's tools in Python."* · *"Did my changes break anything compared with saktum.lock.json?"*
121
+
122
+ Tools: `check_server`, `suggest_annotations`, `diff_against_lock`, `generate_docs`, `explain_check`, `list_checks`.
123
+ Passive by default; local targets start on your machine; `active` only for servers you own. Saktum's own server earns
124
+ trust A and agent readiness A under its own checks.
125
+
126
+ ## Check your whole agent set-up
127
+
128
+ `npx saktum scan-config` finds the MCP servers in Claude Desktop, Claude Code, Cursor and VS Code, asks before starting
129
+ them, and reports what they cost together every turn (and per month), duplicate and look-alike tools across servers,
130
+ servers not on your allowlist, and the weakest grades. Configured secrets are never printed.
131
+
54
132
  ## The provider toolkit
55
133
 
56
134
  | Command | What it does |
@@ -59,17 +137,21 @@ grade. Every report ends with **OWASP MCP Top 10 coverage**: which categories th
59
137
  | `saktum snapshot -- <server>` | Writes `saktum.lock.json`, a lock file of your tools |
60
138
  | `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
139
  | `saktum docs -- <server>` | A Markdown tools table and ready-to-paste configuration for Claude Desktop, Cursor and VS Code |
140
+ | `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) |
141
+ | `saktum attest saktum-report.json` | A compact signed attestation (grades, maturity evidence, tool fingerprint) plus a README badge; anyone can check it with `saktum verify` |
62
142
  | `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
143
 
64
144
  ## In CI (GitHub Action)
65
145
 
66
146
  ```yaml
67
147
  - uses: actions/checkout@v4
68
- - uses: soodhere/saktum-check@v0.3.1
148
+ - uses: soodhere/saktum-check@v0.4.0
69
149
  with:
70
150
  target: "-- node build/index.js" # or an https URL
71
151
  args: "--active --tests saktum.tests.yaml" # optional; --active only for your own server
72
152
  fail-on: high
153
+ sarif: "true" # findings in GitHub's Security tab (add permissions: security-events: write)
154
+ baseline: saktum-baseline.json # optional: fail only on new findings
73
155
  ```
74
156
 
75
157
  The report appears in the job summary; the signed result, HTML report and badge are saved as an artifact.
package/package.json CHANGED
@@ -1,14 +1,40 @@
1
1
  {
2
2
  "name": "saktum",
3
- "version": "0.3.1",
3
+ "version": "0.4.0",
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",
7
- "bin": { "saktum": "saktum.mjs" },
8
- "files": ["saktum.mjs", "README.md", "LICENSE"],
9
- "engines": { "node": ">=20" },
10
- "repository": { "type": "git", "url": "git+https://github.com/soodhere/saktum-check.git" },
7
+ "bin": {
8
+ "saktum": "saktum.mjs"
9
+ },
10
+ "files": [
11
+ "saktum.mjs",
12
+ "README.md",
13
+ "LICENSE"
14
+ ],
15
+ "engines": {
16
+ "node": ">=20"
17
+ },
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/soodhere/saktum-check.git"
21
+ },
11
22
  "homepage": "https://github.com/soodhere/saktum-check#readme",
12
23
  "bugs": "https://github.com/soodhere/saktum-check/issues",
13
- "keywords": ["mcp", "mcp-server", "model-context-protocol", "mcp-security", "owasp", "security", "testing", "conformance", "oauth", "ai-agents", "llm-security", "prompt-injection", "cli"]
24
+ "keywords": [
25
+ "mcp",
26
+ "mcp-server",
27
+ "model-context-protocol",
28
+ "mcp-security",
29
+ "owasp",
30
+ "security",
31
+ "testing",
32
+ "conformance",
33
+ "oauth",
34
+ "ai-agents",
35
+ "llm-security",
36
+ "prompt-injection",
37
+ "cli"
38
+ ],
39
+ "mcpName": "io.github.soodhere/saktum-check"
14
40
  }