Repository navigation
Description
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-permissionsResult
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 withinitialize+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:
- Spawn MCP servers from BOTH project-local and HOME-level configs, OR
- Spawn from project-local with project-local taking precedence, OR
- 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
is hidden: ignore urirejects workspaces with any dot-prefixed ancestor, even when the workspace itself isn't hidden #20 (workspace folders rejected when path is "hidden" —file://URIs under dot-prefixed dirs like~/.agend-terminal/...) — different surface but the same class of project-local config-handling regression. Workspace addition fails silently; project-localmcpServersfails silently. Both observable only viacli.loginspection.
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 inCreating CLI server backend: ... appDataDir=...log line)
Activity
docs(#704 sub-task 3 follow-up): add agy backend to release smoke che…
HakAl commentedon May 30, 2026
+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.
cheerc commentedon Jun 1, 2026
Additional evidence + workaround via
.agents/mcp_config.jsonConfirming the issue with additional findings from binary analysis. Also discovered a working workaround.
Binary strings evidence
stringson the agy binary (v1.0.3, macOS) reveals an embedded Customization Roots system withcustomizations/mcp.goas a dedicated module:The embedded docs describe two customization roots:
~/.gemini/config/(dynamic, resolved at runtime).agents/relative to workspace rootThe
.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.jsonPlacing
mcp_config.jsonin the workspace customization root (.agents/) instead of.antigravitycli/works:Verified: MCP servers defined in
.agents/mcp_config.jsonload 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. Thecustomizations/discovery.gomodule discovers customization items from~/.gemini/config/and<workspace>/.agents/, but NOT from.antigravitycli/.The log line
project: using project ... at <path>/mcp_config.jsonis 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 frommcp_config.jsontoconfig/mcp_config.json, but for the CLI binary specifically, the app data dir path is authoritative.System info: macOS, agy 1.0.3
hatch: fix agy MCP path for Antigravity CLI runtime (not Gemini legacy)
fix(agy): register MCP servers in the post-migration read-path (~/.ge…
fix(agy): register MCP servers in the post-migration read-path (~/.ge…
feat(bl045): wire agy's MCP bridge via HOME-level config -- VERIFIED …
pr656d commentedon Jul 17, 2026
.agents/mcp_config.jsonworkaround appears regressed on 1.1.3Tested 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.jsonwith a single stdio server:{ "mcpServers": { "agy-probe": { "command": "npx", "args": ["-y", "@upstash/context7-mcp"] } } }Results:
~/.gemini/antigravity-cli/mcp_config.json+~/.gemini/config/mcp_config.jsonpopulated): a session started in the workspace lists only the HOME-level servers;agy-probenever loads.{"mcpServers": {}}(the workaround's step 1): the session reports zero MCP servers — the workspace.agents/mcp_config.jsonis still not read.cli.logand the per-session logs contain no discovery lines referencing the workspacemcp_config.jsonin 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.
feat: bridge openclaw's MCP tools into agy
docs(gotchas): document codex's project-local .codex/config.toml as t…
#101:平板念群消息跳句重念、群里吞掉哈基米的话、哈基米没有 MCP 工具