run-mcp-server.jsā¢792 B
#!/usr/bin/env node
/**
* MCP Server Launcher - Ensures JWT server is running
*/
import { spawn } from 'child_process';
import { fileURLToPath } from 'url';
import { dirname, join } from 'path';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
// Start JWT server in background
const jwtServer = spawn('node', [join(__dirname, 'tools/servers/jwt-redirect-server-v1.0.2.js')], {
detached: true,
stdio: 'ignore'
});
// Give JWT server time to start
setTimeout(() => {
// Import and run the MCP server
import('./dist/browser-automation-api-direct-save-v4.0.3.js');
}, 2000);
// Handle process termination
process.on('SIGINT', () => {
try {
process.kill(-jwtServer.pid);
} catch (e) {
// Ignore errors
}
process.exit();
});