A thin, auditable MCP server wrapping the Antigravity CLI (agy). Forward-compatible with future CLI flags via extra_args passthrough.
Project description
antigravity-cli-mcp-slim
A thin, auditable MCP server wrapping the Antigravity CLI (agy).
Why
When you add an MCP server to your AI coding tool, every prompt and code snippet
you send flows through that wrapper. Most CLI-wrapping MCP servers are small,
individually maintained packages — and recent supply-chain incidents
(xz-utils, postmark-mcp, the npm chalk/debug compromise) show that
"small and useful" is not the same as "safe to trust blindly."
This project takes the opposite stance: instead of asking you to trust it, it tries to be easy to audit.
- Single file — the whole server is
src/antigravity_cli_mcp_slim/server.py, readable end-to-end in one sitting - One third-party dependency (
mcp) — minimal supply-chain surface - Faithful CLI mapping — every typed parameter mirrors a real
agyflag by name, so it is obvious which flags an invocation actually sets - Forward-compatible — any new or uncommon
agyflag is reachable viaextra_argswithout touching this server - Configurable binary path —
$AGY_CMDlets you swap or wrap theagybinary - Transparent — every invocation logs the exact argv to stderr
Read server.py before you install. That is the point.
Prerequisites
- The
agyCLI installed and on$PATH(or pointed to via$AGY_CMD). See the official Antigravity CLI repository and install docs. agyalready authenticated — this wrapper does not manage login; it surfacesagy's own error output if the CLI is not ready.
Installation
# Run directly without installing
uvx antigravity-cli-mcp-slim
# Install from PyPI
pip install antigravity-cli-mcp-slim
# Run from GitHub HEAD
uvx --from git+https://github.com/tksfjt1024/antigravity-cli-mcp-slim antigravity-cli-mcp-slim
Usage as an MCP server
Claude Code
claude mcp add antigravity-cli uvx antigravity-cli-mcp-slim
Or manually in ~/.claude.json:
{
"mcpServers": {
"antigravity-cli": {
"type": "stdio",
"command": "uvx",
"args": ["antigravity-cli-mcp-slim"]
}
}
}
If agy is not on the launching process's $PATH, point $AGY_CMD at it:
{
"mcpServers": {
"antigravity-cli": {
"type": "stdio",
"command": "uvx",
"args": ["antigravity-cli-mcp-slim"],
"env": { "AGY_CMD": "/absolute/path/to/agy" }
}
}
}
Other MCP clients
Any MCP-compatible client can launch the server via stdio:
uvx antigravity-cli-mcp-slim
Tool: consult_agy
Runs a single agy invocation in non-interactive print mode (agy --print).
agy is an agentic assistant: it autonomously reads files in directory
(and any add_dir) to fulfill the request, then prints the response.
| Parameter | Type | Description |
|---|---|---|
query (required) |
string | Prompt sent verbatim to agy --print |
directory (required) |
string | Working directory (agy cwd); the default workspace root |
add_dir |
string[] | Extra workspace directories; each maps to one --add-dir (repeatable, not comma-joined) |
dangerously_skip_permissions |
bool | Pass --dangerously-skip-permissions (auto-approve all tool requests). See warning below |
sandbox |
bool | Pass --sandbox (terminal restrictions enabled) |
continue |
bool | Pass --continue (resume the most recent conversation). Mutually exclusive with conversation |
conversation |
string | Pass --conversation <ID> (resume a specific conversation). Mutually exclusive with continue |
print_timeout |
string | Pass --print-timeout (Go duration, e.g. 5m0s). Keep shorter than timeout_seconds |
extra_args |
string[] | Raw CLI flags appended verbatim. Use for new/uncommon agy flags |
env |
object | Extra environment variables for the agy subprocess |
timeout_seconds |
int | Hard wall-clock timeout for the subprocess (default 660) |
Security note: dangerously_skip_permissions
dangerously_skip_permissions: true passes --dangerously-skip-permissions,
which auto-approves all of agy's tool permission requests — including
running shell commands and editing files — with no prompt. The parameter keeps
the dangerously_ prefix on purpose: enable it only in a trusted, isolated
workspace where you fully trust the prompt. It defaults to false.
Cross-repository analysis example
Analyze multiple repositories from a single invocation by adding directories to the workspace:
{
"name": "consult_agy",
"arguments": {
"query": "Compare the API surface of the main service with the clients that call it",
"directory": "/path/to/main-service",
"add_dir": [
"/path/to/client-a",
"/path/to/client-b"
]
}
}
This launches agy --print "..." --add-dir /path/to/client-a --add-dir /path/to/client-b,
giving the agent read access to all three workspaces in one session.
Conversation continuity
agy can resume prior conversations. This wrapper exposes that directly and
stays stateless itself:
continue: trueresumes the most recent conversation. Because "most recent" is shared state, concurrent calls can race on it — preferconversationwhen it matters.conversation: "<ID>"resumes a specific conversation by id.
The two are mutually exclusive; passing both returns an error.
Timeout configuration
There are two independent timeouts:
print_timeout—agy's own wait timeout (Go duration;agydefaults to about 5 minutes).timeout_seconds— this wrapper's hard wall-clock limit (default 660).
Keep timeout_seconds longer than print_timeout so agy can finish or time
out cleanly before the wrapper force-kills the subprocess. When you raise
print_timeout for a long task, raise timeout_seconds to match.
Forward-compatibility example
If a future agy release adds a new flag (say --super-mode), use it
immediately without updating this server:
{
"name": "consult_agy",
"arguments": {
"query": "...",
"directory": "...",
"extra_args": ["--super-mode"]
}
}
Configuration
| Environment variable | Default | Purpose |
|---|---|---|
AGY_CMD |
agy |
Path to the agy CLI binary |
ANTIGRAVITY_CLI_MCP_SLIM_TIMEOUT |
660 |
Default subprocess timeout in seconds |
ANTIGRAVITY_CLI_MCP_SLIM_LOG_LEVEL |
INFO |
Logging level for stderr diagnostics |
Development
# Install dev dependencies
pip install -e ".[test,dev]"
# Lint
ruff check .
# Test
pytest
License
MIT © tksfjt1024
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file antigravity_cli_mcp_slim-0.1.0.tar.gz.
File metadata
- Download URL: antigravity_cli_mcp_slim-0.1.0.tar.gz
- Upload date:
- Size: 14.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8cd711353c2fc049c33e0c9de0d065696015f5804a6cfb86055ff34721888191
|
|
| MD5 |
149112a9ecc055263e48c6158f86798e
|
|
| BLAKE2b-256 |
2588e81e040e4f9d29814cc1dc3016aff856be4ca4ba65f0bb62dc16e7a6b9e9
|
Provenance
The following attestation bundles were made for antigravity_cli_mcp_slim-0.1.0.tar.gz:
Publisher:
publish.yml on tksfjt1024/antigravity-cli-mcp-slim
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
antigravity_cli_mcp_slim-0.1.0.tar.gz -
Subject digest:
8cd711353c2fc049c33e0c9de0d065696015f5804a6cfb86055ff34721888191 - Sigstore transparency entry: 1633748588
- Sigstore integration time:
-
Permalink:
tksfjt1024/antigravity-cli-mcp-slim@16db0666b2abf05e86be7793887affc8b344e673 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/tksfjt1024
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@16db0666b2abf05e86be7793887affc8b344e673 -
Trigger Event:
push
-
Statement type:
File details
Details for the file antigravity_cli_mcp_slim-0.1.0-py3-none-any.whl.
File metadata
- Download URL: antigravity_cli_mcp_slim-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f721f50d4104ea22b5a0514ef7a7a7ce6a2b226f521eb98e762dda7e56036793
|
|
| MD5 |
d292baf6d7ebee7818c1a4289c100273
|
|
| BLAKE2b-256 |
d063a8f594145b652822fda4db883a90545b2b272971fdcd2f429c680114a42f
|
Provenance
The following attestation bundles were made for antigravity_cli_mcp_slim-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on tksfjt1024/antigravity-cli-mcp-slim
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
antigravity_cli_mcp_slim-0.1.0-py3-none-any.whl -
Subject digest:
f721f50d4104ea22b5a0514ef7a7a7ce6a2b226f521eb98e762dda7e56036793 - Sigstore transparency entry: 1633748611
- Sigstore integration time:
-
Permalink:
tksfjt1024/antigravity-cli-mcp-slim@16db0666b2abf05e86be7793887affc8b344e673 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/tksfjt1024
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@16db0666b2abf05e86be7793887affc8b344e673 -
Trigger Event:
push
-
Statement type: