Skip to main content

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

PyPI version Python versions License: MIT CI

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 agy flag by name, so it is obvious which flags an invocation actually sets
  • Forward-compatible — any new or uncommon agy flag is reachable via extra_args without touching this server
  • Configurable binary path$AGY_CMD lets you swap or wrap the agy binary
  • Transparent — every invocation logs the exact argv to stderr

Read server.py before you install. That is the point.

Prerequisites

  • The agy CLI installed and on $PATH (or pointed to via $AGY_CMD). See the official Antigravity CLI repository and install docs.
  • agy already authenticated — this wrapper does not manage login; it surfaces agy'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: true resumes the most recent conversation. Because "most recent" is shared state, concurrent calls can race on it — prefer conversation when 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_timeoutagy's own wait timeout (Go duration; agy defaults 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

antigravity_cli_mcp_slim-0.1.1.tar.gz (14.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

antigravity_cli_mcp_slim-0.1.1-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file antigravity_cli_mcp_slim-0.1.1.tar.gz.

File metadata

  • Download URL: antigravity_cli_mcp_slim-0.1.1.tar.gz
  • Upload date:
  • Size: 14.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for antigravity_cli_mcp_slim-0.1.1.tar.gz
Algorithm Hash digest
SHA256 584816e4e699c01945f7d5cd527855d68d67ecd2baa05034f63c53440b288d75
MD5 07767f10fd8d540eb1ea3e50d0b76ccc
BLAKE2b-256 ffd56d6ef5d62fa52c81125fcb2841ba9f997cb0146e0cc9d88891f798d3a78c

See more details on using hashes here.

Provenance

The following attestation bundles were made for antigravity_cli_mcp_slim-0.1.1.tar.gz:

Publisher: publish.yml on tksfjt1024/antigravity-cli-mcp-slim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file antigravity_cli_mcp_slim-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for antigravity_cli_mcp_slim-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a6b93771d8b94e677ea8e1b066240b156b78a9531478d69ee3984e19e0cf1e80
MD5 1771959e628d411a8aea8821100dfd4a
BLAKE2b-256 a0716a03881c02ea8a67234bc67cfbd2aa04c01ce4660cfb542143af4fd6b2ef

See more details on using hashes here.

Provenance

The following attestation bundles were made for antigravity_cli_mcp_slim-0.1.1-py3-none-any.whl:

Publisher: publish.yml on tksfjt1024/antigravity-cli-mcp-slim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page