"""Simple test - just import and try start with timeout"""
import sys
from pathlib import Path
PROJECT_ROOT = Path(__file__).parent.parent
sys.path.insert(0, str(PROJECT_ROOT / "python"))
print("[Test] Importing blender_mcp...", flush=True)
import blender_mcp
print(f"[Test] Imported: {dir(blender_mcp)}", flush=True)
print("[Test] Creating BlenderMcp instance...", flush=True)
mcp = blender_mcp.BlenderMcp("test", 8765)
print(f"[Test] Created: tag={mcp.tag}, port={mcp.port}", flush=True)
print("[Test] Starting server (this may hang)...", flush=True)
sys.stdout.flush()
sys.stderr.flush()
try:
port = mcp.start()
print(f"[Test] Server started on port {port}", flush=True)
print(f"[Test] URL: {mcp.url()}", flush=True)
# Try to stop
print("[Test] Stopping server...", flush=True)
mcp.stop()
print("[Test] Server stopped", flush=True)
except Exception as e:
print(f"[Test] ERROR: {e}", flush=True)
import traceback
traceback.print_exc()
print("[Test] Done!", flush=True)