MCP Config Validators¶
dnallm.mcp.config_validators ¶
Configuration validators for MCP Server.
This module provides Pydantic models for validating MCP server configurations and inference model configurations.
Classes¶
InferenceConfig ¶
Bases: BaseModel
Inference configuration for model prediction.
Methods:¶
set_use_bf16
classmethod
¶
set_use_bf16(v, info)
Set use_bf16 based on precision setting.
Source code in dnallm/mcp/config_validators.py
43 44 45 46 47 48 49 | |
set_use_fp16
classmethod
¶
set_use_fp16(v, info)
Set use_fp16 based on precision setting.
Source code in dnallm/mcp/config_validators.py
35 36 37 38 39 40 41 | |
InferenceModelConfig ¶
Bases: BaseModel
Complete inference model configuration.
Methods:¶
validate_task_labels
classmethod
¶
validate_task_labels(v)
Validate that num_labels matches label_names length.
Source code in dnallm/mcp/config_validators.py
78 79 80 81 82 83 84 | |
LoggingConfig ¶
Bases: BaseModel
Logging configuration.
MCPConfig ¶
Bases: BaseModel
MCP protocol configuration.
MCPServerConfig ¶
Bases: BaseModel
Complete MCP server configuration.
Methods:¶
validate_model_names
classmethod
¶
validate_model_names(v)
Validate that model names are unique.
Source code in dnallm/mcp/config_validators.py
182 183 184 185 186 187 188 189 | |
validate_multi_model_references
classmethod
¶
validate_multi_model_references(v, info)
Validate that multi-model configurations reference existing models.
Source code in dnallm/mcp/config_validators.py
191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 | |
warn_both_transports
classmethod
¶
warn_both_transports(v, info)
Warn when both SSE and Streamable HTTP blocks are present.
Having both sse and streamable_http configured is a valid
transitional state, but it is unusual in production. A warning is
logged so operators are aware that two transports are active.
Source code in dnallm/mcp/config_validators.py
207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 | |
ModelConfig ¶
Bases: BaseModel
Individual model configuration.
ModelEntryConfig ¶
Bases: BaseModel
Model entry in the main configuration.
Methods:¶
validate_config_path
classmethod
¶
validate_config_path(v)
Validate config path format.
Source code in dnallm/mcp/config_validators.py
114 115 116 117 118 119 120 | |
ModelInfoConfig ¶
Bases: BaseModel
Model information configuration.
MultiModelConfig ¶
Bases: BaseModel
Multi-model parallel prediction configuration.
SSEConfig ¶
Bases: BaseModel
SSE (Server-Sent Events) configuration.
ServerConfig ¶
Bases: BaseModel
Server configuration.
StreamableHTTPConfig ¶
Bases: BaseModel
Streamable HTTP configuration.
Configuration for the Streamable HTTP transport protocol as defined
in the MCP specification 2025-11-25. The default path of /mcp
follows the standard MCP endpoint convention.
Attributes:
| Name | Type | Description |
|---|---|---|
host |
str
|
Host address to bind the HTTP server to. |
port |
int
|
Port number to bind the HTTP server to. |
path |
str
|
URL path for the MCP endpoint (defaults to |
TaskConfig ¶
Bases: BaseModel
Task configuration for DNA prediction models.
Functions:¶
validate_inference_model_config ¶
validate_inference_model_config(config_path)
Validate inference model configuration file.
Source code in dnallm/mcp/config_validators.py
237 238 239 240 241 242 243 244 | |
validate_mcp_server_config ¶
validate_mcp_server_config(config_path)
Validate MCP server configuration file.
Source code in dnallm/mcp/config_validators.py
227 228 229 230 231 232 233 234 | |