@ziffer-io/mcp 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.
package/LICENSE ADDED
@@ -0,0 +1,120 @@
1
+ ZIFFER SDK LICENSE
2
+
3
+ Copyright (c) 2026 code75 SASU, Paris, France. All rights reserved.
4
+ ZIFFER is a registered trademark of code75 SASU ("code75") — code75.io · ziffer.io
5
+
6
+ This licence governs the software package it accompanies (the "SDK"): the ZIFFER client
7
+ libraries, receipt verifier, wire types and MCP server published by code75. The SDK is
8
+ proprietary software. It is not open source.
9
+
10
+ 1. DEFINITIONS
11
+ "Agreement" means the written contract under which code75 provides the ZIFFER service to
12
+ you or the organisation you act for. code75's standard form of that contract is the ZIFFER
13
+ Customer Agreement, docs/legal/ziffer-customer-agreement.md, v0.1, provided on request.
14
+ "Service" means the ZIFFER service so provided. "You" means the person or organisation
15
+ using the SDK under an Agreement.
16
+
17
+ 2. LICENCE
18
+ Subject to the Agreement and to this licence, code75 grants you a limited, non-exclusive,
19
+ non-transferable, non-sublicensable, revocable licence to install and run the SDK, in
20
+ unmodified form, solely to interact with the Service and to verify the receipts it issues,
21
+ for the term of the Agreement.
22
+
23
+ 3. RESTRICTIONS
24
+ Except as expressly permitted by section 2 or by a law that cannot be excluded by
25
+ contract, you shall not, and shall not permit anyone else to:
26
+ (a) copy, distribute, publish, sublicense, sell, rent, lease or lend the SDK, or make it
27
+ available to any third party;
28
+ (b) modify, adapt, translate or create derivative works of the SDK;
29
+ (c) reverse engineer, decompile, disassemble or otherwise attempt to derive the source
30
+ code, algorithms or protocols of the SDK or the Service;
31
+ (d) use the SDK to build, train or benchmark a product or service that competes with the
32
+ Service, or to access the Service other than through the interfaces code75 documents;
33
+ (e) circumvent, disable or interfere with any security, verification or usage-control
34
+ mechanism of the SDK or the Service;
35
+ (f) remove, obscure or alter any copyright, trademark or other proprietary notice on or
36
+ in the SDK.
37
+
38
+ 4. OWNERSHIP AND INTELLECTUAL PROPERTY
39
+ The SDK is licensed, not sold. code75 and its licensors own and retain all right, title
40
+ and interest in and to the SDK and the Service, including all copyright, patent, trade
41
+ secret, trademark and other intellectual property rights, and all improvements and
42
+ derivative works, by whomever made. Nothing in this licence transfers any such right to
43
+ you. All rights not expressly granted are reserved. Any suggestion, idea or feedback you
44
+ provide about the SDK or the Service may be used by code75 without restriction or
45
+ compensation. "ZIFFER" and "code75" and the associated logos are brands and marks of
46
+ code75; this licence grants no right to use them.
47
+
48
+ 5. THIRD-PARTY COMPONENTS
49
+ The SDK includes third-party open-source components listed in the accompanying file
50
+ THIRD-PARTY-NOTICES. Those components are licensed under their own terms, which govern
51
+ them and prevail over this licence for those components only. This licence does not
52
+ apply to them.
53
+
54
+ 6. UPDATES
55
+ code75 may release updated versions of the SDK. This licence applies to each version you
56
+ install unless a later version is accompanied by a different licence. code75 has no
57
+ obligation to provide updates or support except as stated in the Agreement.
58
+
59
+ 7. YOUR RESPONSIBILITY FOR YOUR ACTIONS AND YOUR DATA
60
+ The Service issues decisions and signed receipts; it does not perform any action. You
61
+ alone decide what your systems do with a decision, you alone hold the credentials with
62
+ which any action is performed, and you alone are responsible for every action your
63
+ systems take or fail to take, for the policy you write and sign, for the data you submit
64
+ to the Service, and for your compliance with applicable law, including data protection,
65
+ export control and sanctions laws. A decision or receipt is not legal, regulatory,
66
+ financial or professional advice and is not a guarantee that any action is lawful,
67
+ appropriate or safe.
68
+
69
+ 7A. INDEMNITY
70
+ You shall defend, indemnify and hold harmless code75, its officers, employees and
71
+ contractors from and against any claim, loss, liability, damage, cost or expense
72
+ (including reasonable legal fees) arising out of or relating to: (a) your use of the
73
+ SDK or the Service; (b) any action taken or not taken by your systems; (c) the policy,
74
+ data or content you provide; or (d) your breach of this licence, the Agreement or
75
+ applicable law.
76
+
77
+ 7B. PRE-RELEASE SOFTWARE
78
+ The SDK and the Service may be provided in a pre-release, evaluation or limited form.
79
+ You accept that such software may contain errors and may change or be withdrawn, and
80
+ you use it at your own risk.
81
+
82
+ 8. NO WARRANTY
83
+ THE SDK IS PROVIDED "AS IS" AND "AS AVAILABLE", WITHOUT WARRANTY OF ANY KIND, EXPRESS,
84
+ IMPLIED OR STATUTORY, INCLUDING WITHOUT LIMITATION ANY WARRANTY OF MERCHANTABILITY,
85
+ FITNESS FOR A PARTICULAR PURPOSE, TITLE OR NON-INFRINGEMENT, TO THE MAXIMUM EXTENT
86
+ PERMITTED BY LAW.
87
+
88
+ 9. LIMITATION OF LIABILITY
89
+ TO THE MAXIMUM EXTENT PERMITTED BY LAW, CODE75 SHALL NOT BE LIABLE FOR ANY INDIRECT,
90
+ INCIDENTAL, SPECIAL, CONSEQUENTIAL OR PUNITIVE DAMAGES, OR FOR ANY LOSS OF PROFITS,
91
+ REVENUE, DATA OR GOODWILL, ARISING OUT OF OR RELATING TO THE SDK, HOWEVER CAUSED AND
92
+ UNDER ANY THEORY OF LIABILITY, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
93
+ CODE75'S TOTAL LIABILITY UNDER THIS LICENCE SHALL NOT EXCEED THE AMOUNT STATED IN THE
94
+ AGREEMENT OR, IF NONE IS STATED, ONE HUNDRED EUROS (EUR 100). Nothing in this licence
95
+ excludes or limits liability that cannot be excluded or limited under applicable law.
96
+
97
+ 10. TERMINATION
98
+ This licence terminates automatically, without notice, if you breach it or when the
99
+ Agreement ends. On termination you shall stop all use of the SDK and destroy every copy
100
+ in your possession or control. Sections 3, 4, 7, 7A, 8, 9, 10, 11 and 12 survive
101
+ termination.
102
+
103
+ 11. GOVERNING LAW AND JURISDICTION
104
+ This licence is governed by the laws of France, without regard to conflict-of-law rules.
105
+ Any dispute arising out of or relating to this licence is submitted to the exclusive
106
+ jurisdiction of the competent courts of Paris, France, unless the Agreement states
107
+ otherwise.
108
+
109
+ 12. GENERAL
110
+ This licence, the Agreement and THIRD-PARTY-NOTICES are the entire terms for the SDK.
111
+ Where this licence and the Agreement conflict, the Agreement prevails. If any provision
112
+ of this licence is held unenforceable, it is enforced to the maximum extent permitted
113
+ and the remainder stays in effect. No failure or delay by code75 in exercising a right
114
+ is a waiver of it. You may not assign this licence without code75's written consent;
115
+ code75 may assign it to a successor of the ZIFFER business. Any claim by you relating to
116
+ the SDK must be brought within one (1) year after it arises, to the extent the law
117
+ allows. This licence is written in English; a translation is for convenience only and
118
+ the English text prevails.
119
+
120
+ Contact: code75 SASU, Paris — code75.io · ziffer.io
package/README.md ADDED
@@ -0,0 +1,136 @@
1
+ # `@ziffer-io/mcp`
2
+
3
+ A local MCP server, over stdio, so a coding agent can integrate the ZIFFER SDK against our real
4
+ documentation and drive a live decision loop while testing.
5
+
6
+ ```bash
7
+ npx @ziffer-io/mcp
8
+ ```
9
+
10
+ ## What it is, and the boundary that matters
11
+
12
+ **This server has no hands on your machine.** It serves knowledge and ZIFFER-side calls. It
13
+ writes no files, runs no commands, and starts no processes. Your coding agent is the thing that
14
+ edits your code; this is a source it can ask.
15
+
16
+ That boundary is also the honest limit of what it does for your security posture:
17
+
18
+ > **MCP alone routes the question; only the SDK's `verify` line enforces the answer.**
19
+
20
+ An agent that has talked to this server has not thereby been gated by anything. It runs on a
21
+ developer's machine at development time and is nowhere near your production path. What gates an
22
+ action is the `verify` call that ends up in your handler — `docs/onboarding/sdk.md` section 6
23
+ says so at length, and that document is what `get_integration_guide` serves.
24
+
25
+ ## The five tools
26
+
27
+ | tool | what it does | needs |
28
+ | --- | --- | --- |
29
+ | `get_integration_guide` | returns `docs/onboarding/sdk.md` for `python` or `typescript` | nothing |
30
+ | `propose` | submits one wire Proposal, returns the gateway response verbatim | `ZIFFER_API_URL`, `ZIFFER_API_KEY` |
31
+ | `check_decision` | one decision by id, receipt included when present | `ZIFFER_API_URL`, `ZIFFER_API_KEY` |
32
+ | `explain_receipt` | verifies a receipt, reports `valid: bound to <hash>` or the named clause | `ZIFFER_TRUST_ANCHOR`, `ZIFFER_SUITE_FLOOR` |
33
+ | `sandbox_status` | whether a tenant id is a sandbox, and whether one decision still waits on its robot approver | nothing, or `ZIFFER_API_URL`+`ZIFFER_API_KEY` with a `decision_id` |
34
+
35
+ `explain_receipt` takes the proposal as **base64 of the bytes your code passes to `verify`**,
36
+ not as a JSON object, because `verify` takes bytes and this tool exists to reproduce your call.
37
+ Accepting an object would insert an encoding step your production path does not have, and would
38
+ hide one real failure outright: bytes that are not UTF-8 JSON at all — a truncated read, a
39
+ double-encoded string — which the verifier refuses under `AT-8a`.
40
+
41
+ **Key order and whitespace are not the issue**, and it is worth saying because the opposite reads
42
+ so plausibly that an earlier draft of this package asserted it. The verifier parses your bytes and
43
+ canonicalises them itself, so `JSON.stringify`, `json.dumps` and a pretty-printed copy of one
44
+ object all verify identically. A `9.3-3` means a genuinely different proposal, and the tool's hint
45
+ says so.
46
+
47
+ There is **no approve tool and no simulated approval**, and there will not be one added quietly.
48
+ An approval minted on a laptop is a fake receipt factory, which is the exact artifact this product
49
+ exists to make impossible.
50
+
51
+ `sandbox_status` is not an exception to that, and the reason is the design rather than a
52
+ concession. Until ACP-213 this file said a sandbox mode was "a separate ticket with its own
53
+ design"; that ticket landed, and the design is: **a ZIFFER sandbox is a separate tenant** with its
54
+ own receipt signing identity, approved by a robot service inside the deployment holding keys this
55
+ machine never sees. So a sandbox receipt is signed by a different key and fails production
56
+ verification (`9.3-1`) by construction. There is a truthful thing for a client to report, and
57
+ still nothing for it to approve — `sandbox_status` reads a name and asks the API about one
58
+ decision, verifies nothing, and says so in its own output. `docs/onboarding/sandbox.md` states
59
+ what the marker guarantees and what it does not.
60
+
61
+ ## Configuration
62
+
63
+ | variable | what it is |
64
+ | --- | --- |
65
+ | `ZIFFER_API_URL` | the gateway base URL. `https://`, or `http://` on loopback only — the key is a bearer credential |
66
+ | `ZIFFER_API_KEY` | your API key. **It determines the tenant**; nothing here sends a tenant name |
67
+ | `ZIFFER_TRUST_ANCHOR` | path to an `acp-bundle pubkey --key <keyfile> --out anchor.json` document |
68
+ | `ZIFFER_SUITE_FLOOR` | the CR-4 signature suite floor. No default, deliberately |
69
+
70
+ **The server starts without any of them**, which inverts the rule every other process in this
71
+ repository follows. The reason is in `src/config.ts`: a stdio server that exits during the
72
+ handshake tells the agent only that the server failed to start, and the name of the missing
73
+ variable dies on a stderr nobody is reading. So each tool refuses on its own, by name, telling
74
+ the agent exactly which variable to set. `get_integration_guide` needs nothing at all, so an
75
+ agent can read how to integrate before any credential exists.
76
+
77
+ Nothing is defaulted. An unconfigured `propose` sends no request; an unconfigured
78
+ `explain_receipt` verifies nothing. The refusal moved from process exit to tool result; it did
79
+ not become a fallback.
80
+
81
+ ## What does not work yet
82
+
83
+ 1. **`npx @ziffer-io/mcp` does not resolve, because nothing is published yet — but the reason it
84
+ *could not have been* published is now fixed (ACP-214).** Until this change the blocker was
85
+ structural: this package depended on `@acp/client` and `@acp/verify`, which were unpublished
86
+ workspace packages, and `@acp/client` in turn declared the engine's `@acp/types` as a `git+`
87
+ dependency on a repository that is **private** — so a developer who ran `npx` would have got a
88
+ command that installs and then cannot start, or cannot install at all. That is closed. There
89
+ are four packages now (`@ziffer-io/types`, `@ziffer-io/verify`, `@ziffer-io/client` and this
90
+ one), each publishing compiled `dist/` with no git dependency and nothing for a consumer to
91
+ build, and `tools/release-npm.sh` packs and checks all four in dependency order.
92
+
93
+ **What remains is the act, and it is the operator's.** The release script prints the four
94
+ `npm publish` lines and the tag line and never runs them; nothing reaches the registry until a
95
+ person pastes them. So this item stays in this section: today `npx @ziffer-io/mcp` still
96
+ resolves to nothing, and it will keep saying so here until the first publication has actually
97
+ happened rather than merely become possible. Note also that the first publish of each package
98
+ must be that manual one — npm cannot register a trusted publisher for a package that does not
99
+ exist yet, so CI takes over only from the second release.
100
+
101
+ 2. **All five tools ran against a live gateway on 2026-09-03; what is still untried is a
102
+ *deployed* one.** Until that day this item read, in these words, "`propose` and
103
+ `check_decision` have never been run against a live gateway [...] treat the two as
104
+ wired-and-untried rather than proven", and `tools/rehearse/03-loop.sh` exists to end it (the
105
+ transcript is `tools/rehearsal-2026-09-03.json`, `rehearsal GREEN: 4 of 4 steps`). That
106
+ step drives this server over a spawned stdio transport against `services/gateway` in a
107
+ container, over the composed configuration tree of a real sandbox tenant: `propose` returned
108
+ the gateway's answer verbatim, `check_decision` was polled until the receipt attached,
109
+ `explain_receipt` reported that receipt valid and refused one bound to a different proposal at
110
+ `9.3-3`, and `sandbox_status` and `get_integration_guide` answered beside them. What that run
111
+ did **not** cover is a deployed control plane rather than a local compose stack — and it was
112
+ driven by a script, which is item 3. It is evidence about that tree on that day and nothing
113
+ later; `tools/rehearse.sh` records each rehearsal as `tools/rehearsal-<date>.json`.
114
+
115
+ 3. **Nothing here has been exercised by a real coding agent.** The tool descriptions are written
116
+ for a model to act on, and whether a model reads them the way they were meant is a question
117
+ about models, not about this code. No test can answer it, and none here claims to.
118
+
119
+ ## Development
120
+
121
+ ```bash
122
+ pnpm --filter @ziffer-io/mcp test # embed the guide, build, run node --test
123
+ ```
124
+
125
+ The build copies `docs/onboarding/sdk.md` into `src/generated/` (gitignored) so the published
126
+ server carries the guide it serves. `src/guide.test.ts` reads that document from the repository
127
+ and asserts the served text matches it, so an edit to the doc without a rebuild fails the suite
128
+ rather than shipping a stale answer.
129
+
130
+ ## Licence
131
+
132
+ Proprietary. Copyright (c) 2026 code75 SASU, Paris, France. ZIFFER is a registered trademark of code75
133
+ SASU. This package is **not open source**: it is licensed for use with the ZIFFER service under
134
+ your agreement with code75, on the terms in `LICENSE` beside this file. The third-party
135
+ open-source components it redistributes are listed in `THIRD-PARTY-NOTICES` and are governed by
136
+ their own licences.