@oobe-protocol-labs/sap-mcp-server 0.1.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 (593) hide show
  1. package/.env.example +159 -0
  2. package/CHANGELOG.md +55 -0
  3. package/LICENSE +21 -0
  4. package/README.md +223 -0
  5. package/config.example.json +64 -0
  6. package/config.schema.json +370 -0
  7. package/config.secure-example.json +100 -0
  8. package/dist/adapters/index.d.ts +6 -0
  9. package/dist/adapters/index.d.ts.map +1 -0
  10. package/dist/adapters/index.js +6 -0
  11. package/dist/adapters/index.js.map +1 -0
  12. package/dist/adapters/mcp/errors.d.ts +7 -0
  13. package/dist/adapters/mcp/errors.d.ts.map +1 -0
  14. package/dist/adapters/mcp/errors.js +10 -0
  15. package/dist/adapters/mcp/errors.js.map +1 -0
  16. package/dist/adapters/mcp/index.d.ts +8 -0
  17. package/dist/adapters/mcp/index.d.ts.map +1 -0
  18. package/dist/adapters/mcp/index.js +8 -0
  19. package/dist/adapters/mcp/index.js.map +1 -0
  20. package/dist/adapters/mcp/prompt-response.d.ts +13 -0
  21. package/dist/adapters/mcp/prompt-response.d.ts.map +1 -0
  22. package/dist/adapters/mcp/prompt-response.js +7 -0
  23. package/dist/adapters/mcp/prompt-response.js.map +1 -0
  24. package/dist/adapters/mcp/resource-response.d.ts +8 -0
  25. package/dist/adapters/mcp/resource-response.d.ts.map +1 -0
  26. package/dist/adapters/mcp/resource-response.js +7 -0
  27. package/dist/adapters/mcp/resource-response.js.map +1 -0
  28. package/dist/adapters/mcp/sdk-compat.d.ts +191 -0
  29. package/dist/adapters/mcp/sdk-compat.d.ts.map +1 -0
  30. package/dist/adapters/mcp/sdk-compat.js +606 -0
  31. package/dist/adapters/mcp/sdk-compat.js.map +1 -0
  32. package/dist/adapters/mcp/tool-response.d.ts +32 -0
  33. package/dist/adapters/mcp/tool-response.d.ts.map +1 -0
  34. package/dist/adapters/mcp/tool-response.js +27 -0
  35. package/dist/adapters/mcp/tool-response.js.map +1 -0
  36. package/dist/adapters/solana/commitment.d.ts +9 -0
  37. package/dist/adapters/solana/commitment.d.ts.map +1 -0
  38. package/dist/adapters/solana/commitment.js +14 -0
  39. package/dist/adapters/solana/commitment.js.map +1 -0
  40. package/dist/adapters/solana/connection.d.ts +10 -0
  41. package/dist/adapters/solana/connection.d.ts.map +1 -0
  42. package/dist/adapters/solana/connection.js +13 -0
  43. package/dist/adapters/solana/connection.js.map +1 -0
  44. package/dist/adapters/solana/index.d.ts +7 -0
  45. package/dist/adapters/solana/index.d.ts.map +1 -0
  46. package/dist/adapters/solana/index.js +7 -0
  47. package/dist/adapters/solana/index.js.map +1 -0
  48. package/dist/adapters/solana/public-key.d.ts +9 -0
  49. package/dist/adapters/solana/public-key.d.ts.map +1 -0
  50. package/dist/adapters/solana/public-key.js +11 -0
  51. package/dist/adapters/solana/public-key.js.map +1 -0
  52. package/dist/cli.d.ts +29 -0
  53. package/dist/cli.d.ts.map +1 -0
  54. package/dist/cli.js +269 -0
  55. package/dist/cli.js.map +1 -0
  56. package/dist/config/defaults.d.ts +28 -0
  57. package/dist/config/defaults.d.ts.map +1 -0
  58. package/dist/config/defaults.js +28 -0
  59. package/dist/config/defaults.js.map +1 -0
  60. package/dist/config/env.d.ts +297 -0
  61. package/dist/config/env.d.ts.map +1 -0
  62. package/dist/config/env.js +563 -0
  63. package/dist/config/env.js.map +1 -0
  64. package/dist/config/index.d.ts +7 -0
  65. package/dist/config/index.d.ts.map +1 -0
  66. package/dist/config/index.js +7 -0
  67. package/dist/config/index.js.map +1 -0
  68. package/dist/config/mcp-client-injection.d.ts +113 -0
  69. package/dist/config/mcp-client-injection.d.ts.map +1 -0
  70. package/dist/config/mcp-client-injection.js +453 -0
  71. package/dist/config/mcp-client-injection.js.map +1 -0
  72. package/dist/config/paths.d.ts +37 -0
  73. package/dist/config/paths.d.ts.map +1 -0
  74. package/dist/config/paths.js +93 -0
  75. package/dist/config/paths.js.map +1 -0
  76. package/dist/config/profiles.d.ts +85 -0
  77. package/dist/config/profiles.d.ts.map +1 -0
  78. package/dist/config/profiles.js +346 -0
  79. package/dist/config/profiles.js.map +1 -0
  80. package/dist/config/schema.d.ts +9 -0
  81. package/dist/config/schema.d.ts.map +1 -0
  82. package/dist/config/schema.js +8 -0
  83. package/dist/config/schema.js.map +1 -0
  84. package/dist/config/secure-config.d.ts +607 -0
  85. package/dist/config/secure-config.d.ts.map +1 -0
  86. package/dist/config/secure-config.js +526 -0
  87. package/dist/config/secure-config.js.map +1 -0
  88. package/dist/config/setup.d.ts +42 -0
  89. package/dist/config/setup.d.ts.map +1 -0
  90. package/dist/config/setup.js +173 -0
  91. package/dist/config/setup.js.map +1 -0
  92. package/dist/config/wizard.d.ts +15 -0
  93. package/dist/config/wizard.d.ts.map +1 -0
  94. package/dist/config/wizard.js +1176 -0
  95. package/dist/config/wizard.js.map +1 -0
  96. package/dist/config-cli.d.ts +21 -0
  97. package/dist/config-cli.d.ts.map +1 -0
  98. package/dist/config-cli.js +679 -0
  99. package/dist/config-cli.js.map +1 -0
  100. package/dist/core/constants.d.ts +78 -0
  101. package/dist/core/constants.d.ts.map +1 -0
  102. package/dist/core/constants.js +78 -0
  103. package/dist/core/constants.js.map +1 -0
  104. package/dist/core/errors.d.ts +188 -0
  105. package/dist/core/errors.d.ts.map +1 -0
  106. package/dist/core/errors.js +337 -0
  107. package/dist/core/errors.js.map +1 -0
  108. package/dist/core/guards.d.ts +41 -0
  109. package/dist/core/guards.d.ts.map +1 -0
  110. package/dist/core/guards.js +93 -0
  111. package/dist/core/guards.js.map +1 -0
  112. package/dist/core/index.d.ts +11 -0
  113. package/dist/core/index.d.ts.map +1 -0
  114. package/dist/core/index.js +10 -0
  115. package/dist/core/index.js.map +1 -0
  116. package/dist/core/logger.d.ts +64 -0
  117. package/dist/core/logger.d.ts.map +1 -0
  118. package/dist/core/logger.js +159 -0
  119. package/dist/core/logger.js.map +1 -0
  120. package/dist/core/result.d.ts +49 -0
  121. package/dist/core/result.d.ts.map +1 -0
  122. package/dist/core/result.js +61 -0
  123. package/dist/core/result.js.map +1 -0
  124. package/dist/core/types.d.ts +147 -0
  125. package/dist/core/types.d.ts.map +1 -0
  126. package/dist/core/types.js +8 -0
  127. package/dist/core/types.js.map +1 -0
  128. package/dist/index.d.ts +18 -0
  129. package/dist/index.d.ts.map +1 -0
  130. package/dist/index.js +15 -0
  131. package/dist/index.js.map +1 -0
  132. package/dist/payments/http-adapter.d.ts +76 -0
  133. package/dist/payments/http-adapter.d.ts.map +1 -0
  134. package/dist/payments/http-adapter.js +126 -0
  135. package/dist/payments/http-adapter.js.map +1 -0
  136. package/dist/payments/index.d.ts +12 -0
  137. package/dist/payments/index.d.ts.map +1 -0
  138. package/dist/payments/index.js +9 -0
  139. package/dist/payments/index.js.map +1 -0
  140. package/dist/payments/json-rpc.d.ts +49 -0
  141. package/dist/payments/json-rpc.d.ts.map +1 -0
  142. package/dist/payments/json-rpc.js +53 -0
  143. package/dist/payments/json-rpc.js.map +1 -0
  144. package/dist/payments/monetization-gate.d.ts +49 -0
  145. package/dist/payments/monetization-gate.d.ts.map +1 -0
  146. package/dist/payments/monetization-gate.js +398 -0
  147. package/dist/payments/monetization-gate.js.map +1 -0
  148. package/dist/payments/oobe-facilitator-server.d.ts +71 -0
  149. package/dist/payments/oobe-facilitator-server.d.ts.map +1 -0
  150. package/dist/payments/oobe-facilitator-server.js +409 -0
  151. package/dist/payments/oobe-facilitator-server.js.map +1 -0
  152. package/dist/payments/pay-sh-spec.d.ts +44 -0
  153. package/dist/payments/pay-sh-spec.d.ts.map +1 -0
  154. package/dist/payments/pay-sh-spec.js +218 -0
  155. package/dist/payments/pay-sh-spec.js.map +1 -0
  156. package/dist/payments/pricing.d.ts +60 -0
  157. package/dist/payments/pricing.d.ts.map +1 -0
  158. package/dist/payments/pricing.js +272 -0
  159. package/dist/payments/pricing.js.map +1 -0
  160. package/dist/payments/usage-ledger.d.ts +84 -0
  161. package/dist/payments/usage-ledger.d.ts.map +1 -0
  162. package/dist/payments/usage-ledger.js +126 -0
  163. package/dist/payments/usage-ledger.js.map +1 -0
  164. package/dist/policy/bento-policy-engine.d.ts +71 -0
  165. package/dist/policy/bento-policy-engine.d.ts.map +1 -0
  166. package/dist/policy/bento-policy-engine.js +218 -0
  167. package/dist/policy/bento-policy-engine.js.map +1 -0
  168. package/dist/policy/default-policies.d.ts +9 -0
  169. package/dist/policy/default-policies.d.ts.map +1 -0
  170. package/dist/policy/default-policies.js +69 -0
  171. package/dist/policy/default-policies.js.map +1 -0
  172. package/dist/policy/hybrid-policy-engine.d.ts +95 -0
  173. package/dist/policy/hybrid-policy-engine.d.ts.map +1 -0
  174. package/dist/policy/hybrid-policy-engine.js +297 -0
  175. package/dist/policy/hybrid-policy-engine.js.map +1 -0
  176. package/dist/policy/index.d.ts +10 -0
  177. package/dist/policy/index.d.ts.map +1 -0
  178. package/dist/policy/index.js +10 -0
  179. package/dist/policy/index.js.map +1 -0
  180. package/dist/policy/local-policy-engine.d.ts +119 -0
  181. package/dist/policy/local-policy-engine.d.ts.map +1 -0
  182. package/dist/policy/local-policy-engine.js +318 -0
  183. package/dist/policy/local-policy-engine.js.map +1 -0
  184. package/dist/policy/permission-checks.d.ts +19 -0
  185. package/dist/policy/permission-checks.d.ts.map +1 -0
  186. package/dist/policy/permission-checks.js +60 -0
  187. package/dist/policy/permission-checks.js.map +1 -0
  188. package/dist/policy/policy-engine.d.ts +57 -0
  189. package/dist/policy/policy-engine.d.ts.map +1 -0
  190. package/dist/policy/policy-engine.js +162 -0
  191. package/dist/policy/policy-engine.js.map +1 -0
  192. package/dist/policy/policy-types.d.ts +46 -0
  193. package/dist/policy/policy-types.d.ts.map +1 -0
  194. package/dist/policy/policy-types.js +5 -0
  195. package/dist/policy/policy-types.js.map +1 -0
  196. package/dist/policy/risk-level.d.ts +18 -0
  197. package/dist/policy/risk-level.d.ts.map +1 -0
  198. package/dist/policy/risk-level.js +46 -0
  199. package/dist/policy/risk-level.js.map +1 -0
  200. package/dist/policy/spending-limits.d.ts +17 -0
  201. package/dist/policy/spending-limits.d.ts.map +1 -0
  202. package/dist/policy/spending-limits.js +40 -0
  203. package/dist/policy/spending-limits.js.map +1 -0
  204. package/dist/prompts/context/sap-agent-context.prompt.d.ts +64 -0
  205. package/dist/prompts/context/sap-agent-context.prompt.d.ts.map +1 -0
  206. package/dist/prompts/context/sap-agent-context.prompt.js +336 -0
  207. package/dist/prompts/context/sap-agent-context.prompt.js.map +1 -0
  208. package/dist/prompts/developer/debug-sap-error.prompt.d.ts +13 -0
  209. package/dist/prompts/developer/debug-sap-error.prompt.d.ts.map +1 -0
  210. package/dist/prompts/developer/debug-sap-error.prompt.js +78 -0
  211. package/dist/prompts/developer/debug-sap-error.prompt.js.map +1 -0
  212. package/dist/prompts/developer/generate-sap-integration.prompt.d.ts +13 -0
  213. package/dist/prompts/developer/generate-sap-integration.prompt.d.ts.map +1 -0
  214. package/dist/prompts/developer/generate-sap-integration.prompt.js +132 -0
  215. package/dist/prompts/developer/generate-sap-integration.prompt.js.map +1 -0
  216. package/dist/prompts/developer/index.d.ts +6 -0
  217. package/dist/prompts/developer/index.d.ts.map +1 -0
  218. package/dist/prompts/developer/index.js +6 -0
  219. package/dist/prompts/developer/index.js.map +1 -0
  220. package/dist/prompts/execution-proof/explain-proof-of-execution.prompt.d.ts +13 -0
  221. package/dist/prompts/execution-proof/explain-proof-of-execution.prompt.d.ts.map +1 -0
  222. package/dist/prompts/execution-proof/explain-proof-of-execution.prompt.js +97 -0
  223. package/dist/prompts/execution-proof/explain-proof-of-execution.prompt.js.map +1 -0
  224. package/dist/prompts/execution-proof/index.d.ts +6 -0
  225. package/dist/prompts/execution-proof/index.d.ts.map +1 -0
  226. package/dist/prompts/execution-proof/index.js +6 -0
  227. package/dist/prompts/execution-proof/index.js.map +1 -0
  228. package/dist/prompts/execution-proof/verify-execution-proof.prompt.d.ts +13 -0
  229. package/dist/prompts/execution-proof/verify-execution-proof.prompt.d.ts.map +1 -0
  230. package/dist/prompts/execution-proof/verify-execution-proof.prompt.js +95 -0
  231. package/dist/prompts/execution-proof/verify-execution-proof.prompt.js.map +1 -0
  232. package/dist/prompts/index.d.ts +5 -0
  233. package/dist/prompts/index.d.ts.map +1 -0
  234. package/dist/prompts/index.js +5 -0
  235. package/dist/prompts/index.js.map +1 -0
  236. package/dist/prompts/payments/create-paid-api.prompt.d.ts +13 -0
  237. package/dist/prompts/payments/create-paid-api.prompt.d.ts.map +1 -0
  238. package/dist/prompts/payments/create-paid-api.prompt.js +142 -0
  239. package/dist/prompts/payments/create-paid-api.prompt.js.map +1 -0
  240. package/dist/prompts/payments/explain-x402-settlement.prompt.d.ts +13 -0
  241. package/dist/prompts/payments/explain-x402-settlement.prompt.d.ts.map +1 -0
  242. package/dist/prompts/payments/explain-x402-settlement.prompt.js +83 -0
  243. package/dist/prompts/payments/explain-x402-settlement.prompt.js.map +1 -0
  244. package/dist/prompts/payments/index.d.ts +6 -0
  245. package/dist/prompts/payments/index.d.ts.map +1 -0
  246. package/dist/prompts/payments/index.js +6 -0
  247. package/dist/prompts/payments/index.js.map +1 -0
  248. package/dist/prompts/register-prompts.d.ts +10 -0
  249. package/dist/prompts/register-prompts.d.ts.map +1 -0
  250. package/dist/prompts/register-prompts.js +40 -0
  251. package/dist/prompts/register-prompts.js.map +1 -0
  252. package/dist/prompts/registry/analyze-sap-agent.prompt.d.ts +13 -0
  253. package/dist/prompts/registry/analyze-sap-agent.prompt.d.ts.map +1 -0
  254. package/dist/prompts/registry/analyze-sap-agent.prompt.js +85 -0
  255. package/dist/prompts/registry/analyze-sap-agent.prompt.js.map +1 -0
  256. package/dist/prompts/registry/index.d.ts +6 -0
  257. package/dist/prompts/registry/index.d.ts.map +1 -0
  258. package/dist/prompts/registry/index.js +6 -0
  259. package/dist/prompts/registry/index.js.map +1 -0
  260. package/dist/prompts/registry/register-sap-agent.prompt.d.ts +13 -0
  261. package/dist/prompts/registry/register-sap-agent.prompt.d.ts.map +1 -0
  262. package/dist/prompts/registry/register-sap-agent.prompt.js +152 -0
  263. package/dist/prompts/registry/register-sap-agent.prompt.js.map +1 -0
  264. package/dist/remote/auth/index.d.ts +86 -0
  265. package/dist/remote/auth/index.d.ts.map +1 -0
  266. package/dist/remote/auth/index.js +152 -0
  267. package/dist/remote/auth/index.js.map +1 -0
  268. package/dist/remote/server.d.ts +140 -0
  269. package/dist/remote/server.d.ts.map +1 -0
  270. package/dist/remote/server.js +412 -0
  271. package/dist/remote/server.js.map +1 -0
  272. package/dist/resources/current/sap-current-config.resource.d.ts +30 -0
  273. package/dist/resources/current/sap-current-config.resource.d.ts.map +1 -0
  274. package/dist/resources/current/sap-current-config.resource.js +142 -0
  275. package/dist/resources/current/sap-current-config.resource.js.map +1 -0
  276. package/dist/resources/execution-proof/index.d.ts +5 -0
  277. package/dist/resources/execution-proof/index.d.ts.map +1 -0
  278. package/dist/resources/execution-proof/index.js +5 -0
  279. package/dist/resources/execution-proof/index.js.map +1 -0
  280. package/dist/resources/execution-proof/sap-execution-record.resource.d.ts +13 -0
  281. package/dist/resources/execution-proof/sap-execution-record.resource.d.ts.map +1 -0
  282. package/dist/resources/execution-proof/sap-execution-record.resource.js +75 -0
  283. package/dist/resources/execution-proof/sap-execution-record.resource.js.map +1 -0
  284. package/dist/resources/index.d.ts +5 -0
  285. package/dist/resources/index.d.ts.map +1 -0
  286. package/dist/resources/index.js +5 -0
  287. package/dist/resources/index.js.map +1 -0
  288. package/dist/resources/memory/index.d.ts +5 -0
  289. package/dist/resources/memory/index.d.ts.map +1 -0
  290. package/dist/resources/memory/index.js +5 -0
  291. package/dist/resources/memory/index.js.map +1 -0
  292. package/dist/resources/memory/sap-memory.resource.d.ts +13 -0
  293. package/dist/resources/memory/sap-memory.resource.d.ts.map +1 -0
  294. package/dist/resources/memory/sap-memory.resource.js +77 -0
  295. package/dist/resources/memory/sap-memory.resource.js.map +1 -0
  296. package/dist/resources/profile/sap-active-profile.resource.d.ts +51 -0
  297. package/dist/resources/profile/sap-active-profile.resource.d.ts.map +1 -0
  298. package/dist/resources/profile/sap-active-profile.resource.js +119 -0
  299. package/dist/resources/profile/sap-active-profile.resource.js.map +1 -0
  300. package/dist/resources/register-resources.d.ts +10 -0
  301. package/dist/resources/register-resources.d.ts.map +1 -0
  302. package/dist/resources/register-resources.js +33 -0
  303. package/dist/resources/register-resources.js.map +1 -0
  304. package/dist/resources/registry/index.d.ts +6 -0
  305. package/dist/resources/registry/index.d.ts.map +1 -0
  306. package/dist/resources/registry/index.js +6 -0
  307. package/dist/resources/registry/index.js.map +1 -0
  308. package/dist/resources/registry/sap-agent.resource.d.ts +13 -0
  309. package/dist/resources/registry/sap-agent.resource.d.ts.map +1 -0
  310. package/dist/resources/registry/sap-agent.resource.js +75 -0
  311. package/dist/resources/registry/sap-agent.resource.js.map +1 -0
  312. package/dist/resources/registry/sap-global-registry.resource.d.ts +13 -0
  313. package/dist/resources/registry/sap-global-registry.resource.d.ts.map +1 -0
  314. package/dist/resources/registry/sap-global-registry.resource.js +71 -0
  315. package/dist/resources/registry/sap-global-registry.resource.js.map +1 -0
  316. package/dist/resources/reputation/index.d.ts +5 -0
  317. package/dist/resources/reputation/index.d.ts.map +1 -0
  318. package/dist/resources/reputation/index.js +5 -0
  319. package/dist/resources/reputation/index.js.map +1 -0
  320. package/dist/resources/reputation/sap-reputation.resource.d.ts +13 -0
  321. package/dist/resources/reputation/sap-reputation.resource.d.ts.map +1 -0
  322. package/dist/resources/reputation/sap-reputation.resource.js +75 -0
  323. package/dist/resources/reputation/sap-reputation.resource.js.map +1 -0
  324. package/dist/resources/stats/sap-network-stats.resource.d.ts +14 -0
  325. package/dist/resources/stats/sap-network-stats.resource.d.ts.map +1 -0
  326. package/dist/resources/stats/sap-network-stats.resource.js +86 -0
  327. package/dist/resources/stats/sap-network-stats.resource.js.map +1 -0
  328. package/dist/resources/tool-schema/index.d.ts +5 -0
  329. package/dist/resources/tool-schema/index.d.ts.map +1 -0
  330. package/dist/resources/tool-schema/index.js +5 -0
  331. package/dist/resources/tool-schema/index.js.map +1 -0
  332. package/dist/resources/tool-schema/sap-tool-schema.resource.d.ts +13 -0
  333. package/dist/resources/tool-schema/sap-tool-schema.resource.d.ts.map +1 -0
  334. package/dist/resources/tool-schema/sap-tool-schema.resource.js +75 -0
  335. package/dist/resources/tool-schema/sap-tool-schema.resource.js.map +1 -0
  336. package/dist/sap/index.d.ts +7 -0
  337. package/dist/sap/index.d.ts.map +1 -0
  338. package/dist/sap/index.js +6 -0
  339. package/dist/sap/index.js.map +1 -0
  340. package/dist/sap/sap-client-manager.d.ts +54 -0
  341. package/dist/sap/sap-client-manager.d.ts.map +1 -0
  342. package/dist/sap/sap-client-manager.js +129 -0
  343. package/dist/sap/sap-client-manager.js.map +1 -0
  344. package/dist/sap/sap-errors.d.ts +13 -0
  345. package/dist/sap/sap-errors.d.ts.map +1 -0
  346. package/dist/sap/sap-errors.js +23 -0
  347. package/dist/sap/sap-errors.js.map +1 -0
  348. package/dist/sap/sap-types.d.ts +69 -0
  349. package/dist/sap/sap-types.d.ts.map +1 -0
  350. package/dist/sap/sap-types.js +5 -0
  351. package/dist/sap/sap-types.js.map +1 -0
  352. package/dist/schemas/common.schema.d.ts +42 -0
  353. package/dist/schemas/common.schema.d.ts.map +1 -0
  354. package/dist/schemas/common.schema.js +36 -0
  355. package/dist/schemas/common.schema.js.map +1 -0
  356. package/dist/schemas/developer.schema.d.ts +31 -0
  357. package/dist/schemas/developer.schema.d.ts.map +1 -0
  358. package/dist/schemas/developer.schema.js +19 -0
  359. package/dist/schemas/developer.schema.js.map +1 -0
  360. package/dist/schemas/execution-proof.schema.d.ts +44 -0
  361. package/dist/schemas/execution-proof.schema.d.ts.map +1 -0
  362. package/dist/schemas/execution-proof.schema.js +26 -0
  363. package/dist/schemas/execution-proof.schema.js.map +1 -0
  364. package/dist/schemas/identity.schema.d.ts +34 -0
  365. package/dist/schemas/identity.schema.d.ts.map +1 -0
  366. package/dist/schemas/identity.schema.js +21 -0
  367. package/dist/schemas/identity.schema.js.map +1 -0
  368. package/dist/schemas/index.d.ts +15 -0
  369. package/dist/schemas/index.d.ts.map +1 -0
  370. package/dist/schemas/index.js +15 -0
  371. package/dist/schemas/index.js.map +1 -0
  372. package/dist/schemas/memory.schema.d.ts +34 -0
  373. package/dist/schemas/memory.schema.d.ts.map +1 -0
  374. package/dist/schemas/memory.schema.js +21 -0
  375. package/dist/schemas/memory.schema.js.map +1 -0
  376. package/dist/schemas/payments.schema.d.ts +37 -0
  377. package/dist/schemas/payments.schema.d.ts.map +1 -0
  378. package/dist/schemas/payments.schema.js +22 -0
  379. package/dist/schemas/payments.schema.js.map +1 -0
  380. package/dist/schemas/registry.schema.d.ts +65 -0
  381. package/dist/schemas/registry.schema.d.ts.map +1 -0
  382. package/dist/schemas/registry.schema.js +34 -0
  383. package/dist/schemas/registry.schema.js.map +1 -0
  384. package/dist/schemas/reputation.schema.d.ts +31 -0
  385. package/dist/schemas/reputation.schema.d.ts.map +1 -0
  386. package/dist/schemas/reputation.schema.js +20 -0
  387. package/dist/schemas/reputation.schema.js.map +1 -0
  388. package/dist/schemas/settlement.schema.d.ts +50 -0
  389. package/dist/schemas/settlement.schema.d.ts.map +1 -0
  390. package/dist/schemas/settlement.schema.js +29 -0
  391. package/dist/schemas/settlement.schema.js.map +1 -0
  392. package/dist/schemas/tool-schema.schema.d.ts +56 -0
  393. package/dist/schemas/tool-schema.schema.d.ts.map +1 -0
  394. package/dist/schemas/tool-schema.schema.js +26 -0
  395. package/dist/schemas/tool-schema.schema.js.map +1 -0
  396. package/dist/schemas/transaction.schema.d.ts +34 -0
  397. package/dist/schemas/transaction.schema.d.ts.map +1 -0
  398. package/dist/schemas/transaction.schema.js +20 -0
  399. package/dist/schemas/transaction.schema.js.map +1 -0
  400. package/dist/security/approval-required.d.ts +9 -0
  401. package/dist/security/approval-required.d.ts.map +1 -0
  402. package/dist/security/approval-required.js +10 -0
  403. package/dist/security/approval-required.js.map +1 -0
  404. package/dist/security/index.d.ts +9 -0
  405. package/dist/security/index.d.ts.map +1 -0
  406. package/dist/security/index.js +9 -0
  407. package/dist/security/index.js.map +1 -0
  408. package/dist/security/private-key-guard.d.ts +11 -0
  409. package/dist/security/private-key-guard.d.ts.map +1 -0
  410. package/dist/security/private-key-guard.js +22 -0
  411. package/dist/security/private-key-guard.js.map +1 -0
  412. package/dist/security/prompt-injection-notes.d.ts +13 -0
  413. package/dist/security/prompt-injection-notes.d.ts.map +1 -0
  414. package/dist/security/prompt-injection-notes.js +23 -0
  415. package/dist/security/prompt-injection-notes.js.map +1 -0
  416. package/dist/security/tool-permissions.d.ts +30 -0
  417. package/dist/security/tool-permissions.d.ts.map +1 -0
  418. package/dist/security/tool-permissions.js +270 -0
  419. package/dist/security/tool-permissions.js.map +1 -0
  420. package/dist/security/unsafe-action-guard.d.ts +28 -0
  421. package/dist/security/unsafe-action-guard.d.ts.map +1 -0
  422. package/dist/security/unsafe-action-guard.js +175 -0
  423. package/dist/security/unsafe-action-guard.js.map +1 -0
  424. package/dist/server/create-server.d.ts +12 -0
  425. package/dist/server/create-server.d.ts.map +1 -0
  426. package/dist/server/create-server.js +57 -0
  427. package/dist/server/create-server.js.map +1 -0
  428. package/dist/server/index.d.ts +7 -0
  429. package/dist/server/index.d.ts.map +1 -0
  430. package/dist/server/index.js +7 -0
  431. package/dist/server/index.js.map +1 -0
  432. package/dist/server/register-capabilities.d.ts +10 -0
  433. package/dist/server/register-capabilities.d.ts.map +1 -0
  434. package/dist/server/register-capabilities.js +23 -0
  435. package/dist/server/register-capabilities.js.map +1 -0
  436. package/dist/server/server-metadata.d.ts +32 -0
  437. package/dist/server/server-metadata.d.ts.map +1 -0
  438. package/dist/server/server-metadata.js +32 -0
  439. package/dist/server/server-metadata.js.map +1 -0
  440. package/dist/session/agent-session.d.ts +25 -0
  441. package/dist/session/agent-session.d.ts.map +1 -0
  442. package/dist/session/agent-session.js +35 -0
  443. package/dist/session/agent-session.js.map +1 -0
  444. package/dist/session/delegated-session.d.ts +20 -0
  445. package/dist/session/delegated-session.d.ts.map +1 -0
  446. package/dist/session/delegated-session.js +47 -0
  447. package/dist/session/delegated-session.js.map +1 -0
  448. package/dist/session/index.d.ts +10 -0
  449. package/dist/session/index.d.ts.map +1 -0
  450. package/dist/session/index.js +9 -0
  451. package/dist/session/index.js.map +1 -0
  452. package/dist/session/redis-session-store.d.ts +89 -0
  453. package/dist/session/redis-session-store.d.ts.map +1 -0
  454. package/dist/session/redis-session-store.js +219 -0
  455. package/dist/session/redis-session-store.js.map +1 -0
  456. package/dist/session/session-limits.d.ts +20 -0
  457. package/dist/session/session-limits.d.ts.map +1 -0
  458. package/dist/session/session-limits.js +55 -0
  459. package/dist/session/session-limits.js.map +1 -0
  460. package/dist/session/session-permissions.d.ts +37 -0
  461. package/dist/session/session-permissions.d.ts.map +1 -0
  462. package/dist/session/session-permissions.js +58 -0
  463. package/dist/session/session-permissions.js.map +1 -0
  464. package/dist/session/session-store.d.ts +38 -0
  465. package/dist/session/session-store.d.ts.map +1 -0
  466. package/dist/session/session-store.js +62 -0
  467. package/dist/session/session-store.js.map +1 -0
  468. package/dist/session/session-types.d.ts +33 -0
  469. package/dist/session/session-types.d.ts.map +1 -0
  470. package/dist/session/session-types.js +5 -0
  471. package/dist/session/session-types.js.map +1 -0
  472. package/dist/signer/external-signer.d.ts +16 -0
  473. package/dist/signer/external-signer.d.ts.map +1 -0
  474. package/dist/signer/external-signer.js +128 -0
  475. package/dist/signer/external-signer.js.map +1 -0
  476. package/dist/signer/index.d.ts +9 -0
  477. package/dist/signer/index.d.ts.map +1 -0
  478. package/dist/signer/index.js +8 -0
  479. package/dist/signer/index.js.map +1 -0
  480. package/dist/signer/load-keypair.d.ts +15 -0
  481. package/dist/signer/load-keypair.d.ts.map +1 -0
  482. package/dist/signer/load-keypair.js +39 -0
  483. package/dist/signer/load-keypair.js.map +1 -0
  484. package/dist/signer/local-keypair-signer.d.ts +11 -0
  485. package/dist/signer/local-keypair-signer.d.ts.map +1 -0
  486. package/dist/signer/local-keypair-signer.js +46 -0
  487. package/dist/signer/local-keypair-signer.js.map +1 -0
  488. package/dist/signer/signer-resolver.d.ts +10 -0
  489. package/dist/signer/signer-resolver.d.ts.map +1 -0
  490. package/dist/signer/signer-resolver.js +63 -0
  491. package/dist/signer/signer-resolver.js.map +1 -0
  492. package/dist/signer/signer-types.d.ts +35 -0
  493. package/dist/signer/signer-types.d.ts.map +1 -0
  494. package/dist/signer/signer-types.js +5 -0
  495. package/dist/signer/signer-types.js.map +1 -0
  496. package/dist/signer/signing-proxy.d.ts +45 -0
  497. package/dist/signer/signing-proxy.d.ts.map +1 -0
  498. package/dist/signer/signing-proxy.js +300 -0
  499. package/dist/signer/signing-proxy.js.map +1 -0
  500. package/dist/tools/client-sdk-tools.d.ts +22 -0
  501. package/dist/tools/client-sdk-tools.d.ts.map +1 -0
  502. package/dist/tools/client-sdk-tools.js +220 -0
  503. package/dist/tools/client-sdk-tools.js.map +1 -0
  504. package/dist/tools/index.d.ts +11 -0
  505. package/dist/tools/index.d.ts.map +1 -0
  506. package/dist/tools/index.js +17 -0
  507. package/dist/tools/index.js.map +1 -0
  508. package/dist/tools/profile-tools.d.ts +12 -0
  509. package/dist/tools/profile-tools.d.ts.map +1 -0
  510. package/dist/tools/profile-tools.js +250 -0
  511. package/dist/tools/profile-tools.js.map +1 -0
  512. package/dist/tools/register-tools.d.ts +12 -0
  513. package/dist/tools/register-tools.d.ts.map +1 -0
  514. package/dist/tools/register-tools.js +36 -0
  515. package/dist/tools/register-tools.js.map +1 -0
  516. package/dist/tools/sap-network-stats.tool.d.ts +14 -0
  517. package/dist/tools/sap-network-stats.tool.d.ts.map +1 -0
  518. package/dist/tools/sap-network-stats.tool.js +101 -0
  519. package/dist/tools/sap-network-stats.tool.js.map +1 -0
  520. package/dist/tools/sap-sdk-tools.d.ts +15 -0
  521. package/dist/tools/sap-sdk-tools.d.ts.map +1 -0
  522. package/dist/tools/sap-sdk-tools.js +1515 -0
  523. package/dist/tools/sap-sdk-tools.js.map +1 -0
  524. package/dist/tools/sap-sns-tools.d.ts +35 -0
  525. package/dist/tools/sap-sns-tools.d.ts.map +1 -0
  526. package/dist/tools/sap-sns-tools.js +626 -0
  527. package/dist/tools/sap-sns-tools.js.map +1 -0
  528. package/dist/tools/skills-tools.d.ts +12 -0
  529. package/dist/tools/skills-tools.d.ts.map +1 -0
  530. package/dist/tools/skills-tools.js +273 -0
  531. package/dist/tools/skills-tools.js.map +1 -0
  532. package/dist/tools/transaction-tools.d.ts +14 -0
  533. package/dist/tools/transaction-tools.d.ts.map +1 -0
  534. package/dist/tools/transaction-tools.js +297 -0
  535. package/dist/tools/transaction-tools.js.map +1 -0
  536. package/dist/transports/http.d.ts +40 -0
  537. package/dist/transports/http.d.ts.map +1 -0
  538. package/dist/transports/http.js +212 -0
  539. package/dist/transports/http.js.map +1 -0
  540. package/dist/transports/index.d.ts +6 -0
  541. package/dist/transports/index.d.ts.map +1 -0
  542. package/dist/transports/index.js +6 -0
  543. package/dist/transports/index.js.map +1 -0
  544. package/dist/transports/stdio.d.ts +14 -0
  545. package/dist/transports/stdio.d.ts.map +1 -0
  546. package/dist/transports/stdio.js +32 -0
  547. package/dist/transports/stdio.js.map +1 -0
  548. package/dist/tui/components.d.ts +59 -0
  549. package/dist/tui/components.d.ts.map +1 -0
  550. package/dist/tui/components.js +82 -0
  551. package/dist/tui/components.js.map +1 -0
  552. package/dist/tui/config-wizard.d.ts +12 -0
  553. package/dist/tui/config-wizard.d.ts.map +1 -0
  554. package/dist/tui/config-wizard.js +348 -0
  555. package/dist/tui/config-wizard.js.map +1 -0
  556. package/dist/tui/wizard-save.d.ts +51 -0
  557. package/dist/tui/wizard-save.d.ts.map +1 -0
  558. package/dist/tui/wizard-save.js +148 -0
  559. package/dist/tui/wizard-save.js.map +1 -0
  560. package/docs/00_README.md +45 -0
  561. package/docs/01_PRODUCT_OVERVIEW.md +69 -0
  562. package/docs/02_ARCHITECTURE_AND_REQUEST_FLOW.md +120 -0
  563. package/docs/03_CONFIGURATION_AND_WIZARD.md +143 -0
  564. package/docs/04_LOCAL_STDIO_USAGE.md +118 -0
  565. package/docs/05_REMOTE_VPS_DEPLOYMENT.md +136 -0
  566. package/docs/06_PAYMENTS_X402_AND_PAYSH.md +162 -0
  567. package/docs/07_ENDPOINTS_AND_CLIENTS.md +114 -0
  568. package/docs/08_SECURITY_POLICY_AND_SIGNING.md +134 -0
  569. package/docs/09_TOOLS_SKILLS_AND_AGENT_GUIDE.md +72 -0
  570. package/docs/10_OPERATIONS_RELEASE_AND_PM2.md +90 -0
  571. package/docs/11_CODE_QUALITY_AUDIT.md +49 -0
  572. package/ecosystem.config.example.cjs +55 -0
  573. package/package.json +132 -0
  574. package/skills/README.md +146 -0
  575. package/skills/sap-agent-registry/SKILL.md +39 -0
  576. package/skills/sap-agentkit/SKILL.md +40 -0
  577. package/skills/sap-defi/SKILL.md +51 -0
  578. package/skills/sap-discovery-indexing/SKILL.md +33 -0
  579. package/skills/sap-escrow-settlement/SKILL.md +37 -0
  580. package/skills/sap-ledger-session/SKILL.md +24 -0
  581. package/skills/sap-market-data/SKILL.md +36 -0
  582. package/skills/sap-mcp/SKILL.md +202 -0
  583. package/skills/sap-mcp/TOOL_REFERENCE.md +184 -0
  584. package/skills/sap-memory-vault/SKILL.md +29 -0
  585. package/skills/sap-nft-metaplex/SKILL.md +38 -0
  586. package/skills/sap-operations/SKILL.md +97 -0
  587. package/skills/sap-payments-x402/SKILL.md +47 -0
  588. package/skills/sap-reputation-attestation/SKILL.md +30 -0
  589. package/skills/sap-sns/SKILL.md +51 -0
  590. package/skills/sap-social-gaming/SKILL.md +30 -0
  591. package/skills/sap-solana-token/SKILL.md +32 -0
  592. package/skills/sap-staking/SKILL.md +24 -0
  593. package/skills/sap-tool-registry/SKILL.md +29 -0
@@ -0,0 +1,45 @@
1
+ # 00. Documentation Index
2
+
3
+ SAP MCP Server is a production-oriented Model Context Protocol server for OOBE SAP Protocol, Solana, Synapse AgentKit, SNS, and monetized hosted agent workflows.
4
+
5
+ This documentation set is intentionally numbered. Read it in order for a full system view, or jump directly to the operational area you need.
6
+
7
+ ## 00.1 Document Map
8
+
9
+ | Document | Purpose |
10
+ | --- | --- |
11
+ | [01. Product Overview](01_PRODUCT_OVERVIEW.md) | What SAP MCP is, who uses it, and which deployment models it supports. |
12
+ | [02. Architecture And Request Flow](02_ARCHITECTURE_AND_REQUEST_FLOW.md) | Runtime modules, MCP flow, signing flow, payment flow, and trust boundaries. |
13
+ | [03. Configuration And Wizard](03_CONFIGURATION_AND_WIZARD.md) | Profile manager, wallet isolation, wizard behavior, client config injection, and config CLI. |
14
+ | [04. Local Stdio Usage](04_LOCAL_STDIO_USAGE.md) | Local MCP setup for Claude, Hermes, Codex, OpenClaw, and development agents. |
15
+ | [05. Remote VPS Deployment](05_REMOTE_VPS_DEPLOYMENT.md) | Hosted Streamable HTTP deployment for `mcp.sap.oobeprotocol.ai`, reverse proxy, PM2, and release packaging. |
16
+ | [06. Payments, x402, And pay.sh](06_PAYMENTS_X402_AND_PAYSH.md) | Monetization model, x402 payment gate, pay.sh provider YAML, facilitator keypair, pricing, and settlement. |
17
+ | [07. Endpoints And Clients](07_ENDPOINTS_AND_CLIENTS.md) | HTTP endpoints, headers, MCP client examples, health checks, smoke tests, and payment endpoints. |
18
+ | [08. Security, Policy, And Signing](08_SECURITY_POLICY_AND_SIGNING.md) | Keypair safety, Bento/local policy, approval rules, signer modes, and operational security. |
19
+ | [09. Tools, Skills, And Agent Guide](09_TOOLS_SKILLS_AND_AGENT_GUIDE.md) | Tool families, agent context, skills installation, SDK docs pointers, and language expectations. |
20
+ | [10. Operations, Release, And PM2](10_OPERATIONS_RELEASE_AND_PM2.md) | Build gates, PM2 ecosystem, logs, monitoring, changelog discipline, public/private repo guidance. |
21
+ | [11. Code Quality Audit](11_CODE_QUALITY_AUDIT.md) | Engineering scorecard, release gates, quality rules, and current residual risks. |
22
+
23
+ ## 00.2 Primary Binaries
24
+
25
+ | Binary | Purpose |
26
+ | --- | --- |
27
+ | `sap-mcp-server` | Local stdio MCP server and CLI entry point. |
28
+ | `sap-mcp-remote` | Remote MCP Streamable HTTP server. Supports bearerless public mode plus API key/JWT private modes. |
29
+ | `sap-mcp-config` | Config CLI, profile manager, approval workflow, and wizard entry point. |
30
+ | `sap-mcp-wizard` | TUI setup wizard. |
31
+ | `sap-signing-proxy` | Local signing proxy for external signer mode. |
32
+ | `sap-mcp-facilitator` | Self-hosted x402 SVM facilitator. |
33
+ | `sap-mcp-pay-sh-spec` | pay.sh provider YAML generator. |
34
+
35
+ ## 00.3 Golden Rules
36
+
37
+ 1. Generated SAP MCP wallets live under `~/.config/mcp-sap/keypairs/`.
38
+ 2. The wizard never modifies `~/.config/solana/id.json`.
39
+ 3. Local stdio mode is for a user's own machine.
40
+ 4. Remote HTTP mode can be bearerless for hosted agents; paid tools still require x402.
41
+ 5. Hosted payment and transaction signing flows still require a wizard-created user SAP profile and a local or external signer.
42
+ 6. x402 monetization applies to paid `tools/call` requests, not to the basic MCP handshake.
43
+ 7. pay.sh is an outer provider/catalog/proxy integration; SAP MCP remains the source of truth for per-tool pricing.
44
+ 8. Facilitator signer, revenue recipient, user SAP wallet, agent PDA, and Solana CLI wallet are separate identities.
45
+ 9. Keypair bytes must never be logged, shown to agents, injected into client config, or documented in examples.
@@ -0,0 +1,69 @@
1
+ # 01. Product Overview
2
+
3
+ ## 01.1 What SAP MCP Is
4
+
5
+ SAP MCP Server exposes OOBE Synapse Agent Protocol functionality through the Model Context Protocol. Agents connect through MCP and receive a structured tool surface for Solana, SAP Protocol, Synapse AgentKit, SNS, profiles, skills, payments, and transaction signing.
6
+
7
+ The server supports two first-class modes:
8
+
9
+ | Mode | Transport | Primary use case |
10
+ | --- | --- | --- |
11
+ | Local | stdio | Claude Desktop, Hermes, Codex, OpenClaw, Cursor, and local agent development. |
12
+ | Remote | Streamable HTTP at `/mcp` | Hosted access at a public domain such as `mcp.sap.oobeprotocol.ai`. |
13
+
14
+ ## 01.2 What It Exposes
15
+
16
+ The runtime tool registry includes:
17
+
18
+ 1. SAP SDK tools from `@oobe-protocol-labs/synapse-sap-sdk`.
19
+ 2. SAP SNS tools for domain and identity workflows.
20
+ 3. Synapse AgentKit tools from `@oobe-protocol-labs/synapse-client-sdk`.
21
+ 4. Solana RPC, DAS, token, NFT, DeFi, Jupiter, transaction, and profile tools.
22
+ 5. SAP MCP profile and skill-pack management tools.
23
+ 6. x402 payment helper tools for paid hosted workflows.
24
+
25
+ Tool count changes as upstream SDKs evolve. Verify the current runtime count with `tools/list` or the smoke test in [07. Endpoints And Clients](07_ENDPOINTS_AND_CLIENTS.md).
26
+
27
+ ## 01.3 Who Uses It
28
+
29
+ | Actor | What they need |
30
+ | --- | --- |
31
+ | Local agent operator | A profile under `~/.config/mcp-sap`, a dedicated SAP MCP keypair or external signer, and a local MCP client config. |
32
+ | Hosted MCP customer | A remote MCP URL and payment headers only for paid tool calls. |
33
+ | OOBE operator | A VPS deployment, reverse proxy, PM2 services, API keys or JWT auth, facilitator service, payment recipient wallet, and monitoring. |
34
+ | Developer | The repo, SDK dependencies, typecheck/build/test gates, and the docs in this directory. |
35
+
36
+ ## 01.4 Public Or Private Repository
37
+
38
+ The recommended model is:
39
+
40
+ 1. Keep the source repo public once secrets, private config files, keypairs, deployment tokens, and customer credentials are excluded.
41
+ 2. Keep production `.env`, PM2 ecosystem files with secrets, facilitator signer files, and customer API keys private.
42
+ 3. Publish signed GitHub releases and npm packages so users can install the wizard and local server without cloning private infrastructure.
43
+
44
+ Public source helps agent developers audit the tool surface, transport behavior, and signing model. Private deployment state protects the business.
45
+
46
+ ## 01.5 Do Remote Customers Need The Wizard?
47
+
48
+ Yes for signing and paid agent operation.
49
+
50
+ 1. Customers can connect read-only agents to hosted `https://mcp.sap.oobeprotocol.ai/mcp` with only a client config entry.
51
+ 2. Hosted users who sign x402/pay.sh payments or tool transactions must run `sap-mcp-config wizard` to create the user SAP profile, policy limits, and local or external signer.
52
+ 3. Developers who want to run SAP MCP locally should use the wizard.
53
+ 4. Hosted customers should not receive server keypairs, facilitator keypairs, or OOBE deployment secrets.
54
+
55
+ The wizard is distributed through the npm package and release artifacts. It is the standard onboarding path for hosted users who need user-controlled signing.
56
+
57
+ Agent owners need the wizard when they want their own SAP identity, local profile, dedicated wallet, signing policy, or external signer connection. In that case the wallet lives on the user's machine under `~/.config/mcp-sap/keypairs/` or behind an external signer, not inside the hosted OOBE remote MCP process.
58
+
59
+ | Customer mode | Wizard required | Wallet or signer location |
60
+ | --- | --- | --- |
61
+ | Read-only hosted discovery | Optional | None required for read-only calls. |
62
+ | Hosted user paying x402/pay.sh charges | Yes | User machine under `~/.config/mcp-sap/keypairs/` or external signer. |
63
+ | Hosted user signing SAP/Solana tool transactions | Yes | User-controlled signer, never uploaded to `mcp.sap.oobeprotocol.ai`. |
64
+ | Local stdio or self-hosted developer | Yes | User machine under `~/.config/mcp-sap/keypairs/` or external signer. |
65
+ | OOBE custodial hosted agent | No for end user | OOBE-controlled secret manager; separate product and risk model. |
66
+
67
+ ## 01.6 Monetization Model In One Sentence
68
+
69
+ Agents do not pay merely because they connect. Free protocol and base profile calls remain free; paid tools are priced per `tools/call` and authorized through x402 before execution.
@@ -0,0 +1,120 @@
1
+ # 02. Architecture And Request Flow
2
+
3
+ ## 02.1 High-Level Architecture
4
+
5
+ ```text
6
+ MCP Client
7
+ | stdio or Streamable HTTP
8
+ v
9
+ SAP MCP Server
10
+ |-- config/profile manager
11
+ |-- policy engine
12
+ |-- tool registry
13
+ |-- signer resolver
14
+ |-- optional x402 payment gate
15
+ v
16
+ OOBE SDKs and Solana RPC
17
+ |-- synapse-sap-sdk
18
+ |-- synapse-client-sdk
19
+ |-- Solana RPC
20
+ v
21
+ Solana / SAP Protocol / SNS / AgentKit
22
+ ```
23
+
24
+ ## 02.2 Runtime Modules
25
+
26
+ | Directory | Responsibility |
27
+ | --- | --- |
28
+ | `src/server/` | MCP server factory and capability registration. |
29
+ | `src/transports/` | stdio and local HTTP transport helpers. |
30
+ | `src/remote/` | Streamable HTTP MCP server. Supports bearerless public mode plus API key/JWT private modes. |
31
+ | `src/tools/` | SAP, Solana, AgentKit, SNS, transaction, profile, skill, and payment tool registration. |
32
+ | `src/config/` | Runtime config, secure config manager, profile manager, wizard pipeline, and client injection. |
33
+ | `src/policy/` | Local policy, Bento policy, hybrid policy, spending limits, and risk evaluation. |
34
+ | `src/security/` | Private-key guard, unsafe action guard, approval requirements, and tool permission maps. |
35
+ | `src/signer/` | Local keypair signer, external signer, delegated signer, and signing proxy. |
36
+ | `src/payments/` | x402 monetization gate, facilitator server, usage ledger, pricing, and pay.sh spec generator. |
37
+ | `src/resources/` | MCP resources for current config, registry, reputation, memory, stats, and tool schemas. |
38
+ | `src/prompts/` | MCP prompts that teach agents how to use SAP MCP safely. |
39
+
40
+ ## 02.3 Local Stdio Flow
41
+
42
+ 1. Agent client starts `sap-mcp-server` as a child process.
43
+ 2. Server loads the active profile from `~/.config/mcp-sap`.
44
+ 3. MCP handshake runs over stdio.
45
+ 4. Client calls tools through JSON-RPC.
46
+ 5. Policy and security guards run before tool execution.
47
+ 6. If a tool needs signing, the signer resolver uses local keypair or external signer mode.
48
+ 7. Results are returned through MCP content blocks.
49
+
50
+ Local stdio is not monetized by default. It is the user's own local runtime.
51
+
52
+ ## 02.4 Remote HTTP Flow
53
+
54
+ 1. Client connects to `POST /mcp`, `GET /mcp`, or `DELETE /mcp`.
55
+ 2. Reverse proxy terminates TLS.
56
+ 3. Public mode accepts the MCP request without Bearer auth; private modes validate Bearer auth.
57
+ 4. x402 gate inspects `tools/call` requests when monetization is enabled.
58
+ 5. Free requests pass through immediately.
59
+ 6. Paid requests return payment requirements until the client supplies a payment signed by the user's wallet or external signer.
60
+ 7. Paid requests require a valid `PAYMENT-SIGNATURE` or `X-PAYMENT` header.
61
+ 8. Tool call executes only after verification.
62
+ 9. Settlement is attempted after successful handler completion.
63
+ 10. Usage ledger records the decision, verification, settlement, or cancellation state.
64
+
65
+ ## 02.5 Signing Flow
66
+
67
+ ```text
68
+ Tool call
69
+ |
70
+ v
71
+ Policy and permission checks
72
+ |
73
+ v
74
+ Signer resolver
75
+ |-- readonly: no signing
76
+ |-- local-dev-keypair: dedicated SAP MCP keypair
77
+ |-- external-signer: signer service or signing proxy
78
+ |-- hosted-api: no raw customer keypair in process
79
+ v
80
+ Signed transaction or explicit refusal
81
+ ```
82
+
83
+ The agent sees public keys, profile names, network, and policy limits. It must never see secret key bytes.
84
+
85
+ In hosted mode, `mcp.sap.oobeprotocol.ai` is the remote MCP transport and payment verifier, not a custodial signer for customer wallets. Any hosted workflow that needs a user signature must use the wizard-created local profile, a local signing proxy, or an external signer.
86
+
87
+ ## 02.6 Payment Flow
88
+
89
+ ```text
90
+ MCP tools/call
91
+ |
92
+ v
93
+ Pricing resolver
94
+ |-- free: execute
95
+ |-- paid: build x402 payment requirements
96
+ v
97
+ x402 resource server
98
+ |
99
+ v
100
+ OOBE facilitator verify
101
+ |
102
+ v
103
+ Tool execution
104
+ |
105
+ v
106
+ OOBE facilitator settle
107
+ ```
108
+
109
+ The facilitator signer pays or sponsors the settlement path when configured. It is not the revenue recipient and not an agent wallet.
110
+
111
+ ## 02.7 Trust Boundaries
112
+
113
+ | Boundary | Rule |
114
+ | --- | --- |
115
+ | MCP client to remote server | Public hosted mode can be bearerless; private/enterprise mode can require Bearer auth. Paid tools still require x402. |
116
+ | Remote server to facilitator | Use a private facilitator auth token. |
117
+ | Server to local keypair | Never print or expose keypair bytes. |
118
+ | Agent profile to Solana CLI | Keep SAP MCP keypairs separate from Solana CLI keypairs. |
119
+ | pay.sh to SAP MCP | pay.sh can proxy/catalog the HTTP endpoint; SAP MCP still enforces per-tool pricing. |
120
+ | Policy to tool handler | Policy must run before sensitive or value-moving calls. |
@@ -0,0 +1,143 @@
1
+ # 03. Configuration And Wizard
2
+
3
+ ## 03.1 Config Directory
4
+
5
+ SAP MCP uses one canonical local config namespace:
6
+
7
+ ```text
8
+ ~/.config/mcp-sap/
9
+ .active-profile
10
+ config.json
11
+ config-<profile>.json
12
+ keypairs/
13
+ <profile>-keypair.json
14
+ logs/
15
+ ```
16
+
17
+ Legacy paths such as `~/.config/sap-mcp` should not be used by new installs. Client config entries should point to the SAP MCP profile manager, not hard-code legacy wallet paths.
18
+
19
+ ## 03.2 Profile Resolution
20
+
21
+ Runtime config is resolved in this order:
22
+
23
+ 1. Safe built-in defaults.
24
+ 2. `SAP_MCP_CONFIG_PATH`, when explicitly set.
25
+ 3. `SAP_MCP_PROFILE`, when explicitly set.
26
+ 4. `~/.config/mcp-sap/.active-profile`.
27
+ 5. `~/.config/mcp-sap/config.json`.
28
+ 6. Deployment environment variables.
29
+ 7. Explicit runtime overrides from code.
30
+
31
+ Profile-owned fields remain authoritative unless `SAP_MCP_ALLOW_ENV_CONFIG_OVERRIDE=true`.
32
+
33
+ ## 03.3 Profile-Owned Fields
34
+
35
+ These fields normally belong to the active profile:
36
+
37
+ | Field | Meaning |
38
+ | --- | --- |
39
+ | `mode` | `readonly`, `local-dev-keypair`, `hosted-api`, or external signer mode. |
40
+ | `rpcUrl` | Solana RPC endpoint. |
41
+ | `programId` | SAP program ID. |
42
+ | `commitment` | Solana commitment level. |
43
+ | `agentPubkey` | Agent public key or PDA exposed to agents. |
44
+ | `walletPath` | Dedicated SAP MCP keypair path when local signing is enabled. |
45
+ | `walletEncrypted` | Whether the wallet file is encrypted. |
46
+ | `policy` | Local, Bento, or hybrid policy configuration. |
47
+ | `bento` | Optional Bento integration settings. |
48
+ | `monetization` | Hosted payment settings when remote monetization is enabled. |
49
+
50
+ ## 03.4 Wizard Responsibilities
51
+
52
+ The wizard should:
53
+
54
+ 1. Create `~/.config/mcp-sap` when missing.
55
+ 2. Ask for a profile name instead of silently creating ambiguous `default` state.
56
+ 3. Create or import a dedicated SAP MCP wallet.
57
+ 4. Store the wallet under `~/.config/mcp-sap/keypairs/` by default.
58
+ 5. Never write to `~/.config/solana/id.json`.
59
+ 6. Ask whether Bento policy should be enabled.
60
+ 7. Validate RPC URL, program ID, keypair path, mode, limits, and profile names.
61
+ 8. Show a final preview before writing files.
62
+ 9. Offer optional MCP client config injection.
63
+ 10. Warn before merge or override when an existing `sap` MCP entry is found.
64
+
65
+ ## 03.5 Client Config Injection
66
+
67
+ The injection step is optional. It targets known local MCP clients such as Claude Desktop, Hermes, Codex, and OpenClaw.
68
+
69
+ The injected config should follow the profile manager:
70
+
71
+ ```json
72
+ {
73
+ "mcpServers": {
74
+ "sap": {
75
+ "command": "node",
76
+ "args": ["/path/to/sap-mcp-server/dist/cli.js"],
77
+ "cwd": "/path/to/sap-mcp-server",
78
+ "env": {
79
+ "SAP_MCP_ALLOW_ENV_CONFIG_OVERRIDE": "false",
80
+ "SAP_LOG_LEVEL": "info"
81
+ }
82
+ }
83
+ }
84
+ }
85
+ ```
86
+
87
+ Do not inject keypair bytes, hard-coded legacy wallet paths, or stale RPC overrides into agent client files.
88
+
89
+ ## 03.6 Config CLI
90
+
91
+ Use `sap-mcp-config` for profile and policy operations:
92
+
93
+ ```bash
94
+ npx sap-mcp-config wizard
95
+ npx sap-mcp-config show
96
+ npx sap-mcp-config profiles
97
+ npx sap-mcp-config profile <name>
98
+ npx sap-mcp-config create-profile <name> [copy-from]
99
+ npx sap-mcp-config delete-profile <name>
100
+ npx sap-mcp-config profile-info
101
+ npx sap-mcp-config pubkey
102
+ npx sap-mcp-config info
103
+ npx sap-mcp-config wallet
104
+ npx sap-mcp-config set mode readonly
105
+ npx sap-mcp-config pending
106
+ npx sap-mcp-config approve <id>
107
+ npx sap-mcp-config deny <id>
108
+ npx sap-mcp-config audit
109
+ npx sap-mcp-config hash
110
+ ```
111
+
112
+ ## 03.7 Approval Workflow
113
+
114
+ Sensitive config changes can require approval. Typical protected fields are:
115
+
116
+ 1. `mode`
117
+ 2. `walletPath`
118
+ 3. `externalSignerUrl`
119
+ 4. `maxTxValueSol`
120
+ 5. `dailyLimitSol`
121
+
122
+ Pending changes are listed with `sap-mcp-config pending`, approved with `sap-mcp-config approve <id>`, and denied with `sap-mcp-config deny <id>`.
123
+
124
+ ## 03.8 Network Consistency
125
+
126
+ The active profile is the source of truth for network behavior. If a profile is on devnet, SAP tools must return devnet data. If a profile is on mainnet, SAP tools must return mainnet data.
127
+
128
+ Avoid this anti-pattern:
129
+
130
+ ```yaml
131
+ env:
132
+ SAP_MCP_RPC_URL: https://api.devnet.solana.com
133
+ SAP_WALLET_PATH: /legacy/path/keypair.json
134
+ ```
135
+
136
+ Use profile-managed config instead:
137
+
138
+ ```yaml
139
+ env:
140
+ SAP_MCP_ALLOW_ENV_CONFIG_OVERRIDE: "false"
141
+ SAP_LOG_LEVEL: info
142
+ ```
143
+
@@ -0,0 +1,118 @@
1
+ # 04. Local Stdio Usage
2
+
3
+ ## 04.1 When To Use Local Mode
4
+
5
+ Use local stdio when the MCP server runs on the same machine as the agent client:
6
+
7
+ 1. Claude Desktop.
8
+ 2. Hermes.
9
+ 3. Codex.
10
+ 4. OpenClaw.
11
+ 5. Cursor or another local MCP client.
12
+ 6. Local development and smoke testing.
13
+
14
+ ## 04.2 Install And Build
15
+
16
+ From the repo:
17
+
18
+ ```bash
19
+ pnpm install
20
+ pnpm run build
21
+ ```
22
+
23
+ From a published package:
24
+
25
+ ```bash
26
+ npm install -g @oobe-protocol-labs/sap-mcp-server
27
+ ```
28
+
29
+ ## 04.3 Create A Profile
30
+
31
+ ```bash
32
+ npx sap-mcp-config wizard
33
+ ```
34
+
35
+ Then inspect it:
36
+
37
+ ```bash
38
+ npx sap-mcp-config show
39
+ npx sap-mcp-config pubkey
40
+ npx sap-mcp-config profiles
41
+ ```
42
+
43
+ ## 04.4 Start Local MCP
44
+
45
+ From source:
46
+
47
+ ```bash
48
+ node dist/cli.js
49
+ ```
50
+
51
+ From an installed package:
52
+
53
+ ```bash
54
+ sap-mcp-server
55
+ ```
56
+
57
+ ## 04.5 Client Config Examples
58
+
59
+ ### Claude Desktop
60
+
61
+ ```json
62
+ {
63
+ "mcpServers": {
64
+ "sap": {
65
+ "command": "sap-mcp-server",
66
+ "env": {
67
+ "SAP_MCP_ALLOW_ENV_CONFIG_OVERRIDE": "false",
68
+ "SAP_LOG_LEVEL": "info"
69
+ }
70
+ }
71
+ }
72
+ }
73
+ ```
74
+
75
+ ### Hermes
76
+
77
+ ```yaml
78
+ mcp_servers:
79
+ sap:
80
+ command: sap-mcp-server
81
+ env:
82
+ SAP_MCP_ALLOW_ENV_CONFIG_OVERRIDE: "false"
83
+ SAP_LOG_LEVEL: info
84
+ ```
85
+
86
+ ### Source Checkout
87
+
88
+ ```yaml
89
+ mcp_servers:
90
+ sap:
91
+ command: node
92
+ args:
93
+ - /path/to/sap-mcp-server/dist/cli.js
94
+ cwd: /path/to/sap-mcp-server
95
+ env:
96
+ SAP_MCP_ALLOW_ENV_CONFIG_OVERRIDE: "false"
97
+ SAP_LOG_LEVEL: info
98
+ ```
99
+
100
+ ## 04.6 What The Agent Should See
101
+
102
+ The agent may see:
103
+
104
+ 1. Loaded profile name.
105
+ 2. Network and RPC URL.
106
+ 3. Program ID.
107
+ 4. Signer public key.
108
+ 5. Agent public key or PDA.
109
+ 6. Config path.
110
+ 7. A statement that secret material is never exposed.
111
+
112
+ The agent must not read, print, summarize, or reveal keypair byte arrays.
113
+
114
+ ## 04.7 Local Signing
115
+
116
+ Local signing requires a profile in `local-dev-keypair` mode or a configured external signer.
117
+
118
+ Use local signing only when the machine operator controls the wallet and understands the risk. Remote hosted production should prefer `readonly`, `hosted-api`, or `external-signer` boundaries.
@@ -0,0 +1,136 @@
1
+ # 05. Remote Hosted Deployment
2
+
3
+ ## 05.1 Public Documentation Boundary
4
+
5
+ This document is intentionally public-safe. It describes the supported hosted deployment shape without exposing OOBE's live VPS layout, private ports, private process names, secret names, signer paths, production RPC providers, or infrastructure topology.
6
+
7
+ Keep the real deployment runbook, PM2 ecosystem file, reverse-proxy config, firewall rules, signer paths, payment recipient addresses, facilitator auth tokens, and RPC credentials in a private infrastructure repository or secret manager.
8
+
9
+ ## 05.2 Deployment Goal
10
+
11
+ Remote mode exposes SAP MCP over Streamable HTTP at a hosted `/mcp` endpoint. Public hosted deployments should run behind:
12
+
13
+ 1. TLS termination.
14
+ 2. Reverse proxy access control.
15
+ 3. Rate limiting.
16
+ 4. Policy checks.
17
+ 5. x402 monetization for paid `tools/call` requests.
18
+ 6. Private server-to-server authentication for facilitator traffic when applicable.
19
+ 7. Centralized logs and monitoring that do not expose secrets.
20
+
21
+ ## 05.3 Build Gates
22
+
23
+ Run release gates before publishing or deploying:
24
+
25
+ ```bash
26
+ pnpm run typecheck
27
+ pnpm run lint
28
+ pnpm test -- --run
29
+ pnpm run build
30
+ npm pack --dry-run
31
+ ```
32
+
33
+ The aggregate release command is:
34
+
35
+ ```bash
36
+ pnpm run verify:release
37
+ ```
38
+
39
+ ## 05.4 Runtime Configuration
40
+
41
+ Production runtime values must be injected from a private environment store, not hard-coded in public docs.
42
+
43
+ Required categories:
44
+
45
+ 1. Hosted profile name.
46
+ 2. Bind host and port for the private Node listener.
47
+ 3. Public base URL used in discovery responses.
48
+ 4. Remote auth mode for public or private deployments.
49
+ 5. Solana RPC provider.
50
+ 6. Monetization settings.
51
+ 7. Facilitator URL and facilitator auth token when x402 is enabled.
52
+ 8. Logging format and retention settings.
53
+
54
+ Public agent-facing deployments can run without Bearer auth when x402, rate limits, and policy are enabled. Private beta, enterprise, admin, and non-public deployments should use API key or JWT auth.
55
+
56
+ ## 05.5 Public Routes
57
+
58
+ Expose only the required public routes through the reverse proxy:
59
+
60
+ ```text
61
+ GET /health
62
+ GET /.well-known/agent-card.json
63
+ GET /.well-known/sap-mcp-wizard.json
64
+ GET /wizard/install.sh
65
+ POST /mcp
66
+ GET /mcp
67
+ DELETE /mcp
68
+ ```
69
+
70
+ Facilitator routes should be exposed only when required by the selected x402 architecture and protected with private facilitator authentication:
71
+
72
+ ```text
73
+ GET /facilitator/health
74
+ GET /facilitator/supported
75
+ POST /facilitator/verify
76
+ POST /facilitator/settle
77
+ ```
78
+
79
+ Do not publish the private reverse-proxy file, internal listener ports, private upstream names, or live facilitator auth values.
80
+
81
+ ## 05.6 Process Management
82
+
83
+ Run the remote MCP server and facilitator under a process manager such as PM2, systemd, or a container supervisor.
84
+
85
+ Recommended rules:
86
+
87
+ 1. Keep the production process file outside the public repository.
88
+ 2. Store secrets in the host secret manager or private environment file.
89
+ 3. Use structured logs.
90
+ 4. Rotate logs.
91
+ 5. Restart on crash.
92
+ 6. Alert on health-check failures, payment verification failures, and unexpected auth failures.
93
+ 7. Never commit production PM2 ecosystem files containing real environment values.
94
+
95
+ The public `ecosystem.config.example.cjs` is a shape reference only. Copy it into private infrastructure and replace every placeholder from your secret store before deployment.
96
+
97
+ ## 05.7 Hosted Customer Onboarding
98
+
99
+ Hosted user signing/payment onboarding:
100
+
101
+ 1. Install the npm package or release artifact that includes `sap-mcp-config` and `sap-mcp-wizard`.
102
+ 2. Run `npx sap-mcp-config wizard`.
103
+ 3. Create or import a dedicated SAP MCP wallet under `~/.config/mcp-sap/keypairs/`, or configure an external signer.
104
+ 4. Configure the agent client with the hosted MCP URL.
105
+ 5. Paid x402/pay.sh flows and value-moving tools sign with the user-controlled signer, not with the hosted OOBE server keypair.
106
+ 6. No Bearer token is required in public agent-facing mode.
107
+
108
+ Agents that cannot see local OS config should direct the user to the hosted wizard endpoint:
109
+
110
+ ```bash
111
+ curl -fsSL https://mcp.sap.oobeprotocol.ai/wizard/install.sh | sh
112
+ ```
113
+
114
+ They can inspect machine-readable wizard metadata at:
115
+
116
+ ```text
117
+ https://mcp.sap.oobeprotocol.ai/.well-known/sap-mcp-wizard.json
118
+ ```
119
+
120
+ Read-only hosted discovery:
121
+
122
+ 1. Use the hosted MCP URL.
123
+ 2. No local signer is required for free read-only calls.
124
+ 3. Optional skills/docs pack improves agent behavior.
125
+
126
+ ## 05.8 Production Profile Mode
127
+
128
+ For public hosting, avoid loading customer private keypairs into the remote process.
129
+
130
+ Recommended modes:
131
+
132
+ 1. `readonly` for read-only hosted discovery.
133
+ 2. `hosted-api` for server-side hosted operations governed by explicit product policy.
134
+ 3. `external-signer` when customer signing must happen outside the MCP server process.
135
+
136
+ The hosted server is transport, policy, discovery, and payment verification infrastructure. It is not a custodial wallet service for customer keypairs.