@forestrie/mcp-register 0.1.0 → 0.1.1
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/README.md +61 -9
- package/dist/core/version.d.ts +1 -1
- package/dist/core/version.js +1 -1
- package/package.json +2 -2
- package/src/core/version.ts +1 -1
package/README.md
CHANGED
|
@@ -19,15 +19,17 @@ with a separate authority key, held the same way. The model never handles
|
|
|
19
19
|
signature bytes: you pass the payload and the server signs it. No tool takes
|
|
20
20
|
a signature or a key as input.
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
Paying is optional, and the payer is yours. The server never creates a payer
|
|
23
|
+
key and holds no funds of its own: you choose how payment happens (see
|
|
24
|
+
[Choosing a payer](#choosing-a-payer)). Whichever you choose, a payer key
|
|
25
|
+
never crosses the MCP boundary, and the spending caps are configuration, not
|
|
26
|
+
tool arguments. With no payer configured, the server spends nothing: it
|
|
27
|
+
returns canopy's payment requirements, and you pay from your own x402 wallet
|
|
28
|
+
(relay mode).
|
|
27
29
|
|
|
28
30
|
## Status
|
|
29
31
|
|
|
30
|
-
|
|
32
|
+
Version 0.1.1 on npm, published with provenance from `publish.yml`. 0.1.0 was published by hand and has no provenance attestation; use 0.1.1 or later.
|
|
31
33
|
|
|
32
34
|
## Tools
|
|
33
35
|
|
|
@@ -67,7 +69,59 @@ Every value can be overridden per call.
|
|
|
67
69
|
| `MCP_REGISTER_KEY_FILE` | the log key file, default `$MCP_REGISTER_HOME/log-key.jwk` |
|
|
68
70
|
| `MCP_REGISTER_AUTHORITY_KEY_FILE` | the authority key file, default `$MCP_REGISTER_HOME/authority-key.jwk` |
|
|
69
71
|
|
|
70
|
-
###
|
|
72
|
+
### Choosing a payer
|
|
73
|
+
|
|
74
|
+
Whoever wants the work done pays for it: the requester, paying canopy
|
|
75
|
+
directly. The server supports three ways to do that and prefers none of them.
|
|
76
|
+
|
|
77
|
+
| Setup | What you configure | Who holds the key |
|
|
78
|
+
| ---------------- | ------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------- |
|
|
79
|
+
| Relay | nothing | your own x402 wallet: `register_grant` returns canopy's payment requirements and resumes on a call that carries your `X-PAYMENT` |
|
|
80
|
+
| Key file | `MCP_REGISTER_PAYER_KEY_FILE` and the caps below | a file on the machine that runs the server |
|
|
81
|
+
| Your own backend | `createServer({ payer })` from `@forestrie/mcp-register/server`, when you embed the server | whatever your `PayerBackend` uses: a hosted wallet, a KMS, a remote signer |
|
|
82
|
+
|
|
83
|
+
A backend of your own must sign an EIP-3009 authorisation with the nonce it
|
|
84
|
+
is given. That nonce is what stops one grant being paid for twice (see
|
|
85
|
+
[Payment settings](#payment-settings)).
|
|
86
|
+
|
|
87
|
+
#### Example: a dedicated key file
|
|
88
|
+
|
|
89
|
+
This is one way to set up the key-file payer, not the way. Any EVM account
|
|
90
|
+
works; what matters is that it pays for this and nothing else.
|
|
91
|
+
|
|
92
|
+
1. Create a private key in a file only you can read. Any wallet tool that
|
|
93
|
+
exports a raw private key will do. With no extra tools:
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
( umask 077; printf '0x%s\n' "$(openssl rand -hex 32)" > payer.key )
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
The server accepts one line, `0x` and 64 hex digits, in a regular file
|
|
100
|
+
(not a symlink) that no other user can read.
|
|
101
|
+
|
|
102
|
+
2. Find the account's address with a tool you already trust to derive one
|
|
103
|
+
from a private key, or by importing the key into a wallet you use.
|
|
104
|
+
|
|
105
|
+
3. Fund the address with the asset canopy charges in. On the default
|
|
106
|
+
network, Base Sepolia, that is testnet USDC, from
|
|
107
|
+
[Circle's faucet](https://faucet.circle.com). The account needs no ETH:
|
|
108
|
+
it only signs an authorisation, and the x402 facilitator submits the
|
|
109
|
+
transfer and pays its gas.
|
|
110
|
+
|
|
111
|
+
4. Point the server at the file and set the caps:
|
|
112
|
+
|
|
113
|
+
```
|
|
114
|
+
MCP_REGISTER_PAYER_KEY_FILE=/path/to/payer.key
|
|
115
|
+
MCP_REGISTER_PAY_MAX_PER_CALL=100000 # $0.10
|
|
116
|
+
MCP_REGISTER_PAY_MAX_PER_DAY=1000000 # $1.00
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Keep one account per requester. Payments settle on chain, so anyone can link
|
|
120
|
+
a payer address to the grants it paid for. To rotate the key, create a new
|
|
121
|
+
one, move what is left to it, and point `MCP_REGISTER_PAYER_KEY_FILE` at the
|
|
122
|
+
new file.
|
|
123
|
+
|
|
124
|
+
### Payment settings
|
|
71
125
|
|
|
72
126
|
These are read from the environment only. No tool argument can set or raise
|
|
73
127
|
them.
|
|
@@ -110,8 +164,6 @@ x402, straight to the transparency operator.
|
|
|
110
164
|
npx -y @forestrie/mcp-register
|
|
111
165
|
```
|
|
112
166
|
|
|
113
|
-
(Not yet published.)
|
|
114
|
-
|
|
115
167
|
## Layers
|
|
116
168
|
|
|
117
169
|
- `src/core` is browser-safe and works on bytes only.
|
package/dist/core/version.d.ts
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* Bump each one in the same commit as the dependency it names.
|
|
12
12
|
*/
|
|
13
13
|
/** Keep in sync with package.json#version. Asserted by test/node/mcp-smoke. */
|
|
14
|
-
export declare const PACKAGE_VERSION = "0.1.
|
|
14
|
+
export declare const PACKAGE_VERSION = "0.1.1";
|
|
15
15
|
/** Keep in sync with package.json#dependencies["@forestrie/mcp-verify"] — the
|
|
16
16
|
* verifier this package composes with. Asserted by
|
|
17
17
|
* test/core/version.test.ts. */
|
package/dist/core/version.js
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* Bump each one in the same commit as the dependency it names.
|
|
12
12
|
*/
|
|
13
13
|
/** Keep in sync with package.json#version. Asserted by test/node/mcp-smoke. */
|
|
14
|
-
export const PACKAGE_VERSION = "0.1.
|
|
14
|
+
export const PACKAGE_VERSION = "0.1.1";
|
|
15
15
|
/** Keep in sync with package.json#dependencies["@forestrie/mcp-verify"] — the
|
|
16
16
|
* verifier this package composes with. Asserted by
|
|
17
17
|
* test/core/version.test.ts. */
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forestrie/mcp-register",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"mcpName": "dev.forestrie/register",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
|
-
"description": "Sign and register
|
|
7
|
+
"description": "Sign and register statements on a Forestrie transparency log, verify their receipts, and buy grants over x402 within spending caps",
|
|
8
8
|
"keywords": [
|
|
9
9
|
"mcp",
|
|
10
10
|
"modelcontextprotocol",
|
package/src/core/version.ts
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
/** Keep in sync with package.json#version. Asserted by test/node/mcp-smoke. */
|
|
15
|
-
export const PACKAGE_VERSION = "0.1.
|
|
15
|
+
export const PACKAGE_VERSION = "0.1.1";
|
|
16
16
|
|
|
17
17
|
/** Keep in sync with package.json#dependencies["@forestrie/mcp-verify"] — the
|
|
18
18
|
* verifier this package composes with. Asserted by
|