Skip to main content
Glama

mcp-adr-analysis-server

by tosin2013
test-node-compatibility.jsโ€ข2.72 kB
#!/usr/bin/env node /** * Test Node.js compatibility for MCP ADR Analysis Server * This script tests basic functionality across different Node.js versions */ import { createRequire } from 'module'; import { fileURLToPath } from 'url'; import { dirname, join } from 'path'; import { readFileSync } from 'fs'; const require = createRequire(import.meta.url); const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); console.log('๐Ÿ” Testing Node.js Compatibility'); console.log('================================'); // Test 1: Node.js version console.log(`Node.js version: ${process.version}`); console.log(`Platform: ${process.platform}`); console.log(`Architecture: ${process.arch}`); // Test 2: ESM support console.log('\nโœ… ESM imports working'); // Test 3: Package.json validation try { const packagePath = join(__dirname, '..', 'package.json'); const packageJson = JSON.parse(readFileSync(packagePath, 'utf8')); console.log(`โœ… Package: ${packageJson.name}@${packageJson.version}`); console.log(`โœ… Type: ${packageJson.type}`); } catch (error) { console.error('โŒ Package.json error:', error.message); process.exit(1); } // Test 4: TypeScript compilation check try { const distPath = join(__dirname, '..', 'dist', 'src', 'index.js'); const compiledCode = readFileSync(distPath, 'utf8'); if (compiledCode.includes('export')) { console.log('โœ… TypeScript ESM compilation working'); } else { console.log('โš ๏ธ TypeScript compilation may have issues'); } } catch (error) { console.log('โš ๏ธ Compiled code not found (run npm run build first)'); } // Test 5: Basic module loading try { const { loadConfig } = await import('../dist/src/utils/config.js'); console.log('โœ… Module loading working'); // Test configuration loading const config = loadConfig(); console.log(`โœ… Configuration loaded: ${config.projectPath}`); } catch (error) { console.error('โŒ Module loading error:', error.message); process.exit(1); } // Test 6: Zod validation try { const { z } = await import('zod'); const testSchema = z.object({ test: z.string() }); testSchema.parse({ test: 'hello' }); console.log('โœ… Zod validation working'); } catch (error) { console.error('โŒ Zod validation error:', error.message); process.exit(1); } // Test 7: MCP SDK compatibility try { const { Server } = await import('@modelcontextprotocol/sdk/server/index.js'); console.log('โœ… MCP SDK import working'); } catch (error) { console.error('โŒ MCP SDK error:', error.message); process.exit(1); } console.log('\n๐ŸŽ‰ All Node.js compatibility tests passed!'); console.log(`โœ… Node.js ${process.version} is fully compatible`);

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/tosin2013/mcp-adr-analysis-server'

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