@@ -37,6 +37,11 @@ namespace mcp {
3737 return get_config_file_path ();
3838 }
3939
40+ enum class ConfigMode {
41+ NONE, // Do not load config,use default settings
42+ STATIC, // Load config from static file
43+ DYNAMIC // Load config dynamically
44+ };
4045
4146 /* *
4247 * Server-specific configuration structure
@@ -163,6 +168,42 @@ namespace mcp {
163168 }
164169 };
165170
171+ 172+ /* *
173+ * Python environment configuration structure
174+ * Contains settings for Python interpreter environment selection
175+ */
176+ struct PythonEnvConfig {
177+ std::string default_env; // Default Python environment type (system, conda, uv)
178+ std::string conda_prefix;// Conda environment installation prefix
179+ std::string uv_venv_path;// UV virtual environment path
180+ 181+ /* *
182+ * Load Python environment configuration from INI file
183+ * @param ini Reference to IniManager instance
184+ * @return Populated PythonEnvConfig structure
185+ */
186+ static PythonEnvConfig load (inicpp::IniManager &ini) {
187+ try {
188+ PythonEnvConfig config;
189+ 190+ // Get python_environment section, create if not exists
191+ auto python_section = ini[" python_environment" ];
192+ 193+ // Load configuration values with defaults
194+ config.default_env = python_section[" default" ].String ().empty () ? " system" : python_section[" default" ].String ();
195+ config.conda_prefix = python_section[" conda_prefix" ].String ().empty () ? " /opt/conda" : python_section[" conda_prefix" ].String ();
196+ config.uv_venv_path = python_section[" uv_venv_path" ].String ().empty () ? " ./venv" : python_section[" uv_venv_path" ].String ();
197+ 198+ return config;
199+ } catch (const std::exception &e) {
200+ MCP_ERROR (" Failed to load Python environment config: {}" , e.what ());
201+ std::cerr << " Failed to load Python environment config: " << e.what () << std::endl;
202+ throw ;
203+ }
204+ }
205+ };
206+ 166207 /* *
167208 * Global application configuration structure
168209 * Contains top-level configuration and nested server settings
@@ -171,6 +212,7 @@ namespace mcp {
171212 std::string title; // Configuration file title/description
172213 ServerConfig server; // Nested server configuration
173214 PluginHubConfig plugin_hub;// Nested plugin hub configuration
215+ PythonEnvConfig python_env;// Nested Python environment configuration
174216
175217 /* *
176218 * Loads complete configuration from INI file
@@ -185,6 +227,7 @@ namespace mcp {
185227 config.title = ini[" " ][" title" ].String ().empty () ? " MCP Server Configuration" : ini[" " ][" title" ].String ();
186228 config.server = ServerConfig::load (ini);
187229 config.plugin_hub = PluginHubConfig::load (ini);
230+ config.python_env = PythonEnvConfig::load (ini);
188231
189232 return config;
190233 } catch (const std::exception &e) {
0 commit comments