@oobe-protocol-labs/sap-mcp-server 0.9.22 → 0.9.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +23 -9
- package/CHANGELOG.md +124 -6
- package/README.md +8 -7
- package/USER_DOCS/00_START_HERE.md +9 -1
- package/USER_DOCS/01_HOSTED_REMOTE_MCP.md +1 -1
- package/USER_DOCS/03_PAYMENTS_X402_PAYSH.md +1 -1
- package/USER_DOCS/04_CLIENT_CONFIGS.md +3 -3
- package/USER_DOCS/06_DESKTOP_GUI_WIZARD.md +5 -5
- package/config.example.json +5 -4
- package/dist/config/env.d.ts +22 -0
- package/dist/config/env.d.ts.map +1 -1
- package/dist/config/env.js +26 -8
- package/dist/config/env.js.map +1 -1
- package/dist/config/mcp-client-injection.d.ts.map +1 -1
- package/dist/config/mcp-client-injection.js +34 -5
- package/dist/config/mcp-client-injection.js.map +1 -1
- package/dist/config/paths.d.ts +9 -1
- package/dist/config/paths.d.ts.map +1 -1
- package/dist/config/paths.js +15 -1
- package/dist/config/paths.js.map +1 -1
- package/dist/config/profiles.d.ts +5 -0
- package/dist/config/profiles.d.ts.map +1 -1
- package/dist/config/profiles.js +37 -9
- package/dist/config/profiles.js.map +1 -1
- package/dist/config/wizard.d.ts.map +1 -1
- package/dist/config/wizard.js +44 -1
- package/dist/config/wizard.js.map +1 -1
- package/dist/config-cli.d.ts.map +1 -1
- package/dist/config-cli.js +17 -1
- package/dist/config-cli.js.map +1 -1
- package/dist/core/constants.d.ts +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/logger.js +1 -1
- package/dist/memory/async-processor.d.ts +107 -0
- package/dist/memory/async-processor.d.ts.map +1 -0
- package/dist/memory/async-processor.js +204 -0
- package/dist/memory/async-processor.js.map +1 -0
- package/dist/memory/auto-record.d.ts +47 -0
- package/dist/memory/auto-record.d.ts.map +1 -0
- package/dist/memory/auto-record.js +133 -0
- package/dist/memory/auto-record.js.map +1 -0
- package/dist/memory/database.d.ts +103 -0
- package/dist/memory/database.d.ts.map +1 -0
- package/dist/memory/database.js +337 -0
- package/dist/memory/database.js.map +1 -0
- package/dist/memory/hermes-bridge.d.ts +70 -0
- package/dist/memory/hermes-bridge.d.ts.map +1 -0
- package/dist/memory/hermes-bridge.js +155 -0
- package/dist/memory/hermes-bridge.js.map +1 -0
- package/dist/memory/index.d.ts +23 -0
- package/dist/memory/index.d.ts.map +1 -0
- package/dist/memory/index.js +22 -0
- package/dist/memory/index.js.map +1 -0
- package/dist/memory/memory-store.d.ts +76 -0
- package/dist/memory/memory-store.d.ts.map +1 -0
- package/dist/memory/memory-store.js +231 -0
- package/dist/memory/memory-store.js.map +1 -0
- package/dist/memory/stream-buffer-store.d.ts +69 -0
- package/dist/memory/stream-buffer-store.d.ts.map +1 -0
- package/dist/memory/stream-buffer-store.js +182 -0
- package/dist/memory/stream-buffer-store.js.map +1 -0
- package/dist/memory/tool-call-store.d.ts +68 -0
- package/dist/memory/tool-call-store.d.ts.map +1 -0
- package/dist/memory/tool-call-store.js +189 -0
- package/dist/memory/tool-call-store.js.map +1 -0
- package/dist/memory/types.d.ts +197 -0
- package/dist/memory/types.d.ts.map +1 -0
- package/dist/memory/types.js +15 -0
- package/dist/memory/types.js.map +1 -0
- package/dist/memory/utils.d.ts +30 -0
- package/dist/memory/utils.d.ts.map +1 -0
- package/dist/memory/utils.js +47 -0
- package/dist/memory/utils.js.map +1 -0
- package/dist/payments/hosted-tool-eligibility.d.ts.map +1 -1
- package/dist/payments/hosted-tool-eligibility.js +4 -6
- package/dist/payments/hosted-tool-eligibility.js.map +1 -1
- package/dist/payments/monetization-gate.d.ts +39 -0
- package/dist/payments/monetization-gate.d.ts.map +1 -1
- package/dist/payments/monetization-gate.js +165 -11
- package/dist/payments/monetization-gate.js.map +1 -1
- package/dist/payments/pay-sh-spec.d.ts.map +1 -1
- package/dist/payments/pay-sh-spec.js +4 -2
- package/dist/payments/pay-sh-spec.js.map +1 -1
- package/dist/payments/pricing.d.ts +3 -1
- package/dist/payments/pricing.d.ts.map +1 -1
- package/dist/payments/pricing.js +137 -56
- package/dist/payments/pricing.js.map +1 -1
- package/dist/payments/x402-paid-call.d.ts.map +1 -1
- package/dist/payments/x402-paid-call.js +26 -2
- package/dist/payments/x402-paid-call.js.map +1 -1
- package/dist/premium/builtin-plugins.d.ts +42 -0
- package/dist/premium/builtin-plugins.d.ts.map +1 -1
- package/dist/premium/builtin-plugins.js +91 -10
- package/dist/premium/builtin-plugins.js.map +1 -1
- package/dist/premium/manifest-builder.d.ts.map +1 -1
- package/dist/premium/manifest-builder.js +43 -7
- package/dist/premium/manifest-builder.js.map +1 -1
- package/dist/premium/meme-radar-capabilities.js +9 -9
- package/dist/premium/meme-radar-capabilities.js.map +1 -1
- package/dist/premium/plugin-validator.d.ts.map +1 -1
- package/dist/premium/plugin-validator.js +62 -1
- package/dist/premium/plugin-validator.js.map +1 -1
- package/dist/premium/provider-bridge.d.ts +25 -1
- package/dist/premium/provider-bridge.d.ts.map +1 -1
- package/dist/premium/provider-bridge.js +130 -20
- package/dist/premium/provider-bridge.js.map +1 -1
- package/dist/premium/session-manager.d.ts.map +1 -1
- package/dist/premium/session-manager.js +12 -3
- package/dist/premium/session-manager.js.map +1 -1
- package/dist/premium/tech-fundamentals-capabilities.js +5 -5
- package/dist/premium/tech-fundamentals-capabilities.js.map +1 -1
- package/dist/premium/trading-capabilities.js +5 -5
- package/dist/premium/trading-capabilities.js.map +1 -1
- package/dist/premium/webhook-engine.d.ts.map +1 -1
- package/dist/premium/webhook-engine.js +7 -1
- package/dist/premium/webhook-engine.js.map +1 -1
- package/dist/prompts/context/sap-agent-context.prompt.js +4 -3
- package/dist/prompts/context/sap-agent-context.prompt.js.map +1 -1
- package/dist/prompts/context/sap-agent-intent-router.prompt.js +1 -1
- package/dist/prompts/payments/explain-x402-settlement.prompt.js +1 -1
- package/dist/remote/premium-routes.d.ts.map +1 -1
- package/dist/remote/premium-routes.js +3 -2
- package/dist/remote/premium-routes.js.map +1 -1
- package/dist/remote/public-home/sections.d.ts.map +1 -1
- package/dist/remote/public-home/sections.js +2 -3
- package/dist/remote/public-home/sections.js.map +1 -1
- package/dist/remote/public-home/styles.d.ts +1 -1
- package/dist/remote/public-home/styles.js +2 -2
- package/dist/remote/server.d.ts.map +1 -1
- package/dist/remote/server.js +19 -4
- package/dist/remote/server.js.map +1 -1
- package/dist/server/server-metadata.js +1 -1
- package/dist/strategies/strategy-store.d.ts +82 -0
- package/dist/strategies/strategy-store.d.ts.map +1 -0
- package/dist/strategies/strategy-store.js +165 -0
- package/dist/strategies/strategy-store.js.map +1 -0
- package/dist/tools/agent-start-tool.d.ts.map +1 -1
- package/dist/tools/agent-start-tool.js +103 -16
- package/dist/tools/agent-start-tool.js.map +1 -1
- package/dist/tools/client-sdk-tools.d.ts.map +1 -1
- package/dist/tools/client-sdk-tools.js +156 -12
- package/dist/tools/client-sdk-tools.js.map +1 -1
- package/dist/tools/estimate-tool-cost.d.ts.map +1 -1
- package/dist/tools/estimate-tool-cost.js +11 -4
- package/dist/tools/estimate-tool-cost.js.map +1 -1
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +2 -0
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/magicblock-tools.js +8 -8
- package/dist/tools/magicblock-tools.js.map +1 -1
- package/dist/tools/memory-tools.d.ts +26 -0
- package/dist/tools/memory-tools.d.ts.map +1 -0
- package/dist/tools/memory-tools.js +533 -0
- package/dist/tools/memory-tools.js.map +1 -0
- package/dist/tools/perp-tools.d.ts +7 -9
- package/dist/tools/perp-tools.d.ts.map +1 -1
- package/dist/tools/perp-tools.js +404 -367
- package/dist/tools/perp-tools.js.map +1 -1
- package/dist/tools/premium-tools.d.ts.map +1 -1
- package/dist/tools/premium-tools.js +8 -2
- package/dist/tools/premium-tools.js.map +1 -1
- package/dist/tools/profile-tools.d.ts.map +1 -1
- package/dist/tools/profile-tools.js +18 -1
- package/dist/tools/profile-tools.js.map +1 -1
- package/dist/tools/quick-context-tool.d.ts.map +1 -1
- package/dist/tools/quick-context-tool.js +101 -9
- package/dist/tools/quick-context-tool.js.map +1 -1
- package/dist/tools/register-tools.d.ts.map +1 -1
- package/dist/tools/register-tools.js +3 -0
- package/dist/tools/register-tools.js.map +1 -1
- package/dist/tools/sap-sdk-tools.d.ts.map +1 -1
- package/dist/tools/sap-sdk-tools.js +14 -13
- package/dist/tools/sap-sdk-tools.js.map +1 -1
- package/dist/tools/session-context-packet.d.ts +19 -0
- package/dist/tools/session-context-packet.d.ts.map +1 -0
- package/dist/tools/session-context-packet.js +256 -0
- package/dist/tools/session-context-packet.js.map +1 -0
- package/dist/tools/skills-tools.d.ts +10 -0
- package/dist/tools/skills-tools.d.ts.map +1 -1
- package/dist/tools/skills-tools.js +19 -0
- package/dist/tools/skills-tools.js.map +1 -1
- package/dist/tools/transaction-tools.d.ts +1 -0
- package/dist/tools/transaction-tools.d.ts.map +1 -1
- package/dist/tools/transaction-tools.js +248 -9
- package/dist/tools/transaction-tools.js.map +1 -1
- package/dist/tools/x402-paid-call-tool.d.ts.map +1 -1
- package/dist/tools/x402-paid-call-tool.js +55 -21
- package/dist/tools/x402-paid-call-tool.js.map +1 -1
- package/dist/wizard-core/desktop-flow.d.ts.map +1 -1
- package/dist/wizard-core/desktop-flow.js +4 -2
- package/dist/wizard-core/desktop-flow.js.map +1 -1
- package/docs/06_PAYMENTS_X402_AND_PAYSH.md +38 -13
- package/docs/07_ENDPOINTS_AND_CLIENTS.md +1 -1
- package/docs/09_TOOLS_SKILLS_AND_AGENT_GUIDE.md +14 -6
- package/docs/13_BOUNTY_PROGRAM_PROPOSAL.md +1 -1
- package/docs/14_DESKTOP_WIZARD_RELEASE.md +3 -3
- package/docs/15_DASHBOARD_SCREENSHARE_SCRIPT.md +1 -1
- package/docs/BRANCH_AND_CI.md +2 -2
- package/docs/README.md +1 -1
- package/package.json +3 -1
- package/server.json +3 -3
- package/skills/README.md +3 -3
- package/skills/sap-agent-registry/SKILL.md +2 -2
- package/skills/sap-agentkit/SKILL.md +10 -4
- package/skills/sap-defi/SKILL.md +42 -5
- package/skills/sap-discovery-indexing/SKILL.md +4 -3
- package/skills/sap-market-data/SKILL.md +9 -5
- package/skills/sap-mcp/SKILL.md +37 -24
- package/skills/sap-mcp/TOOL_REFERENCE.md +9 -8
- package/skills/sap-operations/SKILL.md +5 -4
- package/skills/sap-payments-x402/SKILL.md +34 -19
- package/assets/logos/drift.svg +0 -12
package/.env.example
CHANGED
|
@@ -100,6 +100,16 @@ SAP_MCP_REMOTE_KEEP_ALIVE_TIMEOUT_MS=75000
|
|
|
100
100
|
# 0 means unlimited requests per socket.
|
|
101
101
|
SAP_MCP_REMOTE_MAX_REQUESTS_PER_SOCKET=0
|
|
102
102
|
|
|
103
|
+
# =============================================================================
|
|
104
|
+
# Hosted Provider Keys (server-side only)
|
|
105
|
+
# =============================================================================
|
|
106
|
+
# Used only by the hosted SAP MCP gateway when serving protocol tools to users.
|
|
107
|
+
# Never put provider keys in agent runtime configs, public metadata, or MCP snippets.
|
|
108
|
+
SAP_MCP_JUPITER_API_BASE_URL=https://api.jup.ag
|
|
109
|
+
# SAP_MCP_JUPITER_TOKENS_API_BASE_URL=https://api.jup.ag
|
|
110
|
+
# SAP_MCP_JUPITER_API_KEY=your-jupiter-api-key
|
|
111
|
+
SAP_MCP_JUPITER_TIMEOUT_MS=30000
|
|
112
|
+
|
|
103
113
|
# =============================================================================
|
|
104
114
|
# Remote MCP Access Control
|
|
105
115
|
# =============================================================================
|
|
@@ -179,15 +189,19 @@ SAP_MCP_FACILITATOR_NETWORKS=devnet
|
|
|
179
189
|
# SAP_MCP_FACILITATOR_RPC_FALLBACK_URLS=https://api.devnet.solana.com
|
|
180
190
|
# SAP_MCP_FACILITATOR_AUTH_TOKEN=
|
|
181
191
|
|
|
182
|
-
#
|
|
183
|
-
# Free:
|
|
184
|
-
#
|
|
185
|
-
#
|
|
186
|
-
#
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
192
|
+
# Hosted pricing:
|
|
193
|
+
# Free: MCP handshake, schemas, bootstrap, repair/status, cost estimation,
|
|
194
|
+
# local payment bridge control, memory/audit, transaction preview/finalize helpers.
|
|
195
|
+
# Micro read: fresh exact data such as agent/profile reads, compact directory pages,
|
|
196
|
+
# balance checks, SNS availability, single-asset prices, and lightweight trader context.
|
|
197
|
+
# Read premium: broad discovery, enriched holdings/DAS, token lists, quotes/routes, history.
|
|
198
|
+
# Builder: unsigned transaction builders and complex pre-execution preparation.
|
|
199
|
+
# Value action: fixed fee for value-linked hosted operations; heavy paths use a lower heavy fixed fee.
|
|
200
|
+
SAP_MCP_PRICE_MICRO_READ_USD=0.001
|
|
201
|
+
SAP_MCP_PRICE_READ_PREMIUM_USD=0.002
|
|
202
|
+
SAP_MCP_PRICE_BUILDER_USD=0.006
|
|
203
|
+
SAP_MCP_PRICE_VALUE_FIXED_USD=0.06
|
|
204
|
+
SAP_MCP_PRICE_HEAVY_VALUE_USD=0.035
|
|
191
205
|
SAP_MCP_PRICE_VALUE_BPS=0
|
|
192
206
|
SAP_MCP_PRICE_MIN_USD=0.001
|
|
193
207
|
SAP_MCP_PRICE_MAX_USD=100
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,127 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project are documented in this file.
|
|
4
4
|
|
|
5
|
+
## 0.9.36 - 2026-07-27
|
|
6
|
+
|
|
7
|
+
### Changed — Agent Readiness And Runtime Repair
|
|
8
|
+
|
|
9
|
+
- Made wallet/payment readiness genuinely free for hosted agents: native SOL
|
|
10
|
+
balance, SPL token accounts/balances, x402 balance, MagicBlock balance, and
|
|
11
|
+
single-asset price snapshots no longer require x402. Agents can now check
|
|
12
|
+
whether the owner must top up SOL or USDC before spending.
|
|
13
|
+
- Kept broad discovery, enriched indexes, quotes, historical market data, and
|
|
14
|
+
value-moving builders monetized so hosted SAP MCP remains usable as a paid
|
|
15
|
+
gateway without blocking basic wallet health checks.
|
|
16
|
+
- Hardened Hermes repair against dirty mixed configs: the repair flow removes
|
|
17
|
+
only legacy SAP/SAP payments entries from nested `mcpServers` maps, preserves
|
|
18
|
+
unrelated third-party MCP servers, and rewrites canonical flat Hermes entries.
|
|
19
|
+
- Added profile hygiene diagnostics for active profile, missing wallet files,
|
|
20
|
+
public mainnet RPC usage, and plaintext dedicated wallet risk.
|
|
21
|
+
- Added a repair-time profile summary so users can see local profile issues
|
|
22
|
+
immediately after running the wizard or `sap-mcp-config repair`.
|
|
23
|
+
- Added local JSONL audit logging for successful local x402 bridge calls at
|
|
24
|
+
`~/.config/mcp-sap/sap-payments-audit.jsonl`.
|
|
25
|
+
- Updated SAP MCP startup guidance, payment docs, and skills so agents call free
|
|
26
|
+
readiness tools directly and reserve `sap_payments_call_paid_tool` for hosted
|
|
27
|
+
paid tools.
|
|
28
|
+
|
|
29
|
+
## 0.9.35 - 2026-07-26
|
|
30
|
+
|
|
31
|
+
### Changed — Protocol Safety And Perps Readiness
|
|
32
|
+
|
|
33
|
+
- Removed the disabled perp protocol family from the public SAP MCP surface while
|
|
34
|
+
it is under active exploit review. Public docs, skills, landing-page copy,
|
|
35
|
+
logo carousels, and dynamic AgentKit registration now exclude those tools.
|
|
36
|
+
- Replaced incomplete Adrena transaction builders with `sap_perp_trade_plan`,
|
|
37
|
+
a free trader-grade planning tool that returns notional sizing, liquidation
|
|
38
|
+
estimate, stop risk, reward/risk, risk flags, and the exact read tools an
|
|
39
|
+
agent should call before any external perps execution route.
|
|
40
|
+
- Kept perps analytics free and fast: markets, positions, funding, OHLC,
|
|
41
|
+
long-term charts, volume profile, liquidation zones, and trade planning.
|
|
42
|
+
- Moved local memory and strategy stores onto the canonical SAP MCP profile
|
|
43
|
+
directory: `~/.config/mcp-sap/`.
|
|
44
|
+
- Updated release metadata, hosted server card, desktop wizard references, and
|
|
45
|
+
npm/client snippets to `0.9.35`.
|
|
46
|
+
|
|
47
|
+
### Added — Local Agent Memory Subsystem (SQLite FTS5)
|
|
48
|
+
|
|
49
|
+
### Added — Local Agent Memory Subsystem (SQLite FTS5)
|
|
50
|
+
|
|
51
|
+
A complete serverless local-memory subsystem built on SQLite FTS5, using
|
|
52
|
+
inverted full-text indexes and relevance-ranked retrieval to recover historical
|
|
53
|
+
agent interactions. All data is stored locally at
|
|
54
|
+
`~/.config/mcp-sap/memory/agent-memory.db` — no data leaves the user's machine.
|
|
55
|
+
|
|
56
|
+
**10 module files:**
|
|
57
|
+
- `src/memory/types.ts` — 11 TypeScript interfaces with strict typing
|
|
58
|
+
- `src/memory/database.ts` — Singleton SQLite connection (WAL mode, FTS5, schema versioning, prepared statements, graceful degradation)
|
|
59
|
+
- `src/memory/tool-call-store.ts` — Records + FTS5 search with BM25 ranking
|
|
60
|
+
- `src/memory/memory-store.ts` — Agent memories with relevance decay + recall
|
|
61
|
+
- `src/memory/stream-buffer-store.ts` — FIFO event buffering with dedup + replay
|
|
62
|
+
- `src/memory/async-processor.ts` — Non-blocking background maintenance (decay, evict, archive, prune, WAL checkpoint)
|
|
63
|
+
- `src/memory/auto-record.ts` — Automatic tool call recording hook
|
|
64
|
+
- `src/memory/hermes-bridge.ts` — Cross-session Hermes Agent integration (read-only)
|
|
65
|
+
- `src/memory/utils.ts` — truncate, decayRelevance, isExpired
|
|
66
|
+
- `src/strategies/strategy-store.ts` — File-based JSON strategy store with versioning + path traversal protection
|
|
67
|
+
|
|
68
|
+
**17 FREE MCP memory tools (tool surface now 327 total after risk-policy removals, all local, no x402):**
|
|
69
|
+
|
|
70
|
+
| Category | Tool | Function |
|
|
71
|
+
|---|---|---|
|
|
72
|
+
| Memory | `sap_memory_record` | Record a tool call in the DB |
|
|
73
|
+
| | `sap_memory_search` | FTS5 search across tool call history |
|
|
74
|
+
| | `sap_memory_summarize` | Create an LLM-compressed memory (lesson/pattern/failure/success) |
|
|
75
|
+
| | `sap_memory_recall` | Top N memories for a category (prompt injection) |
|
|
76
|
+
| | `sap_memory_prune` | Remove expired + low-relevance memories |
|
|
77
|
+
| Strategy | `sap_strategy_save` | Save/update a strategy JSON |
|
|
78
|
+
| | `sap_strategy_load` | Load a strategy by category+name |
|
|
79
|
+
| | `sap_strategy_list` | List strategies (filterable) |
|
|
80
|
+
| | `sap_strategy_activate` | Activate/deactivate a strategy |
|
|
81
|
+
| Stream | `sap_stream_buffer` | Buffer a stream event (dedup by eventId) |
|
|
82
|
+
| | `sap_stream_consume` | Consume events FIFO (mark consumed) |
|
|
83
|
+
| | `sap_stream_replay` | Replay all events for backtest |
|
|
84
|
+
| Audit | `sap_audit_query` | Query audit trail via FTS5 |
|
|
85
|
+
| | `sap_audit_record` | Record a manual audit entry |
|
|
86
|
+
| | `sap_audit_stats` | Aggregate stats (counts, breakdowns, DB size) |
|
|
87
|
+
| Hermes | `sap_hermes_search` | Search Hermes session history |
|
|
88
|
+
| | `sap_hermes_recent` | Recent Hermes sessions for context injection |
|
|
89
|
+
|
|
90
|
+
**Key engineering features:**
|
|
91
|
+
- SQLite FTS5 with BM25 relevance ranking
|
|
92
|
+
- WAL mode for concurrent read access (crash-safe)
|
|
93
|
+
- Thread-safe singleton with cached prepared statements
|
|
94
|
+
- Graceful degradation (if DB can't open, tools return empty results)
|
|
95
|
+
- Async processor: decay (1h), evict (5m), archive (1h), prune (6h), WAL checkpoint (10m)
|
|
96
|
+
- Relevance decay: 1%/day, auto-prune below 0.05
|
|
97
|
+
- Stream dedup: (streamType, eventId) unique index
|
|
98
|
+
- Strategy versioning: auto-increment on update
|
|
99
|
+
- Path traversal protection: sanitized path segments (alphanumeric + dash/underscore/dot only)
|
|
100
|
+
- Hermes bridge: auto-detected, read-only, FTS5 with LIKE fallback
|
|
101
|
+
- Server lifecycle: init+start on boot, stop+close on shutdown
|
|
102
|
+
|
|
103
|
+
### Added — Quick Context Auto-Update
|
|
104
|
+
|
|
105
|
+
`sap_quick_context` now accepts `agentKnownVersion`:
|
|
106
|
+
- When omitted (first bootstrap): `skillsUpdateRequired=true`, `skillsContents` populated with full SKILL.md inline
|
|
107
|
+
- When ≠ server version: `skillsUpdateRequired=true`, skills contents included
|
|
108
|
+
- When == server version: `skillsUpdateRequired=false` (token savings)
|
|
109
|
+
|
|
110
|
+
Also returns `serverCommit` (git short hash), `environment` (network, mode, authType, rateLimitPerMinute), and `recommendedFlow` (mode-specific workflow guidance).
|
|
111
|
+
|
|
112
|
+
### Added — Wizard Directory Creation
|
|
113
|
+
|
|
114
|
+
`ensureConfigDirectories()` now creates `~/.config/mcp-sap/memory/` and `~/.config/mcp-sap/strategies/` with private permissions (mode 0o700) alongside the existing config, keypair, data, log, and cache directories.
|
|
115
|
+
|
|
116
|
+
### Security
|
|
117
|
+
|
|
118
|
+
- Path traversal protection on all strategy store operations (`sanitizePathSegment`)
|
|
119
|
+
- All SQL queries use parameterized prepared statements (no string interpolation)
|
|
120
|
+
- Hermes bridge opens read-only connections only
|
|
121
|
+
- Memory database is local-only — no network access
|
|
122
|
+
- No secrets, private keys, or keypair bytes stored in the memory DB
|
|
123
|
+
- 0 dependency vulnerabilities (`pnpm audit`)
|
|
124
|
+
- `createRequire` used instead of `require()` to satisfy ESLint
|
|
125
|
+
|
|
5
126
|
## 0.9.22 - 2026-07-25
|
|
6
127
|
|
|
7
128
|
### Added
|
|
@@ -178,7 +299,7 @@ All notable changes to this project are documented in this file.
|
|
|
178
299
|
|
|
179
300
|
### Added
|
|
180
301
|
|
|
181
|
-
- Added
|
|
302
|
+
- Added MCP tools for perpetual futures market analytics and chart analysis:
|
|
182
303
|
- `sap_perp_markets` — List Adrena perp markets with mark price, funding, OI.
|
|
183
304
|
- `sap_perp_position_info` — Read on-chain Adrena perp positions for a wallet.
|
|
184
305
|
- `sap_perp_funding_history` — Historical funding rates from Adrena API.
|
|
@@ -186,11 +307,8 @@ All notable changes to this project are documented in this file.
|
|
|
186
307
|
- `sap_chart_long_term` — Long-term price history + protocol TVL (DexScreener + DeFiLlama).
|
|
187
308
|
- `sap_chart_volume_profile` — Volume profile analysis with POC, VAH, VAL.
|
|
188
309
|
- `sap_perp_liquidation_zones` — Compute liquidation zones for open positions.
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
- `sap_perp_build_modify` — Build unsigned tx to add/remove collateral.
|
|
192
|
-
- All 10 tools use only free APIs (DexScreener, DeFiLlama, Adrena REST, Solana RPC).
|
|
193
|
-
- Inscribed tools (`sap_perp_build_*`) return unsigned transactions for local agent signing.
|
|
310
|
+
- Execution builders were later removed from the public surface until IDL-backed, locally finalizable
|
|
311
|
+
perps transactions can meet the SAP MCP signing and safety bar.
|
|
194
312
|
|
|
195
313
|
### Removed
|
|
196
314
|
|
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ User-facing setup docs live in [`USER_DOCS/`](USER_DOCS/00_START_HERE.md). Opera
|
|
|
15
15
|
|
|
16
16
|
| Area | Current behavior |
|
|
17
17
|
| --- | --- |
|
|
18
|
-
| Package version | `0.9.
|
|
18
|
+
| Package version | `0.9.36` |
|
|
19
19
|
| MCP transport | stdio locally, Streamable HTTP remotely |
|
|
20
20
|
| Remote access | Bearerless public mode for hosted agents; API key or JWT for private modes |
|
|
21
21
|
| Config directory | `~/.config/mcp-sap` only |
|
|
@@ -134,7 +134,7 @@ For paid/write hosted tools, add the local non-custodial payment bridge as well:
|
|
|
134
134
|
```toml
|
|
135
135
|
[mcp_servers.sap_payments]
|
|
136
136
|
command = "npx"
|
|
137
|
-
args = ["--yes", "--package", "@oobe-protocol-labs/sap-mcp-server@0.9.
|
|
137
|
+
args = ["--yes", "--package", "@oobe-protocol-labs/sap-mcp-server@0.9.36", "sap-mcp-server"]
|
|
138
138
|
startup_timeout_sec = 300
|
|
139
139
|
tool_timeout_sec = 300
|
|
140
140
|
|
|
@@ -152,7 +152,7 @@ Codex supports Streamable HTTP MCP servers with URL-based entries in `config.tom
|
|
|
152
152
|
```toml
|
|
153
153
|
[mcp_servers.sap]
|
|
154
154
|
command = "npx"
|
|
155
|
-
args = ["--yes", "--package", "@oobe-protocol-labs/sap-mcp-server@0.9.
|
|
155
|
+
args = ["--yes", "--package", "@oobe-protocol-labs/sap-mcp-server@0.9.36", "sap-mcp-server"]
|
|
156
156
|
|
|
157
157
|
[mcp_servers.sap.env]
|
|
158
158
|
SAP_MCP_ALLOW_ENV_CONFIG_OVERRIDE = "false"
|
|
@@ -213,10 +213,11 @@ Initial model:
|
|
|
213
213
|
|
|
214
214
|
| Tier | Examples | Price |
|
|
215
215
|
| --- | --- | --- |
|
|
216
|
-
| Free | `tools/list`, `prompts/list`, `resources/list`,
|
|
217
|
-
|
|
|
218
|
-
|
|
|
219
|
-
|
|
|
216
|
+
| Free | `tools/list`, `prompts/list`, `resources/list`, bootstrap/status/repair, cost estimation, local payment bridge control, SOL/SPL/x402 balance readiness, single-asset price snapshots, memory/audit, transaction preview/finalize helpers | Free |
|
|
217
|
+
| Micro read | exact agent/profile reads, compact directory pages, SNS availability, escrow state, lightweight trader context | `$0.001` |
|
|
218
|
+
| Premium read | broad discovery, enriched holdings/DAS, token lists, quotes/routes, history/OHLCV, analytics, larger pages | `$0.002` |
|
|
219
|
+
| Builder or batch | complex builders, SNS/domain batch checks, unsigned transaction builders, routing preparation | `$0.006`, batch = sum of paid calls |
|
|
220
|
+
| Value action | selected value-linked operations | fixed `$0.06` standard, `$0.035` selected heavy paths, plus optional bps |
|
|
220
221
|
|
|
221
222
|
Enable x402:
|
|
222
223
|
|
|
@@ -71,7 +71,14 @@ npm exec --yes --package @oobe-protocol-labs/sap-mcp-server -- sap-mcp-config re
|
|
|
71
71
|
9. For registrations, check `success`, `agentRegistered`, `agentPda`, `protocolFee`, and `protocolComplete`. Local registration does not pay a hosted x402 fee. `success: true` means the agent account exists and the source-level protocol fee invariant was verified. If `success: false` with `agentRegistered: true`, the account may exist but SAP registration is not protocol-complete.
|
|
72
72
|
10. Use `sap_payments_finalize_transaction` when a paid hosted builder returns an unsigned transaction to preview, sign locally, and optionally submit already-signed bytes through the hosted OOBE relay.
|
|
73
73
|
11. Use `sap_agent_runtime_status` when asking an agent whether SAP MCP is connected or ready for paid/write work. It returns the hosted/local bridge routing truth without reading local files.
|
|
74
|
-
12. Use `
|
|
74
|
+
12. Use `sap_prepare_action` before swaps, registry writes, identity updates, Escrow V2, external x402 calls, premium streams, or transaction finalization. It returns fresh-data requirements, the correct hosted/local route, confirmation policy, retry rules, and proof-tape fields without charging x402.
|
|
75
|
+
13. Use `sap_pricing_catalog` or `https://mcp.sap.oobeprotocol.ai/pricing.json` to inspect generated hosted pricing tiers. The x402 challenge returned by a paid tool remains the final payment source of truth.
|
|
76
|
+
|
|
77
|
+
Session memory is for operational context and audit: active profile name after
|
|
78
|
+
readiness, public wallet keys, runtime namespace availability, x402 receipts,
|
|
79
|
+
submitted signatures, final statuses, and error classifications. Do not use
|
|
80
|
+
memory as cached truth for balances, token prices, Jupiter quotes/orders,
|
|
81
|
+
blockhashes, simulations, liquidity/routes, SNS ownership, or SAP account state.
|
|
75
82
|
|
|
76
83
|
Agent identity, profile images, Metaplex bridging, SNS linking, capabilities,
|
|
77
84
|
pricing, and update fields are documented in:
|
|
@@ -87,6 +94,7 @@ server exposes these free maintenance tools:
|
|
|
87
94
|
| --- | --- |
|
|
88
95
|
| `sap_agent_start` | Load the canonical startup playbook. |
|
|
89
96
|
| `sap_agent_runtime_status` | Free runtime truth table for hosted connection, local `sap_payments` readiness expectations, write routing, forbidden actions, and next tool calls. |
|
|
97
|
+
| `sap_prepare_action` | Free intent-level planner for paid calls, writes, swaps, escrow, external x402, premium streams, confirmation policy, retry rules, and proof-tape shape. |
|
|
90
98
|
| `sap_pricing_catalog` | Free machine-readable pricing catalog generated from the hosted pricing registry. Also available at `/pricing.json`. |
|
|
91
99
|
| `sap_protocol_invariants` | Return the canonical SAP program id, protocol treasury, registration fee, hosted/local routing rules, and forbidden actions. |
|
|
92
100
|
| `sap_agent_identity_plan` | Free planner for SAP registration, image/profile updates, Metaplex identity, SNS linking, and verification. |
|
|
@@ -29,7 +29,7 @@ Public `server.json` shape:
|
|
|
29
29
|
"name": "sap-mcp-server",
|
|
30
30
|
"title": "SAP MCP Server | OOBE Protocol",
|
|
31
31
|
"description": "Hosted Solana-native MCP gateway for Synapse Agent Protocol tools, x402/pay.sh monetization, SNS identity, and agent operations.",
|
|
32
|
-
"version": "0.9.
|
|
32
|
+
"version": "0.9.36",
|
|
33
33
|
"status": "online",
|
|
34
34
|
"protocol": {
|
|
35
35
|
"primary": "mcp",
|
|
@@ -123,7 +123,7 @@ MCP paid-tool helper. It signs the external provider's 402 challenge locally,
|
|
|
123
123
|
retries the same HTTP request, and returns the provider response plus the x402
|
|
124
124
|
receipt. It is for generic HTTP x402 endpoints, not hosted SAP MCP tool names.
|
|
125
125
|
|
|
126
|
-
Basic wallet
|
|
126
|
+
Basic wallet and price-readiness checks are free hosted reads. Call `sol_get_balance`, `spl-token_getBalance`, `spl-token_getTokenAccounts`, `sap_x402_get_balance`, `magicblock_balance`, `jupiter_getPrice`, `pyth_getPrice`, or `coingecko_getTokenPrice` directly on hosted SAP MCP when you need fresh payment readiness data. They should not be routed through the local payment bridge unless your runtime is explicitly resolving an x402 challenge.
|
|
127
127
|
|
|
128
128
|
If hosted SAP MCP returns `hosted_local_signer_required`, no x402 payment was
|
|
129
129
|
charged. The requested tool requires a user-owned Solana signature or is not
|
|
@@ -45,7 +45,7 @@ url = "https://mcp.sap.oobeprotocol.ai/mcp"
|
|
|
45
45
|
|
|
46
46
|
[mcp_servers.sap_payments]
|
|
47
47
|
command = "npx.cmd"
|
|
48
|
-
args = ["--yes", "--package", "@oobe-protocol-labs/sap-mcp-server@0.9.
|
|
48
|
+
args = ["--yes", "--package", "@oobe-protocol-labs/sap-mcp-server@0.9.36", "sap-mcp-server"]
|
|
49
49
|
startup_timeout_sec = 300
|
|
50
50
|
tool_timeout_sec = 300
|
|
51
51
|
|
|
@@ -65,7 +65,7 @@ the complete local stdio SAP MCP process instead of using the hosted endpoint, u
|
|
|
65
65
|
```toml
|
|
66
66
|
[mcp_servers.sap]
|
|
67
67
|
command = "npx.cmd"
|
|
68
|
-
args = ["--yes", "--package", "@oobe-protocol-labs/sap-mcp-server@0.9.
|
|
68
|
+
args = ["--yes", "--package", "@oobe-protocol-labs/sap-mcp-server@0.9.36", "sap-mcp-server"]
|
|
69
69
|
|
|
70
70
|
[mcp_servers.sap.env]
|
|
71
71
|
SAP_MCP_ALLOW_ENV_CONFIG_OVERRIDE = "false"
|
|
@@ -201,7 +201,7 @@ For Claude Code, use the official MCP CLI pattern:
|
|
|
201
201
|
|
|
202
202
|
```bash
|
|
203
203
|
claude mcp add --transport http sap https://mcp.sap.oobeprotocol.ai/mcp
|
|
204
|
-
claude mcp add --transport stdio sap_payments -- npx --yes --package @oobe-protocol-labs/sap-mcp-server@0.9.
|
|
204
|
+
claude mcp add --transport stdio sap_payments -- npx --yes --package @oobe-protocol-labs/sap-mcp-server@0.9.36 sap-mcp-server
|
|
205
205
|
```
|
|
206
206
|
|
|
207
207
|
Set `SAP_MCP_PAYMENTS_BRIDGE_ONLY=true` and `SAP_ALLOWED_TOOLS=all` in the
|
|
@@ -106,7 +106,7 @@ url = "https://mcp.sap.oobeprotocol.ai/mcp"
|
|
|
106
106
|
|
|
107
107
|
[mcp_servers.sap_payments]
|
|
108
108
|
command = "npx"
|
|
109
|
-
args = ["--yes", "--package", "@oobe-protocol-labs/sap-mcp-server@0.9.
|
|
109
|
+
args = ["--yes", "--package", "@oobe-protocol-labs/sap-mcp-server@0.9.36", "sap-mcp-server"]
|
|
110
110
|
startup_timeout_sec = 300
|
|
111
111
|
tool_timeout_sec = 300
|
|
112
112
|
|
|
@@ -138,7 +138,7 @@ Claude Desktop uses a root `mcpServers` JSON object:
|
|
|
138
138
|
},
|
|
139
139
|
"sap_payments": {
|
|
140
140
|
"command": "npx",
|
|
141
|
-
"args": ["--yes", "--package", "@oobe-protocol-labs/sap-mcp-server@0.9.
|
|
141
|
+
"args": ["--yes", "--package", "@oobe-protocol-labs/sap-mcp-server@0.9.36", "sap-mcp-server"],
|
|
142
142
|
"env": {
|
|
143
143
|
"SAP_MCP_ALLOW_ENV_CONFIG_OVERRIDE": "false",
|
|
144
144
|
"SAP_MCP_PAYMENTS_BRIDGE_ONLY": "true",
|
|
@@ -170,7 +170,7 @@ Hermes global `mcp.json` uses flat server entries:
|
|
|
170
170
|
},
|
|
171
171
|
"sap_payments": {
|
|
172
172
|
"command": "npx",
|
|
173
|
-
"args": ["--yes", "--package", "@oobe-protocol-labs/sap-mcp-server@0.9.
|
|
173
|
+
"args": ["--yes", "--package", "@oobe-protocol-labs/sap-mcp-server@0.9.36", "sap-mcp-server"],
|
|
174
174
|
"env": {
|
|
175
175
|
"SAP_MCP_ALLOW_ENV_CONFIG_OVERRIDE": "false",
|
|
176
176
|
"SAP_MCP_PAYMENTS_BRIDGE_ONLY": "true",
|
|
@@ -193,7 +193,7 @@ mcp_servers:
|
|
|
193
193
|
args:
|
|
194
194
|
- "--yes"
|
|
195
195
|
- "--package"
|
|
196
|
-
- "@oobe-protocol-labs/sap-mcp-server@0.9.
|
|
196
|
+
- "@oobe-protocol-labs/sap-mcp-server@0.9.36"
|
|
197
197
|
- "sap-mcp-server"
|
|
198
198
|
env:
|
|
199
199
|
SAP_MCP_ALLOW_ENV_CONFIG_OVERRIDE: "false"
|
|
@@ -215,7 +215,7 @@ OpenClaw MCP JSON uses the same root `mcpServers` structure as generic MCP clien
|
|
|
215
215
|
},
|
|
216
216
|
"sap_payments": {
|
|
217
217
|
"command": "npx",
|
|
218
|
-
"args": ["--yes", "--package", "@oobe-protocol-labs/sap-mcp-server@0.9.
|
|
218
|
+
"args": ["--yes", "--package", "@oobe-protocol-labs/sap-mcp-server@0.9.36", "sap-mcp-server"],
|
|
219
219
|
"env": {
|
|
220
220
|
"SAP_MCP_ALLOW_ENV_CONFIG_OVERRIDE": "false",
|
|
221
221
|
"SAP_MCP_PAYMENTS_BRIDGE_ONLY": "true",
|
package/config.example.json
CHANGED
|
@@ -53,10 +53,11 @@
|
|
|
53
53
|
"maxTimeoutSeconds": 120,
|
|
54
54
|
"payShCheckoutUrl": "https://pay.sh/checkout/YOUR_CHECKOUT_ID",
|
|
55
55
|
"prices": {
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
56
|
+
"microReadUsd": 0.001,
|
|
57
|
+
"readPremiumUsd": 0.002,
|
|
58
|
+
"builderUsd": 0.006,
|
|
59
|
+
"valueFixedUsd": 0.06,
|
|
60
|
+
"heavyValueUsd": 0.035,
|
|
60
61
|
"valueBps": 0,
|
|
61
62
|
"minUsd": 0.001,
|
|
62
63
|
"maxUsd": 100
|
package/dist/config/env.d.ts
CHANGED
|
@@ -47,6 +47,10 @@ export declare const envSchema: z.ZodObject<{
|
|
|
47
47
|
SAP_CACHE_TTL_SECONDS: z.ZodDefault<z.ZodNumber>;
|
|
48
48
|
SAP_ENABLE_RATE_LIMIT: z.ZodDefault<z.ZodEffects<z.ZodBoolean, boolean, unknown>>;
|
|
49
49
|
SAP_RATE_LIMIT_PER_MINUTE: z.ZodDefault<z.ZodNumber>;
|
|
50
|
+
SAP_MCP_JUPITER_API_BASE_URL: z.ZodDefault<z.ZodString>;
|
|
51
|
+
SAP_MCP_JUPITER_TOKENS_API_BASE_URL: z.ZodOptional<z.ZodString>;
|
|
52
|
+
SAP_MCP_JUPITER_API_KEY: z.ZodOptional<z.ZodString>;
|
|
53
|
+
SAP_MCP_JUPITER_TIMEOUT_MS: z.ZodDefault<z.ZodNumber>;
|
|
50
54
|
SAP_MCP_MONETIZATION_ENABLED: z.ZodDefault<z.ZodEffects<z.ZodBoolean, boolean, unknown>>;
|
|
51
55
|
SAP_MCP_MONETIZATION_PROVIDER: z.ZodDefault<z.ZodEnum<["x402", "pay-sh"]>>;
|
|
52
56
|
SAP_MCP_MONETIZATION_PAY_TO: z.ZodOptional<z.ZodString>;
|
|
@@ -56,6 +60,7 @@ export declare const envSchema: z.ZodObject<{
|
|
|
56
60
|
SAP_MCP_X402_MAX_TIMEOUT_SECONDS: z.ZodDefault<z.ZodNumber>;
|
|
57
61
|
SAP_MCP_PAY_SH_CHECKOUT_URL: z.ZodOptional<z.ZodString>;
|
|
58
62
|
SAP_MCP_MONETIZATION_STRICT_TOOLS: z.ZodDefault<z.ZodEffects<z.ZodBoolean, boolean, unknown>>;
|
|
63
|
+
SAP_MCP_PRICE_MICRO_READ_USD: z.ZodDefault<z.ZodNumber>;
|
|
59
64
|
SAP_MCP_PRICE_READ_PREMIUM_USD: z.ZodDefault<z.ZodNumber>;
|
|
60
65
|
SAP_MCP_PRICE_BUILDER_USD: z.ZodDefault<z.ZodNumber>;
|
|
61
66
|
SAP_MCP_PRICE_VALUE_FIXED_USD: z.ZodDefault<z.ZodNumber>;
|
|
@@ -87,10 +92,13 @@ export declare const envSchema: z.ZodObject<{
|
|
|
87
92
|
SAP_CACHE_TTL_SECONDS: number;
|
|
88
93
|
SAP_ENABLE_RATE_LIMIT: boolean;
|
|
89
94
|
SAP_RATE_LIMIT_PER_MINUTE: number;
|
|
95
|
+
SAP_MCP_JUPITER_API_BASE_URL: string;
|
|
96
|
+
SAP_MCP_JUPITER_TIMEOUT_MS: number;
|
|
90
97
|
SAP_MCP_MONETIZATION_ENABLED: boolean;
|
|
91
98
|
SAP_MCP_MONETIZATION_PROVIDER: "x402" | "pay-sh";
|
|
92
99
|
SAP_MCP_X402_MAX_TIMEOUT_SECONDS: number;
|
|
93
100
|
SAP_MCP_MONETIZATION_STRICT_TOOLS: boolean;
|
|
101
|
+
SAP_MCP_PRICE_MICRO_READ_USD: number;
|
|
94
102
|
SAP_MCP_PRICE_READ_PREMIUM_USD: number;
|
|
95
103
|
SAP_MCP_PRICE_BUILDER_USD: number;
|
|
96
104
|
SAP_MCP_PRICE_VALUE_FIXED_USD: number;
|
|
@@ -109,6 +117,8 @@ export declare const envSchema: z.ZodObject<{
|
|
|
109
117
|
SAP_HTTP_CORS_ORIGINS?: string | undefined;
|
|
110
118
|
SAP_ALLOWED_TOOLS?: string | undefined;
|
|
111
119
|
SAP_LOG_FILE?: string | undefined;
|
|
120
|
+
SAP_MCP_JUPITER_TOKENS_API_BASE_URL?: string | undefined;
|
|
121
|
+
SAP_MCP_JUPITER_API_KEY?: string | undefined;
|
|
112
122
|
SAP_MCP_MONETIZATION_PAY_TO?: string | undefined;
|
|
113
123
|
SAP_MCP_MONETIZATION_NETWORK?: string | undefined;
|
|
114
124
|
SAP_MCP_X402_FACILITATOR_URL?: string | undefined;
|
|
@@ -149,6 +159,10 @@ export declare const envSchema: z.ZodObject<{
|
|
|
149
159
|
SAP_CACHE_TTL_SECONDS?: number | undefined;
|
|
150
160
|
SAP_ENABLE_RATE_LIMIT?: unknown;
|
|
151
161
|
SAP_RATE_LIMIT_PER_MINUTE?: number | undefined;
|
|
162
|
+
SAP_MCP_JUPITER_API_BASE_URL?: string | undefined;
|
|
163
|
+
SAP_MCP_JUPITER_TOKENS_API_BASE_URL?: string | undefined;
|
|
164
|
+
SAP_MCP_JUPITER_API_KEY?: string | undefined;
|
|
165
|
+
SAP_MCP_JUPITER_TIMEOUT_MS?: number | undefined;
|
|
152
166
|
SAP_MCP_MONETIZATION_ENABLED?: unknown;
|
|
153
167
|
SAP_MCP_MONETIZATION_PROVIDER?: "x402" | "pay-sh" | undefined;
|
|
154
168
|
SAP_MCP_MONETIZATION_PAY_TO?: string | undefined;
|
|
@@ -158,6 +172,7 @@ export declare const envSchema: z.ZodObject<{
|
|
|
158
172
|
SAP_MCP_X402_MAX_TIMEOUT_SECONDS?: number | undefined;
|
|
159
173
|
SAP_MCP_PAY_SH_CHECKOUT_URL?: string | undefined;
|
|
160
174
|
SAP_MCP_MONETIZATION_STRICT_TOOLS?: unknown;
|
|
175
|
+
SAP_MCP_PRICE_MICRO_READ_USD?: number | undefined;
|
|
161
176
|
SAP_MCP_PRICE_READ_PREMIUM_USD?: number | undefined;
|
|
162
177
|
SAP_MCP_PRICE_BUILDER_USD?: number | undefined;
|
|
163
178
|
SAP_MCP_PRICE_VALUE_FIXED_USD?: number | undefined;
|
|
@@ -205,6 +220,12 @@ export interface SapMcpConfig {
|
|
|
205
220
|
cacheTtlSeconds: number;
|
|
206
221
|
enableRateLimit: boolean;
|
|
207
222
|
rateLimitPerMinute: number;
|
|
223
|
+
jupiter: {
|
|
224
|
+
apiBaseUrl: string;
|
|
225
|
+
tokensApiBaseUrl?: string;
|
|
226
|
+
apiKeyConfigured: boolean;
|
|
227
|
+
timeoutMs: number;
|
|
228
|
+
};
|
|
208
229
|
bento?: {
|
|
209
230
|
enabled: boolean;
|
|
210
231
|
apiKey?: string;
|
|
@@ -242,6 +263,7 @@ export interface SapMcpMonetizationConfig {
|
|
|
242
263
|
payShCheckoutUrl?: string;
|
|
243
264
|
strictTools: boolean;
|
|
244
265
|
prices: {
|
|
266
|
+
microReadUsd: number;
|
|
245
267
|
readPremiumUsd: number;
|
|
246
268
|
builderUsd: number;
|
|
247
269
|
valueFixedUsd: number;
|
package/dist/config/env.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/config/env.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAyDxB;;GAEG;AACH,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/config/env.ts"],"names":[],"mappings":"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"}
|
package/dist/config/env.js
CHANGED
|
@@ -102,6 +102,12 @@ export const envSchema = z.object({
|
|
|
102
102
|
SAP_CACHE_TTL_SECONDS: z.coerce.number().positive().default(300),
|
|
103
103
|
SAP_ENABLE_RATE_LIMIT: booleanEnvSchema.default(true),
|
|
104
104
|
SAP_RATE_LIMIT_PER_MINUTE: z.coerce.number().positive().default(60),
|
|
105
|
+
// Hosted gateway provider keys. These are server-side only and must never be
|
|
106
|
+
// written into client MCP configs, public metadata, or tool responses.
|
|
107
|
+
SAP_MCP_JUPITER_API_BASE_URL: z.string().url().default('https://api.jup.ag'),
|
|
108
|
+
SAP_MCP_JUPITER_TOKENS_API_BASE_URL: z.string().url().optional(),
|
|
109
|
+
SAP_MCP_JUPITER_API_KEY: z.string().optional(),
|
|
110
|
+
SAP_MCP_JUPITER_TIMEOUT_MS: z.coerce.number().positive().default(30000),
|
|
105
111
|
// Remote MCP monetization. Applies only when explicitly enabled by hosted HTTP deployments.
|
|
106
112
|
SAP_MCP_MONETIZATION_ENABLED: booleanEnvSchema.default(false),
|
|
107
113
|
SAP_MCP_MONETIZATION_PROVIDER: monetizationProviderSchema.default('x402'),
|
|
@@ -112,10 +118,11 @@ export const envSchema = z.object({
|
|
|
112
118
|
SAP_MCP_X402_MAX_TIMEOUT_SECONDS: z.coerce.number().positive().default(120),
|
|
113
119
|
SAP_MCP_PAY_SH_CHECKOUT_URL: z.string().url().optional(),
|
|
114
120
|
SAP_MCP_MONETIZATION_STRICT_TOOLS: booleanEnvSchema.default(false),
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
121
|
+
SAP_MCP_PRICE_MICRO_READ_USD: z.coerce.number().positive().default(0.001),
|
|
122
|
+
SAP_MCP_PRICE_READ_PREMIUM_USD: z.coerce.number().positive().default(0.002),
|
|
123
|
+
SAP_MCP_PRICE_BUILDER_USD: z.coerce.number().positive().default(0.006),
|
|
124
|
+
SAP_MCP_PRICE_VALUE_FIXED_USD: z.coerce.number().nonnegative().default(0.06),
|
|
125
|
+
SAP_MCP_PRICE_HEAVY_VALUE_USD: z.coerce.number().nonnegative().default(0.035),
|
|
119
126
|
SAP_MCP_PRICE_VALUE_BPS: z.coerce.number().nonnegative().default(0),
|
|
120
127
|
SAP_MCP_PRICE_MIN_USD: z.coerce.number().nonnegative().default(0.001),
|
|
121
128
|
SAP_MCP_PRICE_MAX_USD: z.coerce.number().positive().default(100),
|
|
@@ -385,6 +392,9 @@ function normalizeFileConfig(config) {
|
|
|
385
392
|
envNormalized.SAP_MCP_PAY_SH_CHECKOUT_URL = monetization.payShCheckoutUrl;
|
|
386
393
|
}
|
|
387
394
|
const prices = isRecord(monetization.prices) ? monetization.prices : {};
|
|
395
|
+
if (normalized.SAP_MCP_PRICE_MICRO_READ_USD === undefined && prices.microReadUsd !== undefined) {
|
|
396
|
+
envNormalized.SAP_MCP_PRICE_MICRO_READ_USD = prices.microReadUsd;
|
|
397
|
+
}
|
|
388
398
|
if (normalized.SAP_MCP_PRICE_READ_PREMIUM_USD === undefined && prices.readPremiumUsd !== undefined) {
|
|
389
399
|
envNormalized.SAP_MCP_PRICE_READ_PREMIUM_USD = prices.readPremiumUsd;
|
|
390
400
|
}
|
|
@@ -439,10 +449,11 @@ function getDefaultEnvConfig() {
|
|
|
439
449
|
SAP_MCP_MONETIZATION_ENABLED: false,
|
|
440
450
|
SAP_MCP_MONETIZATION_PROVIDER: 'x402',
|
|
441
451
|
SAP_MCP_X402_MAX_TIMEOUT_SECONDS: 120,
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
452
|
+
SAP_MCP_PRICE_MICRO_READ_USD: 0.001,
|
|
453
|
+
SAP_MCP_PRICE_READ_PREMIUM_USD: 0.002,
|
|
454
|
+
SAP_MCP_PRICE_BUILDER_USD: 0.006,
|
|
455
|
+
SAP_MCP_PRICE_VALUE_FIXED_USD: 0.06,
|
|
456
|
+
SAP_MCP_PRICE_HEAVY_VALUE_USD: 0.035,
|
|
446
457
|
SAP_MCP_PRICE_VALUE_BPS: 0,
|
|
447
458
|
SAP_MCP_PRICE_MIN_USD: 0.001,
|
|
448
459
|
SAP_MCP_PRICE_MAX_USD: 100,
|
|
@@ -499,6 +510,12 @@ function transformToRuntimeConfig(env, fileConfig = {}) {
|
|
|
499
510
|
cacheTtlSeconds: env.SAP_CACHE_TTL_SECONDS,
|
|
500
511
|
enableRateLimit: env.SAP_ENABLE_RATE_LIMIT,
|
|
501
512
|
rateLimitPerMinute: env.SAP_RATE_LIMIT_PER_MINUTE,
|
|
513
|
+
jupiter: {
|
|
514
|
+
apiBaseUrl: env.SAP_MCP_JUPITER_API_BASE_URL,
|
|
515
|
+
tokensApiBaseUrl: env.SAP_MCP_JUPITER_TOKENS_API_BASE_URL,
|
|
516
|
+
apiKeyConfigured: Boolean(env.SAP_MCP_JUPITER_API_KEY?.trim()),
|
|
517
|
+
timeoutMs: env.SAP_MCP_JUPITER_TIMEOUT_MS,
|
|
518
|
+
},
|
|
502
519
|
bento: {
|
|
503
520
|
enabled: effectiveBentoEnabled,
|
|
504
521
|
apiKey: process.env.SAP_MCP_BENTO_API_KEY || asOptionalString(bentoConfig.apiKey),
|
|
@@ -526,6 +543,7 @@ function transformToRuntimeConfig(env, fileConfig = {}) {
|
|
|
526
543
|
strictTools: asOptionalBoolean(monetizationConfig.strictTools)
|
|
527
544
|
?? env.SAP_MCP_MONETIZATION_STRICT_TOOLS,
|
|
528
545
|
prices: {
|
|
546
|
+
microReadUsd: asOptionalNumber(monetizationPrices.microReadUsd) ?? env.SAP_MCP_PRICE_MICRO_READ_USD,
|
|
529
547
|
readPremiumUsd: asOptionalNumber(monetizationPrices.readPremiumUsd) ?? env.SAP_MCP_PRICE_READ_PREMIUM_USD,
|
|
530
548
|
builderUsd: asOptionalNumber(monetizationPrices.builderUsd) ?? env.SAP_MCP_PRICE_BUILDER_USD,
|
|
531
549
|
valueFixedUsd: asOptionalNumber(monetizationPrices.valueFixedUsd) ?? env.SAP_MCP_PRICE_VALUE_FIXED_USD,
|