Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion internal/agents/antigravity/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ func (a *Adapter) MCPStrategy() model.MCPStrategy {
// --- MCP ---

func (a *Adapter) MCPConfigPath(homeDir string, _ string) string {
return filepath.Join(a.antigravityVariantDir(homeDir), "mcp_config.json")
// Antigravity uses a shared global config for MCP across CLI, Desktop, and IDE.
return filepath.Join(homeDir, ".gemini", "config", "mcp_config.json")
Comment on lines +108 to +109
}

// --- Optional capabilities ---
Expand Down
10 changes: 6 additions & 4 deletions internal/agents/antigravity/adapter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,9 @@ func TestConfigPathsCLIOnly(t *testing.T) {
if got := a.SettingsPath(home); got != filepath.Join(cliDir, "settings.json") {
t.Fatalf("SettingsPath() = %q, want %q", got, filepath.Join(cliDir, "settings.json"))
}
if got := a.MCPConfigPath(home, "ctx7"); got != filepath.Join(cliDir, "mcp_config.json") {
t.Fatalf("MCPConfigPath() = %q, want %q", got, filepath.Join(cliDir, "mcp_config.json"))
wantMCP := filepath.Join(home, ".gemini", "config", "mcp_config.json")
if got := a.MCPConfigPath(home, "ctx7"); got != wantMCP {
t.Fatalf("MCPConfigPath() = %q, want %q", got, wantMCP)
}
}

Expand All @@ -193,8 +194,9 @@ func TestConfigPathsDesktopOnly(t *testing.T) {
if got := a.SettingsPath(home); got != filepath.Join(desktopDir, "settings.json") {
t.Fatalf("SettingsPath() = %q, want %q", got, filepath.Join(desktopDir, "settings.json"))
}
if got := a.MCPConfigPath(home, "ctx7"); got != filepath.Join(desktopDir, "mcp_config.json") {
t.Fatalf("MCPConfigPath() = %q, want %q", got, filepath.Join(desktopDir, "mcp_config.json"))
wantMCP := filepath.Join(home, ".gemini", "config", "mcp_config.json")
if got := a.MCPConfigPath(home, "ctx7"); got != wantMCP {
t.Fatalf("MCPConfigPath() = %q, want %q", got, wantMCP)
}
}

Expand Down
8 changes: 4 additions & 4 deletions internal/components/engram/inject_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ func TestInjectGeminiToolsFlagPresent(t *testing.T) {
}
}

func TestInjectAntigravityWritesMCPToCLIConfig(t *testing.T) {
func TestInjectAntigravityWritesMCPToGlobalConfig(t *testing.T) {
home := t.TempDir()

result, err := Inject(home, antigravityAdapter())
Expand All @@ -568,10 +568,10 @@ func TestInjectAntigravityWritesMCPToCLIConfig(t *testing.T) {
t.Fatalf("Inject(antigravity) changed = false")
}

cliMCPPath := filepath.Join(home, ".gemini", "antigravity-cli", "mcp_config.json")
content, err := os.ReadFile(cliMCPPath)
globalMCPPath := filepath.Join(home, ".gemini", "config", "mcp_config.json")
content, err := os.ReadFile(globalMCPPath)
if err != nil {
t.Fatalf("ReadFile(%q) error = %v", cliMCPPath, err)
t.Fatalf("ReadFile(%q) error = %v", globalMCPPath, err)
}
text := string(content)
if !strings.Contains(text, `"args": [`) || !strings.Contains(text, `"mcp"`) {
Expand Down
4 changes: 2 additions & 2 deletions internal/components/golden_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -896,8 +896,8 @@ func TestGoldenEngram_Antigravity(t *testing.T) {
t.Fatalf("engram.Inject(antigravity) changed = false")
}

// MCP config written to ~/.gemini/antigravity-cli/mcp_config.json.
mcpJSON := readTestFile(t, filepath.Join(home, ".gemini", "antigravity-cli", "mcp_config.json"))
// MCP config written to ~/.gemini/config/mcp_config.json.
mcpJSON := readTestFile(t, filepath.Join(home, ".gemini", "config", "mcp_config.json"))
Comment on lines +899 to +900
assertGolden(t, "engram-antigravity-mcp.golden", mcpJSON)

// GEMINI.md must contain the engram-protocol section.
Expand Down