MCP Config Manager¶
dnallm.mcp.config_manager ¶
Configuration Manager for MCP Server.
This module provides configuration management functionality for the MCP server, including loading, validating, and managing both main server configurations and individual model configurations.
Classes¶
MCPConfigManager ¶
MCPConfigManager(
config_dir, server_config_file="mcp_server_config.yaml"
)
Manages MCP server configurations and model configurations.
Initialize the configuration manager.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config_dir
|
str
|
Path to the configuration directory |
required |
server_config_file
|
str
|
Name of the server configuration file |
'mcp_server_config.yaml'
|
Source code in dnallm/mcp/config_manager.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | |
Functions¶
get_enabled_models ¶
get_enabled_models()
Get list of enabled model names.
Returns:
| Type | Description |
|---|---|
list[str]
|
List of enabled model names |
Source code in dnallm/mcp/config_manager.py
122 123 124 125 126 127 128 129 130 131 132 133 134 135 | |
get_logging_config ¶
get_logging_config()
Get logging configuration.
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Dictionary of logging configuration parameters |
Source code in dnallm/mcp/config_manager.py
190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 | |
get_model_config ¶
get_model_config(model_name)
Get configuration for a specific model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model_name
|
str
|
Name of the model |
required |
Returns:
| Type | Description |
|---|---|
InferenceModelConfig | None
|
InferenceModelConfig object or None if not found |
Source code in dnallm/mcp/config_manager.py
103 104 105 106 107 108 109 110 111 112 | |
get_model_configs ¶
get_model_configs()
Get all loaded model configurations.
Returns:
| Type | Description |
|---|---|
dict[str, InferenceModelConfig]
|
Dictionary of model configurations |
Source code in dnallm/mcp/config_manager.py
114 115 116 117 118 119 120 | |
get_model_info_summary ¶
get_model_info_summary()
Get summary information about all loaded models.
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Dictionary containing model information summary |
Source code in dnallm/mcp/config_manager.py
247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 | |
get_model_priority ¶
get_model_priority(model_name)
Get priority of a specific model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model_name
|
str
|
Name of the model |
required |
Returns:
| Type | Description |
|---|---|
int
|
Priority value (1-10, higher is more important) |
Source code in dnallm/mcp/config_manager.py
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 | |
get_multi_model_configs ¶
get_multi_model_configs()
Get multi-model parallel prediction configurations.
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Dictionary of multi-model configurations |
Source code in dnallm/mcp/config_manager.py
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 | |
get_server_config ¶
get_server_config()
Get the main server configuration.
Returns:
| Type | Description |
|---|---|
MCPServerConfig | None
|
MCPServerConfig object or None if not loaded |
Source code in dnallm/mcp/config_manager.py
95 96 97 98 99 100 101 | |
get_sse_config ¶
get_sse_config()
Get SSE configuration.
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Dictionary of SSE configuration parameters |
Source code in dnallm/mcp/config_manager.py
173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 | |
reload_configurations ¶
reload_configurations()
Reload all configurations from files.
Source code in dnallm/mcp/config_manager.py
208 209 210 211 212 213 | |
validate_model_references ¶
validate_model_references()
Validate that all model references are valid.
Returns:
| Type | Description |
|---|---|
list[str]
|
List of validation error messages |
Source code in dnallm/mcp/config_manager.py
215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 | |