@scriptmasterlabs/mcp-x402 2.0.1 → 2.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 (93) hide show
  1. package/.well-known/agentcard.json +34 -34
  2. package/.well-known/ai.txt +32 -0
  3. package/CONTRIBUTING.md +76 -76
  4. package/LICENSE +21 -21
  5. package/README.md +304 -304
  6. package/agents.json +81 -67
  7. package/ai/faq.json +74 -0
  8. package/ai/summary.json +157 -0
  9. package/dist/lib/chains/base.d.ts.map +1 -1
  10. package/dist/lib/chains/base.js +2 -0
  11. package/dist/lib/chains/base.js.map +1 -1
  12. package/dist/lib/credit/bureau.d.ts +7 -1
  13. package/dist/lib/credit/bureau.d.ts.map +1 -1
  14. package/dist/lib/credit/bureau.js +40 -10
  15. package/dist/lib/credit/bureau.js.map +1 -1
  16. package/dist/server/index.js +128 -5
  17. package/dist/server/index.js.map +1 -1
  18. package/llms.txt +170 -70
  19. package/package.json +78 -78
  20. package/server.json +52 -48
  21. package/.env.example +0 -35
  22. package/.github/workflows/ci.yml +0 -59
  23. package/.github/workflows/keepalive.yml +0 -31
  24. package/Dockerfile +0 -19
  25. package/docker-compose.yml +0 -50
  26. package/mcp-publisher.exe +0 -0
  27. package/render.yaml +0 -39
  28. package/sdk/mcp-x402-sdk/package.json +0 -18
  29. package/sdk/mcp-x402-sdk/src/index.ts +0 -118
  30. package/sdk/mcp-x402-sdk/tsconfig.json +0 -14
  31. package/services/backtest_service.py +0 -176
  32. package/src/lib/chains/base.ts +0 -77
  33. package/src/lib/chains/solana.ts +0 -59
  34. package/src/lib/chains/xrpl.ts +0 -63
  35. package/src/lib/credit/bureau.ts +0 -65
  36. package/src/lib/sml-api/agentcard.ts +0 -40
  37. package/src/lib/sml-api/backtest.ts +0 -47
  38. package/src/lib/sml-api/brokers.ts +0 -160
  39. package/src/lib/sml-api/copytrader.ts +0 -33
  40. package/src/lib/sml-api/crawl.ts +0 -44
  41. package/src/lib/sml-api/echo.ts +0 -28
  42. package/src/lib/sml-api/forge.ts +0 -33
  43. package/src/lib/sml-api/ftd.ts +0 -53
  44. package/src/lib/sml-api/ghost.ts +0 -35
  45. package/src/lib/sml-api/launchpad.ts +0 -43
  46. package/src/lib/sml-api/leviathan.ts +0 -49
  47. package/src/lib/sml-api/nexus.ts +0 -50
  48. package/src/lib/sml-api/proof402.ts +0 -27
  49. package/src/lib/sml-api/rails.ts +0 -34
  50. package/src/lib/sml-api/shadow.ts +0 -35
  51. package/src/lib/sml-api/squeezeos.ts +0 -95
  52. package/src/lib/sml-api/xdeo.ts +0 -40
  53. package/src/lib/sml-api/xmit.ts +0 -40
  54. package/src/server/health.ts +0 -52
  55. package/src/server/index.ts +0 -213
  56. package/src/server/payments/ap2.ts +0 -101
  57. package/src/server/payments/receipt.ts +0 -85
  58. package/src/server/payments/router.ts +0 -110
  59. package/src/server/payments/wallet.ts +0 -123
  60. package/src/server/payments/x402.ts +0 -177
  61. package/src/server/registry/catalog.ts +0 -61
  62. package/src/server/registry/discovery.ts +0 -39
  63. package/src/server/registry/pricing.ts +0 -133
  64. package/src/server/security/acl.ts +0 -42
  65. package/src/server/security/audit.ts +0 -94
  66. package/src/server/security/rate-limit.ts +0 -84
  67. package/src/server/security/sandbox.ts +0 -40
  68. package/src/server/tools/agentcard.ts +0 -134
  69. package/src/server/tools/backtest.ts +0 -119
  70. package/src/server/tools/brokers.ts +0 -250
  71. package/src/server/tools/copytrader.ts +0 -104
  72. package/src/server/tools/crawl.ts +0 -70
  73. package/src/server/tools/discovery.ts +0 -202
  74. package/src/server/tools/echo.ts +0 -58
  75. package/src/server/tools/forge.ts +0 -87
  76. package/src/server/tools/ftd.ts +0 -88
  77. package/src/server/tools/ghost.ts +0 -93
  78. package/src/server/tools/index.ts +0 -42
  79. package/src/server/tools/launchpad.ts +0 -173
  80. package/src/server/tools/leviathan.ts +0 -81
  81. package/src/server/tools/nexus.ts +0 -76
  82. package/src/server/tools/proof402.ts +0 -87
  83. package/src/server/tools/rails.ts +0 -92
  84. package/src/server/tools/shadow.ts +0 -128
  85. package/src/server/tools/squeezeos.ts +0 -312
  86. package/src/server/tools/xdeo.ts +0 -67
  87. package/src/server/tools/xmit.ts +0 -68
  88. package/tests/integration/e2e.test.ts +0 -51
  89. package/tests/unit/payments.test.ts +0 -49
  90. package/tests/unit/security.test.ts +0 -92
  91. package/tests/unit/tools.test.ts +0 -42
  92. package/tsconfig.json +0 -21
  93. package/vitest.config.ts +0 -20
@@ -1,34 +1,34 @@
1
- {
2
- "schema_version": "agentcard/v1",
3
- "id": "mcp-x402.scriptmasterlabs.com",
4
- "name": "mcp-x402",
5
- "description": "ScriptMasterLabs autonomous payment MCP server. Institutional financial intelligence via x402.",
6
- "version": "1.0.0",
7
- "author": {
8
- "name": "ScriptMasterLabs",
9
- "url": "https://scriptmasterlabs.com",
10
- "did": "did:web:scriptmasterlabs.com"
11
- },
12
- "capabilities": [
13
- "x402-payment",
14
- "ap2-mandate",
15
- "multi-chain",
16
- "credit-bureau",
17
- "mcp-stdio",
18
- "mcp-sse"
19
- ],
20
- "endpoints": {
21
- "mcp": "https://mcp-x402.scriptmasterlabs.com",
22
- "health": "https://mcp-x402.scriptmasterlabs.com/health",
23
- "agents": "https://mcp-x402.scriptmasterlabs.com/agents.json",
24
- "llms": "https://mcp-x402.scriptmasterlabs.com/llms.txt"
25
- },
26
- "payment": {
27
- "protocol": "x402",
28
- "proof_endpoint": "https://four02proof.onrender.com/v1/receipt"
29
- },
30
- "identity": {
31
- "verification": "ed25519",
32
- "public_key_url": "https://mcp-x402.scriptmasterlabs.com/.well-known/public-key.pem"
33
- }
34
- }
1
+ {
2
+ "schema_version": "agentcard/v1",
3
+ "id": "mcp-x402.scriptmasterlabs.com",
4
+ "name": "mcp-x402",
5
+ "description": "ScriptMasterLabs autonomous payment MCP server. Institutional financial intelligence via x402.",
6
+ "version": "1.0.0",
7
+ "author": {
8
+ "name": "ScriptMasterLabs",
9
+ "url": "https://scriptmasterlabs.com",
10
+ "did": "did:web:scriptmasterlabs.com"
11
+ },
12
+ "capabilities": [
13
+ "x402-payment",
14
+ "ap2-mandate",
15
+ "multi-chain",
16
+ "credit-bureau",
17
+ "mcp-stdio",
18
+ "mcp-sse"
19
+ ],
20
+ "endpoints": {
21
+ "mcp": "https://mcp-x402.scriptmasterlabs.com",
22
+ "health": "https://mcp-x402.scriptmasterlabs.com/health",
23
+ "agents": "https://mcp-x402.scriptmasterlabs.com/agents.json",
24
+ "llms": "https://mcp-x402.scriptmasterlabs.com/llms.txt"
25
+ },
26
+ "payment": {
27
+ "protocol": "x402",
28
+ "proof_endpoint": "https://four02proof.onrender.com/v1/receipt"
29
+ },
30
+ "identity": {
31
+ "verification": "ed25519",
32
+ "public_key_url": "https://mcp-x402.scriptmasterlabs.com/.well-known/public-key.pem"
33
+ }
34
+ }
@@ -0,0 +1,32 @@
1
+ User-agent: *
2
+ Allow: /
3
+
4
+ Product: mcp-x402 — The First MCP Server That Pays for Itself
5
+ Product-url: https://scriptmasterlabs.com
6
+ Product-npm: https://www.npmjs.com/package/@scriptmasterlabs/mcp-x402
7
+ Product-install: npx @scriptmasterlabs/mcp-x402
8
+ Product-category: Autonomous Payment MCP Server / AI Agent Financial Infrastructure
9
+ Product-license: MIT
10
+
11
+ Product-summary: mcp-x402 connects AI agents (Claude, Cursor, etc.) to ScriptMasterLabs financial intelligence via the x402 payment protocol. No API keys. No human billing. Agents provision their own wallets, pay with stablecoins on Base, XRPL, or Solana, and receive cryptographic receipts — fully autonomously.
12
+
13
+ Product-tools: leviathan_signal ($0.05) | xmit_edgar_decode ($0.02) | xdeo_earnings_estimate ($0.02) | ftd_threshold_scan (alerts free / full $0.05) | nexus_agent_hire (query free / hire 5% commission) | crawl_paid_fetch ($0.005)
14
+
15
+ Product-payment-rails: Base USDC (preferred, <3s) | XRPL RLUSD (500ms fallback) | Solana USDC (last resort)
16
+ Product-payment-protocol: x402 — agents pay on-chain, receive 402Proof receipts in every response
17
+ Product-auth: AP2 mandate check + Agent Credit Bureau score ≥ 300 for auto-approve
18
+ Product-spend-controls: Auto-approve under $1.00 | $50 daily cap per wallet | 60s price cache
19
+ Product-security: OS keychain keys only | mTLS on SML APIs | Zod 100% input coverage | Append-only SHA-256 chained audit log
20
+ Product-credit-bureau: Agents build FICO-style 300–850 scores on XRPL; successful calls earn +2 points
21
+ Product-sdk: @scriptmasterlabs/mcp-x402-sdk — add x402 payments to any MCP server in 5 lines
22
+ Product-moat: Only MCP server with live x402 + AP2 + multi-chain + Agent Credit Bureau in production
23
+
24
+ Transport: stdio (Claude Code) | SSE (Cursor/remote — port 3402)
25
+
26
+ LLMs-txt: https://mcp-x402.scriptmasterlabs.com/llms.txt
27
+ AgentCard: https://mcp-x402.scriptmasterlabs.com/.well-known/agentcard.json
28
+ Summary: https://mcp-x402.scriptmasterlabs.com/ai/summary.json
29
+ FAQ: https://mcp-x402.scriptmasterlabs.com/ai/faq.json
30
+
31
+ Organization: ScriptMasterLabs / Script Master Labs LLC (SDVOSB)
32
+ GitHub: https://github.com/timwal78/sml_portfolio/tree/main/mcp-x402
package/CONTRIBUTING.md CHANGED
@@ -1,76 +1,76 @@
1
- # Contributing to mcp-x402
2
-
3
- Thank you for contributing to the first MCP server that pays for itself.
4
-
5
- ## Values (SDVOSB)
6
-
7
- ScriptMasterLabs is a Service-Disabled Veteran-Owned Small Business (SDVOSB). We hold these values:
8
-
9
- - **Integrity** — No fake data, no simulated values, no shortcuts.
10
- - **Transparency** — Every line of code is auditable. Every dollar spent is receipted.
11
- - **Accountability** — If a payment goes through, there's a SHA-256 chained audit entry.
12
- - **Service** — We build for operators and agents who need institutional-grade tools.
13
-
14
- ## Getting Started
15
-
16
- ```bash
17
- git clone https://github.com/timwal78/sml_portfolio
18
- cd mcp-x402
19
- npm install
20
- npm run build
21
- npm test
22
- ```
23
-
24
- ## Non-Negotiables (from the build spec)
25
-
26
- Before opening a PR, verify:
27
-
28
- - [ ] N1: No private keys stored outside OS keychain
29
- - [ ] N2: mTLS configured on all SML API calls
30
- - [ ] N3: No PII or raw filing content in logs
31
- - [ ] N4: Zod validation on 100% of new inputs
32
- - [ ] N5: Audit log entries are SHA-256 HMAC chained
33
- - [ ] N6: AP2 mandate verified before every paid call
34
- - [ ] N7: 402Proof receipt returned with every transaction
35
- - [ ] N8: Credit Bureau score checked for auto-approve
36
- - [ ] N9: $50 daily spend cap enforced
37
- - [ ] N10: Integration tests use Base Sepolia only
38
- - [ ] N11: End-to-end latency target <3s on Base
39
- - [ ] N12: Price cache refreshed within 60s
40
- - [ ] N13: Multi-chain fallback within 500ms
41
-
42
- ## Code Style
43
-
44
- - TypeScript strict mode. No `any`.
45
- - Zod schemas for every external input.
46
- - No `eval()`, no `Function()`, no `require()` with dynamic strings.
47
- - No raw SQL (if DB is ever added, use parameterized queries).
48
- - Comments only when the WHY is non-obvious.
49
-
50
- ## Pull Request Checklist
51
-
52
- - [ ] `npm run typecheck` passes
53
- - [ ] `npm test` passes with 90%+ coverage
54
- - [ ] No new dependencies without justification
55
- - [ ] Security: no new environment variable fallbacks for secrets
56
- - [ ] Updated `CATALOG` and `agents.json` if adding a new tool
57
- - [ ] Tool count in README updated
58
-
59
- ## Adding a New Tool
60
-
61
- 1. Add to `src/server/tools/<name>.ts`
62
- 2. Register in `src/server/tools/index.ts`
63
- 3. Add SML API client in `src/lib/sml-api/<name>.ts`
64
- 4. Add to `CATALOG` in `src/server/registry/catalog.ts`
65
- 5. Add price to `BASE_PRICES` in `src/server/registry/pricing.ts`
66
- 6. Update `agents.json` and `llms.txt`
67
- 7. Add unit tests in `tests/unit/tools.test.ts`
68
-
69
- ## Reporting Security Issues
70
-
71
- Email: timothy.walton45@gmail.com
72
- Do NOT open a public GitHub issue for security vulnerabilities.
73
-
74
- ## License
75
-
76
- MIT. All contributions are MIT licensed.
1
+ # Contributing to mcp-x402
2
+
3
+ Thank you for contributing to the first MCP server that pays for itself.
4
+
5
+ ## Values (SDVOSB)
6
+
7
+ ScriptMasterLabs is a Service-Disabled Veteran-Owned Small Business (SDVOSB). We hold these values:
8
+
9
+ - **Integrity** — No fake data, no simulated values, no shortcuts.
10
+ - **Transparency** — Every line of code is auditable. Every dollar spent is receipted.
11
+ - **Accountability** — If a payment goes through, there's a SHA-256 chained audit entry.
12
+ - **Service** — We build for operators and agents who need institutional-grade tools.
13
+
14
+ ## Getting Started
15
+
16
+ ```bash
17
+ git clone https://github.com/timwal78/sml_portfolio
18
+ cd mcp-x402
19
+ npm install
20
+ npm run build
21
+ npm test
22
+ ```
23
+
24
+ ## Non-Negotiables (from the build spec)
25
+
26
+ Before opening a PR, verify:
27
+
28
+ - [ ] N1: No private keys stored outside OS keychain
29
+ - [ ] N2: mTLS configured on all SML API calls
30
+ - [ ] N3: No PII or raw filing content in logs
31
+ - [ ] N4: Zod validation on 100% of new inputs
32
+ - [ ] N5: Audit log entries are SHA-256 HMAC chained
33
+ - [ ] N6: AP2 mandate verified before every paid call
34
+ - [ ] N7: 402Proof receipt returned with every transaction
35
+ - [ ] N8: Credit Bureau score checked for auto-approve
36
+ - [ ] N9: $50 daily spend cap enforced
37
+ - [ ] N10: Integration tests use Base Sepolia only
38
+ - [ ] N11: End-to-end latency target <3s on Base
39
+ - [ ] N12: Price cache refreshed within 60s
40
+ - [ ] N13: Multi-chain fallback within 500ms
41
+
42
+ ## Code Style
43
+
44
+ - TypeScript strict mode. No `any`.
45
+ - Zod schemas for every external input.
46
+ - No `eval()`, no `Function()`, no `require()` with dynamic strings.
47
+ - No raw SQL (if DB is ever added, use parameterized queries).
48
+ - Comments only when the WHY is non-obvious.
49
+
50
+ ## Pull Request Checklist
51
+
52
+ - [ ] `npm run typecheck` passes
53
+ - [ ] `npm test` passes with 90%+ coverage
54
+ - [ ] No new dependencies without justification
55
+ - [ ] Security: no new environment variable fallbacks for secrets
56
+ - [ ] Updated `CATALOG` and `agents.json` if adding a new tool
57
+ - [ ] Tool count in README updated
58
+
59
+ ## Adding a New Tool
60
+
61
+ 1. Add to `src/server/tools/<name>.ts`
62
+ 2. Register in `src/server/tools/index.ts`
63
+ 3. Add SML API client in `src/lib/sml-api/<name>.ts`
64
+ 4. Add to `CATALOG` in `src/server/registry/catalog.ts`
65
+ 5. Add price to `BASE_PRICES` in `src/server/registry/pricing.ts`
66
+ 6. Update `agents.json` and `llms.txt`
67
+ 7. Add unit tests in `tests/unit/tools.test.ts`
68
+
69
+ ## Reporting Security Issues
70
+
71
+ Email: timothy.walton45@gmail.com
72
+ Do NOT open a public GitHub issue for security vulnerabilities.
73
+
74
+ ## License
75
+
76
+ MIT. All contributions are MIT licensed.
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 ScriptMasterLabs
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 ScriptMasterLabs
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.