Skip to content

fix(setup): write MCP grants in Antigravity's own syntax - #33

Merged
rlorenzo merged 1 commit into
mainfrom
fix/antigravity-mcp-grant-syntax
Sep 8, 2026
Merged

fix(setup): write MCP grants in Antigravity's own syntax#33
rlorenzo merged 1 commit into
mainfrom
fix/antigravity-mcp-grant-syntax

Conversation

@rlorenzo

@rlorenzo rlorenzo commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Problem

setup re-asked to add auto-approve MCP permissions for Antigravity CLI on every run, even after answering yes:

── Antigravity CLI MCP Servers ──
  MCP servers already configured

  Auto-approve permissions to add:

  • mcp__playwright__*

Antigravity parses grants as command(...) / mcp(<server>/*), not Claude Code's mcp__<server>__*. Its log shows the rejection:

permission_grant_store.go:367] ignoring invalid allow entry
"mcp__playwright__*": invalid grant string: "mcp__playwright__*"

It then dropped the entry when rewriting settings.json on the next launch, so the check in is_mcp_permitted never found it again.

Fix

mcp_permission_for() translates the MCP_SERVERS pattern into the tool's own grant syntax; configure_mcp translates once and uses the result for both the check and the write.

Verification

Ran agy with mcp(playwright/*) in the allow list:

CLI settings initialized: permissions=&{Allow:[... mcp(playwright/*)] Deny:[] Ask:[]}

Parsed, retained, no invalid allow entry warning. bash -n setup passes.

@greptile-apps

greptile-apps Bot commented Sep 6, 2026

Copy link
Copy Markdown

Greptile Summary

The 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.

  • Antigravity now receives mcp(<server>/*) grants instead of Claude-style patterns.
  • The translated value is consistently used for permission checks and writes.
  • The new Bats suite directly addresses the prior request for automated regression coverage.

Confidence Score: 5/5

The PR appears safe to merge; the Antigravity grant fix is internally consistent and now has targeted regression coverage.

No actionable new defects or outstanding findings remain. The previous regression-test suggestion was addressed by the added Bats suite and its thread was manually resolved without explanation.

Important Files Changed

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]
Loading

Reviews (2): Last reviewed commit: "test(setup): pin the Antigravity MCP gra..." | Re-trigger Greptile

Comment thread setup
@rlorenzo

rlorenzo commented Sep 8, 2026

Copy link
Copy Markdown
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
rlorenzo force-pushed the fix/antigravity-mcp-grant-syntax branch from bcbed3f to 145658d Compare September 8, 2026 16:23
@rlorenzo
rlorenzo merged commit 3a832d2 into main Sep 8, 2026
5 checks passed
@rlorenzo
rlorenzo deleted the fix/antigravity-mcp-grant-syntax branch September 8, 2026 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant