STDIO server configuration.
| 33 | |
| 34 | |
| 35 | class STDIOServerConfig(BaseModel): |
| 36 | """STDIO server configuration.""" |
| 37 | |
| 38 | name: str |
| 39 | command: str |
| 40 | args: list[str] = Field(default_factory=list) |
| 41 | env: dict[str, str] = Field(default_factory=dict) |
| 42 | disabled: bool = False |
| 43 | tool_timeout: float | None = Field( |
| 44 | default=None, description="Per-server tool timeout" |
| 45 | ) |
| 46 | init_timeout: float | None = Field( |
| 47 | default=None, description="Per-server init timeout" |
| 48 | ) |
| 49 | |
| 50 | model_config = {"frozen": True} |
| 51 | |
| 52 | @field_validator("command") |
| 53 | @classmethod |
| 54 | def validate_command(cls, v: str) -> str: |
| 55 | """Validate command is not empty.""" |
| 56 | if not v or not v.strip(): |
| 57 | raise ValueError("Command cannot be empty") |
| 58 | return v.strip() |
| 59 | |
| 60 | |
| 61 | class OAuthConfig(BaseModel): |
no outgoing calls