bsv-mcp 0.4.0 → 0.5.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/CHANGELOG.md CHANGED
@@ -1,5 +1,120 @@
1
1
  # BSV MCP Server Changelog
2
2
 
3
+ ## [0.5.1] - 2026-09-08
4
+
5
+ ### Changed
6
+
7
+ - Start local stdio when no transport is specified, with early stdout guards in
8
+ both source and bundled entry points. Explicit `TRANSPORT=http` retains the
9
+ existing HTTP server; the deployed hosted endpoint and OAuth routes are unchanged.
10
+ - Run the Codex plugin through the local npm executable instead of hosted MCP.
11
+ The executable requires Bun; the npx installer also requires Node.js.
12
+ - Direct homepage tool links to a generated reference with 106 full tools and six
13
+ compact families, category navigation, search, individual URLs and Markdown.
14
+ - Generate tool schemas and registration availability across isolated wallet
15
+ configurations, preserving schema variants and conditional payment tools.
16
+ - Separate task examples from the tool reference and document wallet and backend
17
+ settings in tables. Local installation needs no account sign-in.
18
+
19
+ ### Fixed
20
+
21
+ - Reject invalid transport values before wallet initialization.
22
+ - Honor reduced-motion preferences while scrolling between homepage sections.
23
+
24
+ ## [0.5.0] - 2026-09-08
25
+
26
+ ### Added
27
+
28
+ - Build release tarballs with a separate consumer manifest so Bun installs
29
+ do not try to resolve checkout-only wallet patches.
30
+
31
+ - Use separate identity and ordinals wallets for SIGMA-signed inscriptions
32
+ through the existing 1Sat SDK local pipeline.
33
+
34
+ - Select existing private/WIF Vault entries and link them to local accounts
35
+ without modifying the encrypted Vault.
36
+
37
+ - Import multiple wallets into one Vault and choose global payment, identity,
38
+ and ordinals keys, with independent overrides in native project MCP settings.
39
+
40
+ - Create, import, and unlock an embedded wallet through private local browser
41
+ setup. Activation refreshes the connected MCP session immediately; the ready
42
+ screen shows a compact, animated tool collage from its enabled catalog, with
43
+ pause controls and reduced-motion support.
44
+ - Receive selected PeerPay payments with `wallet_peerPayments` (or the compact
45
+ `wallet_payments` family). Wallet acceptance precedes acknowledgement;
46
+ automatic MessageBox service-fee spending is refused. Availability is limited
47
+ to eligible embedded wallets.
48
+ - Discover skill metadata and links with `utils_find_skills`, using a bounded,
49
+ cached remote index without installing or fetching skill contents.
50
+ - Preflight the published BAP identity before Sigma inscription signing when
51
+ `wallet_createOrdinals` requests `signWithBAP`.
52
+
53
+ ### Changed
54
+
55
+ - Read every default-basket output page when calculating wallet balance,
56
+ and refuse partial totals when pagination is inconsistent.
57
+
58
+ - Supply a non-administrator MCP originator for local SDK calls that omit it,
59
+ preserving spending approval while allowing key and signing operations.
60
+
61
+ - Restrict the hosted Next.js MCP route to public reads, regardless of key
62
+ environment variables, and answer unauthenticated CORS preflight at both
63
+ the root endpoint and `/api/mcp`.
64
+ - Discover custom wallet locations only from explicit local settings.
65
+
66
+ - Retire static tutorial prompts and BRC/BitCom resource entries. Changelog,
67
+ JungleBus, and MCP App resources remain available.
68
+ - Produce consistent production bundles regardless of the caller’s
69
+ `NODE_ENV`, and remove stale local UI build assets from packaged output.
70
+
71
+ - Migrate the server/client/core boundaries and the surrounding server
72
+ lifecycle, stdio transport, hosted adapter, request routing, and
73
+ prompt/resource registrations to the split MCP TypeScript SDK v2 packages.
74
+ - Make protocol `2026-07-28` primary across stdio, local HTTP, and hosted HTTP.
75
+ Accept supported 2025 clients automatically; `MCP_LEGACY_COMPATIBILITY=false`
76
+ explicitly requires modern clients.
77
+ - Execute modern approval-dependent tools through request-scoped continuations
78
+ bound to the original operation, authenticated principal, arguments, and expiry.
79
+ Cancellation and revocation reject pending approvals; replay cannot re-execute
80
+ the callback. Legacy approvals also remain scoped to their requesting client.
81
+ - Open all configured project roles, including BRC-42 child and BRC-157/Yours
82
+ profile derivations. Isolate child-key storage and preserve selected root
83
+ databases and deposit prefixes.
84
+ - Support external per-role signer endpoints, identity pins, and project-specific
85
+ permission origins without local key loading.
86
+ - Expose BRC-100 BAP publication, rotation, attestations, profiles, and signed
87
+ BSocial posts through the selected identity wallet.
88
+ - Preserve ordinal outputs and token amounts in browser-signed dashboard sweeps.
89
+ Verify source transactions and signatures, bind preparation to the user and
90
+ wallet, and reject duplicate submission. Read all dashboard balance pages.
91
+ - Keep `@modelcontextprotocol/sdk` v1 in the staged dependency graph because
92
+ `@modelcontextprotocol/ext-apps` 1.7.5 still declares it as a peer. A local
93
+ MCP Apps adapter calls native SDK v2 `registerTool` and `registerResource`,
94
+ preserving v2 schema conversion and request validation. ext-apps remains for
95
+ shared constants and its browser `App` implementation; this does not make
96
+ ext-apps itself v2-native.
97
+ - Keep the full tool catalog as the default and capability-derived. Add an
98
+ explicit `MCP_TOOL_CATALOG=compact` opt-in profile for bounded read families;
99
+ local compact catalog and routing tests pass; hosted and browser-host
100
+ validation remain separate release gates.
101
+
102
+ ### Compatibility
103
+
104
+ - The catalog is capability-derived. The checked-in manifest is a synthetic
105
+ baseline for one configured server, while wallet mode, enabled modules,
106
+ account context, and the selected profile determine actual tool exposure.
107
+ Compact mode is an explicit opt-in.
108
+ - Modern protocol tests cover stdio and authenticated HTTP, approval accept,
109
+ decline, cancellation, expiry, replay, external signer HTTP crypto, and
110
+ project-role derivations. Installed clients that only negotiate 2025 connect through default legacy
111
+ compatibility; their success is not modern acceptance.
112
+ - The hosted route remains public-read-only. Browser-host MCP Apps integration
113
+ and deployed traffic require validation in their actual host environments.
114
+
115
+ See [MCP client protocol support](docs/mcp-client-protocol-support.md) for
116
+ endpoint contracts and the distinction between protocol and host validation.
117
+
3
118
  ## [0.4.0] - 2026-09-07
4
119
 
5
120
  ### Breaking changes
@@ -377,4 +492,4 @@
377
492
  - Ordinals tools for NFT functionality
378
493
  - BSV tools for blockchain interaction
379
494
  - MNEE token tools
380
- - Utility tools for data conversion
495
+ - Utility tools for data conversion
package/README.md CHANGED
@@ -2,39 +2,195 @@
2
2
 
3
3
  BSV MCP connects your AI assistant to Bitcoin SV. Ask it to check a transaction, show your balance, send a payment, or create and trade ordinals (content recorded on the blockchain).
4
4
 
5
- [Documentation](https://bsvmcp.com/docs) · [Connect hosted](https://bsvmcp.com/connect) · [npm](https://www.npmjs.com/package/bsv-mcp) · [Issues](https://github.com/b-open-io/bsv-mcp/issues)
5
+ [Documentation](https://bsvmcp.com/docs) · [All tools](https://bsvmcp.com/docs/tools) · [npm](https://www.npmjs.com/package/bsv-mcp) · [Issues](https://github.com/b-open-io/bsv-mcp/issues)
6
6
 
7
- ## Quick start
7
+ ## Install
8
8
 
9
- Install [Bun](https://bun.sh). Set up an encrypted account with `bunx bsv-mcp@latest init`, or connect an existing signer as described in [wallet setup](https://bsvmcp.com/docs#wallets). Then register the server:
9
+ Install [Bun](https://bun.sh) to run the server and Node.js for the `npx` commands below, then add it to your client:
10
10
 
11
11
  ```sh
12
12
  # Codex
13
- codex mcp add bsv-mcp -- bunx bsv-mcp@latest --stdio
13
+ codex mcp add bsv-mcp -- npx -y bsv-mcp@latest --stdio
14
14
 
15
15
  # Claude Code
16
- claude mcp add --transport stdio bsv-mcp -- bunx bsv-mcp@latest --stdio
16
+ claude mcp add --transport stdio bsv-mcp -- npx -y bsv-mcp@latest --stdio
17
17
  ```
18
18
 
19
- Or install the Claude Code plugin from the b-open-io marketplace:
19
+ Choose one command. For Cursor or Claude Desktop, use this server configuration:
20
+
21
+ ```json
22
+ {
23
+ "mcpServers": {
24
+ "bsv-mcp": {
25
+ "command": "npx",
26
+ "args": ["-y", "bsv-mcp@latest", "--stdio"]
27
+ }
28
+ }
29
+ }
30
+ ```
20
31
 
21
- ```sh
22
- claude plugin install bsv-mcp@b-open-io
32
+ Restart your client, then ask: **“Run bsv_status and explain what is available.”**
33
+ Local stdio needs no Sigma account or OAuth sign-in. It is also the default when
34
+ no transport is specified. Existing self-hosted HTTP remains opt-in through
35
+ `TRANSPORT=http`; the deployed hosted endpoint is unchanged.
36
+
37
+ For the Codex desktop plugin, add `b-open-io/claude-plugins` in the plugin
38
+ marketplace and install **BSV MCP**. The plugin starts the local npm executable
39
+ and requires Node.js and Bun. Claude Code and Grok plugins bundle the local server and
40
+ require Bun. Choose one registration to avoid duplicate tools.
41
+
42
+ ## Connect a wallet
43
+
44
+ Ask your assistant to run `wallet_onboarding`. Create, import or unlock a Vault
45
+ in the local browser. Back it up before funding. Enter passwords only in the
46
+ local setup UI, never in chat. After a server restart, unlock it again.
47
+
48
+ To use an existing BRC-100 wallet, configure its signing API instead:
49
+
50
+ ```json
51
+ {
52
+ "mcpServers": {
53
+ "bsv-mcp": {
54
+ "command": "npx",
55
+ "args": ["-y", "bsv-mcp@latest", "--stdio"],
56
+ "env": {
57
+ "BRC100_WALLET_URL": "http://127.0.0.1:3321",
58
+ "BRC100_WALLET_ORIGINATOR": "bsv-mcp.local"
59
+ }
60
+ }
61
+ }
62
+ }
23
63
  ```
24
64
 
25
- For other clients, use `bunx bsv-mcp@latest --stdio` as the MCP server command (stdio transport). For hosted access, connect to **https://bsvmcp.com**. See [client setup](https://bsvmcp.com/#install).
65
+ The wallet keeps its keys and controls permission requests. Its signing API is
66
+ separate from a wallet-storage endpoint. See [wallet setup](https://bsvmcp.com/docs#wallets)
67
+ for network settings, account selection and project roles.
26
68
 
27
- Ask your agent: **“Run bsv_status, then show my wallet balance.”**
69
+ The package also includes the Bun-based `bsv-mcp-local` launcher for explicit external,
70
+ legacy embedded and project configurations. Source-checkout examples live in
71
+ [the installation guide](docs/install-verification.md).
28
72
 
29
- ## Bring your wallet and infrastructure
73
+ ## MCP protocol compatibility
74
+
75
+ Protocol revision `2026-07-28` is preferred, with supported 2025 clients
76
+ accepted automatically on stdio and HTTP. No compatibility override is needed.
77
+ Set `MCP_LEGACY_COMPATIBILITY=false` only to require modern clients. This
78
+ setting also passes through the local launcher. The installed desktop client
79
+ was verified using legacy requests; modern support is tested separately.
80
+
81
+ Modern clients support wallet operations and request-scoped approval. Approval
82
+ continuations retain the original operation and bind to its authenticated user,
83
+ arguments, and expiry. Decline, cancellation, or session revocation stops the
84
+ operation; replaying a continuation does not repeat a transaction. A client
85
+ without form elicitation cannot approve a spend. External wallets retain their
86
+ own signer permission flow. The hosted route exposes public reads only.
87
+
88
+ For the split SDK v2 client:
30
89
 
31
- Connect a compatible existing wallet with `BRC100_WALLET_URL`, or select an encrypted account with `BSV_MCP_ACCOUNT` and unlock it with `BSV_MCP_PASSWORD` in the process environment. Startup never creates keys. An existing wallet keeps its keys and controls permissions. See the wallet setup guide for the required wallet API and configuration.
90
+ ```ts
91
+ const client = new Client(
92
+ { name: "my-app", version: "1" },
93
+ { versionNegotiation: { mode: "auto" }, capabilities: { elicitation: { form: {} } } },
94
+ );
95
+ ```
96
+
97
+ Register a real human approval handler before using approval-dependent tools.
98
+ Legacy protocol compatibility is enabled by default; the connected client must support the approval flow needed by the requested tool.
99
+
100
+ The full tool catalog remains the default and is capability-derived: wallet
101
+ mode, enabled modules, account context, and the selected profile determine what
102
+ `tools/list` returns. The checked-in manifest is a synthetic baseline for one
103
+ configured server, not a promise of a fixed default count. Set
104
+ `MCP_TOOL_CATALOG=compact` only to opt into bounded read families; compact mode
105
+ uses the same underlying handlers. Tool availability still
106
+ depends on wallet mode and enabled modules. Its baseline read families are
107
+ `bsv_read`, `ordinals_read`, `wallet_read`, and `utility`, each with a bounded
108
+ operation enum; unknown operations are rejected. Eligible sessions also expose
109
+ separate mutating `wallet_setup` and `wallet_payments` families. See the [MCP client
110
+ protocol support guide](docs/mcp-client-protocol-support.md) for the per-family
111
+ operation bounds, endpoint contracts, MCP Apps compatibility, and validation
112
+ status.
113
+
114
+ ## Local wallet modes
115
+
116
+ External mode connects to an existing BRC-100 signer. The signer keeps the
117
+ private keys, wallet storage, and permission decisions; BSV MCP receives only
118
+ the SDK signer interface. Embedded mode uses an encrypted local Vault wallet.
119
+ The wallet-ready screen displays an interactive cloud of the connected session’s
120
+ available tools, generated from its live catalog.
121
+
122
+ When setup is needed, `wallet_onboarding` opens the private browser flow to
123
+ create, import, or unlock it. The selected account's database and storage
124
+ configuration remain in use. The launcher's existing-account embedded mode
125
+ still supplies `BSV_MCP_PASSWORD` at runtime.
126
+ Project mode opens every explicitly assigned role: `payments`,
127
+ `identity-signing`, `one-sat`, and `encryption`. It requires paired project
128
+ selectors and `BSV_MCP_PASSWORD` at runtime; set `VAULT_PATH` when the Vault
129
+ module does not provide a default path. Bindings pin the selected public key
130
+ and support direct keys, BRC-42 children, and BRC-157/Yours profile leaves.
131
+ Changing the project binding or expiring its session revokes captured handles.
132
+ Derived keys have separate storage; selecting the account's payment root keeps
133
+ its existing database and deposit prefix.
134
+
135
+ BRC-100 tools accept `walletRole` (`payments`, `identity`, `ordinals`, or
136
+ `encryption`). Method defaults select the matching role, and sign/abort action
137
+ continuations retain their originating wallet and authenticated user. An
138
+ unassigned role fails rather than borrowing another key. BAP tools use the
139
+ identity wallet for publication, rotation, attestations, and profiles without
140
+ exporting an xprv. That wallet also funds those transactions and retains BAP
141
+ records. Signed BSocial posts and SIGMA inscriptions use the configured identity.
142
+
143
+ External registrations can use the same project root/ID pair to derive an
144
+ isolated permission origin, without a Vault password. Optional
145
+ `BRC100_WALLET_PUBLIC_KEY` pins the signer identity. `BRC100_WALLET_ROLES` is a
146
+ JSON object selecting independent role endpoints and public-key pins; see
147
+ [external signer configuration](docs/external-signer.md). The source launcher
148
+ accepts `external --project-root /absolute/project --project-id project.example`.
149
+ It defaults to disabled broadcasting; set `DISABLE_BROADCASTING=false` in its
150
+ runtime environment to enable transaction tools with the signer's approval.
151
+
152
+ Each mode has its own process environment and should be registered as a separate
153
+ server when you need to switch between them. Use only the registrations needed by the project.
154
+
155
+ Embedded wallets can list pending PeerPay payments and receive a selected
156
+ payment with `wallet_peerPayments`. Receiving requires a message ID and
157
+ acknowledges the message only after the wallet accepts it. These operations do
158
+ not pay MessageBox service fees. External signers and Droplit do not expose this tool. Project sessions require
159
+ an assigned payment role.
160
+
161
+ ## Find a skill
162
+
163
+ Use `utils_find_skills` with a short keyword query to find skills in the bOpen
164
+ catalog. It returns up to five descriptions and links to versioned `SKILL.md`
165
+ files. It does not download skill contents or install plugins. In compact mode,
166
+ select `utils_find_skills` from the `utility` tool.
167
+
168
+ The static tutorial prompts and BRC/BitCom resource catalog have been retired.
169
+ Use the skill finder for those references. Changelog, JungleBus documentation,
170
+ and the dashboard app resource remain available.
171
+
172
+ ## Bring your wallet and infrastructure
32
173
 
33
- The default 1Sat backend is `https://api.1sat.app`. Override `ONESAT_API_URL` to use a compatible deployment; configure wallet storage, explorer, content, and legacy services separately. Available tools depend on wallet mode and enabled modules.
174
+ Connect a compatible existing wallet with `BRC100_WALLET_URL`, select a legacy
175
+ encrypted account with `BSV_MCP_ACCOUNT` and unlock it with
176
+ `BSV_MCP_PASSWORD`, or use the local Vault browser setup. If setup is needed,
177
+ ask your agent to run `wallet_onboarding`; after a restart, run it again to
178
+ unlock the saved Vault. Startup never creates keys. An existing wallet keeps
179
+ its keys and controls permissions. `PRIVATE_KEY_WIF` and `IDENTITY_KEY_WIF` are
180
+ legacy compatibility inputs; they trigger a persistent Vault migration warning
181
+ and should be removed after importing the keys into Vault. See the wallet setup
182
+ guide for the required wallet API and configuration.
183
+
184
+ The default 1Sat API backend is `https://api.1sat.app`. New mainnet embedded
185
+ accounts use `https://wallet.1sat.app` for wallet storage by default; testnet
186
+ accounts do not select a remote storage provider unless configured. Override
187
+ `ONESAT_API_URL` for API services and `REMOTE_STORAGE_URL` for wallet storage;
188
+ these are separate settings. Available tools depend on wallet mode and enabled
189
+ modules.
34
190
 
35
191
  - [Wallet setup](https://bsvmcp.com/docs#wallets)
36
192
  - [Backend configuration](https://bsvmcp.com/docs#backends)
37
- - [Tools and workflows](https://bsvmcp.com/docs#tools)
193
+ - [Tools and workflows](https://bsvmcp.com/docs/tools)
38
194
  - [Paid service requests](https://bsvmcp.com/docs#x402)
39
195
  - [Sponsorship](https://bsvmcp.com/docs#sponsorship) and [agent delegation](https://bsvmcp.com/docs#delegation)
40
196
  - [Troubleshooting and development](https://bsvmcp.com/docs#troubleshooting)
@@ -45,8 +201,20 @@ The default 1Sat backend is `https://api.1sat.app`. Override `ONESAT_API_URL` to
45
201
  bun install
46
202
  bun run dev # Website
47
203
  bun run build:all # MCP server and dashboard
48
- bun dist/index.js --stdio # Local stdio launch; npm publication is not required
204
+ # Supply BRC100_WALLET_URL in the host environment before this launch.
205
+ bun --no-env-file scripts/local-mcp-launcher.ts external # Source-checkout local launch
49
206
  bun test
50
207
  ```
51
208
 
52
209
  Experimental software; APIs may change. Keep a wallet backup. If a transaction request times out, check whether it succeeded before sending it again. MIT licensed.
210
+
211
+ ## Preparing a release package
212
+
213
+ Run `bun run pack:release /tmp` to build and create the release tarball. Install
214
+ or publish that tarball, for example `bun publish /tmp/bsv-mcp-0.5.1.tgz`,
215
+ after completing the release checks and selecting the release version.
216
+ Do not publish directly from the checkout: its manifest contains Bun patches
217
+ needed to build the wallet fixes, which fail to resolve in consumer projects.
218
+ The release command stages a separate manifest without build scripts, development
219
+ dependencies, or patch declarations; the compiled bundle includes the wallet fixes.
220
+ The destination directory must already exist.