Skip to content

Project-local .antigravitycli/mcp_config.json mcpServers is read but ignored — only HOME-level config actually loads MCP servers #60

Open

Description

@suzuke

Summary

AGY (Antigravity CLI v1.0.0) discovers the project-local <workdir>/.antigravitycli/mcp_config.json file at startup (the discovery is even logged), but its mcpServers field is silently ignored. Only the HOME-level config at ~/.gemini/antigravity-cli/mcp_config.json (post-migration: ~/.gemini/config/mcp_config.json) actually spawns MCP servers.

This breaks tools that want to register a per-project MCP server (in our case a fleet-orchestration bridge) without polluting the user's HOME config.

Empirical reproduction (macOS 14.5, agy 1.0.0)

Setup

Two distinct probe servers, identical schema, written at two paths:

A. Project-local at /tmp/agy-test-995/.antigravitycli/mcp_config.json:

{
  "mcpServers": {
    "project_local_unique": {
      "command": "/usr/bin/env",
      "args": ["python3", "/tmp/agy-mcp-test/server2.py"],
      "env": {"PROJECT_LOCAL_PROBE": "yes"},
      "disabled": false
    }
  }
}

B. HOME-level at ~/.gemini/antigravity-cli/mcp_config.json (pre-existing operator config):

{
  "mcpServers": {
    "agy_test_probe": {
      "command": "/usr/bin/env",
      "args": ["python3", "/tmp/agy-mcp-test/server.py"],
      "env": {"AGY_PROBE_MARKER": "agend-terminal-mcp-test"},
      "disabled": false
    }
  }
}

The two probes log to distinct files (server.log and server2.log) so we can tell which one AGY actually started.

Run

cd /tmp/agy-test-995/
agy --dangerously-skip-permissions

Result

AGY's own log (~/.gemini/antigravity-cli/log/cli-*.log) shows it discovered the project-local config:

I... project.go:64] project: discovered project ... via /tmp/agy-test-995/.antigravitycli
I... common.go:156] project: using project ... at /private/tmp/agy-test-995/.antigravitycli/mcp_config.json

But only the HOME-level server starts:

  • /tmp/agy-mcp-test/server.log — populated immediately with initialize + tools/list (server B = agy_test_probe, HOME-level)
  • /tmp/agy-mcp-test/server2.log — empty (server A = project_local_unique, project-local). The server was never spawned.

When the project-local config is empty/absent, only HOME-level entries load (as expected). When the HOME-level config is removed, agy starts no MCP servers at all — confirming the project-local mcpServers is universally ignored.

Expected behaviour

project: using project ... at <path>/mcp_config.json reads as a contract that mcpServers will be loaded from that file. We expect AGY to:

  1. Spawn MCP servers from BOTH project-local and HOME-level configs, OR
  2. Spawn from project-local with project-local taking precedence, OR
  3. Document explicitly which fields of the project-local file are honored

Currently the project-local file is recognized only for project-ID storage (the file's outer JSON keys appear to be project metadata) and its mcpServers map is silently dropped.

Impact

This forces external tools (orchestration agents, project-local sandboxes, dev-environment provisioners) to either:

  • write to the user's HOME config (mixing per-project tools into the user's personal AGY setup — fragile under multi-project use)
  • skip MCP registration entirely and lose AGY integration

For our fleet (multi-instance agent orchestration), this means agy backend instances spawn without their orchestration bridge — they cannot send messages, drain inboxes, or claim tasks. We currently ship the agy backend with a [fleet-mcp-unsupported] warning until this is resolved upstream.

Possibly-related

Request

Plumb the project-local mcpServers field into the same MCP server spawn loop that ~/.gemini/config/mcp_config.json (or its legacy ~/.gemini/antigravity-cli/mcp_config.json symlink) uses. Optionally support merge semantics (project-local overrides HOME-level by server name).

System info

  • macOS 14.5
  • agy 1.0.0 (verified via agy --version)
  • AppDataDir resolves to ~/.gemini/antigravity-cli (visible in Creating CLI server backend: ... appDataDir=... log line)

Activity

  1. added a commit that references this issue on May 20, 2026
  2. HakAl commented on May 30, 2026

    @HakAl

    +1
    Same blocker for a bounded agent-dispatch substrate. We need each spawned worker to load its own MCP server scoped to that worker's identity/DB, without touching the shared HOME config (workers run concurrently under different identities). Beyond project-local files, a per-invocation --mcp-config flag (analog of Claude Code's --mcp-config / --strict-mcp-config) would fully solve it — project-local files still can't disambiguate two workers in the same project. Either fix unblocks us; both would be ideal.

  3. cheerc commented on Jun 1, 2026

    @cheerc

    Additional evidence + workaround via .agents/mcp_config.json

    Confirming the issue with additional findings from binary analysis. Also discovered a working workaround.

    Binary strings evidence

    strings on the agy binary (v1.0.3, macOS) reveals an embedded Customization Roots system with customizations/mcp.go as a dedicated module:

    third_party/jetski/cortex/customizations/mcp.go     ← MCP is part of the customization system
    third_party/jetski/cortex/customizations/discovery.go
    third_party/jetski/cortex/customizations/rules.go
    

    The embedded docs describe two customization roots:

    1. Global: ~/.gemini/config/ (dynamic, resolved at runtime)
    2. Workspace: .agents/ relative to workspace root

    The .antigravitycli/ directory is NOT a customization root — it's only used for project-ID symlinks (<uuid>.json → ~/.gemini/config/projects/<uuid>.json).

    Workaround: .agents/mcp_config.json

    Placing mcp_config.json in the workspace customization root (.agents/) instead of .antigravitycli/ works:

    # 1. Clear global config
    echo '{"mcpServers": {}}' > ~/.gemini/antigravity-cli/mcp_config.json
    
    # 2. Place project-scoped config
    mkdir -p <workspace>/.agents
    cat > <workspace>/.agents/mcp_config.json << 'EOF'
    {
      "mcpServers": {
        "my-project-server": {
          "command": "/path/to/server",
          "args": []
        }
      }
    }
    EOF
    
    # 3. Start agy in the workspace — MCP server loads!
    cd <workspace> && agy

    Verified: MCP servers defined in .agents/mcp_config.json load correctly and are scoped to that workspace only. Other workspaces don't see them.

    Root cause hypothesis

    Based on the binary structure, .antigravitycli/ is a project metadata directory (stores project UUID + symlinks), not a customization root. The customizations/discovery.go module discovers customization items from ~/.gemini/config/ and <workspace>/.agents/, but NOT from .antigravitycli/.

    The log line project: using project ... at <path>/mcp_config.json is misleading — it refers to reading the project file for metadata, not for MCP server config.

    Additional note: correct global config path

    The real CLI config path is ~/.gemini/antigravity-cli/mcp_config.json (app data dir), not ~/.gemini/config/mcp_config.json (which appears to be for Antigravity 2.0 GUI). The CHANGELOG v1.0.3 mentions a migration from mcp_config.json to config/mcp_config.json, but for the CLI binary specifically, the app data dir path is authoritative.

    System info: macOS, agy 1.0.3

  4. pr656d commented on Jul 17, 2026

    @pr656d

    .agents/mcp_config.json workaround appears regressed on 1.1.3

    Tested the workaround from #60 (comment) on agy 1.1.3 (macOS, latest per agy update) — it no longer works for me.

    Setup: fresh workspace containing only .agents/mcp_config.json with a single stdio server:

    {
      "mcpServers": {
        "agy-probe": {
          "command": "npx",
          "args": ["-y", "@upstash/context7-mcp"]
        }
      }
    }

    Results:

    1. With HOME-level config present (~/.gemini/antigravity-cli/mcp_config.json + ~/.gemini/config/mcp_config.json populated): a session started in the workspace lists only the HOME-level servers; agy-probe never loads.
    2. With both HOME-level configs emptied to {"mcpServers": {}} (the workaround's step 1): the session reports zero MCP servers — the workspace .agents/mcp_config.json is still not read.
    3. cli.log and the per-session logs contain no discovery lines referencing the workspace mcp_config.json in either case.

    For contrast, HOME-level servers (both stdio and remote serverUrl) load fine in the same sessions, so this isn't a general MCP failure — the workspace customization root just doesn't seem to be consulted for MCP config on 1.1.3, even though it reportedly worked on 1.0.3 per the comment above.

    System info: macOS 15 (Darwin 25.5.0), agy 1.1.3.

  5. added
    bugSomething isn't working
    subtype:macOSmacOS specific issues (e.g., /var symlink handling)
    comp:customizationsPlugins & Skills, MCP, Status Line, Window Title
    on Aug 20, 2026
  6. added a commit that references this issue on Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugSomething isn't workingcomp:customizationsPlugins & Skills, MCP, Status Line, Window Titlesubtype:macOSmacOS specific issues (e.g., /var symlink handling)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions