navigation-equipment-manuals-mcp-server
Version:
Navigation Equipment Manuals MCP Server for create, update, delete, and search navigation equipment manuals
32 lines (25 loc) • 785 B
JavaScript
import { spawn } from 'child_process';
import path from 'path';
import { fileURLToPath } from 'url';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const packageRoot = path.resolve(__dirname, '..');
// Get the main server file
const serverPath = path.join(packageRoot, 'dist', 'index.js');
// Forward all arguments to the main server
const args = process.argv.slice(2);
// Spawn the main server process
const child = spawn('node', [serverPath, ...args], {
stdio: 'inherit',
cwd: packageRoot
});
// Forward exit code
child.on('exit', (code) => {
process.exit(code || 0);
});
// Handle errors
child.on('error', (error) => {
console.error('Failed to start server:', error.message);
process.exit(1);
});