INNER CODE UNIT · Python
shutdown_mcp_server
prajwalshettydev/UnrealGenAISupport · Content/Python/init_unreal.py:13
def shutdown_mcp_server():
"""Shutdown the MCP server process when Unreal Editor closes"""
global mcp_server_process
if mcp_server_process:
log.log_info("Shutting down MCP server process...")
try:
mcp_server_process.terminate()
mcp_server_process = None
log.log_info("MCP server process terminated successfully")
except Exception as e:
log.log_error(f"Error terminating MCP server: {e}")
def start_mcp_server():
"""Start the external MCP server process"""
global mcp_server_process
try:
# Find our plugin's Python directory
plugin_python_path = None