```php title="PHP" start(); $pid = $process->getPid(); echo "MCP server started with PID: {$pid}\n"; // Wait for server to initialize sleep(1); if ($process->isRunning()) { echo "Server is running, listening for connections\n"; echo "Server output: " . $process->getOutput() . "\n"; } else { echo "Server failed to start\n"; echo "Error: " . $process->getErrorOutput() . "\n"; } // Keep process running or register shutdown handler register_shutdown_function(function () use ($process): void { if ($process->isRunning()) { $process->stop(); echo "MCP server stopped\n"; } }); ```