Skip to content

Commit 65ac791

Browse files
committed
fix: reduce log level for missing client config files from warning to debug
Missing client config files are normal when clients aren't installed. This reduces noise in the default log output while still providing debug information when needed.
1 parent 0d5a8de commit 65ac791

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

src/mcpm/clients/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ def _load_config(self) -> Dict[str, Any]:
186186
empty_config = {self.configure_key_name: {}}
187187

188188
if not os.path.exists(self.config_path):
189-
logger.warning(f"Client config file not found at: {self.config_path}")
189+
logger.debug(f"Client config file not found at: {self.config_path}")
190190
return empty_config
191191

192192
try:
@@ -403,7 +403,7 @@ def _load_config(self) -> Dict[str, Any]:
403403
empty_config = self._get_empty_config()
404404

405405
if not os.path.exists(self.config_path):
406-
logger.warning(f"Client config file not found at: {self.config_path}")
406+
logger.debug(f"Client config file not found at: {self.config_path}")
407407
return empty_config
408408

409409
try:

src/mcpm/commands/client.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -194,13 +194,14 @@ def list_clients(verbose):
194194
console.print(table)
195195
console.print()
196196

197-
# Show uninstalled clients in compact format
197+
# Show uninstalled clients in compact format with client codes
198198
if uninstalled_client_names:
199199
uninstalled_display_names = []
200200
for client_name in sorted(uninstalled_client_names):
201201
client_info = ClientRegistry.get_client_info(client_name)
202202
display_name = client_info.get("name", client_name)
203-
uninstalled_display_names.append(display_name)
203+
# Include client code for undetected clients
204+
uninstalled_display_names.append(f"{display_name} ({client_name})")
204205

205206
console.print(f"[dim]Additional supported clients (not detected): {', '.join(uninstalled_display_names)}[/]")
206207
console.print()
@@ -242,9 +243,11 @@ def edit_client(client_name, external, config_path_override):
242243
display_name = client_info.get("name", client_name)
243244

244245
# Check if the client is installed
245-
if not client_manager.is_client_installed():
246-
print_error(f"{display_name} installation not detected.")
247-
return
246+
client_is_installed = client_manager.is_client_installed()
247+
if not client_is_installed:
248+
console.print(f"[yellow]⚠️ {display_name} installation not detected.[/]")
249+
console.print(f"[yellow]Config file will be created at: {client_manager.config_path}[/]")
250+
console.print(f"[dim]You can still configure servers, but make sure to install {display_name} later.[/]\n")
248251

249252
# Get the client config file path
250253
config_path = client_manager.config_path

0 commit comments

Comments
 (0)