|
4 | 4 |
|
5 | 5 | import logging |
6 | 6 | import os |
7 | | -from typing import Any, Dict |
| 7 | +from typing import Any, Dict, override |
8 | 8 |
|
9 | 9 | from mcpm.clients.base import JSONClientManager |
10 | | -from mcpm.schemas.server_config import ServerConfig |
| 10 | +from mcpm.schemas.server_config import ServerConfig, SSEServerConfig, STDIOServerConfig |
11 | 11 | from mcpm.utils.router_server import format_server_url_with_proxy_headers |
12 | 12 |
|
13 | 13 | logger = logging.getLogger(__name__) |
@@ -116,8 +116,18 @@ def is_server_disabled(self, server_name: str) -> bool: |
116 | 116 | def _format_router_server(self, profile_name, base_url) -> ServerConfig: |
117 | 117 | return format_server_url_with_proxy_headers(self.client_key, profile_name, base_url) |
118 | 118 |
|
119 | | - # Uses base class implementation of remove_server |
120 | | - |
121 | | - # Uses base class implementation of get_server |
122 | | - |
123 | | - # Uses base class implementation of list_servers |
| 119 | + @override |
| 120 | + def to_client_format(self, server_config: ServerConfig) -> Dict[str, Any]: |
| 121 | + if isinstance(server_config, SSEServerConfig): |
| 122 | + # use mcp proxy to convert to stdio as sse is not supported for claude desktop yet |
| 123 | + return self.to_client_format( |
| 124 | + STDIOServerConfig( |
| 125 | + name=server_config.name, |
| 126 | + command="uvx", |
| 127 | + args=[ |
| 128 | + "mcp-proxy", |
| 129 | + server_config.url, |
| 130 | + ], |
| 131 | + ) |
| 132 | + ) |
| 133 | + return super().to_client_format(server_config) |
0 commit comments