@oobe-protocol-labs/sap-mcp-server 0.9.2 → 0.9.6

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 (76) hide show
  1. package/CHANGELOG.md +87 -0
  2. package/README.md +8 -2
  3. package/USER_DOCS/00_START_HERE.md +26 -3
  4. package/USER_DOCS/03_PAYMENTS_X402_PAYSH.md +13 -3
  5. package/USER_DOCS/04_CLIENT_CONFIGS.md +9 -5
  6. package/USER_DOCS/05_SKILLS_AND_TOOLS.md +33 -4
  7. package/USER_DOCS/06_DESKTOP_GUI_WIZARD.md +12 -6
  8. package/USER_DOCS/07_SMITHERY_AND_MARKETPLACES.md +7 -0
  9. package/config.schema.json +2 -2
  10. package/dist/adapters/mcp/sdk-compat.d.ts.map +1 -1
  11. package/dist/adapters/mcp/sdk-compat.js +22 -4
  12. package/dist/adapters/mcp/sdk-compat.js.map +1 -1
  13. package/dist/adapters/mcp/tool-response.d.ts +13 -0
  14. package/dist/adapters/mcp/tool-response.d.ts.map +1 -1
  15. package/dist/adapters/mcp/tool-response.js +10 -0
  16. package/dist/adapters/mcp/tool-response.js.map +1 -1
  17. package/dist/config/env.js +4 -4
  18. package/dist/config/env.js.map +1 -1
  19. package/dist/config/mcp-client-injection.d.ts.map +1 -1
  20. package/dist/config/mcp-client-injection.js +10 -4
  21. package/dist/config/mcp-client-injection.js.map +1 -1
  22. package/dist/config/wizard.d.ts +6 -0
  23. package/dist/config/wizard.d.ts.map +1 -1
  24. package/dist/config/wizard.js +99 -17
  25. package/dist/config/wizard.js.map +1 -1
  26. package/dist/config-cli.d.ts.map +1 -1
  27. package/dist/config-cli.js +9 -1
  28. package/dist/config-cli.js.map +1 -1
  29. package/dist/core/constants.d.ts +1 -1
  30. package/dist/core/constants.d.ts.map +1 -1
  31. package/dist/core/constants.js +2 -1
  32. package/dist/core/constants.js.map +1 -1
  33. package/dist/payments/pricing.d.ts.map +1 -1
  34. package/dist/payments/pricing.js +61 -13
  35. package/dist/payments/pricing.js.map +1 -1
  36. package/dist/prompts/context/sap-agent-context.prompt.js +2 -0
  37. package/dist/prompts/context/sap-agent-context.prompt.js.map +1 -1
  38. package/dist/prompts/context/sap-agent-start.prompt.js +2 -0
  39. package/dist/prompts/context/sap-agent-start.prompt.js.map +1 -1
  40. package/dist/remote/public-home/sections.d.ts.map +1 -1
  41. package/dist/remote/public-home/sections.js +10 -3
  42. package/dist/remote/public-home/sections.js.map +1 -1
  43. package/dist/remote/public-home/types.d.ts +1 -0
  44. package/dist/remote/public-home/types.d.ts.map +1 -1
  45. package/dist/remote/server.d.ts.map +1 -1
  46. package/dist/remote/server.js +2 -0
  47. package/dist/remote/server.js.map +1 -1
  48. package/dist/security/tool-permissions.d.ts.map +1 -1
  49. package/dist/security/tool-permissions.js +1 -0
  50. package/dist/security/tool-permissions.js.map +1 -1
  51. package/dist/tools/agent-start-tool.d.ts.map +1 -1
  52. package/dist/tools/agent-start-tool.js +43 -4
  53. package/dist/tools/agent-start-tool.js.map +1 -1
  54. package/dist/tools/magicblock-tools.d.ts +6 -6
  55. package/dist/tools/magicblock-tools.js +26 -26
  56. package/dist/tools/magicblock-tools.js.map +1 -1
  57. package/dist/tools/skills-tools.d.ts.map +1 -1
  58. package/dist/tools/skills-tools.js +199 -1
  59. package/dist/tools/skills-tools.js.map +1 -1
  60. package/dist/tools/transaction-tools.d.ts +78 -0
  61. package/dist/tools/transaction-tools.d.ts.map +1 -1
  62. package/dist/tools/transaction-tools.js +72 -9
  63. package/dist/tools/transaction-tools.js.map +1 -1
  64. package/dist/tools/x402-paid-call-tool.d.ts.map +1 -1
  65. package/dist/tools/x402-paid-call-tool.js +106 -0
  66. package/dist/tools/x402-paid-call-tool.js.map +1 -1
  67. package/docs/03_CONFIGURATION_AND_WIZARD.md +2 -3
  68. package/docs/06_PAYMENTS_X402_AND_PAYSH.md +1 -0
  69. package/docs/07_ENDPOINTS_AND_CLIENTS.md +1 -1
  70. package/docs/14_DESKTOP_WIZARD_RELEASE.md +2 -3
  71. package/docs/README.md +5 -2
  72. package/docs/magicblock-tools.md +44 -29
  73. package/package.json +1 -1
  74. package/server.json +3 -3
  75. package/skills/sap-mcp/SKILL.md +26 -7
  76. package/skills/sap-payments-x402/SKILL.md +7 -0
@@ -66,7 +66,7 @@ url = "https://mcp.sap.oobeprotocol.ai/mcp"
66
66
  ```toml
67
67
  [mcp_servers.sap_payments]
68
68
  command = "npx"
69
- args = ["--yes", "--package", "@oobe-protocol-labs/sap-mcp-server@0.9.2", "sap-mcp-server"]
69
+ args = ["--yes", "--package", "@oobe-protocol-labs/sap-mcp-server@0.9.6", "sap-mcp-server"]
70
70
  startup_timeout_sec = 300
71
71
  tool_timeout_sec = 300
72
72
 
@@ -128,12 +128,11 @@ Every supported runtime may also receive a local `sap_payments` server with only
128
128
  ```txt
129
129
  sap_payments_readiness
130
130
  sap_payments_call_paid_tool
131
+ sap_payments_finalize_transaction
131
132
  sap_payments_prepare_challenge
132
133
  sap_payments_sign_challenge
133
134
  sap_payments_verify_receipt
134
135
  sap_x402_paid_call
135
- sap_profile_current
136
- sap_x402_estimate_cost
137
136
  ```
138
137
 
139
138
  The hosted `sap` entry must not include wallet paths, RPC API-key overrides, profile names, keypair bytes, or private signer data.
package/docs/README.md CHANGED
@@ -91,8 +91,11 @@ Hosted paid tools use x402 and pay.sh:
91
91
  - value flows: fixed or percentage pricing only where it is operationally appropriate
92
92
 
93
93
  For agents that cannot replay x402 challenges natively, configure the local
94
- `sap_payments` MCP bridge and call `sap_payments_call_paid_tool`. The standalone
95
- helper remains available as a terminal/custom-wrapper fallback:
94
+ `sap_payments` MCP bridge and call `sap_payments_call_paid_tool`. If a hosted
95
+ builder returns an unsigned transaction, finalize it with
96
+ `sap_payments_finalize_transaction` so the local signer previews, signs, and
97
+ optionally submits without exposing keypair bytes. The standalone helper remains
98
+ available as a terminal/custom-wrapper fallback:
96
99
 
97
100
  ```bash
98
101
  npx --yes --package @oobe-protocol-labs/sap-mcp-server sap-mcp-x402-paid-call \
@@ -24,21 +24,30 @@ additional configuration needed.
24
24
 
25
25
  ## Pricing
26
26
 
27
- Two tiers, priced in USDC base units (6 decimals):
27
+ Hosted pricing is resolved centrally by `src/payments/pricing.ts` and returned
28
+ as an x402/pay.sh challenge before the paid tool executes.
28
29
 
29
- | Tier | Price | Count | Tools |
30
- |------|-------|-------|-------|
31
- | READ | $0.01 | 14 | ER Router queries, health, auth, balances, swap quotes, mint checks, VRF result |
32
- | WRITE | $0.05 | 6 | deposit, transfer, withdraw, swap, initializeMint, VRF request |
30
+ | Tier | Tools |
31
+ |------|-------|
32
+ | Free/readiness | MCP discovery, SAP skill bootstrap, payment readiness, transaction decode/preview |
33
+ | Read-premium | ER Router queries, balances, swap quotes, mint checks, VRF result |
34
+ | Builder | Deposit, transfer, withdraw, initialize mint, VRF request transaction builders |
35
+ | Value-action | Public/private swap transaction builders and other value-moving actions |
33
36
 
34
- Every tool description includes its price. Every successful response
35
- includes `priceUsd` and `priceBaseUnits` fields for SAP escrow settlement.
37
+ Do not hard-code MagicBlock prices in agents. Call `sap_x402_estimate_cost` or
38
+ the local `sap_payments_call_paid_tool` helper and enforce the user profile's
39
+ `maxPriceUsd` / spend policy.
40
+
41
+ When a hosted MagicBlock builder returns an unsigned transaction, hosted SAP MCP
42
+ remains non-custodial. Finalize the returned `transactionBase64` with the local
43
+ `sap_payments_finalize_transaction` bridge. Do not call hosted
44
+ `sap_sign_transaction`, create temporary signing scripts, or read keypair JSON.
36
45
 
37
46
  ---
38
47
 
39
48
  ## Tools (20 total)
40
49
 
41
- ### ER Router (6 read-only — $0.01)
50
+ ### ER Router (6 read-only)
42
51
 
43
52
  | Tool | Description |
44
53
  |------|-------------|
@@ -49,7 +58,7 @@ includes `priceUsd` and `priceBaseUnits` fields for SAP escrow settlement.
49
58
  | `magicblock_getBlockhashForAccounts` | Get a blockhash for a batch of accounts (max 100) |
50
59
  | `magicblock_getSignatureStatuses` | Check transaction confirmation status |
51
60
 
52
- ### Private Payments — Meta & Auth (3 — $0.01)
61
+ ### Private Payments — Meta & Auth (3)
53
62
 
54
63
  | Tool | Description |
55
64
  |------|-------------|
@@ -57,14 +66,14 @@ includes `priceUsd` and `priceBaseUnits` fields for SAP escrow settlement.
57
66
  | `magicblock_challenge` | Generate a challenge string for wallet auth |
58
67
  | `magicblock_login` | Exchange signed challenge for bearer token |
59
68
 
60
- ### Private Payments — Balance (2 — $0.01)
69
+ ### Private Payments — Balance (2)
61
70
 
62
71
  | Tool | Description |
63
72
  |------|-------------|
64
73
  | `magicblock_balance` | Read base-chain SPL token balance |
65
74
  | `magicblock_privateBalance` | Read ephemeral-rollup SPL balance (requires auth) |
66
75
 
67
- ### Private Payments — SPL Token Flows (3 — $0.05)
76
+ ### Private Payments — SPL Token Flows (3)
68
77
 
69
78
  | Tool | Description |
70
79
  |------|-------------|
@@ -74,24 +83,24 @@ includes `priceUsd` and `priceBaseUnits` fields for SAP escrow settlement.
74
83
 
75
84
  ### Private Payments — Swap (2)
76
85
 
77
- | Tool | Price | Description |
78
- |------|-------|-------------|
79
- | `magicblock_swapQuote` | $0.01 | Get a swap quote between two SPL mints |
80
- | `magicblock_swap` | $0.05 | Build unsigned swap tx (public or private) |
86
+ | Tool | Description |
87
+ |------|-------------|
88
+ | `magicblock_swapQuote` | Get a swap quote between two SPL mints |
89
+ | `magicblock_swap` | Build unsigned swap tx (public or private) |
81
90
 
82
91
  ### Private Payments — Mint Init (2)
83
92
 
84
- | Tool | Price | Description |
85
- |------|-------|-------------|
86
- | `magicblock_initializeMint` | $0.05 | Build unsigned mint transfer queue init tx |
87
- | `magicblock_isMintInitialized` | $0.01 | Check if a mint's transfer queue exists |
93
+ | Tool | Description |
94
+ |------|-------------|
95
+ | `magicblock_initializeMint` | Build unsigned mint transfer queue init tx |
96
+ | `magicblock_isMintInitialized` | Check if a mint's transfer queue exists |
88
97
 
89
98
  ### VRF (2 — on-chain via @solana/web3.js)
90
99
 
91
- | Tool | Price | Description |
92
- |------|-------|-------------|
93
- | `magicblock_requestRandomness` | $0.05 | Build unsigned tx invoking request_randomness on the VRF program (Vrf1RNUjXmQGjmQrQLvJHs9SNkvDJEsRVFPkfSQUwGz) |
94
- | `magicblock_getRandomnessResult` | $0.01 | Read the RandomnessRequest account on-chain to check fulfillment and retrieve random bytes |
100
+ | Tool | Description |
101
+ |------|-------------|
102
+ | `magicblock_requestRandomness` | Build unsigned tx invoking request_randomness on the VRF program (Vrf1RNUjXmQGjmQrQLvJHs9SNkvDJEsRVFPkfSQUwGz) |
103
+ | `magicblock_getRandomnessResult` | Read the RandomnessRequest account on-chain to check fulfillment and retrieve random bytes |
95
104
 
96
105
  ---
97
106
 
@@ -126,21 +135,27 @@ Write tools return an unsigned transaction:
126
135
  Expected flow:
127
136
 
128
137
  1. Call the MagicBlock tool (e.g. `magicblock_deposit`) → get `transactionBase64`
129
- 2. Sign with `sap_sign_transaction`
130
- 3. Submit with `sap_submit_signed_transaction` to the RPC indicated by `sendTo`
138
+ 2. If the transaction came from hosted SAP MCP, call local
139
+ `sap_payments_finalize_transaction` with `confirm: true` and `submit: false`
140
+ for preview/sign, or `submit: true` after user approval.
141
+ 3. If the transaction came from local stdio SAP MCP, use
142
+ `sap_preview_transaction` → `sap_sign_transaction` →
143
+ `sap_submit_signed_transaction`.
144
+ 4. Record the signed transaction or submitted signature in the audit trail.
145
+
146
+ Agents must not create temporary JavaScript signing scripts, read keypair JSON,
147
+ or sign raw message bytes outside SAP MCP transaction tools.
131
148
 
132
149
  ---
133
150
 
134
151
  ## Response Format
135
152
 
136
- Every successful response is wrapped with pricing metadata:
153
+ Successful tool responses are wrapped by SAP MCP:
137
154
 
138
155
  ```json
139
156
  {
140
157
  "success": true,
141
158
  "tool": "magicblock_deposit",
142
- "priceUsd": "$0.05",
143
- "priceBaseUnits": "50000",
144
159
  "data": { ... }
145
160
  }
146
161
  ```
@@ -163,4 +178,4 @@ Error responses:
163
178
  | `src/tools/magicblock-tools.ts` | 20 tool registrations with HTTP client |
164
179
  | `src/tools/__tests__/magicblock-tools.test.ts` | 10 smoke tests |
165
180
  | `src/tools/index.ts` | Barrel export |
166
- | `src/tools/register-tools.ts` | Registration call during server init |
181
+ | `src/tools/register-tools.ts` | Registration call during server init |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oobe-protocol-labs/sap-mcp-server",
3
- "version": "0.9.2",
3
+ "version": "0.9.6",
4
4
  "mcpName": "ai.oobeprotocol.sap.mcp/sap-mcp",
5
5
  "description": "Official MCP gateway for OOBE Protocol SAP — AI agents can interact with SAP identity, registry, reputation, tools, memory, payments, settlement, and proof-of-execution on Solana",
6
6
  "type": "module",
package/server.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "name": "ai.oobeprotocol.sap.mcp/sap-mcp",
4
4
  "title": "SAP MCP Server | OOBE Protocol",
5
5
  "description": "Solana-native MCP gateway for SAP tools, DeFi, SNS identity, x402/pay.sh, and agent operations.",
6
- "version": "0.9.2",
6
+ "version": "0.9.6",
7
7
  "websiteUrl": "https://mcp.sap.oobeprotocol.ai/",
8
8
  "repository": {
9
9
  "url": "https://github.com/OOBE-PROTOCOL/sap-mcp",
@@ -29,7 +29,7 @@
29
29
  {
30
30
  "registryType": "npm",
31
31
  "identifier": "@oobe-protocol-labs/sap-mcp-server",
32
- "version": "0.9.2",
32
+ "version": "0.9.6",
33
33
  "transport": {
34
34
  "type": "stdio"
35
35
  },
@@ -45,7 +45,7 @@
45
45
  },
46
46
  {
47
47
  "type": "positional",
48
- "value": "@oobe-protocol-labs/sap-mcp-server@0.9.2"
48
+ "value": "@oobe-protocol-labs/sap-mcp-server@0.9.6"
49
49
  },
50
50
  {
51
51
  "type": "positional",
@@ -14,10 +14,13 @@ the returned SAP MCP skill contents into context.
14
14
  Always inspect runtime context through MCP tools, not by reading config files:
15
15
 
16
16
  1. `sap_agent_start`
17
- 2. `sap_profile_current`
18
- 3. `sap_profile_list`
19
- 4. `sap_profile_public_key`
20
- 5. `sap_network_stats`
17
+ 2. `sap_skills_bundle` with `includeContents: true`
18
+ 3. `sap_skills_upgrade_plan` when local skills are missing or stale
19
+ 4. `sap_runtime_repair_plan` when hosted tools are connected but `sap_payments` is missing
20
+ 5. `sap_profile_current`
21
+ 6. `sap_profile_list`
22
+ 7. `sap_profile_public_key`
23
+ 8. `sap_network_stats`
21
24
 
22
25
  The server profile is the source of truth. Environment variables from the MCP
23
26
  client must not override profile-owned RPC or wallet settings unless
@@ -61,12 +64,17 @@ Use the bundled routing map for local MCP tool selection:
61
64
  - `USER_DOCS/05_SKILLS_AND_TOOLS.md`
62
65
 
63
66
  SAP MCP startup and skill bootstrap tools are free context/setup tools. Call
64
- `sap_agent_start`, `sap_skills_list`, `sap_skills_bundle`, and local
65
- `sap_skills_install` directly. Do not route startup, skill listing, bundling, or
66
- installation through `sap_x402_paid_call`. On hosted remote MCP, use
67
+ `sap_agent_start`, `sap_skills_list`, `sap_skills_bundle`,
68
+ `sap_skills_upgrade_plan`, `sap_runtime_repair_plan`, and local
69
+ `sap_skills_install` directly. Do not route startup, skill listing, bundling,
70
+ upgrade planning, runtime repair planning, or installation through
71
+ `sap_x402_paid_call`. On hosted remote MCP, use
67
72
  `sap_skills_bundle` to download skill contents; the hosted server cannot
68
73
  install files onto the caller's local machine. Local installation belongs to the
69
74
  wizard, desktop app, addon installer, or a local stdio SAP MCP process.
75
+ If skills or runtime bridge config are stale, call `sap_skills_upgrade_plan` or
76
+ `sap_runtime_repair_plan` first. These tools return the pinned latest-release
77
+ commands and preserve the non-custodial local signing model.
70
78
 
71
79
  ## Hosted Remote MCP
72
80
 
@@ -155,6 +163,12 @@ and arguments, `confirm: true`, and `maxAttempts: 5` so a fresh payment payload
155
163
  is created. Use `sap_x402_paid_call` only when a runtime still exposes the
156
164
  legacy alias.
157
165
 
166
+ When a hosted paid/write builder returns `transactionBase64`, `transaction`, or
167
+ another unsigned Solana transaction payload, finalize it locally with
168
+ `sap_payments_finalize_transaction`. Do not call hosted `sap_sign_transaction`
169
+ for a user-owned signer, do not create `.js`/`.mjs` signing scripts, and do not
170
+ read keypair JSON.
171
+
158
172
  When summarizing a hosted connection, use language like:
159
173
  "server is non-custodial; user signatures come from the local SAP profile or
160
174
  external signer." Avoid saying "signer not configured", "read-only only",
@@ -170,6 +184,11 @@ the current agent runtime injected every tool as callable. If `tools/list`
170
184
  works but callable functions are missing, report a runtime reload/injection
171
185
  issue and ask the user to restart the runtime.
172
186
 
187
+ If `sap_payments` tools are missing after the user says the wizard completed,
188
+ call `sap_runtime_repair_plan`. Do not ask the user to manually rebuild their
189
+ runtime config unless the repair plan has already failed or runtime startup logs
190
+ show a concrete package/runtime error.
191
+
173
192
  ## Profile Tools
174
193
 
175
194
  | Tool | Purpose |
@@ -9,6 +9,7 @@ workflows, and hosted SAP MCP x402/pay.sh monetization.
9
9
  - `sap_x402_get_balance`
10
10
  - `sap_payments_profile_current`
11
11
  - `sap_payments_call_paid_tool`
12
+ - `sap_payments_finalize_transaction`
12
13
  - `sap_payments_prepare_challenge`
13
14
  - `sap_payments_sign_challenge`
14
15
  - `sap_payments_verify_receipt`
@@ -81,6 +82,12 @@ SAP MCP `sap_payments` bridge is already configured. The legacy
81
82
  `sap_x402_paid_call` alias is acceptable only when a runtime has not refreshed
82
83
  to the new tool name.
83
84
 
85
+ If the hosted paid tool returns `transactionBase64`, `transaction`, or an
86
+ unsigned transaction object, call `sap_payments_finalize_transaction` with
87
+ `confirm: true`. Set `submit: false` for preview/sign only, or `submit: true`
88
+ after the user approves execution. Never create temporary signing scripts, read
89
+ keypair JSON, or call hosted `sap_sign_transaction` for user-owned signatures.
90
+
84
91
  Use low-level helpers only for custom clients:
85
92
 
86
93
  - `sap_payments_prepare_challenge` returns the parsed hosted x402 challenge