Spaces:
Sleeping
Sleeping
| #!/usr/bin/env python3 | |
| """ | |
| Start script for just the MCP server (for testing) | |
| """ | |
| import asyncio | |
| import sys | |
| import os | |
| # Add the web directory to the path | |
| sys.path.insert(0, os.path.dirname(__file__)) | |
| def main(): | |
| """Main entry point.""" | |
| print("Starting MCP server only...") | |
| print("=" * 40) | |
| print() | |
| try: | |
| # Import and start the MCP server | |
| from mcp_server import RTSGameMCP | |
| print("โ MCP server module imported successfully") | |
| # Create an instance | |
| server = RTSGameMCP() | |
| print(f"โ MCP server created: {server.mcp.name}") | |
| print(f" Host: {server.mcp.settings.host}") | |
| print(f" Port: {server.mcp.settings.port}") | |
| print() | |
| print("๐ Starting MCP server...") | |
| print("Press Ctrl+C to stop the server") | |
| print() | |
| # Start the server | |
| asyncio.run(server.run()) | |
| except KeyboardInterrupt: | |
| print("\n\n๐ MCP server stopped.") | |
| except Exception as e: | |
| print(f"โ Failed to start MCP server: {e}") | |
| sys.exit(1) | |
| if __name__ == "__main__": | |
| main() |