Skip to content

Commit b13d9d0

Browse files
feat(mcp-augment): implement AugmentHostStrategy
Extends ClaudeHostStrategy for ~/.augment/settings.json with mcpServers key. Same JSON format and settings-preservation logic as Claude family. Path is identical on macOS and Linux (no platform dispatch needed); returns None for native Windows (WSL uses the Linux path). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 5af34d1 commit b13d9d0

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

hatch/mcp_host_config/strategies.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1053,3 +1053,33 @@ def write_configuration(
10531053
except Exception as e:
10541054
logger.error(f"Failed to write OpenCode configuration: {e}")
10551055
return False
1056+
1057+
1058+
@register_host_strategy(MCPHostType.AUGMENT)
1059+
class AugmentHostStrategy(ClaudeHostStrategy):
1060+
"""Configuration strategy for Augment Code (auggie CLI + extensions).
1061+
1062+
Augment Code stores MCP configuration in ~/.augment/settings.json under
1063+
the 'mcpServers' key -- the same format as Claude. The settings.json file
1064+
may contain other non-MCP Augment settings which are preserved via the
1065+
inherited _preserve_claude_settings() mechanism.
1066+
"""
1067+
1068+
def get_adapter_host_name(self) -> str:
1069+
"""Return the adapter host name for Augment Code."""
1070+
return "augment"
1071+
1072+
def get_config_path(self) -> Optional[Path]:
1073+
"""Get Augment Code configuration path.
1074+
1075+
Same path on macOS, Linux, and Windows WSL.
1076+
Native Windows (non-WSL) is not yet confirmed and returns None.
1077+
"""
1078+
system = platform.system()
1079+
if system in ("Darwin", "Linux"):
1080+
return Path.home() / ".augment" / "settings.json"
1081+
return None
1082+
1083+
def is_host_available(self) -> bool:
1084+
"""Check if Augment Code is installed by checking for ~/.augment/ directory."""
1085+
return (Path.home() / ".augment").exists()

0 commit comments

Comments
 (0)