Skip to content

Commit 63efad7

Browse files
author
LittleCoinCoin
committed
fix: config path handling
1 parent 1b1dd1a commit 63efad7

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

hatch/mcp_host_config/strategies.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -433,8 +433,12 @@ def validate_server_config(self, server_config: MCPServerConfig) -> bool:
433433

434434
def read_configuration(self) -> HostConfiguration:
435435
"""Read Kiro configuration file."""
436-
config_path = self.get_config_path()
437-
if not config_path or not config_path.exists():
436+
config_path_str = self.get_config_path()
437+
if not config_path_str:
438+
return HostConfiguration(servers={})
439+
440+
config_path = Path(config_path_str)
441+
if not config_path.exists():
438442
return HostConfiguration(servers={})
439443

440444
try:
@@ -459,10 +463,12 @@ def read_configuration(self) -> HostConfiguration:
459463

460464
def write_configuration(self, config: HostConfiguration, no_backup: bool = False) -> bool:
461465
"""Write configuration to Kiro with backup support."""
462-
config_path = self.get_config_path()
463-
if not config_path:
466+
config_path_str = self.get_config_path()
467+
if not config_path_str:
464468
return False
465469

470+
config_path = Path(config_path_str)
471+
466472
try:
467473
# Ensure directory exists
468474
config_path.parent.mkdir(parents=True, exist_ok=True)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"mcpServers": {
3+
"test_server": {
4+
"command": "auggie",
5+
"args": [
6+
"--mcp"
7+
],
8+
"disabled": false,
9+
"autoApprove": [
10+
"codebase-retrieval"
11+
]
12+
}
13+
}
14+
}

0 commit comments

Comments
 (0)