Sign and register statements on a Forestrie log

dev.forestrie由 forestrie.dev 发布v0.3.0更新于 Nov 3, 2026

Sign and register statements on a Forestrie log, verify receipts, buy grants via x402 within caps

发布方自己的服务:Register.gy

已验证STDIO仅桌面金融安全与监控

概览

AI 生成的概览

对声明签名并注册到 Forestrie 透明日志,校验回执,并可在限额内通过 x402 购买授权。

可以做什么
  • 签名并注册声明:用服务器持有的日志密钥对载荷(内联 base64 或文件路径,最大 4 MiB)签名并注册到 Forestrie 日志。
  • 查询与校验:执行单次状态检查(pending、awaiting seal、sealed),封存后保存回执,并基于声明校验回执。
  • 密钥与封存:返回日志密钥的公钥部分,并为数据日志授权运营方的封存器。
  • 签发与注册授权:用授权密钥签发子数据日志授权,再向 canopy 注册,在限额内支付其 402 费用或转交支付要求。
  • 引导提示:register、audit 和 issue-and-pay 三个提示引导代理完成整个流程。
适用场景
当你需要在 Forestrie 透明日志上留下可审计的签名记录,或作为请求方需要签发并注册子授权(可选支付运营方的 x402 费用)时使用。
运行要求
通过 npx 以 stdio 在本地运行,需要 Node.js。需要 canopy SCRAPI 基础地址(FORESTRIE_BASE_URL)、森林根日志 ID 和 Forestrie-Grant(FORESTRIE_GRANT);签发授权还需 FORESTRIE_AUTHORITY_GRANT,封存需 FORESTRIE_COORDINATOR_URL 和 FORESTRIE_KNOWN_SEALER_KEY。密钥文件首次使用时在 MCP_REGISTER_HOME 下创建。需要访问 canopy 的网络。
安装前请注意
服务器持有签名密钥:首次使用时创建的 ES256 日志密钥和授权密钥,以及通过 FORESTRIE_GRANT 和 FORESTRIE_AUTHORITY_GRANT 提供的授权。若配置付款方,MCP_REGISTER_PAYER_KEY_FILE 保存会花费真实资金的 EVM 私钥;请设置 MCP_REGISTER_PAY_MAX_PER_CALL 和 MCP_REGISTER_PAY_MAX_PER_DAY,且除非设置 MCP_REGISTER_PAY_ALLOW_MAINNET,主网默认关闭。支付在链上结算,可与付款地址关联。注册会写入远程日志。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Sign and register statements on a Forestrie log,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

@forestrie/mcp-register

An MCP server that signs a statement and registers it on a Forestrie transparency log under a Forestrie-Grant, then waits for the seal and verifies the receipt. It can also buy the grant: as the requester, it signs a child grant under your own authority log and registers it with canopy, paying canopy's x402 charge within hard caps. It is the write path of the Forestrie MCP trio:

The statement is signed with a log key the server holds. The default backend for that key is an ES256 key file the server creates. Child grants are signed with a separate authority key, held the same way. The model never handles signature bytes: you pass the payload and the server signs it. No tool takes a signature or a key as input.

Paying is optional, and the payer is yours. The server never creates a payer key and holds no funds of its own: you choose how payment happens (see Choosing a payer). Whichever you choose, a payer key never crosses the MCP boundary, and the spending caps are configuration, not tool arguments. With no payer configured, the server spends nothing: it returns canopy's payment requirements, and you pay from your own x402 wallet (relay mode).

Status

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.

Tools

ToolWhat it does
get_log_keyReturns the log key's public half (x‖y). Your grant must name this key. The key is created on first use.
delegate_sealingAuthorises the operator's sealer for your data log. Runs canopy's prepare with the same grant first if the coordinator does not know the log's public root yet. Once per log.
register_statementSigns a payload (inline base64 or a file path, up to 4 MiB, with an explicit content type) and registers it.
check_registrationDoes one status check: pending, awaiting_seal or sealed. Once sealed, it saves the receipt.
verify_registrationVerifies the receipt over the statement with mcp-verify's verifier and returns its four answers unaltered.
issue_grantAs the requester, signs a child data-log grant with the authority key, naming a log key (by default this server's), sized with maxHeight. Sends nothing.
register_grantRegisters the child grant with canopy, pays its 402 within the caps or relays the requirements, and follows it to its receipt. Resumable by child log id; never pays twice.

The prompts walk an agent through the work:

  • register covers the key and the grant, sealing, registering, waiting, verifying and keeping the receipt.
  • audit explains which trust questions a receipt answers under which trust root.
  • issue-and-pay covers buying a grant as the requester: sizing it, issuing it, paying within the caps or relaying the payment, and handing the completed grant to the performer.

Configuration

Every value can be overridden per call.

VariableMeaning
FORESTRIE_BASE_URLthe canopy SCRAPI base URL
FORESTRIE_ROOT_LOG_IDthe forest's root log id (R in /register/{R}/entries)
FORESTRIE_GRANTyour Forestrie-Grant, as base64 or a file path
FORESTRIE_COORDINATOR_URLthe delegation coordinator, for delegate_sealing
FORESTRIE_KNOWN_SEALER_KEYthe registrar's voucher key, base64 x‖y, for delegate_sealing
FORESTRIE_AUTHORITY_GRANTyour authority log's grant, for issue_grant and register_grant
MCP_REGISTER_HOMEkey files, grants, registrations and the spend ledger, default ~/.config/forestrie/mcp-register
MCP_REGISTER_KEY_FILEthe log key file, default $MCP_REGISTER_HOME/log-key.jwk
MCP_REGISTER_AUTHORITY_KEY_FILEthe authority key file, default $MCP_REGISTER_HOME/authority-key.jwk

Choosing a payer

Whoever wants the work done pays for it: the requester, paying canopy directly. The server supports three ways to do that and prefers none of them.

SetupWhat you configureWho holds the key
Relaynothingyour own x402 wallet: register_grant returns canopy's payment requirements and resumes on a call that carries your X-PAYMENT
Key fileMCP_REGISTER_PAYER_KEY_FILE and the caps belowa file on the machine that runs the server
Your own backendcreateServer({ payer }) from @forestrie/mcp-register/server, when you embed the serverwhatever your PayerBackend uses: a hosted wallet, a KMS, a remote signer

A backend of your own must sign an EIP-3009 authorisation with the nonce it is given. That nonce is what stops one grant being paid for twice (see Payment settings).

Example: a dedicated key file

This is one way to set up the key-file payer, not the way. Any EVM account works; what matters is that it pays for this and nothing else.

  1. Create a private key in a file only you can read. Any wallet tool that exports a raw private key will do. With no extra tools:

    ( umask 077; printf '0x%s\n' "$(openssl rand -hex 32)" > payer.key )

    The server accepts one line, 0x and 64 hex digits, in a regular file (not a symlink) that no other user can read.

  2. Find the account's address with a tool you already trust to derive one from a private key, or by importing the key into a wallet you use.

  3. Fund the address with the asset canopy charges in. On the default network, Base Sepolia, that is testnet USDC, from Circle's faucet. The account needs no ETH: it only signs an authorisation, and the x402 facilitator submits the transfer and pays its gas.

  4. Point the server at the file and set the caps:

    MCP_REGISTER_PAYER_KEY_FILE=/path/to/payer.keyMCP_REGISTER_PAY_MAX_PER_CALL=100000   # $0.10MCP_REGISTER_PAY_MAX_PER_DAY=1000000   # $1.00

Keep one account per requester. Payments settle on chain, so anyone can link a payer address to the grants it paid for. To rotate the key, create a new one, move what is left to it, and point MCP_REGISTER_PAYER_KEY_FILE at the new file.

Payment settings

These are read from the environment only. No tool argument can set or raise them.

VariableMeaning
MCP_REGISTER_PAYER_KEY_FILEan EVM private key (0x + 64 hex, mode 600) that pays; unset means relay mode
MCP_REGISTER_PAY_MAX_PER_CALLthe most one payment may be, in the asset's atomic units (required with a payer)
MCP_REGISTER_PAY_MAX_PER_DAYthe most all payments in one UTC day may total (required with a payer)
MCP_REGISTER_PAY_NETWORKthe one network it pays on, default eip155:84532 (Base Sepolia)
MCP_REGISTER_PAY_ASSETthe one asset it pays in, default USDC on Base Sepolia
MCP_REGISTER_PAY_TOoptional: the only payee
MCP_REGISTER_PAY_ALLOW_MAINNET1 to pay on a network that is not a testnet; off by default

The server pays only the canopy named in FORESTRIE_BASE_URL, and only for the request it made. Every payment it signs for a grant uses a nonce derived from that grant, so the token contract can settle at most one of them: a retry or two overlapping calls never pay for one grant twice. Each signed payment is written to the spend ledger before it is sent and counts toward the daily cap whether or not it settles. The daily cap is approximate when calls overlap. USDC has 6 decimals, so 10000 is $0.01.

Where grants come from

Forestrie runs no grant issuer. Whoever owns the authority log above yours issues your grant, naming the key that get_log_key returns. Canopy sequences grants; it does not issue them.

That owner can be you. If the owner of the root above you creates an authority log for your authority key (get_log_key with which: "authority" returns it as a PEM for forestrie-cli's create-log --auth-log --signer-pem), issue_grant and register_grant let you issue and register your own child grants. If that authority log carries the child-payment-required flag, each registration is paid for over x402, straight to the transparency operator.

Install

npx -y @forestrie/mcp-register

Layers

  • src/core is browser-safe and works on bytes only.
  • src/net is the only place fetch is called, always through an injected fetchImpl.
  • src/node holds the MCP SDK, stdio, the filesystem, the key files and the payer.

See AGENTS.md.

Licence

MIT.

来源:README.md,提交 c6f5745

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

4
  1. v0.3.0最新Nov 3, 2026
  2. v0.2.1Oct 20, 2026
  3. v0.2.0Oct 19, 2026
  4. v0.1.1Oct 17, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

其他 Register 集成