msfs-mcp-server
Version:
Model Context Protocol server for Microsoft Flight Simulator SimConnect integration
33 lines (26 loc) • 1.05 kB
JavaScript
import { spawn } from 'child_process';
import { fileURLToPath } from 'url';
import { dirname, join } from 'path';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
// Try to run with node (SimConnect requires Windows environment)
const serverPath = join(__dirname, '..', 'dist', 'index.js');
console.log('🚀 Starting MSFS SimConnect MCP Server...');
console.log('⚠️ Make sure MSFS is running with an active flight before connecting.');
const child = spawn('node', [serverPath], {
stdio: 'inherit',
shell: process.platform === 'win32'
});
child.on('error', (error) => {
console.error('❌ Error starting MSFS MCP Server:', error.message);
console.log('');
console.log('💡 Troubleshooting:');
console.log('1. Ensure you are running on Windows (not WSL2)');
console.log('2. Make sure MSFS is running with an active flight');
console.log('3. Check that Node.js is installed');
process.exit(1);
});
child.on('exit', (code) => {
process.exit(code || 0);
});