{
"event": "PreToolUse",
"tool_name": "Read",
"tool_input": {
"file_path": "\/var\/www\/mcp-servers\/shared\/infrastructure\/simple_db_connection.py"
}
}
{
"tool_response": {
"type": "text",
"file": {
"filePath": "\/var\/www\/mcp-servers\/shared\/config_base.py",
"content": "\"\"\"\nBase Configuration for all MCP Servers.\n\nIMPORTANT: This class is NOT instantiated!\nAll access is via class attributes.\n\nWrong: config = BaseConfig()\nRight: host = BaseConfig.DB_HOST\n\"\"\"\n\nimport os\nfrom typing import ClassVar, Protocol, runtime_checkable\n\n\n@runtime_checkable\nclass AppDatabaseConfig(Protocol):\n \"\"\"Protocol for App Database Configuration.\"\"\"\n\n DB_HOST: str\n DB_PORT: int\n DB_USER: str\n DB_PASSWORD: str\n DB_NAME: str\n\n\n@runtime_checkable\nclass LogDatabaseConfig(Protocol):\n \"\"\"Protocol for Log Database Configuration.\"\"\"\n\n LOG_DB_HOST: str\n LOG_DB_NAME: str\n LOG_DB_USER: str\n LOG_DB_PASSWORD: str\n\n\nclass BaseConfig:\n \"\"\"\n Static Configuration - DO NOT INSTANTIATE!\n\n Usage:\n from shared.config_base import BaseConfig\n host = BaseConfig.DB_HOST # Correct\n\n config = BaseConfig() # WRONG - raises TypeError!\n \"\"\"\n\n # App Database\n DB_HOST: ClassVar[str] = os.getenv(\"DB_HOST\", \"localhost\")\n DB_PORT: ClassVar[int] = int(os.getenv(\"DB_PORT\", \"3306\"))\n DB_USER: ClassVar[str] = os.getenv(\"DB_USER\", \"root\")\n DB_PASSWORD: ClassVar[str] = os.getenv(\"DB_PASSWORD\", \"\")\n DB_NAME: ClassVar[str] = os.getenv(\"DB_NAME\", \"ki_dev\")\n\n # Log Database\n LOG_DB_HOST: ClassVar[str] = os.getenv(\"LOG_DB_HOST\", \"localhost\")\n LOG_DB_NAME: ClassVar[str] = os.getenv(\"LOG_DB_NAME\", \"ki_dev\")\n LOG_DB_USER: ClassVar[str] = os.getenv(\"LOG_DB_USER\", \"mcp_logger\")\n LOG_DB_PASSWORD: ClassVar[str] = os.getenv(\"LOG_DB_PASSWORD\", \"\")\n\n def __init__(self) -> None:\n raise TypeError(\"BaseConfig is static and must not be instantiated\")\n",
"numLines": 62,
"startLine": 1,
"totalLines": 62
}
}
}