cpp-enhancement-mcp-server
Version:
MCP server for C++ programming enhancement with modern best practices, performance optimization, and real-time web research. Requires Python 3.8+.
47 lines (40 loc) • 1.54 kB
JavaScript
/**
* Check if Python is available for the C++ Enhancement MCP Server
*/
const { execSync } = require('child_process');
function checkPython() {
const pythonCommands = ['py', 'python3', 'python'];
for (const cmd of pythonCommands) {
try {
const version = execSync(`${cmd} --version`, { encoding: 'utf8', stdio: 'pipe' });
if (version.includes('Python 3.')) {
const versionMatch = version.match(/Python (\d+)\.(\d+)/);
if (versionMatch) {
const major = parseInt(versionMatch[1]);
const minor = parseInt(versionMatch[2]);
if (major === 3 && minor >= 8) {
console.log(`✅ Found compatible Python: ${version.trim()}`);
return true;
}
}
}
} catch (error) {
// Command not found, continue to next
}
}
console.log('❌ Python 3.8+ not found!');
console.log('');
console.log('The C++ Enhancement MCP Server requires Python 3.8 or higher.');
console.log('Please install Python from: https://www.python.org/downloads/');
console.log('');
console.log('After installing Python, you can run:');
console.log(' npx cpp-enhancement-mcp-server --help');
console.log('');
return false;
}
if (require.main === module) {
const success = checkPython();
process.exit(success ? 0 : 1);
}
module.exports = { checkPython };