UNPKG

jay-code

Version:

Streamlined AI CLI orchestration engine with mathematical rigor and enterprise-grade reliability

37 lines (32 loc) 1.04 kB
#!/usr/bin/env node /** * MCP Server entry point that uses the wrapper by default */ import { ClaudeCodeMCPWrapper } from './claude-code-wrapper.js'; // Check if we should use the legacy server const useLegacy = process.env.JAY_CODE_LEGACY_MCP === 'true' || process.argv.includes('--legacy'); async function main() { if (useLegacy) { console.error('Starting Jay-Code MCP in legacy mode...'); // Dynamically import the old server to avoid circular dependencies const module = await import('./server.js'); if (module.runMCPServer) { await module.runMCPServer(); } else if (module.default) { await module.default(); } else { console.error('Could not find runMCPServer function in legacy server'); process.exit(1); } } else { console.error('Starting Jay-Code MCP with Claude Code wrapper...'); const wrapper = new ClaudeCodeMCPWrapper(); await wrapper.run(); } } // Run the server main().catch((error) => { console.error('Fatal error:', error); process.exit(1); });