fix(setup): write MCP grants in Antigravity's own syntax - #33
Merged
Conversation
Greptile SummaryThe PR translates MCP permission patterns into Antigravity’s native grant syntax and adds regression coverage for translation, detection, writes, preservation of existing settings, and idempotence.
|
| Filename | Overview |
|---|---|
| setup | Adds tool-specific MCP permission translation and consistently applies the translated grant during detection and writing. |
| test/setup-mcp.bats | Adds comprehensive regression tests for Antigravity translation, permission detection, settings preservation, refusal behavior, valid JSON, and repeated-run idempotence. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[MCP server definition] --> B[Parse server and permission]
B --> C[mcp_permission_for]
C -->|Antigravity| D["mcp(server/*)"]
C -->|Other tools| E[Original permission]
D --> F[Check existing grant]
E --> F
F -->|Missing| G[Write permission]
F -->|Present| H[Skip prompt and write]
Reviews (2): Last reviewed commit: "test(setup): pin the Antigravity MCP gra..." | Re-trigger Greptile
Owner
Author
|
@greptileai review |
Antigravity parses permission grants as command(...) / mcp(<server>/*). It rejected the Claude-style "mcp__playwright__*" that setup wrote: permission_grant_store.go:367] ignoring invalid allow entry "mcp__playwright__*": invalid grant string: "mcp__playwright__*" and dropped the entry when it rewrote settings.json on its next launch, so setup asked to add the same auto-approve permission on every run. Translate the pattern per tool before checking for or adding it. Verified by running agy: the grant now loads as mcp(playwright/*) with no warning. Cover the translation itself, that a Claude-style grant is not mistaken for the Antigravity one when detecting an existing permission, and that a second pass over an already-granted config neither re-prompts nor duplicates the entry.
rlorenzo
force-pushed
the
fix/antigravity-mcp-grant-syntax
branch
from
September 8, 2026 16:23
bcbed3f to
145658d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
setupre-asked to add auto-approve MCP permissions for Antigravity CLI on every run, even after answering yes:Antigravity parses grants as
command(...)/mcp(<server>/*), not Claude Code'smcp__<server>__*. Its log shows the rejection:It then dropped the entry when rewriting
settings.jsonon the next launch, so the check inis_mcp_permittednever found it again.Fix
mcp_permission_for()translates theMCP_SERVERSpattern into the tool's own grant syntax;configure_mcptranslates once and uses the result for both the check and the write.Verification
Ran
agywithmcp(playwright/*)in the allow list:Parsed, retained, no
invalid allow entrywarning.bash -n setuppasses.