@agledger/mcp-server 3.0.0 → 3.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.
- package/CHANGELOG.md +109 -169
- package/README.md +11 -9
- package/dist/server.d.ts +22 -0
- package/dist/server.js +71 -4
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -4,355 +4,295 @@ All notable changes to the AGLedger MCP Server will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/), and this project adheres to [Semantic Versioning](https://semver.org/).
|
|
6
6
|
|
|
7
|
-
## [3.
|
|
7
|
+
## [3.1.0] - 2026-11-05
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
### Added
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
- **`agledger_verify` re-binds inlined evidence.** On an export fetched with `?evidence=true`, each completion's evidence body and each dispute's filed payload is hashed (SHA-256 over RFC 8785) against the hash its entry signs; an edited body fails `CHAIN_EVIDENCE_BINDING_MISMATCH` where it used to pass. `result.evidenceBinding` counts them, the summary names a failed or encrypted-mode body, and the tool description says how to fetch the export with its evidence. Built on `@agledger/verify-core` 2.1.0.
|
|
12
|
+
- **`federationKeys` on `agledger_verify`:** verifies the peer messages a receiving Server seals from federation, against the keys you supply. `result.federationWire` reports `present`, `verified`, `failed` and `afterRetirement` counts, and a failure is `CHAIN_FEDERATION_WIRE_INVALID`. An array entry's `history`, the peer's `GET /.well-known/agledger-federation-keys.json`, trusts every key it links to that entry's key, so entries sealed before the peer changed its federation key verify; each message is placed by its signed `wire.timestamp`, and a hub may be named again for a key the history does not list. Requires `@agledger/verify-core` 2.1.0.
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
- **`agledger_verify` reports a verdict, as `@agledger/verify` and `agledger verify` do.** `structuredContent` carries `verdict` beside verify-core's result: `trusted` when the chain is valid and `keyTrust.status` is `walked`, `failed` when it is not valid, and `unanchored` otherwise. The one text block mirrors `structuredContent` as JSON, which also carries `summary`: the verdict in the other verifiers' words (`Verdict: PASS`, `Verdict: VERIFIED, NOT ANCHORED`, `Verdict: FAIL`) with the next step, worded from `valid` and `keyTrust.status` only. `verdict` is the one `@agledger/verify-core` now puts on its result. An unanchored result says it is not a trusted verdict, and `isError` stays false for it. It is unanchored in two cases: without `trustAnchors` (`keyTrust.status` `no_anchor`), where the text names the key the export claims as its Server's (`exportMetadata.anchoredFrom`, which is not an anchor) and says to call the tool again with a pin; and when the pin was walked but no signature verified under a key it anchors (`no_anchored_signature`), as for an export of unsigned entries pinned on any key. Entries that carry no signature are named as covered by the hash chain only, and agent signatures left unchecked are counted.
|
|
14
|
+
### Fixed
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
- The `agledger_api` description now states that listing pages, `GET /v1/schemas` and `GET /v1/admin/orgs` carry no `nextSteps`, and that the discovery documents and `/a2a` sit at the root rather than under `/v1/`.
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
### Changed
|
|
19
19
|
|
|
20
|
-
-
|
|
21
|
-
- **`agledger_verify` reports an unsigned entry written while the vault was signing.** An entry with no signing key fails with the new `CHAIN_ENTRY_UNSIGNED` when an earlier entry in its chain names a key, or when it was written at or after the earliest activation time among the keys the verifier holds. An unsigned history written before the first key stays reduced coverage, as before. An entry that names a key but carries an all-zero signature now fails `CHAIN_SIGNATURE_INVALID`. Both match the Server's own chain verification.
|
|
20
|
+
- The README states that the package needs an AGLedger Server 2.0 or later and names the last release for a 1.x Server.
|
|
22
21
|
|
|
23
|
-
|
|
22
|
+
## [3.0.0] - 2026-10-05
|
|
24
23
|
|
|
25
|
-
|
|
26
|
-
- **A malformed API URL refuses startup.** An `--api-url` or `AGLEDGER_API_URL` that is not an absolute `http` or `https` URL (`not-a-url`, or `localhost:3000` with no scheme) exits 2 before the server accepts a connection, naming where the URL came from, like the other configuration refusals. It used to start, exit 0 on EOF, and leave every tool call to fail.
|
|
27
|
-
- `agledger_verify` walks an export's key statements in write order (`createdAt`, then `id`), which every API 2.0 export carries, so the key-anchoring findings name the statement row, and a trusted key's later admissions date its window as the Server's do. The write times decide only the order: they are not signed, so a key statement signed by a key in `distrustedKeys` counts for nothing whatever time it carries. A statement that counts for nothing only because its signer is distrusted, dated before the cutoff by the export's own unsigned write time, is a `keyTrust.notes` entry rather than a finding, so an honest rotation away from a key distrusted after it still passes pinned on its successor. The verdict text lists each note as `Key note:`.
|
|
28
|
-
- **A refused OIDC cert exchange reports the Server's `detail`.** API 2.0 removed the top-level `message` from every RFC 9457 error body, leaving `detail` as the one human-readable field. The exchange error read `message`, so against a 2.0 Server an expired or unbound token surfaced as "returned 401" with the Server's reason gone (mcp-server#33). It now reads `detail`. The error body is still forwarded to the tool result as the Server sent it, scrubbed of the token. The server's own errors (`{error, message, code, suggestion}`) keep their `message`; they are not API bodies.
|
|
29
|
-
- **The README says the Server verifies the body signature on every authenticated route** under cert auth and seals it into every chain entry the request writes, rather than recording it on some routes and ignoring it elsewhere (mcp-server#34). The server sends `X-Agent-Signature` only with the OIDC cert credential and only on a request with a body, since the Server refuses the headers with 400 under any other credential (an API key, or an admin or platform OIDC bearer).
|
|
30
|
-
- **`AGLEDGER_OIDC_AGENT_ID` is documented as an assertion, not a choice of agent.** The Server binds a cert to the agent the token names (a mapped `agent_id` claim, else the agent carrying the token's `oidcIss`/`oidcSub`, else an auto-provisioned one), and never to one the request body chooses. When `AGLEDGER_OIDC_AGENT_ID` names a different agent, or the token binds none, the exchange is refused with 403 `CERT_AGENT_BINDING_MISMATCH`; a token bound to a federation shadow agent is refused with 403 `SHADOW_AGENT_CERT_FORBIDDEN`. `--help` and the README now say so, and point at binding the agent instead: `PATCH /v1/agents/{id}` with `oidcIss` and `oidcSub`, or `claimMapping.agent_id` on the trusted issuer. The server still sends the id when it is set, and the refusal reaches the tool result as `OIDC_EXCHANGE_FAILED` with the Server's status, error body, and `recoveryHint` as the `suggestion`, as it did before.
|
|
24
|
+
Targets API 2.0 only.
|
|
31
25
|
|
|
32
|
-
|
|
26
|
+
### Breaking
|
|
27
|
+
|
|
28
|
+
- **`agledger_verify` takes `requireSuppliedKeys`, not `requireOutOfBandKeys`.** Behavior is unchanged, but the old name is refused as an unknown argument. In the result, `keyProvenance.outOfBand` is now `keyProvenance.supplied`, `optionalChecks` carries `key_anchoring`, and every result carries `keyTrust`.
|
|
29
|
+
- **`agledger_verify` reports a verdict, as `@agledger/verify` and `agledger verify` do.** `structuredContent` carries `verdict`: `trusted` when the chain is valid and `keyTrust.status` is `walked`, `failed` when it is not valid, and `unanchored` otherwise. The text block mirrors `structuredContent` as JSON and adds a `summary` (`Verdict: PASS`, `Verdict: VERIFIED, NOT ANCHORED` or `Verdict: FAIL`) with the next step. An unanchored result is not a trusted verdict and `isError` stays false for it. Pass `trustAnchors` to get a trusted verdict.
|
|
33
30
|
|
|
34
31
|
### Added
|
|
35
32
|
|
|
36
|
-
- **`
|
|
37
|
-
-
|
|
33
|
+
- **`trustAnchors` and `distrustedKeys` on `agledger_verify`.** `trustAnchors` takes SPKI digests (`sha256:<hex>`) of vault keys you obtained out of band, and the signed key statements in the export are walked from them. An entry signed by a key the walk does not reach fails `CHAIN_SIGNING_KEY_UNANCHORED`, and a statement that does not hold fails with `KEY_STATEMENT_INVALID`, `KEY_CLOSURE_INVALID` or `CHAIN_KEY_WINDOW_DRIFT`. `distrustedKeys` takes your `VAULT_DISTRUSTED_KEYS` entries and requires `trustAnchors`; a pin may carry a date (`sha256:<hex>@<instant>`) to vouch for what the key signed before that instant. Invalid input is refused with `INVALID_ARGUMENT`. Requires `@agledger/verify-core` 2.0.0.
|
|
34
|
+
- **`agledger_verify` names the distrust entry an export says the Server applied.** When an API 2.0 export lists a distrusted key and your call did not pass the matching `distrustedKeys` entry, the `CHAIN_KEY_WINDOW_DRIFT` or `KEY_CLOSURE_INVALID` finding names the entry to confirm with the Server's operator.
|
|
35
|
+
- **`agledger_verify` reports an unsigned entry written while the vault was signing.** Such an entry fails with the new `CHAIN_ENTRY_UNSIGNED`, and an entry that names a key but carries an all-zero signature fails `CHAIN_SIGNATURE_INVALID`. Both match the Server's own chain verification.
|
|
38
36
|
|
|
39
|
-
|
|
40
|
-
- The cert is re-exchanged once half its lifetime has passed, measured from when it was received so clock skew cannot shorten or stretch it. Concurrent tool calls share one exchange. A refresh that fails while the current cert is still valid keeps it and prints one warning on stderr.
|
|
41
|
-
- A 401 on a cert bearer (a revoked cert) forces exactly one re-exchange and one retry of the request, with the same body bytes and the same `Idempotency-Key`. A second 401 is returned as the answer.
|
|
42
|
-
- Every request body is signed with the key bound to the cert (`X-Agent-Signature-Content-Hash` and `X-Agent-Signature`), so the Server records the agent's own signature in the chain entry (`predicate.on_behalf_of.agent_signature`) on the routes that accept one.
|
|
43
|
-
- A failed exchange reaches the tool result as `code: OIDC_EXCHANGE_FAILED` with the Server's status, error body and `recoveryHint`; a token source that cannot produce a token is `OIDC_TOKEN_SOURCE_FAILED`. Tokens are scrubbed from both, and a failing command's stderr is included with anything shaped like a JWT removed. The command text itself is never echoed, since it can carry a secret of its own.
|
|
44
|
-
- A token command (`AGLEDGER_OIDC_TOKEN_CMD`, and `AGLEDGER_ON_BEHALF_OF_CMD` below) runs in its own process group, and the whole group is killed when the command times out after 60 seconds, prints more than 64 KiB, or exits, so a pipeline or a helper it forks cannot outlive the call and pile up across refreshes in a long-running server.
|
|
45
|
-
- `agledger_discover` fetches `/health` without a credential, so "is the Server up" stays answerable when the credential is what is broken.
|
|
46
|
-
- `--help` and the no-credential startup error list all three credential sources. A token file that cannot be read exits 2 at startup rather than failing on the first tool call.
|
|
37
|
+
### Changed
|
|
47
38
|
|
|
48
|
-
- **
|
|
39
|
+
- **A timeout returns the key to retry with, and `--timeout` exists.** A POST that times out or loses its connection returns the `Idempotency-Key` it sent as `idempotencyKey`; retry with that exact key to avoid creating a second record. `--timeout <seconds>` (or `AGLEDGER_TIMEOUT`) sets the wait for each response, default 30; anything other than a positive number up to 2147483 exits 2.
|
|
40
|
+
- **A malformed API URL refuses startup.** An `--api-url` or `AGLEDGER_API_URL` that is not an absolute `http` or `https` URL exits 2 before the server accepts a connection, and names where the URL came from.
|
|
41
|
+
- `agledger_verify` walks an export's key statements in write order (`createdAt`, then `id`). A statement that counts for nothing only because its signer is distrusted and dated before the cutoff is reported as a `keyTrust.notes` entry (`Key note:` in the verdict text) rather than a finding.
|
|
42
|
+
- **A refused OIDC cert exchange reports the Server's `detail`.** API 2.0 error bodies carry `detail` rather than a top-level `message`, and the exchange error now reads it.
|
|
43
|
+
- **Documentation: body signatures under cert auth.** The README states that the Server verifies the body signature on every authenticated route under cert auth and seals it into each chain entry the request writes. The server sends `X-Agent-Signature` only with the OIDC cert credential and only on a request with a body.
|
|
44
|
+
- **Documentation: `AGLEDGER_OIDC_AGENT_ID` is an assertion, not a choice of agent.** The Server binds a cert to the agent the token names. If `AGLEDGER_OIDC_AGENT_ID` names a different agent, or the token binds none, the exchange is refused with 403 `CERT_AGENT_BINDING_MISMATCH`; a token bound to a federation shadow agent is refused with 403 `SHADOW_AGENT_CERT_FORBIDDEN`. Bind the agent with `PATCH /v1/agents/{id}` (`oidcIss` and `oidcSub`) or `claimMapping.agent_id` on the trusted issuer.
|
|
49
45
|
|
|
50
|
-
|
|
46
|
+
## [2.11.0] - 2026-09-21
|
|
51
47
|
|
|
52
|
-
###
|
|
48
|
+
### Added
|
|
53
49
|
|
|
54
|
-
-
|
|
50
|
+
- **`agledger_verify` refuses a re-attributed export.** The `actorId`, `actorRole` and `actorOwnerId` an export displays are cross-checked against the signed actor claim, and a mismatch fails with the new `CHAIN_ACTOR_ATTRIBUTION_MISMATCH`. Requires `@agledger/verify-core` 1.5.0.
|
|
51
|
+
- **The server can authenticate with an OIDC token instead of an API key.** Set `AGLEDGER_OIDC_TOKEN_FILE` (a file holding the token, such as a Kubernetes projected service-account token) or `AGLEDGER_OIDC_TOKEN_CMD` (a shell command that prints one), plus `AGLEDGER_OIDC_AGENT_ID` to bind the cert to a specific agent. The server generates an Ed25519 key pair in memory, exchanges the token for a short-lived cert (`POST /v1/auth/oidc/cert`) and presents the cert as its bearer, so no long-lived secret sits in the MCP client configuration. An API key wins when set, then the command, then the file; the server prints a note naming any source it ignores.
|
|
52
|
+
- The token source is read on every exchange, and the cert is re-exchanged once half its lifetime has passed. A 401 on a cert forces one re-exchange and one retry with the same body and `Idempotency-Key`.
|
|
53
|
+
- Every request body is signed with the key bound to the cert (`X-Agent-Signature-Content-Hash` and `X-Agent-Signature`), so the Server records the agent's own signature in the chain entry on the routes that accept one.
|
|
54
|
+
- A failed exchange returns `OIDC_EXCHANGE_FAILED` with the Server's status, error body and `recoveryHint`; a token source that cannot produce a token returns `OIDC_TOKEN_SOURCE_FAILED`. Tokens are scrubbed from both.
|
|
55
|
+
- A token command runs in its own process group and is killed on a 60-second timeout or more than 64 KiB of output.
|
|
56
|
+
- `agledger_discover` fetches `/health` without a credential. A token file that cannot be read exits 2 at startup.
|
|
57
|
+
- **The server can act on behalf of a person or another party.** `AGLEDGER_ON_BEHALF_OF_CMD` (a shell command) or `AGLEDGER_ON_BEHALF_OF_FILE` names an RFC 8693 delegation token, which the server sends as `AGLedger-On-Behalf-Of` on every POST. The token comes from the process, never from a tool argument, and is scrubbed from every error and tool result. `agledger_discover` reports only whether a delegation is configured and its source. With the OIDC cert credential the Server records the delegation as `bound` to the agent's identity; with an API key, as `unbound`.
|
|
58
|
+
- **`agledger_verify` takes `agentKeys`**, the Ed25519 public keys (JWKs) of agent certs. An entry whose sealed agent signature names one of them has that signature re-verified offline, and a failure is the new `CHAIN_AGENT_SIGNATURE_INVALID`. Without it, `agentSignatures` counts the signatures without checking them. Requires `@agledger/verify-core` 1.5.0.
|
|
55
59
|
|
|
56
|
-
|
|
60
|
+
### Fixed
|
|
57
61
|
|
|
58
|
-
- **
|
|
62
|
+
- **An argument a tool does not declare is refused.** Each tool answers an undeclared argument with `code: UNKNOWN_ARGUMENT`, naming the argument and the ones it accepts, before anything is sent. For example, `agledger_api` called with `body` instead of `params` now says so.
|
|
63
|
+
- The `agledger_api` description and the README name `recoveryHint` as the field to read on Server errors, and `suggestion` for errors the tool raises itself.
|
|
64
|
+
- The `agledger_verify` description now lists all 19 failure codes an audit export can produce, including `CHAIN_OIDC_ACTOR_MISMATCH`, `CHAIN_KEY_EXPIRED` and `CHAIN_KEY_NOT_YET_ACTIVE`.
|
|
59
65
|
|
|
60
66
|
### Changed
|
|
61
67
|
|
|
62
|
-
- `LICENSE` follows SDK License Template 1.9
|
|
63
|
-
- The README
|
|
68
|
+
- `LICENSE` follows SDK License Template 1.9.
|
|
69
|
+
- The README describes AGLedger as agent memory, approvals, audit trail and notifications on one API and one signed ledger, self-hosted.
|
|
64
70
|
|
|
65
71
|
## [2.10.1] - 2026-09-10
|
|
66
72
|
|
|
67
73
|
### Changed
|
|
68
74
|
|
|
69
|
-
-
|
|
75
|
+
- `LICENSE` section 6 names the ciphers this package line ships: Ed25519 (EdDSA), ECDSA P-256 with SHA-256, HMAC-SHA-256, AES-256-GCM, HKDF-SHA-256 and SHA-256. No other files changed.
|
|
70
76
|
|
|
71
77
|
## [2.10.0] - 2026-08-21
|
|
72
78
|
|
|
73
79
|
### Added
|
|
74
80
|
|
|
75
|
-
- **An `idempotencyKey` argument on `agledger_api`, and a generated key on every POST.**
|
|
81
|
+
- **An `idempotencyKey` argument on `agledger_api`, and a generated key on every POST.** To retry a call that may already have reached the Server, pass the key used the first time and the Server returns the original result instead of creating a second record. The key binds to method, route and body, so a retry with a changed body is rejected.
|
|
76
82
|
|
|
77
83
|
### Fixed
|
|
78
84
|
|
|
79
|
-
- **
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
- **`agledger_verify` published its one mandatory argument as optional.** The tool advertised no `required` array at all, so every client read `export` as something it could omit. `jsonStringField` was built with `z.preprocess`, whose input is typed `unknown`; `unknown` subsumes `undefined`, so zod marked the field `optin: 'optional'` and the MCP SDK left it out of `required` when rendering the schema with `io: 'input'`. The field is now an explicit `unknown` piped through the transform, which reports required-ness correctly while still publishing as `type: string` and still accepting a native object from object-native runtimes. `agledger_api`, whose fields are plain `z.string()`, was never affected. Reported by agledger-testbed against the 2.10.0 candidate (F-982). A new `tests/tool-schema.test.ts` asserts the published `required` array of every tool, read back over a real client connection rather than from the zod, since that is where the two came apart.
|
|
84
|
-
|
|
85
|
-
- **Object query parameters reached the wire as `[object Object]`.** The client ran every query value through `String(value)`, so `agledger_api` with `GET /v1/records/search` and a `criteria` or `metadata` filter returned 400 rather than filtering. Objects now expand into the API's bracket notation (`metadata[state]=blocked`), and a `Date` serializes as ISO-8601 rather than the JS locale form the date-time params reject. Found by driving the server against a live API.
|
|
85
|
+
- **Tool argument descriptions are published when the host already has zod 3.** The package now declares `zod` as a peer dependency with the same `^3.25.0 || ^4.0.0` range as `@modelcontextprotocol/sdk` and imports the `zod/v4` subpath, so a single copy of zod serves both. The server warns on stderr at startup if a dependency tree still resolves two different zod versions.
|
|
86
|
+
- **`agledger_verify` publishes `export` as a required argument.** The tool schema now lists it in `required`.
|
|
87
|
+
- **Object query parameters are sent correctly.** `agledger_api` with `GET /v1/records/search` and a `criteria` or `metadata` filter now expands objects into bracket notation (`metadata[state]=blocked`), and a `Date` serializes as ISO-8601.
|
|
86
88
|
|
|
87
89
|
### Changed
|
|
88
90
|
|
|
89
|
-
- **The `params` description says the body is not type-coerced.**
|
|
90
|
-
|
|
91
|
-
-
|
|
92
|
-
|
|
93
|
-
- `@agledger/verify-core` moves to `^1.4.0`. The declared range was `^1.3.0` while the lockfile pinned 1.3.0, so CI tested against a build without the ES256 verification floor while a fresh install resolved 1.4.0. Lockfile refreshed, which also clears a high-severity `nanoid` advisory in the dev tree (vitest -> vite -> postcss; never shipped in the tarball).
|
|
91
|
+
- **The `params` description says the body is not type-coerced.** Identifier fields such as `externalTaskId`, `correlationId`, `platformRef`, `projectRef` and `publisher` are strings, so all-digit values must be written as strings.
|
|
92
|
+
- **The `agledger_api` description covers supersession:** `supersedesRecordId` with `?superseded=false` returns the current state of tracked work, `supersededByCount` above 1 means a fork with several current heads, and signed `criteria` differ from unsigned `metadata` as filters.
|
|
93
|
+
- `@agledger/verify-core` moves to `^1.4.0`.
|
|
94
94
|
|
|
95
95
|
## [2.9.0] - 2026-08-07
|
|
96
96
|
|
|
97
97
|
### Fixed
|
|
98
98
|
|
|
99
|
-
- **A server that refuses to start now exits non-zero.**
|
|
100
|
-
|
|
101
|
-
- **
|
|
102
|
-
|
|
103
|
-
- **An unknown flag is reported as usage, not as a crash.** `parseArgs` runs in strict mode, so `--version` (which this server does not implement) threw and surfaced as `Uncaught exception: Unknown option '--version'` with exit 0. It now prints an error, points at `--help`, and exits 2.
|
|
99
|
+
- **A server that refuses to start now exits non-zero.** A missing `--api-url` previously printed an error and exited 0.
|
|
100
|
+
- **The Quick Start and `--help` show `--api-url` as required.** The README `claude_desktop_config.json` example and the `--help` usage line now include it.
|
|
101
|
+
- **An unknown flag prints an error, points at `--help`, and exits 2.**
|
|
104
102
|
|
|
105
103
|
### Changed (behavior)
|
|
106
104
|
|
|
107
|
-
- **Exit codes are
|
|
108
|
-
|
|
109
|
-
### Internal
|
|
110
|
-
|
|
111
|
-
- **The live integration suite no longer runs with placeholder credentials.** It probed `localhost:3001` and, if anything answered, ran with `agl_agt_test`, which every real Server rejects. The result was eight failures that read as a regression in whatever had just changed, when the only problem was an unset environment variable. Reachability is not permission, so it now skips on a missing key exactly as it skips on an unreachable API.
|
|
112
|
-
|
|
113
|
-
### Packaging
|
|
114
|
-
|
|
115
|
-
- **Source maps are no longer published.** They shipped with `sources` pointing at `../src/*.ts` and no `sourcesContent`, and `src/` is not in the tarball, so they resolved to nothing. The build no longer emits them at all, so no shipped `.js` or `.d.ts` carries a `sourceMappingURL` comment pointing at a map the tarball does not contain (agents#114).
|
|
116
|
-
- **`bugs` added to package.json.**
|
|
105
|
+
- **Exit codes are a documented contract:** `0` clean, `1` runtime failure, `2` usage or configuration error. A missing `--api-key` or `--api-url` now exits 2. A launcher that checked for exactly `1` to detect bad configuration should check for 2.
|
|
117
106
|
|
|
118
107
|
## [2.8.0] - 2026-08-07
|
|
119
108
|
|
|
120
109
|
### Added
|
|
121
110
|
|
|
122
|
-
- **`agledger://llms.txt` resource
|
|
111
|
+
- **`agledger://llms.txt` resource.** It fetches live from `GET /llms.txt`, and `agledger_discover` now points to it.
|
|
123
112
|
|
|
124
113
|
### Changed
|
|
125
114
|
|
|
126
|
-
- **`--api-url` is now required.** The
|
|
115
|
+
- **`--api-url` is now required.** The placeholder default is removed, and the server refuses to start without a URL.
|
|
127
116
|
|
|
128
117
|
## [2.7.0] - 2026-08-05
|
|
129
118
|
|
|
130
|
-
Signing-agility wave 2.
|
|
131
|
-
|
|
132
119
|
### Added
|
|
133
120
|
|
|
134
|
-
- **`agledger_verify` handles ES256 chains** via `@agledger/verify-core` 1.2.0
|
|
121
|
+
- **`agledger_verify` handles ES256 chains** via `@agledger/verify-core` 1.2.0. Unsupported algorithms still fail closed as `CHAIN_UNSUPPORTED_ALGORITHM`.
|
|
135
122
|
|
|
136
123
|
## [2.6.0] - 2026-08-05
|
|
137
124
|
|
|
138
125
|
### Changed
|
|
139
126
|
|
|
140
|
-
- **`agledger_verify` takes `@agledger/verify-core` `^1.1.0
|
|
127
|
+
- **`agledger_verify` takes `@agledger/verify-core` `^1.1.0`.** Algorithm dispatch binds to the trusted verification key rather than the unverified protected header. Tampered or missing header `alg` values fail as `CHAIN_ALG_MISMATCH`, a key algorithm beyond the build fails as `CHAIN_UNSUPPORTED_ALGORITHM`, the signed kid is cross-checked against `signingKeyId` (`CHAIN_SIGNING_KEY_DRIFT`), and untagged COSE_Sign1 is rejected. Valid Ed25519 exports verify as before.
|
|
141
128
|
|
|
142
129
|
## [2.5.6] - 2026-08-01
|
|
143
130
|
|
|
144
|
-
Security
|
|
145
|
-
|
|
146
|
-
### Changed
|
|
147
|
-
|
|
148
|
-
- Upgraded `@modelcontextprotocol/sdk` to `^1.30.0`. A fresh `npm install @agledger/mcp-server` previously ended with npm reporting moderate vulnerabilities, and enterprise CI that gates on `npm audit --audit-level=moderate` failed the install outright. The chain was `@modelcontextprotocol/sdk` to `@hono/node-server ^1.19.9`, and the advisory (GHSA-frvp-7c67-39w9, path traversal in `serve-static` on Windows via an encoded backslash) is fixed only in `@hono/node-server` 2.x. SDK 1.30.0 widened that range to `^1.19.9 || ^2.0.5`, so there is finally a fix path. Almost certainly not exploitable here, since it is Windows-only on a `serve-static` code path this package does not use, but "no fix available" reads badly on a security product.
|
|
149
|
-
- Refreshed the lockfile to in-range latest, clearing the remaining transitive advisories: `@hono/node-server` 2.0.12, `hono` 4.12.33 (GHSA-xgm2-5f3f-mvvc, GHSA-hvrm-45r6-mjfj, GHSA-w62v-xxxg-mg59), `fast-uri` 3.1.5 (GHSA-v2hh-gcrm-f6hx, GHSA-4c8g-83qw-93j6), `body-parser` 2.3.0. `npm audit` now reports 0 vulnerabilities.
|
|
150
|
-
|
|
151
|
-
### Notes
|
|
152
|
-
|
|
153
|
-
- Verified against a live AGLedger API v1.3.4 over the in-memory MCP transport, not just mocks: all 75 tests pass, including the 8 live integration cases covering discover, auth identity, record list and create, the structured schema-help error, and the record lifecycle.
|
|
131
|
+
### Security
|
|
154
132
|
|
|
155
|
-
|
|
133
|
+
- Upgraded `@modelcontextprotocol/sdk` to `^1.30.0` and refreshed transitive dependencies (`@hono/node-server`, `hono`, `fast-uri`, `body-parser`), so a fresh install reports no `npm audit` vulnerabilities. No tool-surface or behavior change.
|
|
156
134
|
|
|
157
135
|
## [2.5.5] - 2026-07-16
|
|
158
136
|
|
|
159
|
-
Docs and tooling. No tool-surface or behavior change.
|
|
160
|
-
|
|
161
137
|
### Changed
|
|
162
138
|
|
|
163
|
-
- The `agledger_discover` tool description
|
|
164
|
-
-
|
|
165
|
-
- Refreshed the lockfile to in-range latest (`@agledger/verify-core` 1.0.2, plus dev tooling).
|
|
166
|
-
- Upgraded the TypeScript devDependency to `^7.0.2`. Build, typecheck, and tests all pass under 7.0.2.
|
|
139
|
+
- The `agledger_discover` tool description and quickstart now lead with notarize.
|
|
140
|
+
- The README drops outdated terminology.
|
|
167
141
|
|
|
168
142
|
## [2.5.4] - 2026-06-29
|
|
169
143
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
- Docs only: removed em-dashes from the README prose and the package.json description (cross-repo #98 writing-style sweep). Rewrote each sentence rather than swapping the glyph. No tool-surface or behavior change.
|
|
144
|
+
- Maintenance release with no user-facing changes.
|
|
173
145
|
|
|
174
146
|
## [2.5.3] - 2026-06-20
|
|
175
147
|
|
|
176
148
|
### Changed
|
|
177
149
|
|
|
178
|
-
- Bumped `@agledger/verify-core` to `^1.0.0
|
|
150
|
+
- Bumped `@agledger/verify-core` to `^1.0.0`. No tool-surface or behavior changes.
|
|
179
151
|
|
|
180
152
|
## [2.5.2] - 2026-06-18
|
|
181
153
|
|
|
182
|
-
###
|
|
154
|
+
### Security
|
|
183
155
|
|
|
184
|
-
-
|
|
156
|
+
- Replaced a regex-based trailing-slash strip with a linear scan to remove a polynomial-backtracking risk flagged by CodeQL (`js/polynomial-redos`). No tool-surface or behavior change.
|
|
185
157
|
|
|
186
158
|
## [2.5.1] - 2026-06-10
|
|
187
159
|
|
|
188
160
|
### Changed
|
|
189
161
|
|
|
190
|
-
-
|
|
191
|
-
- No code changes; republished so the distributed tarball carries the corrected license text.
|
|
162
|
+
- `LICENSE` is updated to the canonical AGLedger SDK license template v1.5. The README drops a retired protocol link and trims the trademark footer to match `LICENSE` section 7.
|
|
192
163
|
|
|
193
164
|
## [2.5.0] - 2026-06-08
|
|
194
165
|
|
|
195
|
-
|
|
166
|
+
Aligned with AGLedger API v1.0.0 GA. The tool surface is unchanged from 2.4.x.
|
|
196
167
|
|
|
197
168
|
## [2.4.11] - 2026-06-04
|
|
198
169
|
|
|
199
170
|
### Security
|
|
200
171
|
|
|
201
|
-
-
|
|
172
|
+
- `agledger_api` rejects a `path` starting with `//` (returns a `PATH_INVALID` error result), and every request is pinned to the configured API origin. This prevents a crafted path from sending the API key to another host.
|
|
202
173
|
|
|
203
174
|
### Changed
|
|
204
175
|
|
|
205
|
-
-
|
|
176
|
+
- Added `_meta.requiredScopes` to the tools where a scope can be stated: `agledger_verify` and `agledger_discover` declare `[]`. `agledger_api` declares none, since each route enforces its own scope.
|
|
206
177
|
|
|
207
178
|
## [2.4.10] - 2026-06-04
|
|
208
179
|
|
|
209
|
-
|
|
180
|
+
Published with npm build provenance (verify with `npm audit signatures`) and a CycloneDX SBOM. No functional change.
|
|
210
181
|
|
|
211
182
|
## [2.4.9] - 2026-06-02
|
|
212
183
|
|
|
213
184
|
### Security
|
|
214
185
|
|
|
215
|
-
- `agledger_api`
|
|
186
|
+
- `agledger_api` rejects a `path` containing control characters (`\x00` to `\x1f`, `\x7f`) with a `PATH_INVALID` error result.
|
|
216
187
|
|
|
217
188
|
### Changed
|
|
218
189
|
|
|
219
|
-
- `agledger_api` `destructiveHint` annotation
|
|
190
|
+
- The `agledger_api` `destructiveHint` annotation is now `true`, because the tool can dispatch `DELETE` and `PATCH` requests.
|
|
220
191
|
|
|
221
192
|
## [2.4.8] - 2026-05-29
|
|
222
193
|
|
|
223
194
|
### Fixed
|
|
224
195
|
|
|
225
|
-
- `agledger_verify`
|
|
196
|
+
- `agledger_verify` accepts the raw `GET /v1/verification-keys` response envelope (`{data:[...], ...}`) as `publicKeys` and unwraps `.data`. The compact `{keyId: SPKI-DER-base64}` map and the bare `[{keyId, publicKey, ...}]` list are still accepted.
|
|
226
197
|
|
|
227
198
|
## [2.4.7] - 2026-05-29
|
|
228
199
|
|
|
229
200
|
### Changed
|
|
230
201
|
|
|
231
|
-
- `agledger_verify`
|
|
202
|
+
- `agledger_verify` runs on `@agledger/verify-core@^0.1.3`. A denormalized `payload` rewritten while `coseSign1` stays intact fails `CHAIN_PAYLOAD_BINDING_MISMATCH`, and a signature skipped because of an upstream chain break reports `not-checked`.
|
|
232
203
|
|
|
233
204
|
## [2.4.6] - 2026-05-28
|
|
234
205
|
|
|
235
206
|
### Changed
|
|
236
207
|
|
|
237
|
-
-
|
|
208
|
+
- Updated to `@agledger/verify-core` 0.1.2. The `publicKeys` argument of `agledger_verify` accepts either the compact `{keyId: SPKI-DER-base64}` map or the array from `GET /v1/verification-keys` (`[{keyId, publicKey, ...}]`), as a JSON-encoded string or a native object or array. Malformed input returns the standard `{code: "INVALID_JSON", suggestion}` error.
|
|
238
209
|
|
|
239
210
|
## [2.4.5] - 2026-05-28
|
|
240
211
|
|
|
241
212
|
### Changed
|
|
242
213
|
|
|
243
|
-
-
|
|
214
|
+
- Updated to `@agledger/verify-core` 0.1.1. `agledger_verify` applies the `oidc_actor` and `key_temporal` checks to exports that carry the new fields; older exports still report them as `skipped_no_input`.
|
|
244
215
|
|
|
245
216
|
## [2.4.4] - 2026-05-27
|
|
246
217
|
|
|
247
|
-
|
|
218
|
+
`agledger_verify` now runs on the shared verification core `@agledger/verify-core`, the same hash-chain, COSE_Sign1 and Ed25519 logic used by the SDK, CLI and `@agledger/verify`.
|
|
248
219
|
|
|
249
220
|
### Changed
|
|
250
221
|
|
|
251
|
-
- Offline verifier failure reasons are now
|
|
252
|
-
- New `requireOutOfBandKeys` input on
|
|
253
|
-
- The
|
|
222
|
+
- Offline verifier failure reasons are now `FailureCode` values from `@agledger/verify-core`, in SCREAMING_SNAKE case.
|
|
223
|
+
- New `requireOutOfBandKeys` input on `agledger_verify`: fail unless every signature is verified against a caller-supplied key, rejecting keys embedded in the export.
|
|
224
|
+
- The result includes `keyProvenance`, showing whether each verified entry's key was caller-supplied or embedded in the export.
|
|
254
225
|
|
|
255
226
|
## [2.4.3] - 2026-05-27
|
|
256
227
|
|
|
257
228
|
### Fixed
|
|
258
229
|
|
|
259
|
-
- **`agledger_verify` rejected valid exports
|
|
230
|
+
- **`agledger_verify` rejected valid exports.** It now reads `chainPosition` (with a `position` fallback for older exports) instead of only the legacy `position` field.
|
|
260
231
|
|
|
261
232
|
## [2.4.2] - 2026-05-27
|
|
262
233
|
|
|
263
|
-
Tracks AGLedger API v0.25.5 (Verify
|
|
234
|
+
Tracks AGLedger API v0.25.5 (Verify to Gate rename). The renamed routes reach `agledger_api` automatically, and `agledger_verify` is unchanged.
|
|
264
235
|
|
|
265
236
|
### Changed
|
|
266
237
|
|
|
267
|
-
- README: the Verdicts capability is
|
|
238
|
+
- README: the Verdicts capability is described as accept/reject.
|
|
268
239
|
|
|
269
240
|
## [2.4.1] - 2026-05-21
|
|
270
241
|
|
|
271
|
-
Tracks AGLedger API v0.24.0.
|
|
242
|
+
Tracks AGLedger API v0.24.0.
|
|
272
243
|
|
|
273
244
|
### Changed
|
|
274
245
|
|
|
275
|
-
-
|
|
276
|
-
- Integration test fixtures: `/v1/records/{id}/receipts` → `/v1/records/{id}/completions` (vocab cutover leftover from v0.23.0).
|
|
246
|
+
- `agledger_verify`: `RecordAuditExport.exportMetadata.enterpriseId` is now `orgId`, matching the v0.24.0 export shape.
|
|
277
247
|
|
|
278
248
|
## [2.4.0] - 2026-05-19
|
|
279
249
|
|
|
280
|
-
Tracks AGLedger API v0.23.0
|
|
281
|
-
|
|
282
|
-
### Changed (BREAKING — `agledger_verify` tool: format 1.0 → 2.0)
|
|
283
|
-
|
|
284
|
-
- `agledger_verify` now decodes canonical COSE_Sign1 envelopes (RFC 9052, tag 18, EdDSA) over in-toto v1 Statement payloads, deterministic CBOR per RFC 8949 §4.2.1. Replaces the JCS + detached-Ed25519 verifier from 2.3.x.
|
|
285
|
-
- Tool description updated to mention COSE_Sign1 + `Sig_structure` reconstruction + the new failure modes (`cose_decode_failed`, `cose_header_mismatch`).
|
|
286
|
-
- The tool's `structuredContent` result now carries a `signatureCoverage` discriminator (`{ signed, unsigned, skipped, total }`). Agents should not conclude "Ed25519-verified" from `valid: true` alone — surface `signatureCoverage` or `integrityLevel` in their reports.
|
|
287
|
-
- New `chainIntegrityReason: "payload_drift"` — emitted when the visible `payload` jsonb diverges from the predicate signed in `coseSign1` (privileged-DBA-bypass tamper detection).
|
|
288
|
-
- Pre-1.0 export-format JSON (`exportFormatVersion: "1.0"`) is rejected with `unsupported_algorithm`. Re-export the chain from a v0.23.0+ engine. The MCP tool description tells the agent how to do this: `agledger_api method=GET path=/v1/records/{id}/audit-export`.
|
|
289
|
-
- The verifier picks up a `cborg` runtime dependency (only used by the offline-verifier path; the `agledger_discover` + `agledger_api` tools still use direct `fetch`).
|
|
250
|
+
Tracks AGLedger API v0.23.0, which moves the chain to a canonical COSE_Sign1 envelope.
|
|
290
251
|
|
|
291
|
-
### Changed (
|
|
252
|
+
### Changed (breaking)
|
|
292
253
|
|
|
293
|
-
- `
|
|
294
|
-
-
|
|
254
|
+
- `agledger_verify` decodes COSE_Sign1 envelopes (RFC 9052, tag 18, EdDSA) over in-toto v1 Statement payloads with deterministic CBOR (RFC 8949 section 4.2.1), replacing the earlier JCS and detached-Ed25519 verifier.
|
|
255
|
+
- The tool description now covers COSE_Sign1 and the new failure modes `cose_decode_failed` and `cose_header_mismatch`.
|
|
256
|
+
- `structuredContent` carries a `signatureCoverage` object (`{ signed, unsigned, skipped, total }`). Do not conclude "Ed25519-verified" from `valid: true` alone; report `signatureCoverage` or `integrityLevel`.
|
|
257
|
+
- New `chainIntegrityReason: "payload_drift"` when the visible `payload` differs from the predicate signed in `coseSign1`.
|
|
258
|
+
- Export format 1.0 (`exportFormatVersion: "1.0"`) is rejected with `unsupported_algorithm`. Re-export the chain with `agledger_api method=GET path=/v1/records/{id}/audit-export` from a v0.23.0 or later Server.
|
|
259
|
+
- Adds a `cborg` runtime dependency, used only by the offline verifier.
|
|
295
260
|
|
|
296
|
-
|
|
261
|
+
### Changed
|
|
297
262
|
|
|
298
|
-
|
|
263
|
+
- `agledger_discover` quickstart step 4 and the `agledger_api` description now say "submit a completion" with the path `/v1/records/{id}/completions` (was `/v1/records/{id}/receipts`). Update any prompts that target the old path.
|
|
299
264
|
|
|
300
|
-
-
|
|
265
|
+
The three-tool surface is unchanged: `agledger_discover`, `agledger_api` and `agledger_verify`.
|
|
301
266
|
|
|
302
267
|
## [2.3.3] - 2026-05-06
|
|
303
268
|
|
|
304
269
|
### Fixed
|
|
305
270
|
|
|
306
|
-
- **Gemini
|
|
307
|
-
|
|
308
|
-
### Tests
|
|
309
|
-
|
|
310
|
-
- Added Gemini-shape regressions covering all three affected fields: stringified-JSON path, native-object path (back-compat), and malformed-JSON error path. The new `INVALID_JSON` error code surfaces a structured suggestion telling the agent how to retry.
|
|
271
|
+
- **Gemini MCP integrations work on non-trivial calls.** `agledger_api.params`, `agledger_verify.export` and `agledger_verify.publicKeys` are now declared as JSON-encoded strings, which Gemini's function-call grammar accepts. Object-native runtimes (Claude Desktop, ChatGPT MCP) can still pass a native object. Malformed JSON returns the `INVALID_JSON` error with a suggestion for retrying.
|
|
311
272
|
|
|
312
273
|
## [2.3.2] - 2026-05-06
|
|
313
274
|
|
|
314
275
|
### Fixed
|
|
315
276
|
|
|
316
|
-
- **Tool results are
|
|
317
|
-
-
|
|
318
|
-
-
|
|
319
|
-
-
|
|
320
|
-
|
|
321
|
-
### Build
|
|
322
|
-
|
|
323
|
-
- Added a `files` allowlist to `package.json` so the npm tarball only ships `dist/`, `LICENSE`, `README.md`, `CHANGELOG.md`, and `package.json` (24 files vs. 29 in 2.3.1). No more shipping `tests/` or `tsconfig.json`.
|
|
324
|
-
|
|
325
|
-
### Tests
|
|
326
|
-
|
|
327
|
-
- Added `assertContentMirrorsStructured` helper and a dedicated F-531 regression suite covering success and error paths on all three tools, plus a parity test asserting `SERVER_VERSION` matches `package.json`.
|
|
277
|
+
- **Tool results are visible to LLM-driven MCP runtimes.** All three tools now mirror `structuredContent` into a single text content block on every success and error path.
|
|
278
|
+
- `serverInfo.version`, `User-Agent` and the `--help` banner now read the version from `package.json`.
|
|
279
|
+
- The `--help` banner lists all three tools, including `agledger_verify`.
|
|
280
|
+
- The text mirror is no longer pretty-printed, which cuts token use on large responses.
|
|
328
281
|
|
|
329
282
|
## [2.3.1] - 2026-04-30
|
|
330
283
|
|
|
331
|
-
Tracks AGLedger API v0.22.13.
|
|
332
|
-
|
|
333
|
-
### Changed
|
|
334
|
-
|
|
335
|
-
- Re-published as part of the v0.7.1 SDK/CLI sweep tracking API v0.22.13. No tool-surface changes.
|
|
284
|
+
Tracks AGLedger API v0.22.13. No tool-surface changes.
|
|
336
285
|
|
|
337
286
|
## [2.3.0] - 2026-04-27
|
|
338
287
|
|
|
339
|
-
Tracks AGLedger API v0.21.5. Every `/v1/mandates/*` route is now `/v1/records
|
|
288
|
+
Tracks AGLedger API v0.21.5. Every `/v1/mandates/*` route is now `/v1/records/*`, and `Contract Type` is `Type`.
|
|
340
289
|
|
|
341
|
-
### Changed (
|
|
290
|
+
### Changed (breaking)
|
|
342
291
|
|
|
343
|
-
-
|
|
344
|
-
-
|
|
292
|
+
- Offline verifier output fields are renamed: `mandateId` to `recordId` and `contractType` to `type`; `MandateAuditExport` is now `RecordAuditExport`. The signature input `{position}:{payloadHash}:{previousHash}` is unchanged.
|
|
293
|
+
- The `agledger_verify` description points at `/v1/records/{id}/audit-export`, and the `INVALID_EXPORT` error suggestion is updated to match.
|
|
345
294
|
|
|
346
|
-
### Changed
|
|
347
|
-
|
|
348
|
-
- **`agledger_discover` quickstart** now reads:
|
|
349
|
-
1. `GET /v1/schemas` — list Record types.
|
|
350
|
-
2. `GET /v1/schemas/{type}` — get required fields and examples.
|
|
351
|
-
3. `POST /v1/records` — create a record.
|
|
352
|
-
4. `POST /v1/records/{id}/receipts` — submit evidence when done.
|
|
353
|
-
- **`agledger_api` tool description** uses the new vocabulary throughout (workflow steps, path examples, `PATH_INVALID` error message and suggestion).
|
|
354
|
-
- **README** Tools table, Agent workflow section, and "What is AGLedger?" bullet list use Record / Type vocabulary.
|
|
355
|
-
|
|
356
|
-
### Build
|
|
295
|
+
### Changed
|
|
357
296
|
|
|
358
|
-
- `
|
|
297
|
+
- `agledger_discover` quickstart now reads: `GET /v1/schemas` to list Record types, `GET /v1/schemas/{type}` for required fields and examples, `POST /v1/records` to create a record, `POST /v1/records/{id}/receipts` to submit evidence when done.
|
|
298
|
+
- The `agledger_api` description and the README use the Record and Type vocabulary.
|
package/README.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
The official [MCP](https://modelcontextprotocol.io) server for the [AGLedger](https://agledger.ai) API: change control for AI agents. Agent memory, approvals, audit trail, and notifications: one API, one signed ledger, self-hosted.
|
|
4
4
|
|
|
5
|
+
Requires an AGLedger Server 2.0 or later. For a 1.x Server, use `@agledger/mcp-server@2.11.0`, the last release that supports it.
|
|
6
|
+
|
|
5
7
|
Connects any MCP-compatible AI agent (Claude, Cursor, Windsurf, etc.) to the AGLedger API with 2 universal API-pass-through tools plus an offline audit verifier. No SDK code required. Just point your agent at this server.
|
|
6
8
|
|
|
7
9
|
**Learn more**
|
|
@@ -163,7 +165,7 @@ to compare, and it is recorded `unbound`.
|
|
|
163
165
|
|------|-------------|
|
|
164
166
|
| `agledger_discover` | Returns API health, your identity, available scopes, and a quickstart workflow. Call this first. |
|
|
165
167
|
| `agledger_api` | Make any AGLedger API call (method, path, params). Every POST carries a generated `Idempotency-Key`; pass `idempotencyKey` to reuse the first attempt's key when retrying a call that may already have landed. The API returns `nextSteps` on every response for self-guided workflow discovery. |
|
|
166
|
-
| `agledger_verify` | Verify a record audit export offline (COSE_Sign1 envelopes per RFC 9052, hash chain + envelope signatures, Ed25519 or ES256). No network calls. Returns the verifier's result as one JSON text block (the same object as `structuredContent`), with `summary` stating the verdict and the next step. Pass `trustAnchors` (`["sha256:<digest>"]`, the SPKI digest of a vault key the operator took out of band; the installer prints the first one) so the export's signed key statements are walked from a key you trust: an entry under a key the walk does not reach fails `CHAIN_SIGNING_KEY_UNANCHORED`, and a statement that does not hold fails `KEY_STATEMENT_INVALID`, `KEY_CLOSURE_INVALID` or `CHAIN_KEY_WINDOW_DRIFT`. The result carries `verdict`: `trusted` (text `Verdict: PASS`) only when the chain is valid and the walk reached a signature, `failed` (`Verdict: FAIL`), or `unanchored` (`Verdict: VERIFIED, NOT ANCHORED`), which is not a trusted verdict. A run is unanchored without `trustAnchors` (`keyTrust.status` `no_anchor`, the keys taken on the export's word) and when the pin was walked but no signature verified under a key it anchors (`no_anchored_signature`, as for an export of unsigned entries). `distrustedKeys` takes the operator's `VAULT_DISTRUSTED_KEYS` entries and needs `trustAnchors`, and a key both pinned and distrusted is refused (`INVALID_ARGUMENT`), as the Server refuses to start with it; a key statement a distrusted key signed counts for nothing at any instant, because the write times an export carries are not signed. Where an export lists a key retired at the instant the Server distrusts it from (`distrustedFrom`), earlier than its signed retirement, a pinned call without the same `distrustedKeys` entry fails on that key's window (`CHAIN_KEY_WINDOW_DRIFT`, or `KEY_CLOSURE_INVALID` where no closure retires it), and the finding names the entry (`distrustedKeys sha256:<hex>@<distrustedFrom>`), the listing's unsigned word, to confirm with the operator before passing it. `publicKeys` supplies keys (the `GET /v1/verification-keys` response works as is), `requireSuppliedKeys` refuses the export's embedded keys,
|
|
168
|
+
| `agledger_verify` | Verify a record audit export offline (COSE_Sign1 envelopes per RFC 9052, hash chain + envelope signatures, Ed25519 or ES256). No network calls. Returns the verifier's result as one JSON text block (the same object as `structuredContent`), with `summary` stating the verdict and the next step. Pass `trustAnchors` (`["sha256:<digest>"]`, the SPKI digest of a vault key the operator took out of band; the installer prints the first one) so the export's signed key statements are walked from a key you trust: an entry under a key the walk does not reach fails `CHAIN_SIGNING_KEY_UNANCHORED`, and a statement that does not hold fails `KEY_STATEMENT_INVALID`, `KEY_CLOSURE_INVALID` or `CHAIN_KEY_WINDOW_DRIFT`. The result carries `verdict`: `trusted` (text `Verdict: PASS`) only when the chain is valid and the walk reached a signature, `failed` (`Verdict: FAIL`), or `unanchored` (`Verdict: VERIFIED, NOT ANCHORED`), which is not a trusted verdict. A run is unanchored without `trustAnchors` (`keyTrust.status` `no_anchor`, the keys taken on the export's word) and when the pin was walked but no signature verified under a key it anchors (`no_anchored_signature`, as for an export of unsigned entries). `distrustedKeys` takes the operator's `VAULT_DISTRUSTED_KEYS` entries and needs `trustAnchors`, and a key both pinned and distrusted is refused (`INVALID_ARGUMENT`), as the Server refuses to start with it; a key statement a distrusted key signed counts for nothing at any instant, because the write times an export carries are not signed. Where an export lists a key retired at the instant the Server distrusts it from (`distrustedFrom`), earlier than its signed retirement, a pinned call without the same `distrustedKeys` entry fails on that key's window (`CHAIN_KEY_WINDOW_DRIFT`, or `KEY_CLOSURE_INVALID` where no closure retires it), and the finding names the entry (`distrustedKeys sha256:<hex>@<distrustedFrom>`), the listing's unsigned word, to confirm with the operator before passing it. `publicKeys` supplies keys (the `GET /v1/verification-keys` response works as is), `requireSuppliedKeys` refuses the export's embedded keys, `agentKeys` (the agents' cert public keys as JWKs) re-verifies the agent signatures sealed in the chain, and `federationKeys` (`{"<hubId>": "<key>"}`, each peer Server's federation key as its operator gives it) re-verifies the peer messages a receiving Server sealed on its `FEDERATION_*` entries, which fail `CHAIN_FEDERATION_WIRE_INVALID` when they do not hold. After a peer changes its federation key, give an array entry `history`, the JSON the peer serves at `GET /.well-known/agledger-federation-keys.json`, so the entries sealed under its earlier keys verify too. Input verify-core refuses, such as a supplied key window that is not RFC 3339, is `INVALID_ARGUMENT`. Built on the shared `@agledger/verify-core`. |
|
|
167
169
|
|
|
168
170
|
## Resources
|
|
169
171
|
|
|
@@ -178,10 +180,10 @@ Both are fetched live from the running instance, so neither can go stale.
|
|
|
178
180
|
|
|
179
181
|
The `agledger_discover` tool returns a quickstart workflow that guides agents through the accountability flow:
|
|
180
182
|
|
|
181
|
-
1. `GET /v1/schemas
|
|
182
|
-
2. `GET /v1/schemas/{type}
|
|
183
|
-
3. `POST /v1/records
|
|
184
|
-
4. `POST /v1/records/{id}/completions
|
|
183
|
+
1. `GET /v1/schemas`: list available Record types
|
|
184
|
+
2. `GET /v1/schemas/{type}`: get required fields and examples
|
|
185
|
+
3. `POST /v1/records`: create a record
|
|
186
|
+
4. `POST /v1/records/{id}/completions`: submit a completion (evidence) when done
|
|
185
187
|
|
|
186
188
|
Every API error response includes a `recoveryHint` naming the fix, so an agent can correct itself without a human. Errors raised by the MCP server itself (an argument the tool does not declare, a timeout, a credential failure) carry a `code` and a `suggestion` instead.
|
|
187
189
|
|
|
@@ -199,10 +201,10 @@ A call that times out may still have been applied. On a POST, the `TIMEOUT` erro
|
|
|
199
201
|
|
|
200
202
|
AGLedger is change control for AI agents, delivered as a signed ledger for agentic work. Agents notarize what they intended and what they did, principals approve the work that needs a decision, and every entry is signed, hash-chained and verifiable offline.
|
|
201
203
|
|
|
202
|
-
- **Records
|
|
203
|
-
- **Completions
|
|
204
|
-
- **Verdicts
|
|
205
|
-
- **Audit chain
|
|
204
|
+
- **Records**: structured commitments with acceptance criteria and tolerance bands
|
|
205
|
+
- **Completions**: performer evidence recording what was reported to be done
|
|
206
|
+
- **Verdicts**: principal accept/reject decisions on a Completion (the Gate), with settlement signals
|
|
207
|
+
- **Audit chain**: notarized records as COSE_Sign1 envelopes, hash-chained, Ed25519-signed, tamper-evident, verifiable offline
|
|
206
208
|
|
|
207
209
|
Learn more at [agledger.ai](https://www.agledger.ai) | [API docs](https://www.agledger.ai/docs/)
|
|
208
210
|
|
package/dist/server.d.ts
CHANGED
|
@@ -24,6 +24,28 @@ export interface AgledgerMcpServerOptions {
|
|
|
24
24
|
/** Request timeout in milliseconds. Default 30000. */
|
|
25
25
|
timeoutMs?: number;
|
|
26
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* The summary lines on the evidence bodies an `?evidence=true` export
|
|
29
|
+
* inlines, each re-bound to the hash its entry signs. Silent when every one
|
|
30
|
+
* re-bound, or when the export carries none.
|
|
31
|
+
*/
|
|
32
|
+
export declare function evidenceLines(counts: {
|
|
33
|
+
present: number;
|
|
34
|
+
verified: number;
|
|
35
|
+
clientHashed: number;
|
|
36
|
+
failed: number;
|
|
37
|
+
}): string[];
|
|
38
|
+
/**
|
|
39
|
+
* The summary lines on the sealed federation messages. `failed` ones failed a
|
|
40
|
+
* check (a key given for the hub that did not match among them); the rest of
|
|
41
|
+
* the unverified ones came from a hub no key was given for.
|
|
42
|
+
*/
|
|
43
|
+
export declare function peerMessageLines(wire: {
|
|
44
|
+
present: number;
|
|
45
|
+
verified: number;
|
|
46
|
+
failed: number;
|
|
47
|
+
afterRetirement: number;
|
|
48
|
+
}): string[];
|
|
27
49
|
export declare class AgledgerMcpServer {
|
|
28
50
|
readonly mcp: McpServer;
|
|
29
51
|
readonly client: ApiClient;
|
package/dist/server.js
CHANGED
|
@@ -29,7 +29,8 @@ const QUICKSTART = {
|
|
|
29
29
|
],
|
|
30
30
|
};
|
|
31
31
|
const DOCS = {
|
|
32
|
-
description: '
|
|
32
|
+
description: 'Most API responses carry nextSteps for self-guided workflow discovery; follow them when present ' +
|
|
33
|
+
'(listings, the schema catalogue and the org listing carry none). ' +
|
|
33
34
|
'Call GET /openapi.json (also exposed as the agledger://openapi resource) for the full route catalog, ' +
|
|
34
35
|
'and GET /llms.txt (also exposed as the agledger://llms.txt resource) for the prose narrative ' +
|
|
35
36
|
'written for agents: what the product is for, the vocabulary, and how the pieces fit together. ' +
|
|
@@ -248,8 +249,44 @@ function verifyVerdictText(result) {
|
|
|
248
249
|
if (present > verified) {
|
|
249
250
|
lines.push(`${present - verified} of ${present} agent signatures were not checked: pass agentKeys with the agents' cert public keys to re-verify them.`);
|
|
250
251
|
}
|
|
252
|
+
lines.push(...peerMessageLines(result.federationWire));
|
|
253
|
+
lines.push(...evidenceLines(result.evidenceBinding));
|
|
251
254
|
return lines.join('\n');
|
|
252
255
|
}
|
|
256
|
+
/**
|
|
257
|
+
* The summary lines on the evidence bodies an `?evidence=true` export
|
|
258
|
+
* inlines, each re-bound to the hash its entry signs. Silent when every one
|
|
259
|
+
* re-bound, or when the export carries none.
|
|
260
|
+
*/
|
|
261
|
+
export function evidenceLines(counts) {
|
|
262
|
+
const lines = [];
|
|
263
|
+
if (counts.failed > 0) {
|
|
264
|
+
lines.push(`${counts.failed} of ${counts.present} inlined evidence bodies failed CHAIN_EVIDENCE_BINDING_MISMATCH: they do not hash to the evidenceHash or payloadHash their entry signs.`);
|
|
265
|
+
}
|
|
266
|
+
if (counts.clientHashed > 0) {
|
|
267
|
+
lines.push(`${counts.clientHashed} of ${counts.present} inlined evidence bodies are on an encrypted-mode completion, whose signed hash covers a cleartext the export does not carry, so they were not re-bound: decrypt and hash them yourself.`);
|
|
268
|
+
}
|
|
269
|
+
return lines;
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* The summary lines on the sealed federation messages. `failed` ones failed a
|
|
273
|
+
* check (a key given for the hub that did not match among them); the rest of
|
|
274
|
+
* the unverified ones came from a hub no key was given for.
|
|
275
|
+
*/
|
|
276
|
+
export function peerMessageLines(wire) {
|
|
277
|
+
const lines = [];
|
|
278
|
+
if (wire.afterRetirement > 0) {
|
|
279
|
+
lines.push(`${wire.afterRetirement} of ${wire.present} sealed peer messages the peer signed under a key it had already retired: in order when the receiver's federation.peer_revoked audit row for the peer comes after them.`);
|
|
280
|
+
}
|
|
281
|
+
if (wire.failed > 0) {
|
|
282
|
+
lines.push(`${wire.failed} of ${wire.present} sealed peer messages failed CHAIN_FEDERATION_WIRE_INVALID.`);
|
|
283
|
+
}
|
|
284
|
+
const noKey = wire.present - wire.verified - wire.failed;
|
|
285
|
+
if (noKey > 0) {
|
|
286
|
+
lines.push(`${noKey} of ${wire.present} sealed peer messages were hashed and matched to their entry but their peer signature was not checked: pass federationKeys with each sending hub's federation key to re-verify them.`);
|
|
287
|
+
}
|
|
288
|
+
return lines;
|
|
289
|
+
}
|
|
253
290
|
/**
|
|
254
291
|
* Every code `agledger_verify` can report, named in its description so a model
|
|
255
292
|
* can branch on them. The list used to be typed out by hand and fell three
|
|
@@ -280,6 +317,8 @@ const EXPORT_FAILURE_CODES = [
|
|
|
280
317
|
'CHAIN_SIGNING_KEY_DRIFT',
|
|
281
318
|
'CHAIN_ACTOR_ATTRIBUTION_MISMATCH',
|
|
282
319
|
'CHAIN_AGENT_SIGNATURE_INVALID',
|
|
320
|
+
'CHAIN_FEDERATION_WIRE_INVALID',
|
|
321
|
+
'CHAIN_EVIDENCE_BINDING_MISMATCH',
|
|
283
322
|
'CHAIN_UNSUPPORTED_ALGORITHM',
|
|
284
323
|
'CHAIN_SIGNING_KEY_UNANCHORED',
|
|
285
324
|
'KEY_STATEMENT_INVALID',
|
|
@@ -363,6 +402,22 @@ const VERIFY_ARGS = {
|
|
|
363
402
|
'An entry whose sealed agent signature names one of these keys by thumbprint has that ' +
|
|
364
403
|
'signature re-verified offline, and fails CHAIN_AGENT_SIGNATURE_INVALID if it does not verify. ' +
|
|
365
404
|
'Without it, agent signatures are counted in result.agentSignatures but not checked.'),
|
|
405
|
+
federationKeys: jsonStringField
|
|
406
|
+
.optional()
|
|
407
|
+
.describe('Optional peer federation keys, as a JSON-encoded object \'{"<hubId>":"<key>"}\' or array ' +
|
|
408
|
+
'\'[{"hubId":"...","publicKey":"..."}]\', each key the peer Server\'s Ed25519 federation key as its ' +
|
|
409
|
+
'operator gives it (base64 SPKI DER, or base64 of the raw 32 bytes the handshake registered). ' +
|
|
410
|
+
'A receiving Server seals each peer message it accepts on the chain entry it writes (payload.wire), ' +
|
|
411
|
+
'as the peer signed it. Every sealed message is held to its body hash and to its entry; one from a ' +
|
|
412
|
+
'hub given here also has its signature re-verified under that key, which proves what the peer ' +
|
|
413
|
+
'asserted from this export alone, and fails CHAIN_FEDERATION_WIRE_INVALID if it does not verify. ' +
|
|
414
|
+
'After a peer changes its federation key, add "history" to an array entry: the JSON the peer serves at ' +
|
|
415
|
+
'GET /.well-known/agledger-federation-keys.json (no auth). Every key it links to that entry\'s publicKey ' +
|
|
416
|
+
'through successions both keys signed is then trusted inside its window, so entries sealed before the ' +
|
|
417
|
+
'change verify; each message is placed in its key\'s window by its signed wire.timestamp. A hub may appear ' +
|
|
418
|
+
'twice, to pin a key no succession links or one the history does not list. ' +
|
|
419
|
+
'result.federationWire counts present, verified, failed and afterRetirement (verified, but signed by the ' +
|
|
420
|
+
'peer under a key it had already retired).'),
|
|
366
421
|
requireKeyId: z
|
|
367
422
|
.string()
|
|
368
423
|
.optional()
|
|
@@ -474,8 +529,10 @@ export class AgledgerMcpServer {
|
|
|
474
529
|
});
|
|
475
530
|
this.mcp.registerTool('agledger_api', {
|
|
476
531
|
title: 'AGLedger API',
|
|
477
|
-
description: 'Make any AGLedger API call.
|
|
478
|
-
'
|
|
532
|
+
description: 'Make any AGLedger API call. API routes live under /v1/; the discovery documents ' +
|
|
533
|
+
'(/openapi.json, /llms.txt, /llms-full.txt, /lifecycle) and /a2a sit at the root. ' +
|
|
534
|
+
'Most responses carry nextSteps: follow them when present (listing pages, GET /v1/schemas ' +
|
|
535
|
+
'and GET /v1/admin/orgs carry none). Workflow: ' +
|
|
479
536
|
'1. GET /v1/schemas, list Record types. ' +
|
|
480
537
|
'2. GET /v1/schemas/{type}, get required fields and examples. ' +
|
|
481
538
|
'3. POST /v1/records, create a record. ' +
|
|
@@ -604,6 +661,8 @@ export class AgledgerMcpServer {
|
|
|
604
661
|
'On failure, brokenAt pinpoints the first entry that failed and its canonical code ' +
|
|
605
662
|
`(${EXPORT_FAILURE_CODES.join(', ')}); CHAIN_UNSUPPORTED_ALGORITHM means this build ` +
|
|
606
663
|
'could not compute the key\'s algorithm: upgrade, and never read it as a pass. Obtain the export via agledger_api with method=GET, path=/v1/records/{id}/audit-export. ' +
|
|
664
|
+
'Add params \'{"evidence":true}\' to inline each completion\'s evidence and each dispute\'s filed payload: every inlined body is ' +
|
|
665
|
+
're-bound to the hash its entry signs (result.evidenceBinding; an edited one fails CHAIN_EVIDENCE_BINDING_MISMATCH). ' +
|
|
607
666
|
'For the raw COSE_Sign1 stream, use path=/v1/records/{id}/attestation.',
|
|
608
667
|
inputSchema: toolInput(VERIFY_ARGS),
|
|
609
668
|
annotations: {
|
|
@@ -621,7 +680,7 @@ export class AgledgerMcpServer {
|
|
|
621
680
|
if (refused)
|
|
622
681
|
return refused;
|
|
623
682
|
try {
|
|
624
|
-
const { export: exportRaw, publicKeys: publicKeysRaw, agentKeys: agentKeysRaw, trustAnchors, distrustedKeys, requireKeyId, requireSuppliedKeys, } = args;
|
|
683
|
+
const { export: exportRaw, publicKeys: publicKeysRaw, agentKeys: agentKeysRaw, federationKeys: federationKeysRaw, trustAnchors, distrustedKeys, requireKeyId, requireSuppliedKeys, } = args;
|
|
625
684
|
const decodedExport = parseJsonObject(exportRaw, 'export');
|
|
626
685
|
if (!decodedExport.ok)
|
|
627
686
|
return decodedExport.error;
|
|
@@ -667,9 +726,17 @@ export class AgledgerMcpServer {
|
|
|
667
726
|
}
|
|
668
727
|
agentKeys = decodedAgentKeys.value;
|
|
669
728
|
}
|
|
729
|
+
let federationKeys;
|
|
730
|
+
if (federationKeysRaw !== undefined && federationKeysRaw !== '') {
|
|
731
|
+
const decodedFederationKeys = parseJsonObjectOrArray(federationKeysRaw, 'federationKeys');
|
|
732
|
+
if (!decodedFederationKeys.ok)
|
|
733
|
+
return decodedFederationKeys.error;
|
|
734
|
+
federationKeys = decodedFederationKeys.value;
|
|
735
|
+
}
|
|
670
736
|
const result = verifyAuditExport(exportData, {
|
|
671
737
|
publicKeys,
|
|
672
738
|
agentKeys,
|
|
739
|
+
federationKeys,
|
|
673
740
|
requireKeyId,
|
|
674
741
|
requireSuppliedKeys,
|
|
675
742
|
...(anchored ? { trustAnchors, distrustedKeys } : {}),
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agledger/mcp-server",
|
|
3
|
-
"version": "3.
|
|
4
|
-
"description": "AGLedger MCP
|
|
3
|
+
"version": "3.1.0",
|
|
4
|
+
"description": "AGLedger MCP server: the AGLedger API as MCP tools, so any MCP-capable agent can write to the signed ledger.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"author": "AGLedger LLC",
|
|
7
7
|
"repository": {
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"prepublishOnly": "npm run build && npm run lint:pkg"
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@agledger/verify-core": "^2.
|
|
58
|
+
"@agledger/verify-core": "^2.1.0",
|
|
59
59
|
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
60
60
|
"zod": "^3.25.0 || ^4.0.0"
|
|
61
61
|
},
|