mcp.servers.compatibility¶
Backward compatibility layer for MCPServerManager migration.
This module provides a compatibility wrapper that allows existing code using MCPServerManager to work with the new Pydantic-based implementation without modification.
Example
Existing code will continue to work:
from haive.mcp.servers import MCPServerManager # Works via compatibility
manager = MCPServerManager()
manager.run() # Legacy API still works
Classes¶
Compatibility wrapper for legacy MCPServerManager. |
Functions¶
|
Helper to migrate from legacy to V2 manager. |
Module Contents¶
- class mcp.servers.compatibility.MCPServerManager(*args, **kwargs)¶
Bases:
mcp.servers.mcp_server_manager_v2.MCPServerManagerV2
Compatibility wrapper for legacy MCPServerManager.
This class provides full backward compatibility with the original MCPServerManager while using the new Pydantic-based implementation under the hood.
Note
This is a transitional class. New code should use MCPServerManagerV2 directly for better type safety and validation.
- check_server_startup(process, name, timeout=5.0)¶
Legacy synchronous startup check.
- mcp.servers.compatibility.migrate_to_v2(legacy_manager: mcp.servers.mcp_server_manager.MCPServerManager) mcp.servers.mcp_server_manager_v2.MCPServerManagerV2 ¶
Helper to migrate from legacy to V2 manager.
- Parameters:
legacy_manager – Existing MCPServerManager instance
- Returns:
MCPServerManagerV2 with same configuration
Example
>>> legacy = MCPServerManager() >>> legacy.start_server("filesystem") >>> v2_manager = migrate_to_v2(legacy) >>> # v2_manager now has same servers running