Skip to content

Commit 58b7613

Browse files
author
LittleCoinCoin
committed
fix(lmstudio): user-wide config file of the mcp
Fix the expected path for the LMStudio Strategy to point to `~/.lmstudio/mcp.json` Use the presence of the parent folder of the file (i.e. `~/.lmstudio`) as a hint whether LMStudio is setup.
1 parent ba5a02a commit 58b7613

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

hatch/mcp_host_config/strategies.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -278,22 +278,12 @@ class LMStudioHostStrategy(CursorBasedHostStrategy):
278278

279279
def get_config_path(self) -> Optional[Path]:
280280
"""Get LM Studio configuration path."""
281-
# LM Studio uses application-managed configuration
282-
# Path would be determined by LM Studio's internal structure
283-
system = platform.system()
284-
285-
if system == "Darwin": # macOS
286-
return Path.home() / "Library" / "Application Support" / "LMStudio" / "mcp.json"
287-
elif system == "Windows":
288-
return Path.home() / "AppData" / "Roaming" / "LMStudio" / "mcp.json"
289-
elif system == "Linux":
290-
return Path.home() / ".config" / "LMStudio" / "mcp.json"
291-
return None
281+
return Path.home() / ".lmstudio" / "mcp.json"
292282

293283
def is_host_available(self) -> bool:
294284
"""Check if LM Studio is installed."""
295285
config_path = self.get_config_path()
296-
return config_path is not None and config_path.parent.exists()
286+
return self.get_config_path().parent.exists()
297287

298288

299289
@register_host_strategy(MCPHostType.VSCODE)

0 commit comments

Comments
 (0)