run.py•1.08 kB
#!/usr/bin/env python3
"""
Simple startup script for the MCP Data Manager
"""
import uvicorn
import sys
import os
def main():
"""Main function to run the FastAPI server"""
# Set default values
host = os.getenv("HOST", "0.0.0.0")
port = int(os.getenv("PORT", "8000"))
reload = os.getenv("RELOAD", "true").lower() == "true"
print("🚀 Starting Simple MCP Data Manager...")
print(f"📍 Server will be available at: http://{host}:{port}")
print(f"📚 API Documentation: http://{host}:{port}/docs")
print(f"🔧 Health Check: http://{host}:{port}/api/health")
print(f"🔄 Auto-reload: {'Enabled' if reload else 'Disabled'}")
print("-" * 50)
try:
uvicorn.run(
"app.main:app",
host=host,
port=port,
reload=reload,
log_level="info"
)
except KeyboardInterrupt:
print("\n👋 Server stopped by user")
except Exception as e:
print(f"❌ Error starting server: {e}")
sys.exit(1)
if __name__ == "__main__":
main()