bsv-mcp 0.2.14 → 0.3.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.
Files changed (83) hide show
  1. package/CHANGELOG.md +90 -10
  2. package/README.md +13 -13
  3. package/dist/app.html +483 -106
  4. package/dist/index.js +265787 -155292
  5. package/index.ts +505 -70
  6. package/package.json +24 -15
  7. package/prompts/bsvSdk/auth.ts +1 -1
  8. package/prompts/bsvSdk/cryptography.ts +1 -1
  9. package/prompts/bsvSdk/overview.ts +1 -1
  10. package/prompts/bsvSdk/primitives.ts +1 -1
  11. package/prompts/bsvSdk/script.ts +1 -1
  12. package/prompts/bsvSdk/transaction.ts +1 -1
  13. package/prompts/bsvSdk/wallet.ts +1 -1
  14. package/prompts/ordinals.ts +1 -1
  15. package/test-mcp-server.ts +26 -4
  16. package/tools/a2b/discover.ts +2 -2
  17. package/tools/bap/friend.ts +17 -24
  18. package/tools/bap/generate.test.ts +34 -32
  19. package/tools/bap/generate.ts +48 -43
  20. package/tools/bap/getCurrentAddress.ts +1 -3
  21. package/tools/bap/getId.test.ts +18 -10
  22. package/tools/bap/getId.ts +8 -6
  23. package/tools/bap/utils.ts +1 -1
  24. package/tools/bsocial/bmapReadPosts.ts +16 -2
  25. package/tools/bsocial/createPost.ts +21 -10
  26. package/tools/bsocial/readPosts.ts +10 -4
  27. package/tools/bsv/decodeTransaction.ts +1 -1
  28. package/tools/bsv/explore.ts +0 -4
  29. package/tools/bsv/getPrice.ts +1 -1
  30. package/tools/bsv/token.ts +14 -6
  31. package/tools/constants.ts +6 -2
  32. package/tools/index.ts +10 -10
  33. package/tools/mnee/getBalance.ts +1 -1
  34. package/tools/mnee/parseTx.ts +1 -1
  35. package/tools/mnee/sendMnee.ts +30 -8
  36. package/tools/ordinals/getInscription.ts +1 -3
  37. package/tools/ordinals/getTokenByIdOrTicker.ts +1 -3
  38. package/tools/ordinals/index.ts +4 -1
  39. package/tools/ordinals/marketListings.ts +1 -1
  40. package/tools/ordinals/marketSales.ts +1 -1
  41. package/tools/ordinals/searchInscriptions.ts +1 -1
  42. package/tools/utils/aip.ts +31 -22
  43. package/tools/utils/installAgentMaster.ts +8 -9
  44. package/tools/utils/toolRegistration.ts +21 -22
  45. package/tools/utils/transactionBuilder.ts +21 -14
  46. package/tools/wallet/a2bPublishMcp.ts +15 -5
  47. package/tools/wallet/brc100.ts +541 -310
  48. package/tools/wallet/cancelListing.ts +29 -37
  49. package/tools/wallet/createOrdinals.ts +43 -27
  50. package/tools/wallet/fetchPaymentUtxos.ts +7 -5
  51. package/tools/wallet/gatherCollectionInfo.ts +3 -5
  52. package/tools/wallet/getAddress.ts +1 -4
  53. package/tools/wallet/getBalance.ts +15 -15
  54. package/tools/wallet/{getBalanceDroplet.ts → getBalanceDroplit.ts} +6 -6
  55. package/tools/wallet/getBsv21Balances.ts +20 -14
  56. package/tools/wallet/getLockData.ts +11 -11
  57. package/tools/wallet/getOrdinals.ts +26 -20
  58. package/tools/wallet/integratedWallet.ts +55 -53
  59. package/tools/wallet/listOrdinal.ts +40 -39
  60. package/tools/wallet/listTokens.ts +18 -17
  61. package/tools/wallet/lockBsv.ts +36 -22
  62. package/tools/wallet/mintCollection.ts +15 -10
  63. package/tools/wallet/opnsDeregister.ts +29 -39
  64. package/tools/wallet/opnsRegister.ts +29 -39
  65. package/tools/wallet/purchaseListing.test.ts +27 -0
  66. package/tools/wallet/purchaseListing.ts +59 -40
  67. package/tools/wallet/refreshUtxos.ts +1 -1
  68. package/tools/wallet/schemas.ts +0 -13
  69. package/tools/wallet/sendAllBsv.ts +26 -20
  70. package/tools/wallet/sendBsv.ts +107 -0
  71. package/tools/wallet/setupDroplit.ts +157 -0
  72. package/tools/wallet/signBsm.ts +18 -18
  73. package/tools/wallet/sweepBsv.ts +48 -27
  74. package/tools/wallet/sweepBsv21.ts +42 -28
  75. package/tools/wallet/sweepOrdinals.ts +38 -26
  76. package/tools/wallet/tools.ts +11 -13
  77. package/tools/wallet/transactionHelper.ts +13 -5
  78. package/tools/wallet/transferOrdToken.ts +72 -84
  79. package/tools/wallet/unlockBsv.ts +23 -17
  80. package/tools/wallet/utxo.ts +1 -0
  81. package/tools/wallet/wallet.ts +1 -13
  82. package/tools/wallet/sendToAddress.ts +0 -74
  83. package/tools/wallet/setupDroplet.ts +0 -161
package/CHANGELOG.md CHANGED
@@ -1,5 +1,85 @@
1
1
  # BSV MCP Server Changelog
2
2
 
3
+ ## [0.3.0] - 2026-07-30
4
+
5
+ ### Breaking Changes
6
+
7
+ - **Spending now requires approval.** `WalletPermissionsManager` was constructed
8
+ with `seekSpendingPermissions: false`, so no spend was ever gated. It is armed,
9
+ and a handler is bound to `onSpendingAuthorizationRequested`. Clients that
10
+ support elicitation prompt the user with the exact satoshi amount and itemised
11
+ line items; approval grants that amount ephemerally. **On a client without
12
+ elicitation support, spends are denied.** The refusal names the amount and the
13
+ reason. This is deliberate — a confirmation gate that silently passes when the
14
+ client cannot be asked is not a gate.
15
+ - `wallet_setupDroplit` is replaced by three tools —
16
+ `wallet_registerDroplitKey`, `wallet_createDroplitFaucet`, and
17
+ `wallet_checkDroplitFaucetStatus`. It had put three unrelated operations behind
18
+ an `action` enum, which made every argument conditional.
19
+ - `wallet_purchaseListing` no longer accepts `description`. The underlying
20
+ purchase actions have no parameter for it, so it was advertised and discarded.
21
+
22
+ ### Security
23
+
24
+ - **`DISABLE_BROADCASTING` did nothing for the tools that move money.** The
25
+ startup banner printed `Broadcasting: Disabled` while the flag reached only the
26
+ BAP tools; `wallet_sendBsv`, `sendAllBsv`, the three sweeps, `purchaseListing`
27
+ and `sendMnee` never received it. Setting the variable, reading "Disabled", and
28
+ calling `wallet_sendBsv` moved real money. Sixteen transaction-submitting tools
29
+ now assert through one guard that reads the same environment variable the
30
+ banner reads.
31
+ - **WIF redaction covered one of three exit paths.** The sweep tools each defined
32
+ a sanitizer commented "sanitize WIF from any error output" and applied it only
33
+ in the `catch`. The `result.error` branch and the serialised success payload
34
+ both returned raw, on tools that take a raw WIF as an argument. One shared
35
+ redactor now covers all three exits in all three tools, and additionally
36
+ catches testnet WIFs and xprvs.
37
+ - The admin originator was the package name, `bsv-mcp` — the exact string a
38
+ caller reaches for when a parameter named `originator` wants a value. Passing
39
+ it would have bypassed the spending gate while the configuration reported it
40
+ armed.
41
+ - Two identity-key paths caught an invalid WIF, logged a warning, and continued
42
+ unsigned. Both now fail.
43
+
44
+ ### Added
45
+
46
+ - Audit log at `~/.bsv-mcp/audit.log` (JSON Lines, directory `0700`, file
47
+ `0600`), routed through the key redactor. A failed write reports to stderr and
48
+ does not break a payment the user already approved.
49
+ - Amount validation on the money-moving tools. `sendBsv`, `sendMnee`, `lockBsv`
50
+ and `listOrdinal` took a bare `z.number()`, so negative, zero and NaN amounts
51
+ reached the SDK; a negative USD amount converted to a negative satoshi count.
52
+
53
+ ### Fixed
54
+
55
+ - `wallet_createOrdinals` accepted `destinationAddress` and never forwarded it,
56
+ so an ordinal minted to a named address silently locked to a wallet-derived
57
+ self key.
58
+ - Droplit authentication was hand-rolled and could never have succeeded. It is
59
+ now BRC-103/104 via `AuthFetch`, verified against the live service.
60
+ - Five packages the code imports were never declared, `zod` among them, so a
61
+ clean install of the published package could not resolve them.
62
+ - The stdio guard was dead code. Its replacement is a first-position side-effect
63
+ import, since ES imports evaluate before any top-level statement.
64
+ - `purchaseListing`'s marketplace-rate arithmetic is a pure function, so a fee
65
+ bug can be told apart from an execution bug.
66
+
67
+ ### Changed
68
+
69
+ - Core SDKs to current: `@modelcontextprotocol/sdk` 1.27.1 → 1.29.0,
70
+ `@modelcontextprotocol/ext-apps` 1.2.0 → 1.7.5, `@1sat/actions` 0.0.41 →
71
+ 0.0.192, `@bsv/sdk` 2.0.6 → 2.2.0, `bsv-bap` 0.1.23 → 0.3.4.
72
+ - `Droplet` is spelled `Droplit` throughout, matching droplit.dev. Environment
73
+ variables are now `DROPLIT_API_URL` and `DROPLIT_FAUCET_NAME`.
74
+ - Test coverage 15 → 45.
75
+
76
+ ## [0.2.15] - 2026-03-10
77
+
78
+ ### Fixed
79
+ - Dashboard wallet tab now uses BRC-100 context (same as direct tools) for address and balance
80
+ - `app_wallet_data` was returning raw P2PKH address instead of BRC-29 derived deposit address
81
+ - Client-side error handling: wallet errors now display properly instead of rendering empty/zero data
82
+
3
83
  ## [0.2.12] - 2026-03-10
4
84
 
5
85
  ### Changed
@@ -122,29 +202,29 @@
122
202
  - Improved error handling with standardized error types
123
203
  - Better code organization with new utility modules
124
204
 
125
- ## v0.1.0 - Droplet API Integration & Claude Code CLI Support
205
+ ## v0.1.0 - Droplit API Integration & Claude Code CLI Support
126
206
 
127
207
  ### Major Features
128
- - **Droplet API Integration**: Added support for running without local keys using Droplet faucet API
208
+ - **Droplit API Integration**: Added support for running without local keys using Droplit faucet API
129
209
  - New `IntegratedWallet` class supports both local and remote wallet modes
130
- - BSM (Bitcoin Signed Message) authentication for Droplet API communication
131
- - Environment variable configuration: `USE_DROPLET_API`, `DROPLET_API_URL`, `DROPLET_FAUCET_NAME`
132
- - Automatic faucet funding and transaction broadcasting through Droplet service
210
+ - BSM (Bitcoin Signed Message) authentication for Droplit API communication
211
+ - Environment variable configuration: `USE_DROPLIT_API`, `DROPLIT_API_URL`, `DROPLIT_FAUCET_NAME`
212
+ - Automatic faucet funding and transaction broadcasting through Droplit service
133
213
  - **Claude Code CLI Compatibility**: Fixed stdio transport configuration for seamless Claude Code integration
134
214
  - Updated smithery.yaml configuration for proper MCP CLI operation
135
215
  - Enhanced testing and debugging workflows with Claude CLI
136
216
 
137
217
  ### Technical Improvements
138
- - Created `DropletClient` class for robust API communication with go-faucet-api
139
- - Added comprehensive error handling and validation for Droplet operations
218
+ - Created `DroplitClient` class for robust API communication with go-faucet-api
219
+ - Added comprehensive error handling and validation for Droplit operations
140
220
  - Enhanced documentation with testing instructions and troubleshooting guides
141
221
  - Improved dual-mode wallet architecture maintaining backward compatibility
142
222
  - Updated development documentation with detailed testing workflows
143
223
 
144
224
  ### Environment Variables
145
- - `USE_DROPLET_API`: Enable Droplet API mode (default: false)
146
- - `DROPLET_API_URL`: Droplet service endpoint (default: http://localhost:4000)
147
- - `DROPLET_FAUCET_NAME`: Faucet name for API operations (required in Droplet mode)
225
+ - `USE_DROPLIT_API`: Enable Droplit API mode (default: false)
226
+ - `DROPLIT_API_URL`: Droplit service endpoint (default: http://localhost:4000)
227
+ - `DROPLIT_FAUCET_NAME`: Faucet name for API operations (required in Droplit mode)
148
228
  - `TRANSPORT`: MCP transport mode (stdio/http) for Claude Code compatibility
149
229
 
150
230
  ## v0.0.37 - Resource Updates
package/README.md CHANGED
@@ -576,34 +576,34 @@ The BSV MCP server can be customized using environment variables to enable or di
576
576
  | `IDENTITY_KEY_WIF` | `not set` | Optional WIF for identity key; if set, ordinals inscriptions will be signed with sigma-protocol for authentication, curation, and web-of-trust. |
577
577
  | `DISABLE_BROADCASTING` | `false` | Set to `true` to disable transaction broadcasting; returns raw transaction hex instead - useful for testing and transaction review before broadcasting |
578
578
 
579
- ### Droplet API Configuration
579
+ ### Droplit API Configuration
580
580
 
581
- The BSV MCP server supports running in Droplet API mode, which allows operation without local private keys by using a remote faucet service:
581
+ The BSV MCP server supports running in Droplit API mode, which allows operation without local private keys by using a remote faucet service:
582
582
 
583
583
  | Environment Variable | Default | Description |
584
584
  | -------------------- | ------- | ----------- |
585
- | `USE_DROPLET_API` | `false` | Set to `true` to enable Droplet API mode for remote wallet operations |
586
- | `DROPLET_API_URL` | `http://localhost:4000` | Base URL for the Droplet faucet API service |
587
- | `DROPLET_FAUCET_NAME` | `not set` | Name of the faucet to use (required when `USE_DROPLET_API` is true) |
585
+ | `USE_DROPLIT_API` | `false` | Set to `true` to enable Droplit API mode for remote wallet operations |
586
+ | `DROPLIT_API_URL` | `http://localhost:4000` | Base URL for the Droplit faucet API service |
587
+ | `DROPLIT_FAUCET_NAME` | `not set` | Name of the faucet to use (required when `USE_DROPLIT_API` is true) |
588
588
  | `TRANSPORT` | `stdio` | MCP transport mode (stdio/http) - automatically set to stdio for Claude Code compatibility |
589
589
 
590
- #### Droplet API Mode
590
+ #### Droplit API Mode
591
591
 
592
- When `USE_DROPLET_API=true` is set, the server operates in remote mode:
592
+ When `USE_DROPLIT_API=true` is set, the server operates in remote mode:
593
593
 
594
594
  - **No Local Keys Required**: The server doesn't need `PRIVATE_KEY_WIF` or local key files
595
- - **Remote Wallet Operations**: Transactions are funded and broadcast through the Droplet API
595
+ - **Remote Wallet Operations**: Transactions are funded and broadcast through the Droplit API
596
596
  - **BSM Authentication**: Uses Bitcoin Signed Message (BSM) authentication for secure API communication
597
597
  - **Automatic Funding**: The faucet automatically provides UTXOs for transactions
598
598
  - **Seamless Integration**: All existing wallet tools work transparently with the remote service
599
599
 
600
- #### Example Droplet Configuration
600
+ #### Example Droplit Configuration
601
601
 
602
602
  ```bash
603
- # Enable Droplet API mode
604
- USE_DROPLET_API=true
605
- DROPLET_API_URL=https://your-droplet-service.com
606
- DROPLET_FAUCET_NAME=your-faucet-name
603
+ # Enable Droplit API mode
604
+ USE_DROPLIT_API=true
605
+ DROPLIT_API_URL=https://your-droplit-service.com
606
+ DROPLIT_FAUCET_NAME=your-faucet-name
607
607
  TRANSPORT=stdio
608
608
  ```
609
609