Skip to main content
Glama
validate-smithery.jsβ€’5.64 kB
#!/usr/bin/env node /** * Validation script for Smithery deployment */ import fs from 'fs'; import path from 'path'; console.log('πŸ” Validating Smithery deployment configuration...\n'); const checks = []; // Check required files const requiredFiles = [ 'smithery.yaml', 'Dockerfile', '.dockerignore', 'package.json', 'build/index.js', 'build/smithery.yaml', 'build/erc20-contracts-hyperion.json' ]; console.log('πŸ“ Checking required files...'); for (const file of requiredFiles) { const exists = fs.existsSync(file); console.log(` ${exists ? 'βœ…' : '❌'} ${file}`); checks.push({ name: `File: ${file}`, passed: exists }); } // Check smithery.yaml structure console.log('\nπŸ“‹ Validating smithery.yaml...'); try { const smitheryConfig = fs.readFileSync('smithery.yaml', 'utf8'); const hasERC20Tools = smitheryConfig.includes('deploy_erc20_token') && smitheryConfig.includes('get_token_info') && smitheryConfig.includes('mint_tokens'); console.log(` ${hasERC20Tools ? 'βœ…' : '❌'} ERC20 tools defined`); checks.push({ name: 'ERC20 tools in smithery.yaml', passed: hasERC20Tools }); const hasCategories = smitheryConfig.includes('categories:') && smitheryConfig.includes('- tokens') && smitheryConfig.includes('- erc20'); console.log(` ${hasCategories ? 'βœ…' : '❌'} ERC20 categories defined`); checks.push({ name: 'ERC20 categories in smithery.yaml', passed: hasCategories }); const hasKeywords = smitheryConfig.includes('- erc20') && smitheryConfig.includes('- token') && smitheryConfig.includes('- token-deployment'); console.log(` ${hasKeywords ? 'βœ…' : '❌'} ERC20 keywords defined`); checks.push({ name: 'ERC20 keywords in smithery.yaml', passed: hasKeywords }); } catch (error) { console.log(` ❌ Error reading smithery.yaml: ${error.message}`); checks.push({ name: 'smithery.yaml readable', passed: false }); } // Check package.json console.log('\nπŸ“¦ Validating package.json...'); try { const packageJson = JSON.parse(fs.readFileSync('package.json', 'utf8')); const hasSmitheryScript = packageJson.scripts && packageJson.scripts['build:smithery']; console.log(` ${hasSmitheryScript ? 'βœ…' : '❌'} build:smithery script`); checks.push({ name: 'build:smithery script', passed: hasSmitheryScript }); const hasEthers = packageJson.dependencies && packageJson.dependencies['ethers']; console.log(` ${hasEthers ? 'βœ…' : '❌'} ethers.js dependency`); checks.push({ name: 'ethers.js dependency', passed: hasEthers }); } catch (error) { console.log(` ❌ Error reading package.json: ${error.message}`); checks.push({ name: 'package.json readable', passed: false }); } // Check build artifacts console.log('\nπŸ—οΈ Validating build artifacts...'); try { const indexJs = fs.readFileSync('build/index.js', 'utf8'); const hasERC20Tools = indexJs.includes('deploy_erc20_token') && indexJs.includes('get_token_info') && indexJs.includes('mint_tokens'); console.log(` ${hasERC20Tools ? 'βœ…' : '❌'} ERC20 tools in build`); checks.push({ name: 'ERC20 tools in build', passed: hasERC20Tools }); const hasExplorerLinks = indexJs.includes('getExplorerUrl') && indexJs.includes('Transaction Explorer:'); console.log(` ${hasExplorerLinks ? 'βœ…' : '❌'} Explorer links in build`); checks.push({ name: 'Explorer links in build', passed: hasExplorerLinks }); } catch (error) { console.log(` ❌ Error reading build/index.js: ${error.message}`); checks.push({ name: 'build/index.js readable', passed: false }); } // Check ERC20 contracts console.log('\nπŸͺ™ Validating ERC20 contracts...'); try { const contracts = JSON.parse(fs.readFileSync('build/erc20-contracts-hyperion.json', 'utf8')); const hasSimpleERC20 = contracts.simpleERC20 && contracts.simpleERC20.bytecode; console.log(` ${hasSimpleERC20 ? 'βœ…' : '❌'} SimpleERC20 contract`); checks.push({ name: 'SimpleERC20 contract', passed: hasSimpleERC20 }); const hasMintableERC20 = contracts.mintableERC20 && contracts.mintableERC20.bytecode; console.log(` ${hasMintableERC20 ? 'βœ…' : '❌'} MintableERC20 contract`); checks.push({ name: 'MintableERC20 contract', passed: hasMintableERC20 }); } catch (error) { console.log(` ❌ Error reading ERC20 contracts: ${error.message}`); checks.push({ name: 'ERC20 contracts readable', passed: false }); } // Summary console.log('\nπŸ“Š Validation Summary'); console.log('=' .repeat(50)); const passed = checks.filter(c => c.passed).length; const total = checks.length; console.log(`βœ… Passed: ${passed}/${total} checks`); if (passed === total) { console.log('\nπŸŽ‰ All checks passed! Ready for Smithery deployment.'); console.log('\nπŸš€ To deploy:'); console.log(' 1. smithery login'); console.log(' 2. smithery deploy'); console.log('\nπŸ”— Your ERC20 tools will be available at:'); console.log(' - deploy_erc20_token'); console.log(' - get_token_info'); console.log(' - mint_tokens'); } else { console.log('\n❌ Some checks failed. Please fix the issues above.'); console.log('\nFailed checks:'); checks.filter(c => !c.passed).forEach(c => { console.log(` - ${c.name}`); }); process.exit(1); } console.log('\nπŸ“š Documentation:'); console.log(' - SMITHERY.md (deployment guide)'); console.log(' - README.md (general usage)'); console.log(' - smithery.yaml (tool definitions)');

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/cuongpo/hyperion-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server