INNER CODE UNIT · Python
handshake_test
prajwalshettydev/UnrealGenAISupport · Content/Python/mcp_server.py:116
def handshake_test(message: str) -> str:
"""Send a handshake message to Unreal Engine"""
try:
command = {
"type": "handshake",
"message": message
}
response = send_to_unreal(command)
if response.get("success"):
return f"Handshake successful: {response['message']}"
else:
return f"Handshake failed: {response.get('error', 'Unknown error')}"
except Exception as e:
return f"Error communicating with Unreal: {str(e)}"
@mcp.tool()
def execute_python_script(script: str) -> str: