@cmdoss/suipay-mcp 0.2.2-dev.9 → 0.3.0-dev.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.
@@ -3,8 +3,9 @@ import {
3
3
  loadLocalSigner,
4
4
  loadLocalSigningKeyRecord,
5
5
  loadMcpConfig,
6
- loadPaymentProfile
7
- } from "./chunk-NDJ7BFI4.js";
6
+ loadPaymentProfile,
7
+ logError
8
+ } from "./chunk-FKDC22O6.js";
8
9
 
9
10
  // src/index.ts
10
11
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
@@ -25,18 +26,24 @@ async function main() {
25
26
  const boundGateway = loadLocalSigningKeyRecord()?.gatewayUrl ?? cfg.gatewayUrl;
26
27
  const local = loadLocalSigner();
27
28
  if (local) {
28
- console.error(
29
- `[suipay-mcp] ${target} ${boundGateway} \xB7 delegate ${local.address} \xB7 stdio ready`
30
- );
29
+ process.stderr.write(`[suipay-mcp] ${target} ${boundGateway} \xB7 delegate ${local.address} \xB7 stdio ready
30
+ `);
31
31
  } else {
32
- console.error(
33
- `[suipay-mcp] ${target} ${boundGateway} \xB7 not connected \xB7 run suipay_login \xB7 stdio ready`
34
- );
32
+ process.stderr.write(`[suipay-mcp] ${target} ${boundGateway} \xB7 not connected \xB7 run suipay_login \xB7 stdio ready
33
+ `);
35
34
  }
36
- } catch {
37
- console.error(
38
- `[suipay-mcp] ${target} ${cfg.gatewayUrl} \xB7 credentials unreadable: run suipay_login or suipay_logout force=true \xB7 stdio ready`
35
+ } catch (error) {
36
+ logError(
37
+ {
38
+ scope: "suipay-mcp",
39
+ code: "client.local_credentials_invalid",
40
+ level: "warn",
41
+ msg: "local credentials are unreadable; run suipay_login or suipay_logout force=true"
42
+ },
43
+ error
39
44
  );
45
+ process.stderr.write(`[suipay-mcp] ${target} ${cfg.gatewayUrl} \xB7 credentials unreadable \xB7 stdio ready
46
+ `);
40
47
  }
41
48
  }
42
49