@oobe-protocol-labs/sap-mcp-server 0.2.1 → 0.7.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 (162) hide show
  1. package/.env.example +3 -0
  2. package/CHANGELOG.md +238 -1
  3. package/README.md +64 -1
  4. package/USER_DOCS/00_START_HERE.md +23 -1
  5. package/USER_DOCS/01_HOSTED_REMOTE_MCP.md +55 -0
  6. package/USER_DOCS/03_PAYMENTS_X402_PAYSH.md +63 -7
  7. package/USER_DOCS/04_CLIENT_CONFIGS.md +164 -11
  8. package/USER_DOCS/06_DESKTOP_GUI_WIZARD.md +262 -0
  9. package/dist/adapters/mcp/sdk-compat.d.ts.map +1 -1
  10. package/dist/adapters/mcp/sdk-compat.js +32 -18
  11. package/dist/adapters/mcp/sdk-compat.js.map +1 -1
  12. package/dist/config/mcp-client-injection.d.ts +72 -2
  13. package/dist/config/mcp-client-injection.d.ts.map +1 -1
  14. package/dist/config/mcp-client-injection.js +691 -15
  15. package/dist/config/mcp-client-injection.js.map +1 -1
  16. package/dist/config/setup.js +1 -1
  17. package/dist/config/setup.js.map +1 -1
  18. package/dist/config/wizard.d.ts.map +1 -1
  19. package/dist/config/wizard.js +164 -85
  20. package/dist/config/wizard.js.map +1 -1
  21. package/dist/core/constants.d.ts +1 -1
  22. package/dist/core/constants.js +1 -1
  23. package/dist/core/logger.js +1 -1
  24. package/dist/payments/facilitator-rpc-fallback.d.ts +43 -0
  25. package/dist/payments/facilitator-rpc-fallback.d.ts.map +1 -0
  26. package/dist/payments/facilitator-rpc-fallback.js +228 -0
  27. package/dist/payments/facilitator-rpc-fallback.js.map +1 -0
  28. package/dist/payments/json-rpc.d.ts.map +1 -1
  29. package/dist/payments/json-rpc.js +2 -1
  30. package/dist/payments/json-rpc.js.map +1 -1
  31. package/dist/payments/monetization-gate.d.ts +43 -2
  32. package/dist/payments/monetization-gate.d.ts.map +1 -1
  33. package/dist/payments/monetization-gate.js +618 -9
  34. package/dist/payments/monetization-gate.js.map +1 -1
  35. package/dist/payments/oobe-facilitator-server.d.ts +12 -1
  36. package/dist/payments/oobe-facilitator-server.d.ts.map +1 -1
  37. package/dist/payments/oobe-facilitator-server.js +109 -8
  38. package/dist/payments/oobe-facilitator-server.js.map +1 -1
  39. package/dist/payments/pay-sh-spec.js +1 -1
  40. package/dist/payments/pricing.d.ts.map +1 -1
  41. package/dist/payments/pricing.js +1 -0
  42. package/dist/payments/pricing.js.map +1 -1
  43. package/dist/payments/usage-ledger.d.ts +10 -0
  44. package/dist/payments/usage-ledger.d.ts.map +1 -1
  45. package/dist/payments/usage-ledger.js +51 -0
  46. package/dist/payments/usage-ledger.js.map +1 -1
  47. package/dist/payments/x402-paid-call.d.ts +53 -0
  48. package/dist/payments/x402-paid-call.d.ts.map +1 -0
  49. package/dist/payments/x402-paid-call.js +370 -0
  50. package/dist/payments/x402-paid-call.js.map +1 -0
  51. package/dist/prompts/context/sap-agent-context.prompt.js +33 -6
  52. package/dist/prompts/context/sap-agent-context.prompt.js.map +1 -1
  53. package/dist/prompts/developer/debug-sap-error.prompt.js +1 -1
  54. package/dist/prompts/developer/debug-sap-error.prompt.js.map +1 -1
  55. package/dist/prompts/developer/generate-sap-integration.prompt.js +6 -2
  56. package/dist/prompts/developer/generate-sap-integration.prompt.js.map +1 -1
  57. package/dist/prompts/execution-proof/explain-proof-of-execution.prompt.js +1 -1
  58. package/dist/prompts/execution-proof/explain-proof-of-execution.prompt.js.map +1 -1
  59. package/dist/prompts/execution-proof/verify-execution-proof.prompt.js +1 -1
  60. package/dist/prompts/execution-proof/verify-execution-proof.prompt.js.map +1 -1
  61. package/dist/prompts/payments/create-paid-api.prompt.js +1 -1
  62. package/dist/prompts/payments/create-paid-api.prompt.js.map +1 -1
  63. package/dist/prompts/payments/explain-x402-settlement.prompt.js +1 -1
  64. package/dist/prompts/payments/explain-x402-settlement.prompt.js.map +1 -1
  65. package/dist/prompts/register-prompts.js +2 -2
  66. package/dist/prompts/register-prompts.js.map +1 -1
  67. package/dist/prompts/registry/analyze-sap-agent.prompt.js +1 -1
  68. package/dist/prompts/registry/analyze-sap-agent.prompt.js.map +1 -1
  69. package/dist/prompts/registry/register-sap-agent.prompt.js +2 -2
  70. package/dist/prompts/registry/register-sap-agent.prompt.js.map +1 -1
  71. package/dist/remote/server.d.ts +150 -1
  72. package/dist/remote/server.d.ts.map +1 -1
  73. package/dist/remote/server.js +1176 -84
  74. package/dist/remote/server.js.map +1 -1
  75. package/dist/resources/current/sap-current-config.resource.d.ts.map +1 -1
  76. package/dist/resources/current/sap-current-config.resource.js +22 -2
  77. package/dist/resources/current/sap-current-config.resource.js.map +1 -1
  78. package/dist/resources/execution-proof/sap-execution-record.resource.js +1 -1
  79. package/dist/resources/execution-proof/sap-execution-record.resource.js.map +1 -1
  80. package/dist/resources/memory/sap-memory.resource.js +1 -1
  81. package/dist/resources/memory/sap-memory.resource.js.map +1 -1
  82. package/dist/resources/profile/sap-active-profile.resource.js +1 -1
  83. package/dist/resources/profile/sap-active-profile.resource.js.map +1 -1
  84. package/dist/resources/register-resources.js +2 -2
  85. package/dist/resources/register-resources.js.map +1 -1
  86. package/dist/resources/registry/sap-agent.resource.js +1 -1
  87. package/dist/resources/registry/sap-agent.resource.js.map +1 -1
  88. package/dist/resources/registry/sap-global-registry.resource.js +1 -1
  89. package/dist/resources/registry/sap-global-registry.resource.js.map +1 -1
  90. package/dist/resources/reputation/sap-reputation.resource.js +1 -1
  91. package/dist/resources/reputation/sap-reputation.resource.js.map +1 -1
  92. package/dist/resources/stats/sap-network-stats.resource.js +1 -1
  93. package/dist/resources/stats/sap-network-stats.resource.js.map +1 -1
  94. package/dist/resources/tool-schema/sap-tool-schema.resource.js +1 -1
  95. package/dist/resources/tool-schema/sap-tool-schema.resource.js.map +1 -1
  96. package/dist/sap/sap-client-manager.js +6 -6
  97. package/dist/sap/sap-client-manager.js.map +1 -1
  98. package/dist/security/tool-permissions.d.ts.map +1 -1
  99. package/dist/security/tool-permissions.js +1 -0
  100. package/dist/security/tool-permissions.js.map +1 -1
  101. package/dist/server/create-server.js +5 -5
  102. package/dist/server/create-server.js.map +1 -1
  103. package/dist/server/register-capabilities.js +4 -4
  104. package/dist/server/register-capabilities.js.map +1 -1
  105. package/dist/server/server-metadata.js +1 -1
  106. package/dist/signer/signer-resolver.js +12 -5
  107. package/dist/signer/signer-resolver.js.map +1 -1
  108. package/dist/tools/client-sdk-tools.js +7 -7
  109. package/dist/tools/client-sdk-tools.js.map +1 -1
  110. package/dist/tools/index.d.ts +2 -0
  111. package/dist/tools/index.d.ts.map +1 -1
  112. package/dist/tools/index.js +4 -0
  113. package/dist/tools/index.js.map +1 -1
  114. package/dist/tools/magicblock-tools.d.ts +28 -0
  115. package/dist/tools/magicblock-tools.d.ts.map +1 -0
  116. package/dist/tools/magicblock-tools.js +578 -0
  117. package/dist/tools/magicblock-tools.js.map +1 -0
  118. package/dist/tools/profile-tools.d.ts.map +1 -1
  119. package/dist/tools/profile-tools.js +44 -0
  120. package/dist/tools/profile-tools.js.map +1 -1
  121. package/dist/tools/register-tools.d.ts.map +1 -1
  122. package/dist/tools/register-tools.js +11 -2
  123. package/dist/tools/register-tools.js.map +1 -1
  124. package/dist/tools/sap-sdk-tools.js +2 -2
  125. package/dist/tools/sap-sdk-tools.js.map +1 -1
  126. package/dist/tools/sap-sns-tools.js +2 -2
  127. package/dist/tools/sap-sns-tools.js.map +1 -1
  128. package/dist/tools/skills-tools.d.ts +1 -1
  129. package/dist/tools/skills-tools.d.ts.map +1 -1
  130. package/dist/tools/skills-tools.js +10 -1
  131. package/dist/tools/skills-tools.js.map +1 -1
  132. package/dist/tools/tool-aliases.d.ts +10 -0
  133. package/dist/tools/tool-aliases.d.ts.map +1 -0
  134. package/dist/tools/tool-aliases.js +23 -0
  135. package/dist/tools/tool-aliases.js.map +1 -0
  136. package/dist/tools/x402-paid-call-tool.d.ts +12 -0
  137. package/dist/tools/x402-paid-call-tool.d.ts.map +1 -0
  138. package/dist/tools/x402-paid-call-tool.js +118 -0
  139. package/dist/tools/x402-paid-call-tool.js.map +1 -0
  140. package/dist/tui/config-wizard.js +2 -2
  141. package/dist/tui/config-wizard.js.map +1 -1
  142. package/dist/wizard-core/desktop-flow.d.ts +82 -0
  143. package/dist/wizard-core/desktop-flow.d.ts.map +1 -0
  144. package/dist/wizard-core/desktop-flow.js +181 -0
  145. package/dist/wizard-core/desktop-flow.js.map +1 -0
  146. package/docs/00_README.md +3 -0
  147. package/docs/03_CONFIGURATION_AND_WIZARD.md +31 -5
  148. package/docs/06_PAYMENTS_X402_AND_PAYSH.md +70 -7
  149. package/docs/07_ENDPOINTS_AND_CLIENTS.md +56 -1
  150. package/docs/10_OPERATIONS_RELEASE_AND_PM2.md +7 -6
  151. package/docs/13_BOUNTY_PROGRAM_PROPOSAL.md +469 -0
  152. package/docs/14_DESKTOP_WIZARD_RELEASE.md +264 -0
  153. package/docs/README.md +104 -0
  154. package/docs/_sidebar.md +31 -0
  155. package/docs/magicblock-tools.md +166 -0
  156. package/docs/x402-protocol-spec.md +984 -0
  157. package/package.json +23 -2
  158. package/server.json +71 -0
  159. package/skills/README.md +3 -2
  160. package/skills/sap-defi/SKILL.md +8 -0
  161. package/skills/sap-mcp/SKILL.md +124 -2
  162. package/skills/sap-payments-x402/SKILL.md +54 -2
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@oobe-protocol-labs/sap-mcp-server",
3
- "version": "0.2.1",
3
+ "version": "0.7.0",
4
+ "mcpName": "io.github.OOBE-PROTOCOL/sap-mcp",
4
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",
5
6
  "type": "module",
6
7
  "main": "dist/index.js",
@@ -13,7 +14,8 @@
13
14
  "sap-signing-proxy": "dist/signer/signing-proxy.js",
14
15
  "sap-mcp-remote": "dist/bin/sap-mcp-remote.js",
15
16
  "sap-mcp-facilitator": "dist/payments/oobe-facilitator-server.js",
16
- "sap-mcp-pay-sh-spec": "dist/payments/pay-sh-spec.js"
17
+ "sap-mcp-pay-sh-spec": "dist/payments/pay-sh-spec.js",
18
+ "sap-mcp-x402-paid-call": "dist/payments/x402-paid-call.js"
17
19
  },
18
20
  "files": [
19
21
  "dist",
@@ -24,6 +26,7 @@
24
26
  "README.md",
25
27
  "CHANGELOG.md",
26
28
  "LICENSE",
29
+ "server.json",
27
30
  ".env.example",
28
31
  "config.example.json",
29
32
  "config.secure-example.json",
@@ -43,6 +46,10 @@
43
46
  "build": "pnpm run clean && tsc && tsc -p tsconfig.tui.json",
44
47
  "build:core": "tsc",
45
48
  "build:tui": "tsc -p tsconfig.tui.json",
49
+ "desktop:renderer": "vite --config apps/desktop/vite.config.ts",
50
+ "desktop:renderer:build": "vite build --config apps/desktop/vite.config.ts",
51
+ "desktop:build": "pnpm run build && pnpm run desktop:renderer:build && electron-builder --config apps/desktop/electron-builder.cjs --publish never",
52
+ "desktop:verify-artifact": "node scripts/verify-desktop-artifact.mjs",
46
53
  "dev": "tsx src/cli.ts",
47
54
  "start": "node dist/cli.js",
48
55
  "config": "tsx src/config-cli.ts",
@@ -67,6 +74,14 @@
67
74
  ],
68
75
  "author": "OOBE Protocol Labs",
69
76
  "license": "MIT",
77
+ "homepage": "https://mcp.sap.oobeprotocol.ai/",
78
+ "repository": {
79
+ "type": "git",
80
+ "url": "git+https://github.com/OOBE-PROTOCOL/sap-mcp.git"
81
+ },
82
+ "bugs": {
83
+ "url": "https://github.com/OOBE-PROTOCOL/sap-mcp/issues"
84
+ },
70
85
  "dependencies": {
71
86
  "@bonfida/spl-name-service": "3.0.9",
72
87
  "@coral-xyz/anchor": "^0.30.1",
@@ -94,17 +109,23 @@
94
109
  "js-sha256": "^0.11.0",
95
110
  "jsonwebtoken": "^9.0.0",
96
111
  "react": "^19.2.7",
112
+ "react-dom": "^19.2.7",
97
113
  "tweetnacl": "^1.0.3",
98
114
  "ws": "^8.21.0",
99
115
  "zod": "^3.23.0"
100
116
  },
101
117
  "devDependencies": {
118
+ "@electron/notarize": "2.5.0",
102
119
  "@eslint/js": "^9.39.4",
103
120
  "@types/bn.js": "^5.2.0",
104
121
  "@types/cors": "^2.8.0",
105
122
  "@types/express": "^4.17.0",
106
123
  "@types/node": "^22.0.0",
107
124
  "@types/react": "^19.2.17",
125
+ "@types/react-dom": "^19.2.3",
126
+ "@vitejs/plugin-react": "^5.1.0",
127
+ "electron": "^39.2.7",
128
+ "electron-builder": "^26.0.12",
108
129
  "eslint": "^9.0.0",
109
130
  "tsx": "^4.19.0",
110
131
  "typescript": "^5.7.0",
package/server.json ADDED
@@ -0,0 +1,71 @@
1
+ {
2
+ "$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
3
+ "name": "io.github.OOBE-PROTOCOL/sap-mcp",
4
+ "title": "SAP MCP Server",
5
+ "description": "Solana-native MCP gateway for SAP, DeFi tools, SNS identity, and x402 payments.",
6
+ "version": "0.7.0",
7
+ "websiteUrl": "https://mcp.sap.oobeprotocol.ai/",
8
+ "repository": {
9
+ "url": "https://github.com/OOBE-PROTOCOL/sap-mcp",
10
+ "source": "github",
11
+ "id": "1283972695"
12
+ },
13
+ "icons": [
14
+ {
15
+ "src": "https://mcp.sap.oobeprotocol.ai/favicon.png",
16
+ "mimeType": "image/png",
17
+ "sizes": [
18
+ "512x512"
19
+ ]
20
+ }
21
+ ],
22
+ "remotes": [
23
+ {
24
+ "type": "streamable-http",
25
+ "url": "https://mcp.sap.oobeprotocol.ai/mcp"
26
+ }
27
+ ],
28
+ "packages": [
29
+ {
30
+ "registryType": "npm",
31
+ "identifier": "@oobe-protocol-labs/sap-mcp-server",
32
+ "version": "0.7.0",
33
+ "transport": {
34
+ "type": "stdio"
35
+ },
36
+ "runtimeHint": "npx",
37
+ "runtimeArguments": [
38
+ {
39
+ "type": "positional",
40
+ "value": "--yes"
41
+ },
42
+ {
43
+ "type": "positional",
44
+ "value": "--package"
45
+ },
46
+ {
47
+ "type": "positional",
48
+ "value": "@oobe-protocol-labs/sap-mcp-server@0.7.0"
49
+ },
50
+ {
51
+ "type": "positional",
52
+ "value": "sap-mcp-server"
53
+ }
54
+ ],
55
+ "environmentVariables": [
56
+ {
57
+ "name": "SAP_MCP_ALLOW_ENV_CONFIG_OVERRIDE",
58
+ "description": "Keep SAP MCP pointed at the active profile manager instead of stale client env overrides.",
59
+ "format": "boolean",
60
+ "value": "false"
61
+ },
62
+ {
63
+ "name": "SAP_LOG_LEVEL",
64
+ "description": "Runtime log level for local SAP MCP stdio sessions.",
65
+ "format": "string",
66
+ "default": "info"
67
+ }
68
+ ]
69
+ }
70
+ ]
71
+ }
package/skills/README.md CHANGED
@@ -59,8 +59,9 @@ or wants to compare this bundled MCP skill pack with the source SDK skills:
59
59
  - Use `sap_discover_agents` only for protocol/capability-filtered discovery.
60
60
  - Treat `mcp_sap_<tool>` as a client display prefix; the callable MCP tool name
61
61
  inside this server is the suffix, for example `jupiter_getQuote`.
62
- - Use `docs/SAP_SDK_SKILLS.md` as the complete routing map when deciding which
63
- SAP MCP tool or skill domain applies to a user request.
62
+ - Use `skills/sap-mcp/TOOL_REFERENCE.md` and `USER_DOCS/05_SKILLS_AND_TOOLS.md`
63
+ as the bundled routing maps when deciding which SAP MCP tool or skill domain
64
+ applies to a user request.
64
65
 
65
66
  ## Install With MCP
66
67
 
@@ -44,8 +44,16 @@ staking protocols.
44
44
  `jupiter_swapInstructions`.
45
45
  3. Explain slippage, route, token mints, amount units, and expected output.
46
46
  4. Preview and policy-check before signing.
47
+ 5. For any unsigned or partially signed transaction returned by Jupiter, use
48
+ `sap_preview_transaction`, `sap_sign_transaction`, and
49
+ `sap_submit_signed_transaction`. Do not write ad-hoc signing scripts.
47
50
 
48
51
  ## Safety
49
52
 
50
53
  DeFi execution can lose funds through slippage, MEV, wrong decimals, or bad
51
54
  mints. Do not proceed from ticker symbols alone when mint addresses are needed.
55
+ Never read, print, export, or pass keypair bytes through shell commands,
56
+ environment variables, temporary scripts, screenshots, prompts, or MCP client
57
+ config. If a transaction cannot be decoded by SAP MCP transaction tools, stop
58
+ and report the unsupported transaction format instead of manually signing raw
59
+ message bytes.
@@ -51,7 +51,89 @@ source skill taxonomy:
51
51
 
52
52
  Use the bundled routing map for local MCP tool selection:
53
53
 
54
- - `docs/SAP_SDK_SKILLS.md`
54
+ - `skills/sap-mcp/TOOL_REFERENCE.md`
55
+ - `USER_DOCS/05_SKILLS_AND_TOOLS.md`
56
+
57
+ SAP MCP skill bootstrap tools are free context/setup tools. Call
58
+ `sap_skills_list`, `sap_skills_bundle`, and local `sap_skills_install`
59
+ directly. Do not route skill listing, bundling, or installation through
60
+ `sap_x402_paid_call`. On hosted remote MCP, use `sap_skills_bundle` to download
61
+ skill contents; the hosted server cannot install files onto the caller's local
62
+ machine. Local installation belongs to the wizard, desktop app, addon installer,
63
+ or a local stdio SAP MCP process.
64
+
65
+ ## Hosted Remote MCP
66
+
67
+ Canonical hosted endpoint:
68
+
69
+ ```text
70
+ https://mcp.sap.oobeprotocol.ai/mcp
71
+ ```
72
+
73
+ Public server metadata:
74
+
75
+ ```json
76
+ {
77
+ "name": "sap-mcp-server",
78
+ "title": "SAP MCP Server | OOBE Protocol",
79
+ "status": "online",
80
+ "protocol": {
81
+ "primary": "mcp",
82
+ "transport": "streamable-http",
83
+ "protocolVersion": "2025-06-18"
84
+ },
85
+ "endpoints": {
86
+ "landing": "https://mcp.sap.oobeprotocol.ai/",
87
+ "mcp": "https://mcp.sap.oobeprotocol.ai/mcp",
88
+ "serverInfo": "https://mcp.sap.oobeprotocol.ai/server.json",
89
+ "wizardDescriptor": "https://mcp.sap.oobeprotocol.ai/.well-known/sap-mcp-wizard.json",
90
+ "wizardInstallScript": "https://mcp.sap.oobeprotocol.ai/wizard/install.sh"
91
+ },
92
+ "authentication": {
93
+ "schemes": ["none", "x402"],
94
+ "bearerRequired": false
95
+ },
96
+ "security": {
97
+ "keypairBytesExposed": false,
98
+ "storesUserKeypairs": false,
99
+ "rpcSecretsExposed": false,
100
+ "wizardConfigDirectory": "~/.config/mcp-sap"
101
+ }
102
+ }
103
+ ```
104
+
105
+ Hosted users still need a local SAP MCP profile when they sign x402/pay.sh
106
+ payments, SAP transactions, Solana transactions, SNS operations, or settlement
107
+ actions. The hosted MCP server is not a wallet custodian.
108
+
109
+ For hosted paid tools, use the native x402 flow. If the client runtime cannot
110
+ attach `PAYMENT-SIGNATURE` itself, use the local `x402_paid_call` addon installed
111
+ by the wizard or the local MCP helper `sap_x402_paid_call`. That helper signs
112
+ payment payloads with the user's local SAP MCP profile and retries the hosted
113
+ tool call. It must not be treated as a remote hosted signing service.
114
+
115
+ When connected to hosted SAP MCP, `signerConfigured: false` on the remote
116
+ server means the hosted server is non-custodial. It does not mean the remote
117
+ tool surface is unavailable. Do not silently switch to local stdio just because
118
+ a hosted call requires x402 payment or because the hosted server does not hold
119
+ the user's signer. Use the hosted x402 flow first; ask the user before using a
120
+ local stdio fallback.
121
+
122
+ If a hosted paid tool returns `BlockhashNotFound`,
123
+ `transaction_simulation_failed`, `smart_wallet_simulation_failed`, `node is
124
+ behind`, `minimum context slot`, `fetch failed`, `gateway timeout`, or a
125
+ response marked `retryable: true`, treat it as a transient x402/Solana RPC
126
+ settlement error. Do not claim that SAP MCP is down unless `/health` also
127
+ fails. Do not bypass the paid hosted path with terminal/direct RPC. Retry
128
+ through the local `sap_x402_paid_call` bridge with the same tool name and
129
+ arguments, `confirm: true`, and `maxAttempts: 5` so a fresh payment payload is
130
+ created.
131
+
132
+ When summarizing a hosted connection, use language like:
133
+ "server is non-custodial; user signatures come from the local SAP profile or
134
+ external signer." Avoid saying "signer not configured", "read-only only",
135
+ "writes unavailable", or "remote MCP broken" unless a specific tool returns
136
+ that exact operational error.
55
137
 
56
138
  ## Profile Tools
57
139
 
@@ -156,6 +238,39 @@ Avoid passing `SAP_WALLET_PATH` or `SAP_MCP_RPC_URL` from the MCP client unless
156
238
  the user intentionally wants env overrides and has set
157
239
  `SAP_MCP_ALLOW_ENV_CONFIG_OVERRIDE=true`.
158
240
 
241
+ Hosted Claude/Codex/OpenClaw-style JSON:
242
+
243
+ ```json
244
+ {
245
+ "mcpServers": {
246
+ "sap": {
247
+ "url": "https://mcp.sap.oobeprotocol.ai/mcp",
248
+ "transport": "streamable-http"
249
+ }
250
+ }
251
+ }
252
+ ```
253
+
254
+ Hosted Hermes global `~/.hermes/mcp.json` JSON:
255
+
256
+ ```json
257
+ {
258
+ "sap": {
259
+ "url": "https://mcp.sap.oobeprotocol.ai/mcp",
260
+ "transport": "streamable-http"
261
+ }
262
+ }
263
+ ```
264
+
265
+ Hosted Hermes profile YAML:
266
+
267
+ ```yaml
268
+ mcp_servers:
269
+ sap:
270
+ url: https://mcp.sap.oobeprotocol.ai/mcp
271
+ transport: streamable-http
272
+ ```
273
+
159
274
  Show active profile:
160
275
 
161
276
  ```bash
@@ -177,7 +292,7 @@ Start local MCP over stdio:
177
292
  npx sap-mcp-server start
178
293
  ```
179
294
 
180
- Start remote MCP over Streamable HTTP:
295
+ Operator-only: start your own remote MCP over Streamable HTTP:
181
296
 
182
297
  ```bash
183
298
  SAP_MCP_AUTH_TYPE=api_key \
@@ -185,6 +300,13 @@ SAP_MCP_API_KEYS=<api-key>=<operator-id> \
185
300
  npx sap-mcp-remote
186
301
  ```
187
302
 
303
+ Do not ask hosted users to run their own HTTP server unless they are deploying
304
+ their own VPS/operator instance.
305
+
306
+ Do not call a local free `stdio` SAP MCP server as an implicit substitute for
307
+ hosted paid tools. Local stdio is a developer fallback only when the user asks
308
+ for local execution or the client cannot perform remote Streamable HTTP/x402.
309
+
188
310
  ## Signing Rules
189
311
 
190
312
  - Do not read wallet/keypair files.
@@ -7,6 +7,7 @@ workflows, and hosted SAP MCP x402/pay.sh monetization.
7
7
 
8
8
  - `sap_x402_prepare_payment`
9
9
  - `sap_x402_get_balance`
10
+ - `sap_x402_paid_call`
10
11
  - `sap_create_subscription`
11
12
  - `sap_fund_subscription`
12
13
  - `sap_cancel_subscription`
@@ -22,8 +23,17 @@ workflows, and hosted SAP MCP x402/pay.sh monetization.
22
23
 
23
24
  ## Hosted MCP Monetization
24
25
 
26
+ Canonical hosted endpoint: `https://mcp.sap.oobeprotocol.ai/mcp`.
27
+
25
28
  Remote `/mcp` deployments can require x402 v2 payment for paid `tools/call`
26
- requests. Local `stdio` usage remains free.
29
+ requests. Local `stdio` usage remains free and should not attempt x402 payment.
30
+ Do not treat hosted `402 Payment Required` as a failure; it is the expected
31
+ payment handshake. Do not silently bypass hosted paid tools by switching to a
32
+ local free stdio MCP server unless the user explicitly asks for local execution.
33
+ If `sap_profile_current` says the hosted server has no signer, treat that as
34
+ the non-custodial model: OOBE does not hold user keys. Paid and value-moving
35
+ hosted calls still proceed through x402/pay.sh plus the user's local SAP profile
36
+ or external signer.
27
37
 
28
38
  - Free: `tools/list`, `prompts/list`, `resources/list`, `sap_profile_current`,
29
39
  `sap_get_network_overview`.
@@ -38,7 +48,49 @@ instructions, create a payment, retry with `PAYMENT-SIGNATURE`, and capture
38
48
  `PAYMENT-RESPONSE` after settlement. If a `payShCheckoutUrl` is present, surface
39
49
  it for browser/manual checkout flows.
40
50
 
41
- Reference: `docs/MONETIZATION.md`.
51
+ For fast x402 execution:
52
+
53
+ 1. Reuse the MCP session returned by `initialize`.
54
+ 2. Retry the same MCP method and params after payment. The JSON-RPC `id` may
55
+ change, but the tool name and arguments must match the challenge.
56
+ 3. Use `PAYMENT-SIGNATURE` first; use `X-PAYMENT` only for clients that require
57
+ the alternate header.
58
+ 4. Cache free `tools/list`, `prompts/list`, and `resources/list` locally rather
59
+ than paying or re-fetching repeatedly.
60
+ 5. Treat `PAYMENT-RESPONSE` as the receipt bound to the tool output.
61
+ 6. If the client runtime cannot sign or attach x402 payment headers, ask the
62
+ user to run the SAP MCP wizard and install the local `x402_paid_call` addon
63
+ instead of falling back to local stdio automatically.
64
+
65
+ When available locally, call `sap_x402_paid_call` with `toolName`, `arguments`,
66
+ `maxPriceUsd`, and `confirm: true`. It initializes the hosted MCP session,
67
+ signs the x402 payment with the user SAP MCP profile wallet, retries the hosted
68
+ tool call, and returns the settlement receipt. The OOBE hosted server should
69
+ not expose this helper when it has no local user wallet because payment signing
70
+ belongs on the user's machine.
71
+
72
+ ## Transient Settlement Errors
73
+
74
+ If a hosted paid call fails with `BlockhashNotFound`,
75
+ `transaction_simulation_failed`, `smart_wallet_simulation_failed`, `node is
76
+ behind`, `minimum context slot`, `fetch failed`, `gateway timeout`, or a
77
+ response marked `retryable: true`, treat it as a transient x402/Solana RPC
78
+ settlement failure. Do not say the SAP MCP server is down unless `/health`
79
+ also fails. Do not switch to terminal/direct RPC to bypass payment, and do not
80
+ reuse the old signed payment payload.
81
+
82
+ Correct recovery:
83
+
84
+ 1. Call the local `sap_x402_paid_call` bridge again with the same `toolName`
85
+ and `arguments`.
86
+ 2. Set `maxAttempts: 5` when the runtime supports it.
87
+ 3. Let the helper create a fresh x402 challenge and payment payload for each
88
+ attempt.
89
+ 4. If all attempts fail, report that x402 settlement is temporarily unavailable
90
+ and ask the user to retry or repair the facilitator/RPC deployment.
91
+
92
+ References: `USER_DOCS/03_PAYMENTS_X402_PAYSH.md` and
93
+ `docs/06_PAYMENTS_X402_AND_PAYSH.md`.
42
94
 
43
95
  ## Safety
44
96