unity-mcp/UnityMcpServer/src/config.py

30 lines
775 B
Python
Raw Normal View History

2025-03-18 19:00:50 +08:00
"""
Configuration settings for the Unity MCP Server.
This file contains all configurable parameters for the server.
"""
from dataclasses import dataclass
@dataclass
class ServerConfig:
"""Main configuration class for the MCP server."""
# Network settings
2025-03-19 01:15:39 +08:00
unity_host: str = "localhost"
unity_port: int = 6400
mcp_port: int = 6500
2025-03-18 19:00:50 +08:00
# Connection settings
connection_timeout: float = 600.0 # 10 minutes timeout
2025-03-31 04:01:17 +08:00
buffer_size: int = 16 * 1024 * 1024 # 16MB buffer
2025-03-18 19:00:50 +08:00
# Logging settings
2025-03-19 01:15:39 +08:00
log_level: str = "INFO"
log_format: str = "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
2025-03-18 19:00:50 +08:00
# Server settings
2025-03-19 01:15:39 +08:00
max_retries: int = 3
retry_delay: float = 1.0
2025-03-18 19:00:50 +08:00
# Create a global config instance
2025-03-19 01:15:39 +08:00
config = ServerConfig()