helius-mcp 0.5.2 → 1.0.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 (67) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/LICENSE +1 -1
  3. package/README.md +97 -21
  4. package/dist/http.d.ts +1 -0
  5. package/dist/http.js +2 -0
  6. package/dist/index.js +79 -2
  7. package/dist/scripts/validate-catalog.d.ts +13 -0
  8. package/dist/scripts/validate-catalog.js +76 -0
  9. package/dist/tools/accounts.js +114 -204
  10. package/dist/tools/assets.js +109 -123
  11. package/dist/tools/auth.d.ts +2 -0
  12. package/dist/tools/auth.js +447 -0
  13. package/dist/tools/balance.js +28 -32
  14. package/dist/tools/blocks.js +68 -87
  15. package/dist/tools/config.js +18 -79
  16. package/dist/tools/das-extras.js +56 -41
  17. package/dist/tools/docs.js +13 -67
  18. package/dist/tools/enhanced-websockets.js +104 -74
  19. package/dist/tools/fees.js +42 -61
  20. package/dist/tools/guides.js +126 -515
  21. package/dist/tools/index.js +11 -3
  22. package/dist/tools/laserstream.js +107 -53
  23. package/dist/tools/network.js +47 -69
  24. package/dist/tools/plans.d.ts +21 -0
  25. package/dist/tools/plans.js +105 -246
  26. package/dist/tools/product-catalog.d.ts +10 -0
  27. package/dist/tools/product-catalog.js +123 -0
  28. package/dist/tools/recommend.d.ts +4 -0
  29. package/dist/tools/recommend.js +233 -0
  30. package/dist/tools/shared.js +8 -3
  31. package/dist/tools/solana-knowledge.d.ts +2 -0
  32. package/dist/tools/solana-knowledge.js +544 -0
  33. package/dist/tools/tokens.js +17 -18
  34. package/dist/tools/transactions.js +232 -302
  35. package/dist/tools/transfers.d.ts +2 -0
  36. package/dist/tools/transfers.js +270 -0
  37. package/dist/tools/wallet.js +175 -177
  38. package/dist/tools/webhooks.js +80 -82
  39. package/dist/types/transaction-types.d.ts +1 -1
  40. package/dist/types/transaction-types.js +2 -1
  41. package/dist/utils/config.d.ts +27 -0
  42. package/dist/utils/config.js +76 -0
  43. package/dist/utils/docs.d.ts +24 -0
  44. package/dist/utils/docs.js +76 -0
  45. package/dist/utils/errors.d.ts +32 -0
  46. package/dist/utils/errors.js +137 -0
  47. package/dist/utils/feedback.d.ts +14 -0
  48. package/dist/utils/feedback.js +25 -0
  49. package/dist/utils/formatters.d.ts +0 -1
  50. package/dist/utils/formatters.js +0 -3
  51. package/dist/utils/helius.d.ts +15 -5
  52. package/dist/utils/helius.js +52 -45
  53. package/dist/version.d.ts +1 -0
  54. package/dist/version.js +1 -0
  55. package/package.json +17 -7
  56. package/system-prompts/helius/claude.system.md +170 -0
  57. package/system-prompts/helius/full.md +2868 -0
  58. package/system-prompts/helius/openai.developer.md +170 -0
  59. package/system-prompts/helius-dflow/claude.system.md +290 -0
  60. package/system-prompts/helius-dflow/full.md +3647 -0
  61. package/system-prompts/helius-dflow/openai.developer.md +290 -0
  62. package/system-prompts/helius-phantom/claude.system.md +348 -0
  63. package/system-prompts/helius-phantom/full.md +5472 -0
  64. package/system-prompts/helius-phantom/openai.developer.md +348 -0
  65. package/system-prompts/svm/claude.system.md +174 -0
  66. package/system-prompts/svm/full.md +699 -0
  67. package/system-prompts/svm/openai.developer.md +174 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,52 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
9
+
10
+ ## helius-mcp@1.0.0 - 2026-03-03
11
+
12
+ ### Merged
13
+
14
+ - feat: Cross-platform skill portability for non-Claude developers [`#42`](https://github.com/helius-labs/core-ai/pull/42)
15
+ - feat(MCP): Improve Testing Suite [`#41`](https://github.com/helius-labs/core-ai/pull/41)
16
+ - feat(MCP): Add Changelog [`#43`](https://github.com/helius-labs/core-ai/pull/43)
17
+ - feat(MCP): Prep For 1.0.0 Release [`#40`](https://github.com/helius-labs/core-ai/pull/40)
18
+ - release: helius-cli@1.1.0 [`#39`](https://github.com/helius-labs/core-ai/pull/39)
19
+ - feat(docs): Better `README.md` Files [`#38`](https://github.com/helius-labs/core-ai/pull/38)
20
+ - feat(mcp): add transferSol and transferToken tools [`#35`](https://github.com/helius-labs/core-ai/pull/35)
21
+ - Add Helius x Phantom frontend skill [`#33`](https://github.com/helius-labs/core-ai/pull/33)
22
+ - Standardize MCP Zod parameter descriptions [`#36`](https://github.com/helius-labs/core-ai/pull/36)
23
+ - feat(mcp): reduce token usage across MCP server and SKILL.md [`#34`](https://github.com/helius-labs/core-ai/pull/34)
24
+ - feat(skill): Add SVM Skill [`#37`](https://github.com/helius-labs/core-ai/pull/37)
25
+ - Fix MCP tool selection ambiguity with BEST FOR/PREFER routing [`#32`](https://github.com/helius-labs/core-ai/pull/32)
26
+ - Replace hardcoded billing data with live doc fetches [`#31`](https://github.com/helius-labs/core-ai/pull/31)
27
+ - feat(mcp + cli): Add Solana Knowledge Tools [`#30`](https://github.com/helius-labs/core-ai/pull/30)
28
+ - fix(cli): Improve Signup UX [`#29`](https://github.com/helius-labs/core-ai/pull/29)
29
+ - feat(skill): Add Helius x DFlow Skill [`#27`](https://github.com/helius-labs/core-ai/pull/27)
30
+ - Remove vestigial projectType from recommendStack [`#28`](https://github.com/helius-labs/core-ai/pull/28)
31
+ - Add recommendStack MCP tool for architecture recommendations [`#25`](https://github.com/helius-labs/core-ai/pull/25)
32
+ - feat(docs) Add README [`#11`](https://github.com/helius-labs/core-ai/pull/11)
33
+ - feat(plugin): Add Helius Plugin For Claude Code [`#26`](https://github.com/helius-labs/core-ai/pull/26)
34
+ - chore(GitHub): Add `.claude` to `.gitignore` [`#24`](https://github.com/helius-labs/core-ai/pull/24)
35
+ - feat(mcp): Improve Onboarding [`#23`](https://github.com/helius-labs/core-ai/pull/23)
36
+ - Improve MCP tool routing [`#22`](https://github.com/helius-labs/core-ai/pull/22)
37
+ - feat(skills): Add Helius Skill [`#20`](https://github.com/helius-labs/core-ai/pull/20)
38
+ - feat(cli): Better Errors [`#16`](https://github.com/helius-labs/core-ai/pull/16)
39
+ - feat(mcp): Add Credit Cost Annotations [`#18`](https://github.com/helius-labs/core-ai/pull/18)
40
+ - feat(mcp): Make All Data-bearing Guide Tools Fetch Directly From the Docs [`#19`](https://github.com/helius-labs/core-ai/pull/19)
41
+ - feat(mcp): Add `getAccountStatus` Tool [`#17`](https://github.com/helius-labs/core-ai/pull/17)
42
+ - fix: pass customer info through upgradePlan and CLI upgrade [`#15`](https://github.com/helius-labs/core-ai/pull/15)
43
+ - feat(cli): Format Snake Case Enums Into Title Case [`#14`](https://github.com/helius-labs/core-ai/pull/14)
44
+ - feat(cli): Explicitly Set Project ID on CLI Creation [`#13`](https://github.com/helius-labs/core-ai/pull/13)
45
+ - feat: OpenPay integration for CLI and MCP server [`#10`](https://github.com/helius-labs/core-ai/pull/10)
46
+ - feat/agent-signup [`#9`](https://github.com/helius-labs/core-ai/pull/9)
47
+ - Add docs integration and cleanup [`#6`](https://github.com/helius-labs/core-ai/pull/6)
48
+ - fix: migrate to use sdk [`#8`](https://github.com/helius-labs/core-ai/pull/8)
49
+ - feat/claude.md and helius-sdk for cli [`#7`](https://github.com/helius-labs/core-ai/pull/7)
50
+ - feat: add error handling [`#4`](https://github.com/helius-labs/core-ai/pull/4)
51
+ - fix: repair updateWebhook and deleteWebhook MCP tools [`#2`](https://github.com/helius-labs/core-ai/pull/2)
52
+ - feat: upgrade helius-mcp data tools with rich formatting and new capa… [`#1`](https://github.com/helius-labs/core-ai/pull/1)
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2024 Helius Labs
3
+ Copyright (c) 2026 Helius Labs
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -1,56 +1,132 @@
1
1
  # Helius MCP Server
2
2
 
3
- MCP server for Helius - Solana blockchain data access for Claude.
3
+ MCP server for Helius Solana blockchain data access for AI assistants, provided by Solana's fastest, most reliable infrastructure provider
4
4
 
5
- ## Setup
5
+ See the [CHANGELOG](https://github.com/helius-labs/core-ai/blob/main/helius-mcp/CHANGELOG.md) for version history and release notes.
6
+
7
+ Interested in contributing? Read the [contribution guide](https://github.com/helius-labs/core-ai/blob/main/helius-mcp/CONTRIBUTING.md) before opening a PR.
8
+
9
+ ## Quick Start
10
+
11
+ ### 1. Add the MCP server
12
+
13
+ Add to your MCP host's config (works with Claude, Cursor, Windsurf, and any MCP-compatible client):
14
+
15
+ ```json
16
+ {
17
+ "mcpServers": {
18
+ "helius": {
19
+ "command": "npx",
20
+ "args": ["helius-mcp@latest"]
21
+ }
22
+ }
23
+ }
24
+ ```
25
+
26
+ Or if you're using Claude Code:
6
27
 
7
28
  ```bash
8
29
  claude mcp add helius npx helius-mcp@latest
9
30
  ```
10
31
 
11
- Set your API key:
32
+ ### 2. Configure your API key
33
+
34
+ **If you already have a Helius API key:**
35
+
12
36
  ```bash
13
37
  export HELIUS_API_KEY=your-api-key
14
38
  ```
15
39
 
16
- ## Tools (48)
40
+ Or set it from your AI assistant by calling the `setHeliusApiKey` tool.
41
+
42
+ **If you need a new account:**
43
+
44
+ The MCP includes a fully autonomous signup flow — no browser needed:
45
+
46
+ 1. Call the `generateKeypair` tool — it creates a Solana wallet and returns the address
47
+ 2. Fund the wallet with **~0.001 SOL** (transaction fees) + **1 USDC** (basic plan costs $1)
48
+ 3. Call `checkSignupBalance` to verify funds arrived
49
+ 4. Call `agenticSignup` to create your account — API key is configured automatically
17
50
 
18
- **Config (2):** setHeliusApiKey, getHeliusApiKeyStatus
51
+ > **Paid plans (developer/business/professional):** `agenticSignup` and `upgradePlan` require `email`, `firstName`, and `lastName`. Basic plan does not.
52
+
53
+ Or do the same from the terminal:
54
+
55
+ ```bash
56
+ npx helius-cli@latest keygen # Generate keypair
57
+ # Fund the wallet address shown above with ~0.001 SOL + 1 USDC
58
+ npx helius-cli@latest signup # Verify balance + create account
59
+ ```
19
60
 
20
- **DAS API (12):** getAsset, getAssetBatch, getAssetsByOwner, getAssetsByGroup, getAssetsByCreator, getAssetsByAuthority, searchAssets, getAssetProof, getAssetProofBatch, getSignaturesForAsset, getNftEditions, getTokenAccounts
61
+ ### 3. Start using tools
21
62
 
22
- **RPC (7):** getBalance, getTokenBalances, getAccountInfo, getProgramAccounts, getNetworkStatus, getBlock, getTokenHolders
63
+ Ask questions in plain English the right tool is selected automatically:
64
+
65
+ - "What NFTs does this wallet own?"
66
+ - "Parse this transaction: 5abc..."
67
+ - "Get the balance of Gh9ZwEm..."
68
+ - "Create a webhook for \<address\>"
69
+
70
+ ## Tools
71
+
72
+ **Onboarding (6):** getStarted, setHeliusApiKey, generateKeypair, checkSignupBalance, agenticSignup, getAccountStatus
73
+
74
+ **DAS API (9):** getAsset (single + batch), getAssetsByOwner, getAssetsByGroup, searchAssets (routes getAssetsByCreator / getAssetsByAuthority), getAssetProof, getAssetProofBatch, getSignaturesForAsset, getNftEditions, getTokenAccounts
75
+
76
+ **RPC (5):** getBalance, getTokenBalances, getAccountInfo (single + batch), getNetworkStatus, getBlock
23
77
 
24
78
  **Transactions (2):** parseTransactions, getTransactionHistory
25
79
 
80
+ **Transfers (2):** transferSol, transferToken
81
+
26
82
  **Priority Fees (1):** getPriorityFeeEstimate
27
83
 
84
+ **Tokens (2):** getTokenHolders, getProgramAccounts
85
+
28
86
  **Webhooks (5):** getAllWebhooks, getWebhookByID, createWebhook, updateWebhook, deleteWebhook
29
87
 
30
88
  **Enhanced WebSockets (3):** transactionSubscribe, accountSubscribe, getEnhancedWebSocketInfo
31
89
 
32
90
  **Laserstream gRPC (2):** laserstreamSubscribe, getLaserstreamInfo
33
91
 
34
- **Wallet API (6):** getWalletIdentity, batchWalletIdentity, getWalletBalances, getWalletHistory, getWalletTransfers, getWalletFundedBy
92
+ **Wallet (6):** getWalletIdentity, batchWalletIdentity, getWalletBalances, getWalletHistory, getWalletTransfers, getWalletFundedBy
35
93
 
36
- **Plans & Guides (8):** getHeliusPlanInfo, compareHeliusPlans, getRateLimitInfo, getSenderInfo, getWebhookGuide, troubleshootError, getLatencyComparison, getPumpFunGuide
94
+ **Plans & Billing (5):** getHeliusPlanInfo, compareHeliusPlans, previewUpgrade, upgradePlan, payRenewal
37
95
 
38
- **Documentation (3):** lookupHeliusDocs, listHeliusDocTopics, getHeliusCreditsInfo
96
+ **Docs & Guides (10):** lookupHeliusDocs, listHeliusDocTopics, getHeliusCreditsInfo, getRateLimitInfo, troubleshootError, getSenderInfo, getWebhookGuide, getLatencyComparison, getPumpFunGuide, recommendStack
39
97
 
40
- ## Networks
98
+ **Solana Knowledge (5):** getSIMD, listSIMDs, searchSolanaDocs, readSolanaSourceFile, fetchHeliusBlog
41
99
 
42
- Mainnet and Devnet. Set via `HELIUS_NETWORK` env var or use the `network` parameter in `setHeliusApiKey`.
100
+ ## System Prompts
43
101
 
44
- ## Development
102
+ This package ships with pre-built system prompts that teach AI models how to use Helius tools effectively. Find them in `system-prompts/`:
45
103
 
46
- ```bash
47
- pnpm install
48
- pnpm build
49
- pnpm test
50
104
  ```
105
+ system-prompts/
106
+ ├── helius/ # Core Helius skill
107
+ ├── helius-dflow/ # DFlow trading skill
108
+ ├── helius-phantom/ # Phantom frontend skill
109
+ └── svm/ # SVM architecture skill
110
+ ```
111
+
112
+ Each contains three variants:
113
+ - `openai.developer.md` — for OpenAI Responses/Chat Completions API (`developer` message)
114
+ - `claude.system.md` — for Claude API (system prompt)
115
+ - `full.md` — self-contained with all references inlined (Cursor Rules, ChatGPT, etc.)
116
+
117
+ See [`helius-skills/SYSTEM-PROMPTS.md`](https://github.com/helius-labs/core-ai/blob/main/helius-skills/SYSTEM-PROMPTS.md) for integration guides and code examples.
118
+
119
+ ## Networks
120
+
121
+ Mainnet Beta (default) and Devnet. Set via `HELIUS_NETWORK` env var or `setNetwork` in the session
51
122
 
52
- ## Docs
123
+ ## Related Resources
53
124
 
54
- - [Helius API](https://docs.helius.dev)
55
- - [Enhanced WebSockets](https://docs.helius.dev/enhanced-websockets)
56
- - [Laserstream](https://docs.helius.dev/laserstream)
125
+ - [Full Documentation](https://www.helius.dev/docs)
126
+ - [LLM-Optimized Docs](https://www.helius.dev/docs/llms.txt)
127
+ - [API Reference](https://www.helius.dev/docs/api-reference)
128
+ - [Billing and Credits](https://www.helius.dev/docs/billing/credits.md)
129
+ - [Rate Limits](https://www.helius.dev/docs/billing/rate-limits.md)
130
+ - [Dashboard](https://dashboard.helius.dev)
131
+ - [Status Page](https://helius.statuspage.io)
132
+ - [Full Agent Signup Instructions](https://dashboard.helius.dev/agents.md)
package/dist/http.d.ts ADDED
@@ -0,0 +1 @@
1
+ export declare const MCP_USER_AGENT = "helius-mcp/1.0.0";
package/dist/http.js ADDED
@@ -0,0 +1,2 @@
1
+ import { version } from './version.js';
2
+ export const MCP_USER_AGENT = `helius-mcp/${version}`;
package/dist/index.js CHANGED
@@ -2,16 +2,93 @@
2
2
  import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
3
3
  import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
4
4
  import { registerTools } from './tools/index.js';
5
- import { setApiKey } from './utils/helius.js';
5
+ import { setApiKey, setSessionSecretKey, setSessionWalletAddress } from './utils/helius.js';
6
+ import { getSharedApiKey, loadKeypairFromDisk } from './utils/config.js';
7
+ import { loadKeypair } from 'helius-sdk/auth/loadKeypair';
8
+ import { getAddress } from 'helius-sdk/auth/getAddress';
9
+ import { version } from './version.js';
6
10
  const server = new McpServer({
7
11
  name: 'helius-mcp',
8
- version: '0.3.0'
12
+ version
13
+ }, {
14
+ instructions: `These instructions provide fallback tool selection guidance. If you have more specific routing instructions from a Helius skill or system prompt, prefer those.
15
+
16
+ ## Tool Routing
17
+
18
+ | Intent | Tool | Credits |
19
+ |--------|------|---------|
20
+ | SOL balance | getBalance | 1 |
21
+ | token balances by wallet | getTokenBalances | 10/pg |
22
+ | full portfolio + USD | getWalletBalances | 100 |
23
+ | parse tx by signature | parseTransactions | 100 |
24
+ | wallet transaction history | getTransactionHistory | ~110 |
25
+ | balance deltas/tx | getWalletHistory | 100 |
26
+ | sends/receives | getWalletTransfers | 100 |
27
+ | asset by mint (single or batch) | getAsset | 10 |
28
+ | wallet NFTs | getAssetsByOwner | 10 |
29
+ | filtered asset search / by creator or authority | searchAssets | 10 |
30
+ | collection NFTs | getAssetsByGroup | 10 |
31
+ | asset tx history (by mint) | getSignaturesForAsset | 10 |
32
+ | edition prints of master NFT | getNftEditions | 10 |
33
+ | cNFT Merkle proof (single or batch) | getAssetProof, getAssetProofBatch | 10 |
34
+ | raw account inspection (single or batch) | getAccountInfo | 1 |
35
+ | token holders by mint | getTokenHolders | ~20 |
36
+ | token accounts by mint or owner | getTokenAccounts | 10 |
37
+ | program accounts / protocol state | getProgramAccounts | 10 |
38
+ | network status / epoch / block height | getNetworkStatus | 3 |
39
+ | block data by slot | getBlock | 1 |
40
+ | plans/pricing | getHeliusPlanInfo | 0 |
41
+ | plan comparison | compareHeliusPlans | 0 |
42
+ | plan upgrade / billing | previewUpgrade, upgradePlan, payRenewal | 0 |
43
+ | rate limits/credits | getRateLimitInfo | 0 |
44
+ | API docs by topic | lookupHeliusDocs | 0 |
45
+ | error diagnosis | troubleshootError | 0 |
46
+ | tx sending / Jito / SWQoS | getSenderInfo | 0 |
47
+ | webhook setup guide | getWebhookGuide | 0 |
48
+ | streaming latency | getLatencyComparison | 0 |
49
+ | pump.fun tokens | getPumpFunGuide | 0 |
50
+ | project architecture / stack selection | recommendStack | 0 |
51
+ | Solana SIMDs / protocol proposals | getSIMD, listSIMDs | 0 |
52
+ | Solana source / docs search | searchSolanaDocs, readSolanaSourceFile | 0 |
53
+ | Helius blog posts | fetchHeliusBlog | 0 |
54
+ | wallet identity | getWalletIdentity | 100 |
55
+ | batch wallet identity | batchWalletIdentity | 100 |
56
+ | funding source | getWalletFundedBy | 100 |
57
+ | event notifications (any plan) | createWebhook | 100 |
58
+ | live streaming (WS, Business+) | transactionSubscribe, accountSubscribe | — |
59
+ | production streaming (gRPC, Pro) | laserstreamSubscribe | — |
60
+ | Account setup | getStarted → generateKeypair → agenticSignup | — |
61
+
62
+ Rules:
63
+ - For pricing, start with getHeliusPlanInfo — NOT lookupHeliusDocs.
64
+ - For errors, use troubleshootError first.
65
+ - When a user describes ANY project they want to build ("I want to build/make/create...", "help me build...", "I need a..."), call recommendStack immediately with their description — do not ask clarifying questions first. After recommendations, use getHeliusPlanInfo for pricing and lookupHeliusDocs for API details.
66
+ - "send SOL" / "transfer SOL" → transferSol (~3 credits). "send tokens" / "transfer USDC/BONK/etc" → transferToken (~13 credits). Both require a configured keypair (generateKeypair) and use Helius Sender.`
9
67
  });
10
68
  registerTools(server);
11
69
  async function main() {
12
70
  if (process.env.HELIUS_API_KEY) {
13
71
  setApiKey(process.env.HELIUS_API_KEY);
14
72
  }
73
+ else {
74
+ const sharedKey = getSharedApiKey();
75
+ if (sharedKey) {
76
+ setApiKey(sharedKey);
77
+ }
78
+ }
79
+ // Load persisted keypair from disk so MCP survives restarts
80
+ const diskKey = loadKeypairFromDisk();
81
+ if (diskKey) {
82
+ try {
83
+ const walletKeypair = loadKeypair(diskKey);
84
+ const address = await getAddress(walletKeypair);
85
+ setSessionSecretKey(diskKey);
86
+ setSessionWalletAddress(address);
87
+ }
88
+ catch {
89
+ // Ignore invalid keypair on disk
90
+ }
91
+ }
15
92
  const transport = new StdioServerTransport();
16
93
  await server.connect(transport);
17
94
  }
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Validates the product catalog for correctness.
4
+ *
5
+ * Checks:
6
+ * 1. Every mcpTools entry exists in KNOWN_TOOLS
7
+ * 2. Every referenceFile exists on disk
8
+ * 3. Every docKey exists in DOCS_INDEX
9
+ * 4. Every minimumPlan is a valid key in PLAN_RANK and HELIUS_PLANS
10
+ * 5. Plan-feature compatibility (Laserstream mainnet → professional, Enhanced WebSockets → business+)
11
+ * 6. No empty mcpTools arrays
12
+ */
13
+ export {};
@@ -0,0 +1,76 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Validates the product catalog for correctness.
4
+ *
5
+ * Checks:
6
+ * 1. Every mcpTools entry exists in KNOWN_TOOLS
7
+ * 2. Every referenceFile exists on disk
8
+ * 3. Every docKey exists in DOCS_INDEX
9
+ * 4. Every minimumPlan is a valid key in PLAN_RANK and HELIUS_PLANS
10
+ * 5. Plan-feature compatibility (Laserstream mainnet → professional, Enhanced WebSockets → business+)
11
+ * 6. No empty mcpTools arrays
12
+ */
13
+ import fs from 'fs';
14
+ import path from 'path';
15
+ import { PRODUCT_CATALOG } from '../tools/product-catalog.js';
16
+ import { KNOWN_TOOLS, PLAN_RANK } from '../tools/recommend.js';
17
+ import { HELIUS_PLANS } from '../tools/plans.js';
18
+ import { DOCS_INDEX } from '../utils/docs.js';
19
+ // Resolve skill references relative to repo root
20
+ const REPO_ROOT = path.resolve(import.meta.dirname, '..', '..', '..');
21
+ const SKILL_DIR = path.join(REPO_ROOT, 'helius-skills', 'helius');
22
+ let errors = [];
23
+ function error(productKey, msg) {
24
+ errors.push(`[${productKey}] ${msg}`);
25
+ }
26
+ for (const [key, product] of Object.entries(PRODUCT_CATALOG)) {
27
+ // 1. MCP tool names exist in KNOWN_TOOLS
28
+ for (const tool of product.mcpTools) {
29
+ if (!KNOWN_TOOLS.has(tool)) {
30
+ error(key, `Unknown MCP tool "${tool}"`);
31
+ }
32
+ }
33
+ // 2. referenceFile exists on disk
34
+ if (product.referenceFile) {
35
+ const refPath = path.join(SKILL_DIR, product.referenceFile);
36
+ if (!fs.existsSync(refPath)) {
37
+ error(key, `Reference file not found: ${product.referenceFile} (looked at ${refPath})`);
38
+ }
39
+ }
40
+ // 3. docKey exists in DOCS_INDEX
41
+ if (!(product.docKey in DOCS_INDEX)) {
42
+ error(key, `Unknown docKey "${product.docKey}" — available: ${Object.keys(DOCS_INDEX).join(', ')}`);
43
+ }
44
+ // 4. minimumPlan is valid
45
+ if (!(product.minimumPlan in PLAN_RANK)) {
46
+ error(key, `Unknown plan "${product.minimumPlan}" in PLAN_RANK`);
47
+ }
48
+ if (!(product.minimumPlan in HELIUS_PLANS)) {
49
+ error(key, `Plan "${product.minimumPlan}" not found in HELIUS_PLANS`);
50
+ }
51
+ // 5. Plan-feature compatibility
52
+ const nameLower = product.name.toLowerCase();
53
+ if (nameLower.includes('laserstream') && nameLower.includes('mainnet') && product.minimumPlan !== 'professional') {
54
+ error(key, `Laserstream mainnet requires professional plan, but has "${product.minimumPlan}"`);
55
+ }
56
+ if (nameLower.includes('enhanced websocket') && (PLAN_RANK[product.minimumPlan] ?? 0) < PLAN_RANK['business']) {
57
+ error(key, `Enhanced WebSockets requires business+ plan, but has "${product.minimumPlan}"`);
58
+ }
59
+ // 6. No empty mcpTools
60
+ if (product.mcpTools.length === 0) {
61
+ error(key, 'mcpTools array is empty');
62
+ }
63
+ }
64
+ // ── Report ──
65
+ if (errors.length > 0) {
66
+ console.error(`\n\u274C Catalog validation failed with ${errors.length} error(s):\n`);
67
+ for (const err of errors) {
68
+ console.error(` \u2022 ${err}`);
69
+ }
70
+ console.error('');
71
+ process.exit(1);
72
+ }
73
+ else {
74
+ const productCount = Object.keys(PRODUCT_CATALOG).length;
75
+ console.log(`\u2705 All products valid (${productCount} products in catalog)`);
76
+ }