UNPKG

code-auditor-mcp

Version:

Multi-language code quality auditor with MCP server - Analyze TypeScript, JavaScript, and Go code for SOLID principles, DRY violations, security patterns, and more

41 lines 1.62 kB
#!/usr/bin/env node /** * Hybrid MCP Server - Supports both stdio and HTTP/UI protocols * * This allows the code auditor to work with: * - Traditional MCP clients via stdio (Claude Desktop, VS Code, etc.) * - Interactive UI clients via HTTP (web dashboards, iframe embedding) */ import chalk from 'chalk'; console.error(chalk.blue('[HYBRID]'), 'Starting hybrid MCP server...'); // Start the HTTP/UI server import('./mcp-ui-server.js').then(({ startMcpUIServer }) => { startMcpUIServer(); console.error(chalk.green('[HYBRID]'), 'MCP-UI HTTP server started'); }).catch(error => { console.error(chalk.red('[HYBRID ERROR]'), 'Failed to start MCP-UI server:', error); }); // Check if we should also start the stdio server const mode = process.env.MCP_MODE || 'hybrid'; if (mode === 'hybrid' || mode === 'stdio') { console.error(chalk.blue('[HYBRID]'), 'Also starting stdio MCP server...'); // Import and start the original stdio server import('./mcp.js').then(() => { console.error(chalk.green('[HYBRID]'), 'MCP stdio server started'); }).catch(error => { console.error(chalk.red('[HYBRID ERROR]'), 'Failed to start stdio MCP server:', error); }); } else { console.error(chalk.blue('[HYBRID]'), 'Running in HTTP-only mode'); } // Handle shutdown gracefully process.on('SIGINT', () => { console.error(chalk.yellow('[HYBRID]'), 'Shutting down hybrid server...'); process.exit(0); }); process.on('SIGTERM', () => { console.error(chalk.yellow('[HYBRID]'), 'Received SIGTERM, shutting down...'); process.exit(0); }); //# sourceMappingURL=mcp-hybrid.js.map