unity-mcp/Python/config.py

30 lines
782 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 = 300.0 # 5 minutes timeout
buffer_size: int = 1024 * 1024 # 1MB buffer for localhost
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()