bsv-mcp 0.3.2 → 0.3.3

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,11 @@
1
1
  # BSV MCP Server Changelog
2
2
 
3
+ ## [0.3.3] - 2026-09-06
4
+
5
+ ### Fixed
6
+ - Honor `DROPLIT_SITE_URL` for sponsor approval links so staging requests reach the correct owner UI.
7
+ - Build approval links from the configured sponsor and verified wallet identity; reject unsafe site origins.
8
+
3
9
  ## [0.3.2] - 2026-09-06
4
10
 
5
11
  ### Added
package/README.md CHANGED
@@ -884,6 +884,8 @@ BRC100_WALLET_URL=http://127.0.0.1:3321
884
884
  BRC100_WALLET_ORIGINATOR=bsv-mcp.local
885
885
  DROPLIT_API_URL=https://api.droplit.dev/droplit
886
886
  DROPLIT_FAUCET_NAME=your-sponsor-slug
887
+ # Optional: set explicitly when the owner approval UI is hosted elsewhere.
888
+ DROPLIT_SITE_URL=https://droplit.dev
887
889
  ```
888
890
 
889
891
  Set both sponsor values explicitly. The URL includes the server's configured
@@ -893,8 +895,15 @@ BRC-100 wallet contexts also support this sponsor pair. `1sat serve` exposes a
893
895
  wallet stack service; it is not itself a BRC-100 signer RPC endpoint.
894
896
 
895
897
  Call `droplit_getAccess` to inspect your own authorization and quotas. An
896
- `approval_required` response includes a `https://droplit.dev` link for manual
898
+ `approval_required` response includes a link to `DROPLIT_SITE_URL` (default
899
+ `https://droplit.dev`) for manual
897
900
  owner review. Do not automatically open, approve, or register to obtain access.
901
+ The site URL must be an HTTPS origin (HTTP is allowed only for loopback),
902
+ without credentials, a path, query, or fragment. For staging, set it to the
903
+ trusted staging frontend origin independently of `DROPLIT_API_URL`. Approval
904
+ links use the configured sponsor and authenticated wallet identity; a server
905
+ response cannot redirect them to another site.
906
+
898
907
  Public status and public-key registration do not prove sponsor approval, and
899
908
  creating your own faucet requires funding rather than providing free credit.
900
909
  Missing quota kinds are unrestricted for authorized users; a configured zero
package/dist/index.js CHANGED
@@ -256042,7 +256042,7 @@ var package_default = {
256042
256042
  name: "bsv-mcp",
256043
256043
  module: "dist/index.js",
256044
256044
  type: "module",
256045
- version: "0.3.2",
256045
+ version: "0.3.3",
256046
256046
  license: "MIT",
256047
256047
  author: "satchmo",
256048
256048
  description: "A collection of Bitcoin SV (BSV) tools for the Model Context Protocol (MCP) framework",
@@ -284877,6 +284877,15 @@ function registerUtilsTools(server) {
284877
284877
 
284878
284878
  // utils/droplit.ts
284879
284879
  init_mod2();
284880
+ function approvalSiteOrigin(value2 = "https://droplit.dev") {
284881
+ const url3 = new URL(value2);
284882
+ const loopback = ["localhost", "127.0.0.1", "[::1]"].includes(url3.hostname);
284883
+ if (url3.username || url3.password || url3.pathname !== "/" || url3.href.includes("?") || url3.href.includes("#") || value2.includes("\\") || !(url3.protocol === "https:" || url3.protocol === "http:" && loopback)) {
284884
+ throw new Error("DROPLIT_SITE_URL requires an HTTPS or HTTP loopback origin without credentials, path, query or fragment");
284885
+ }
284886
+ return url3.origin;
284887
+ }
284888
+
284880
284889
  class DroplitError extends Error {
284881
284890
  code;
284882
284891
  status;
@@ -284926,9 +284935,11 @@ function httpFailure(status, details = {}) {
284926
284935
  class DroplitClient {
284927
284936
  config;
284928
284937
  authFetch;
284938
+ siteOrigin;
284929
284939
  wallet;
284930
284940
  constructor(config2) {
284931
284941
  this.config = config2;
284942
+ this.siteOrigin = approvalSiteOrigin(config2.siteUrl);
284932
284943
  if (config2.wallet && config2.authKey)
284933
284944
  throw new Error("Configure Droplit wallet or authKey, not both");
284934
284945
  const url3 = new URL(config2.apiUrl);
@@ -285023,6 +285034,7 @@ class DroplitClient {
285023
285034
  throw new DroplitError("invalid_response", "Sponsor access response did not match the authenticated wallet.");
285024
285035
  }
285025
285036
  access.approval_path = `/droplit/${encodeURIComponent(this.config.faucetName)}?tab=api&request_key=${encodeURIComponent(identity6)}`;
285037
+ access.approval_url = new URL(access.approval_path, this.siteOrigin).href;
285026
285038
  return access;
285027
285039
  }
285028
285040
  async fund(rawtx) {
@@ -285093,7 +285105,7 @@ function registerDroplitTools(server, client, disableBroadcasting = false) {
285093
285105
  ...!access.authorized ? {
285094
285106
  error: "approval_required",
285095
285107
  message: "Ask the sponsor owner to approve this wallet. Copy the approval URL for manual review; do not auto-open or submit approval.",
285096
- approval_url: `https://droplit.dev${access.approval_path}`
285108
+ approval_url: access.approval_url
285097
285109
  } : {}
285098
285110
  };
285099
285111
  return {
@@ -295163,7 +295175,7 @@ var package_default2 = {
295163
295175
  name: "bsv-mcp",
295164
295176
  module: "dist/index.js",
295165
295177
  type: "module",
295166
- version: "0.3.2",
295178
+ version: "0.3.3",
295167
295179
  license: "MIT",
295168
295180
  author: "satchmo",
295169
295181
  description: "A collection of Bitcoin SV (BSV) tools for the Model Context Protocol (MCP) framework",
@@ -298351,12 +298363,25 @@ init_mod2();
298351
298363
  function readDroplitSponsorConfig(env = process.env) {
298352
298364
  const apiUrl = env.DROPLIT_API_URL;
298353
298365
  const faucetName = env.DROPLIT_FAUCET_NAME;
298354
- if (apiUrl === undefined && faucetName === undefined)
298366
+ const siteUrl = env.DROPLIT_SITE_URL;
298367
+ if (apiUrl === undefined && faucetName === undefined && siteUrl === undefined)
298355
298368
  return;
298356
298369
  if (!apiUrl?.trim() || !faucetName?.trim()) {
298357
298370
  throw new Error("DROPLIT_API_URL and DROPLIT_FAUCET_NAME must both be explicitly configured");
298358
298371
  }
298359
- return { apiUrl, faucetName };
298372
+ return {
298373
+ apiUrl,
298374
+ faucetName,
298375
+ ...siteUrl === undefined ? {} : { siteUrl: approvalSiteOrigin2(siteUrl) }
298376
+ };
298377
+ }
298378
+ function approvalSiteOrigin2(value2 = "https://droplit.dev") {
298379
+ const url3 = new URL(value2);
298380
+ const loopback = ["localhost", "127.0.0.1", "[::1]"].includes(url3.hostname);
298381
+ if (url3.username || url3.password || url3.pathname !== "/" || url3.href.includes("?") || url3.href.includes("#") || value2.includes("\\") || !(url3.protocol === "https:" || url3.protocol === "http:" && loopback)) {
298382
+ throw new Error("DROPLIT_SITE_URL requires an HTTPS or HTTP loopback origin without credentials, path, query or fragment");
298383
+ }
298384
+ return url3.origin;
298360
298385
  }
298361
298386
 
298362
298387
  class DroplitError2 extends Error {
@@ -298408,9 +298433,11 @@ function httpFailure2(status, details = {}) {
298408
298433
  class DroplitClient2 {
298409
298434
  config;
298410
298435
  authFetch;
298436
+ siteOrigin;
298411
298437
  wallet;
298412
298438
  constructor(config2) {
298413
298439
  this.config = config2;
298440
+ this.siteOrigin = approvalSiteOrigin2(config2.siteUrl);
298414
298441
  if (config2.wallet && config2.authKey)
298415
298442
  throw new Error("Configure Droplit wallet or authKey, not both");
298416
298443
  const url3 = new URL(config2.apiUrl);
@@ -298505,6 +298532,7 @@ class DroplitClient2 {
298505
298532
  throw new DroplitError2("invalid_response", "Sponsor access response did not match the authenticated wallet.");
298506
298533
  }
298507
298534
  access.approval_path = `/droplit/${encodeURIComponent(this.config.faucetName)}?tab=api&request_key=${encodeURIComponent(identity6)}`;
298535
+ access.approval_url = new URL(access.approval_path, this.siteOrigin).href;
298508
298536
  return access;
298509
298537
  }
298510
298538
  async fund(rawtx) {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "bsv-mcp",
3
3
  "module": "dist/index.js",
4
4
  "type": "module",
5
- "version": "0.3.2",
5
+ "version": "0.3.3",
6
6
  "license": "MIT",
7
7
  "author": "satchmo",
8
8
  "description": "A collection of Bitcoin SV (BSV) tools for the Model Context Protocol (MCP) framework",
@@ -53,7 +53,7 @@ export function registerDroplitTools(
53
53
  error: "approval_required",
54
54
  message:
55
55
  "Ask the sponsor owner to approve this wallet. Copy the approval URL for manual review; do not auto-open or submit approval.",
56
- approval_url: `https://droplit.dev${access.approval_path}`,
56
+ approval_url: access.approval_url,
57
57
  }
58
58
  : {}),
59
59
  };