Helper function to check that the server object is supported Args: server_object: The server object to check. Returns: True if it's supported.
(server_object: Any, object_name: str)
| 141 | spec.loader.exec_module(module) |
| 142 | |
| 143 | def _check_server_object(server_object: Any, object_name: str): |
| 144 | """Helper function to check that the server object is supported |
| 145 | |
| 146 | Args: |
| 147 | server_object: The server object to check. |
| 148 | |
| 149 | Returns: |
| 150 | True if it's supported. |
| 151 | """ |
| 152 | if not isinstance(server_object, MCPServer): |
| 153 | logger.error(f"The server object {object_name} is of type {type(server_object)} (expecting {MCPServer}).") |
| 154 | if isinstance(server_object, LowLevelServer): |
| 155 | logger.warning("Note that only MCPServer is supported. Low level Server class is not yet supported.") |
| 156 | return False |
| 157 | return True |
| 158 | |
| 159 | # If no object specified, try common server names |
| 160 | if not server_object: |
no test coverage detected