MCPcopy Create free account
hub / github.com/IBM/mcp-cli / to_unified

Method to_unified

src/mcp_cli/config/server_models.py:198–219  ·  view source on GitHub ↗

Convert to immutable UnifiedServerConfig.

(self, name: str)

Source from the content-addressed store, hash-verified

196 model_config = {"frozen": False, "extra": "ignore"}
197
198 def to_unified(self, name: str) -> UnifiedServerConfig:
199 """Convert to immutable UnifiedServerConfig."""
200 # Parse OAuth if it's a dict
201 oauth_config = None
202 if self.oauth:
203 if isinstance(self.oauth, dict):
204 oauth_config = OAuthConfig.model_validate(self.oauth)
205 else:
206 oauth_config = self.oauth
207
208 return UnifiedServerConfig(
209 name=name,
210 url=self.url,
211 headers=self.headers,
212 oauth=oauth_config,
213 command=self.command,
214 args=self.args,
215 env=self.env,
216 disabled=self.disabled,
217 tool_timeout=self.tool_timeout,
218 init_timeout=self.init_timeout,
219 )
220
221
222__all__ = [

Calls 1

UnifiedServerConfigClass · 0.85