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 | |
Methods:¶
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
109 110 111 112 113 114 115 116 117 118 | |
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
193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 | |
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
90 91 92 93 94 95 96 97 98 99 | |
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
101 102 103 104 105 106 107 | |
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
262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 | |
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
120 121 122 123 124 125 126 127 128 129 130 131 132 | |
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
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 | |
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
82 83 84 85 86 87 88 | |
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
153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 | |
get_streamable_http_config ¶
get_streamable_http_config()
Get Streamable HTTP configuration.
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Dictionary of Streamable HTTP configuration parameters |
Source code in dnallm/mcp/config_manager.py
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 | |
get_timeout_config ¶
get_timeout_config()
Get timeout configuration.
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Dictionary of timeout configuration parameters |
Source code in dnallm/mcp/config_manager.py
212 213 214 215 216 217 218 219 220 221 222 223 | |
reload_configurations ¶
reload_configurations()
Reload all configurations from files.
Source code in dnallm/mcp/config_manager.py
225 226 227 228 229 230 | |
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
232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 | |