bsv-mcp 0.3.0 → 0.3.2
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 +17 -0
- package/README.md +123 -0
- package/dist/index.js +894 -146
- package/index.ts +61 -7
- package/package.json +1 -1
- package/tools/index.ts +12 -3
- package/tools/wallet/brc100.ts +25 -1
- package/tools/wallet/droplit.ts +124 -0
- package/tools/wallet/integratedWallet.ts +1 -3
- package/tools/wallet/revealDelegation.ts +74 -0
- package/tools/wallet/setupDroplit.ts +10 -16
- package/tools/wallet/tools.ts +8 -4
- package/test-mcp-server.ts +0 -179
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# BSV MCP Server Changelog
|
|
2
2
|
|
|
3
|
+
## [0.3.2] - 2026-09-06
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
- Reveal a human-issued Sigma delegation with the connected agent wallet, using standard certificate acquisition and proof.
|
|
7
|
+
- Reject redirects, automatic payments, and ambiguous mutation retries; submit only verifier-specific keys.
|
|
8
|
+
|
|
9
|
+
## [0.3.1] - 2026-09-05
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
- Connect an existing BRC-100 HTTP signer without loading local private keys or provisioning wallet storage.
|
|
13
|
+
- Inspect sponsor access and submit sponsored push/fund operations with the connected signer.
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
- Preserve wallet permission arguments through MCP schemas.
|
|
17
|
+
- Block automatic HTTP payment during sponsor authentication and avoid ambiguous write retries.
|
|
18
|
+
- Preserve explicitly requested satoshi amounts in legacy Droplit taps.
|
|
19
|
+
|
|
3
20
|
## [0.3.0] - 2026-07-30
|
|
4
21
|
|
|
5
22
|
### Breaking Changes
|
package/README.md
CHANGED
|
@@ -8,6 +8,51 @@
|
|
|
8
8
|
|
|
9
9
|
A collection of Bitcoin SV (BSV) tools for the Model Context Protocol (MCP) framework. This library provides wallet, ordinals, and utility functions for BSV blockchain interaction.
|
|
10
10
|
|
|
11
|
+
## Connect an existing BRC-100 signer
|
|
12
|
+
|
|
13
|
+
Set `BRC100_WALLET_URL` to explicitly use an existing wallet through the SDK's
|
|
14
|
+
`HTTPWalletJSON` signer RPC transport. For example, **if your wallet already
|
|
15
|
+
exposes this signer RPC**:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
BRC100_WALLET_URL=http://127.0.0.1:3321 BRC100_WALLET_ORIGINATOR=bsv-mcp.local bun run index.ts --stdio
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
`BRC100_WALLET_ORIGINATOR` is optional and defaults to `bsv-mcp.local`; use a
|
|
22
|
+
domain or HTTP(S) origin without credentials, paths, queries or fragments.
|
|
23
|
+
Empty, malformed and `admin.bsv-mcp.internal` origins are rejected. The SDK
|
|
24
|
+
sends the origin as both `Origin` and `Originator` headers in Node/Bun.
|
|
25
|
+
Signer URLs must use HTTPS, or HTTP on loopback (`localhost`, `127.0.0.0/8`,
|
|
26
|
+
`[::1]`), without credentials, queries or fragments. Redirects are rejected.
|
|
27
|
+
|
|
28
|
+
Remove `PRIVATE_KEY_WIF`, `IDENTITY_KEY_WIF`, `DROPLIT_API_URL` and
|
|
29
|
+
`DROPLIT_FAUCET_NAME`, and disable `USE_DROPLIT_API` before enabling this mode:
|
|
30
|
+
explicit conflicting configuration is rejected. Existing local key files are
|
|
31
|
+
left unread. This mode generates no keys, creates no local wallet or storage,
|
|
32
|
+
and provisions no remote storage. Startup performs one identity-public-key
|
|
33
|
+
request with a 10-second timeout. Failure stops startup with a nonzero exit;
|
|
34
|
+
there is no endpoint probing or identity fallback. All signer calls have a
|
|
35
|
+
10-second timeout and no automatic retries; a timed-out write may have reached
|
|
36
|
+
the signer, so inspect its state before resubmitting.
|
|
37
|
+
|
|
38
|
+
The external wallet remains the permission authority, including spending and
|
|
39
|
+
identity disclosure. Tool arguments (including `seekPermission`) reach it
|
|
40
|
+
without a permission-bypass wrapper or automatic approval. Approve requests
|
|
41
|
+
in your wallet. MCP shutdown does not shut down the signer.
|
|
42
|
+
|
|
43
|
+
Context wallet/BRC-100 tools are available without a legacy wallet. Legacy
|
|
44
|
+
collection minting/gathering, A2B publication, BAP/raw-key, BSocial and MNEE
|
|
45
|
+
tools are unavailable in this mode. `BSV_CHAIN` selects `main` (default) or
|
|
46
|
+
`test`. Existing `ONESAT_API_URL` configures the auxiliary OneSat API clients
|
|
47
|
+
used by context actions; it is separate from the signer URL. Those actions
|
|
48
|
+
still require the corresponding OneSat service capabilities and the signer's
|
|
49
|
+
support for the requested protocol/baskets. Existing tool disable flags apply.
|
|
50
|
+
|
|
51
|
+
**Transport distinction:** `1sat serve wallet` exposes **storage RPC**, not
|
|
52
|
+
the SDK signer RPC. Do not set `BRC100_WALLET_URL` to that storage endpoint.
|
|
53
|
+
This server does not start or supply a signer daemon. Without
|
|
54
|
+
`BRC100_WALLET_URL`, the existing local wallet configuration remains in effect.
|
|
55
|
+
|
|
11
56
|
## Installation Options
|
|
12
57
|
|
|
13
58
|
### Option 1: Claude Code Plugin (Simplest)
|
|
@@ -830,3 +875,81 @@ npm test
|
|
|
830
875
|
## License
|
|
831
876
|
|
|
832
877
|
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
878
|
+
|
|
879
|
+
|
|
880
|
+
### Use a sponsor with your connected wallet
|
|
881
|
+
|
|
882
|
+
```sh
|
|
883
|
+
BRC100_WALLET_URL=http://127.0.0.1:3321
|
|
884
|
+
BRC100_WALLET_ORIGINATOR=bsv-mcp.local
|
|
885
|
+
DROPLIT_API_URL=https://api.droplit.dev/droplit
|
|
886
|
+
DROPLIT_FAUCET_NAME=your-sponsor-slug
|
|
887
|
+
```
|
|
888
|
+
|
|
889
|
+
Set both sponsor values explicitly. The URL includes the server's configured
|
|
890
|
+
base path. Leave `USE_DROPLIT_API` unset: these sponsor tools appear alongside
|
|
891
|
+
normal wallet tools and use the same connected signer identity. Existing local
|
|
892
|
+
BRC-100 wallet contexts also support this sponsor pair. `1sat serve` exposes a
|
|
893
|
+
wallet stack service; it is not itself a BRC-100 signer RPC endpoint.
|
|
894
|
+
|
|
895
|
+
Call `droplit_getAccess` to inspect your own authorization and quotas. An
|
|
896
|
+
`approval_required` response includes a `https://droplit.dev` link for manual
|
|
897
|
+
owner review. Do not automatically open, approve, or register to obtain access.
|
|
898
|
+
Public status and public-key registration do not prove sponsor approval, and
|
|
899
|
+
creating your own faucet requires funding rather than providing free credit.
|
|
900
|
+
Missing quota kinds are unrestricted for authorized users; a configured zero
|
|
901
|
+
count remains denied. Count and transfer quotas exclude a guaranteed miner-fee
|
|
902
|
+
budget.
|
|
903
|
+
|
|
904
|
+
`droplit_push` accepts `data: string[]` and `encoding: "hex" | "utf8"`.
|
|
905
|
+
`droplit_fund` accepts `rawtx` transaction hex and requests sponsor funding and
|
|
906
|
+
broadcast. Both obey broadcasting disable settings and make one client
|
|
907
|
+
submission, with no automatic 402 payment or ambiguous-write retry. Wallet
|
|
908
|
+
signing permissions remain controlled by the configured signer. The API authentication
|
|
909
|
+
facade forwards signer methods but rejects payment creation/signing, so SDK
|
|
910
|
+
BRC-105 payment handling cannot spend funds; a 402 requires human review. Structured
|
|
911
|
+
401/403/429 errors identify authentication, approval, or quota problems;
|
|
912
|
+
available quota reset information is retained. `unknown_outcome` means reconcile
|
|
913
|
+
transaction/history before retrying; no idempotency-key support is claimed.
|
|
914
|
+
The legacy `USE_DROPLIT_API=true` wallet mode remains available separately.
|
|
915
|
+
|
|
916
|
+
|
|
917
|
+
### Reveal a Sigma agent delegation with the connected wallet
|
|
918
|
+
|
|
919
|
+
After the human owner binds this agent wallet and issues its BRC-169 delegation,
|
|
920
|
+
copy the owner's complete handoff JSON into `wallet_revealDelegation`:
|
|
921
|
+
|
|
922
|
+
- `sigmaOrigin`: the intended Sigma HTTPS origin (HTTP is allowed only for loopback testing).
|
|
923
|
+
- `handoffJSON`: the owner's JSON containing `certificate`, `subjectKeyring`, `revealTo`, and `revelationPath`.
|
|
924
|
+
|
|
925
|
+
The explicit tool invocation acquires the certificate into the connected wallet,
|
|
926
|
+
proves all restrictions to the named Sigma verifier, and POSTs only that verifier's
|
|
927
|
+
keyring. Use the same wallet that supplied the bound identity; its Ed25519 agent
|
|
928
|
+
token cannot perform this step. The encrypted subject keyring stays with the agent
|
|
929
|
+
and is never included in the HTTP request or tool result. This does not grant
|
|
930
|
+
Droplit sponsor permission. No automatic payments, redirects, or POST retries are
|
|
931
|
+
allowed. On `outcome_unknown`, ask the owner to refresh delegation status before
|
|
932
|
+
trying again; certificate acquisition may already have succeeded.
|
|
933
|
+
|
|
934
|
+
For a **local 1Sat CLI wallet** used throughout binding, the existing commands
|
|
935
|
+
provide the same operation. Save the owner package as `handoff.json`, then:
|
|
936
|
+
|
|
937
|
+
```sh
|
|
938
|
+
bun -e 'const h=await Bun.file("handoff.json").json(),c=h.certificate; await Bun.write("acquire.json",JSON.stringify({acquisitionProtocol:"direct",type:c.type,certifier:c.certifier,fields:c.fields,serialNumber:c.serialNumber,revocationOutpoint:c.revocationOutpoint,signature:c.signature,keyringRevealer:"certifier",keyringForSubject:h.subjectKeyring})); await Bun.write("prove.json",JSON.stringify({certificate:c,fieldsToReveal:Object.keys(c.fields),verifier:h.revealTo}));'
|
|
939
|
+
1sat wallet acquire-certificate "$(cat acquire.json)" --json
|
|
940
|
+
1sat wallet prove-certificate "$(cat prove.json)" --json > proof.json
|
|
941
|
+
bun -e 'const p=await Bun.file("proof.json").json(); if(!p.keyringForVerifier) throw new Error("Missing verifier keyring"); await Bun.write("revelation.json",JSON.stringify({keyring:p.keyringForVerifier}));'
|
|
942
|
+
```
|
|
943
|
+
|
|
944
|
+
Set `SIGMA_ORIGIN` to the intended Sigma origin and `REVELATION_PATH` to the
|
|
945
|
+
owner's `/api/agents/{agentId}/delegations/{encodedSerialNumber}/revelation` path;
|
|
946
|
+
percent-encode the base64 serial number as one path segment. Then:
|
|
947
|
+
|
|
948
|
+
```sh
|
|
949
|
+
1sat authfetch POST "${SIGMA_ORIGIN}${REVELATION_PATH}" --body @revelation.json --json
|
|
950
|
+
```
|
|
951
|
+
|
|
952
|
+
Use `@1sat/cli` 0.0.110 or later for stale-session mutation replay protection.
|
|
953
|
+
Keep the same configured wallet and chain for every command. This CLI alternative
|
|
954
|
+
does not use the MCP external wallet connection. The endpoint does not require a
|
|
955
|
+
payment; do not add `--yes` to work around an unexpected 402.
|