antigravity-bridge 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,13 @@
1
+ Copyright 2025 Fojle Rabbi Rabib
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+
7
+ http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ Unless required by applicable law or agreed to in writing, software
10
+ distributed under the License is distributed on an "AS IS" BASIS,
11
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ See the License for the specific language governing permissions and
13
+ limitations under the License.
@@ -0,0 +1,345 @@
1
+ Metadata-Version: 2.4
2
+ Name: antigravity-bridge
3
+ Version: 1.0.0
4
+ Summary: Lightweight MCP server bridging Claude Code to Antigravity AI via official CLI
5
+ Author: Fojle Rabbi Rabib
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/FojleRabbiRabib/Antigravity-Bridge
8
+ Project-URL: Repository, https://github.com/FojleRabbiRabib/Antigravity-Bridge
9
+ Project-URL: Issues, https://github.com/FojleRabbiRabib/Antigravity-Bridge/issues
10
+ Keywords: mcp,antigravity,ai,coding,assistant,claude
11
+ Classifier: Development Status :: 5 - Production/Stable
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
18
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
19
+ Requires-Python: >=3.10
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ Requires-Dist: mcp>=1.0.0
23
+ Dynamic: license-file
24
+
25
+ # Antigravity Bridge
26
+
27
+ ![CI Status](https://github.com/FojleRabbiRabib/Antigravity-Bridge/actions/workflows/ci.yml/badge.svg)
28
+ ![PyPI Version](https://img.shields.io/pypi/v/antigravity-bridge)
29
+ ![Apache 2.0](https://img.shields.io/badge/license-Apache%202.0-blue.svg)
30
+ ![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)
31
+ ![MCP Compatible](https://img.shields.io/badge/MCP-compatible-green.svg)
32
+
33
+ A lightweight MCP (Model Context Protocol) server that enables AI coding assistants to interact with Antigravity AI through the official CLI. Zero API costs, stateless architecture, minimal dependencies. Production-ready with comprehensive CI/CD automation.
34
+
35
+ ## Features
36
+
37
+ - **Direct Antigravity CLI Integration**: Zero API costs using the official `agy` CLI
38
+ - **Three MCP Tools**: Basic queries, file analysis, and web search capabilities
39
+ - **Stateless Operation**: No sessions, caching, or complex state management
40
+ - **Production Ready**: Robust error handling with configurable timeouts
41
+ - **Minimal Dependencies**: Only requires `mcp>=1.0.0` and Antigravity CLI
42
+ - **Easy Deployment**: Support for both `uvx` and traditional `pip` installation
43
+ - **Universal MCP Compatibility**: Works with Claude Code, Cursor, VS Code, Windsurf, Cline, Void, Cherry Studio, Augment, Roo Code, Zencoder, and any MCP-compatible client
44
+ - **Modern Python**: Python 3.10+ with type hints and pathlib
45
+
46
+ ## Prerequisites
47
+
48
+ Install the Antigravity CLI:
49
+
50
+ ```bash
51
+ # macOS / Linux
52
+ curl -fsSL https://antigravity.google/cli/install.sh | bash
53
+
54
+ # Windows PowerShell
55
+ irm https://antigravity.google/cli/install.ps1 | iex
56
+
57
+ # Verify installation
58
+ agy --version
59
+ ```
60
+
61
+ Authentication is handled internally by Antigravity — no separate login command needed.
62
+
63
+ ## Installation
64
+
65
+ **Recommended: PyPI with uvx**
66
+ ```bash
67
+ claude mcp add antigravity-bridge -s user -- uvx agy
68
+ ```
69
+
70
+ **From PyPI**
71
+ ```bash
72
+ pip install antigravity-bridge
73
+ claude mcp add antigravity-bridge -s user -- uvx agy
74
+ ```
75
+
76
+ **From Source**
77
+ ```bash
78
+ git clone https://github.com/FojleRabbiRabib/Antigravity-Bridge.git
79
+ cd antigravity-bridge
80
+ pip install -e .
81
+
82
+ # Development mode
83
+ claude mcp add antigravity-bridge-dev -s user -- python3 -m src
84
+ ```
85
+
86
+ ## Configuration
87
+
88
+ ### Environment Variables
89
+
90
+ All configuration is done through environment variables prefixed with `ANTIGRAVITY_BRIDGE_`:
91
+
92
+ | Variable | Default | Description |
93
+ |---|---|---|
94
+ | `ANTIGRAVITY_BRIDGE_TIMEOUT` | `120` | Global timeout override (seconds) |
95
+ | `ANTIGRAVITY_BRIDGE_DEFAULT_TIMEOUT` | `120` | Module-level default timeout |
96
+ | `ANTIGRAVITY_BRIDGE_SKIP_PERMISSIONS` | `true` | Add `--dangerously-skip-permissions` for MCP automation |
97
+ | `ANTIGRAVITY_BRIDGE_SANDBOX` | `false` | Add `--sandbox` for restricted execution |
98
+ | `ANTIGRAVITY_BRIDGE_MAX_INLINE_FILE_COUNT` | `30` | Max files in inline mode |
99
+ | `ANTIGRAVITY_BRIDGE_MAX_INLINE_TOTAL_BYTES` | `1048576` (1MB) | Max total inline payload |
100
+ | `ANTIGRAVITY_BRIDGE_MAX_INLINE_FILE_BYTES` | `524288` (512KB) | Max per-file inline size |
101
+ | `ANTIGRAVITY_BRIDGE_INLINE_HEAD_BYTES` | `65536` (64KB) | Head chunk for truncated files |
102
+ | `ANTIGRAVITY_BRIDGE_INLINE_TAIL_BYTES` | `32768` (32KB) | Tail chunk for truncated files |
103
+
104
+ **Timeout example:**
105
+ ```bash
106
+ claude mcp add antigravity-bridge -s user --env ANTIGRAVITY_BRIDGE_TIMEOUT=180 -- uvx agy
107
+ ```
108
+
109
+ ## Available Tools
110
+
111
+ ### `agy_consult`
112
+ Direct CLI bridge for simple queries.
113
+
114
+ **Parameters:**
115
+ - `query` (string, required): The question or prompt to send to Antigravity
116
+ - `directory` (string, required): Working directory for the query
117
+ - `timeout_seconds` (int, optional): Override execution timeout for this request
118
+
119
+ **Example:**
120
+ ```python
121
+ agy_consult(query="What authentication patterns are used?", directory="/path/to/project")
122
+ ```
123
+
124
+ ### `agy_consult_with_files`
125
+ CLI bridge with file attachments for detailed analysis.
126
+
127
+ **Parameters:**
128
+ - `query` (string, required): The question or prompt
129
+ - `directory` (string, required): Working directory
130
+ - `files` (list, required): List of file paths relative to the directory
131
+ - `timeout_seconds` (int, optional): Override execution timeout
132
+ - `mode` (string, optional): `"inline"` (default) or `"at_command"`
133
+
134
+ **File Modes:**
135
+ - `inline` — streams truncated file snippets directly in the prompt
136
+ - `at_command` — emits `@path` directives so Antigravity CLI resolves files itself
137
+
138
+ **Example:**
139
+ ```python
140
+ agy_consult_with_files(
141
+ query="Review these auth files for security issues",
142
+ directory="/path/to/project",
143
+ files=["src/auth.py", "src/middleware.py"],
144
+ mode="at_command"
145
+ )
146
+ ```
147
+
148
+ ### `agy_web_search`
149
+ Queries with web search context. Best-effort — the model decides when to search.
150
+
151
+ **Parameters:**
152
+ - `query` (string, required): Search query or question
153
+ - `directory` (string, required): Working directory for command execution
154
+ - `timeout_seconds` (int, optional): Override execution timeout
155
+
156
+ **Example:**
157
+ ```python
158
+ agy_web_search(query="latest Python 3.13 features")
159
+ ```
160
+
161
+ ## Multi-Client Support
162
+
163
+ Antigravity Bridge works with any MCP-compatible AI coding assistant. The server implementation is identical across clients — only the configuration differs.
164
+
165
+ ### Claude Code
166
+ ```bash
167
+ claude mcp add antigravity-bridge -s user -- uvx agy
168
+ ```
169
+
170
+ ### Cursor
171
+ **Global** (`~/.cursor/mcp.json`):
172
+ ```json
173
+ {
174
+ "mcpServers": {
175
+ "antigravity-bridge": {
176
+ "command": "uvx",
177
+ "args": ["agy"]
178
+ }
179
+ }
180
+ }
181
+ ```
182
+
183
+ ### VS Code
184
+ **Configuration** (`.vscode/mcp.json`):
185
+ ```json
186
+ {
187
+ "servers": {
188
+ "antigravity-bridge": {
189
+ "type": "stdio",
190
+ "command": "uvx",
191
+ "args": ["agy"]
192
+ }
193
+ }
194
+ }
195
+ ```
196
+
197
+ ### Windsurf
198
+ ```json
199
+ {
200
+ "mcpServers": {
201
+ "antigravity-bridge": {
202
+ "command": "uvx",
203
+ "args": ["agy"]
204
+ }
205
+ }
206
+ }
207
+ ```
208
+
209
+ ### Cline (VS Code Extension)
210
+ 1. Click **MCP Servers** in top navigation
211
+ 2. Select **Installed** tab → **Advanced MCP Settings**
212
+ 3. Add to `cline_mcp_settings.json`:
213
+ ```json
214
+ {
215
+ "mcpServers": {
216
+ "antigravity-bridge": {
217
+ "command": "uvx",
218
+ "args": ["agy"]
219
+ }
220
+ }
221
+ }
222
+ ```
223
+
224
+ ### Void
225
+ `Settings` → `MCP` → `Add MCP Server`
226
+ ```json
227
+ {
228
+ "command": "uvx",
229
+ "args": ["agy"]
230
+ }
231
+ ```
232
+
233
+ ### Cherry Studio
234
+ `Settings` → `MCP Servers` → `Add Server`
235
+ - Name: `antigravity-bridge`
236
+ - Type: `STDIO`
237
+ - Command: `uvx`
238
+ - Arguments: `["agy"]`
239
+
240
+ ### Augment
241
+ Click hamburger menu → `Settings` → `Tools` → `+ Add MCP`
242
+ - Command: `uvx agy`
243
+ - Name: Antigravity Bridge
244
+
245
+ ### Roo Code
246
+ `Settings` → `MCP Servers` → `Edit Global Config`
247
+ ```json
248
+ {
249
+ "mcpServers": {
250
+ "antigravity-bridge": {
251
+ "command": "uvx",
252
+ "args": ["agy"]
253
+ }
254
+ }
255
+ }
256
+ ```
257
+
258
+ ### Zencoder
259
+ Zencoder menu → `Tools` → `Add Custom MCP`
260
+ ```json
261
+ {
262
+ "command": "uvx",
263
+ "args": ["agy"]
264
+ }
265
+ ```
266
+
267
+ ## Architecture
268
+
269
+ ### Design Principles
270
+ - **CLI-First**: Direct subprocess calls to `agy --print`
271
+ - **Stateless**: Each tool call is independent with no session state
272
+ - **Adaptive Timeout**: Defaults to 120 seconds, overridable per request or via env var
273
+ - **Attachment Guardrails**: Inline mode enforces byte/quantity caps; `@` mode delegates to Antigravity CLI
274
+ - **Fail-Fast**: Clear error messages with simple error handling
275
+ - **Zero Extra Dependencies**: Only `mcp>=1.0.0` beyond the Antigravity CLI
276
+
277
+ ### Module Structure
278
+ ```
279
+ src/
280
+ ├── __init__.py # Package entry point, version
281
+ ├── __main__.py # Module execution entry point
282
+ ├── config.py # Constants and environment variable configuration
283
+ ├── cli.py # Subprocess calls to agy
284
+ ├── files.py # File handling (inline, @-command, truncation)
285
+ └── tools.py # MCP tool definitions (FastMCP)
286
+ ```
287
+
288
+ ### File Handling Safeguards
289
+ - Inline transfers cap at 512KB per file and 1MB per request
290
+ - Oversized files are truncated to head/tail snippets with warnings
291
+ - Tune caps via `ANTIGRAVITY_BRIDGE_MAX_INLINE_*` env vars
292
+ - Use `mode="at_command"` for larger payloads
293
+
294
+ ## Development
295
+
296
+ ```bash
297
+ # Install in development mode
298
+ pip install -e .
299
+
300
+ # Run tests
301
+ pytest
302
+
303
+ # Run MCP server directly
304
+ python3 -m src
305
+
306
+ # Verify CLI availability
307
+ agy --version
308
+ ```
309
+
310
+ ### Build & Distribution
311
+ ```bash
312
+ # Clean build
313
+ rm -rf dist/ build/ *.egg-info
314
+
315
+ # Build package
316
+ uvx --from build pyproject-build
317
+
318
+ # Verify build
319
+ pip install dist/*.whl
320
+ python3 -c "import src; print(f'v{src.__version__}')"
321
+ ```
322
+
323
+ ## Troubleshooting
324
+
325
+ | Error | Solution |
326
+ |---|---|
327
+ | "Antigravity CLI not found" | `curl -fsSL https://antigravity.google/cli/install.sh \| bash` |
328
+ | "Authentication required" | Verify Antigravity authentication |
329
+ | "Timed out after X seconds" | Increase timeout or simplify query |
330
+ | "Directory does not exist" | Use absolute paths or verify directory |
331
+ | "No files provided" | Provide at least one valid file path |
332
+ | "Unsupported files mode" | Use `"inline"` or `"at_command"` |
333
+
334
+ ## Contributing
335
+
336
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for development guidelines.
337
+
338
+ ## License
339
+
340
+ Apache 2.0 — see [LICENSE](LICENSE).
341
+
342
+ ## Support
343
+
344
+ - **Issues**: [GitHub Issues](https://github.com/FojleRabbiRabib/Antigravity-Bridge/issues)
345
+ - **Discussions**: [GitHub Discussions](https://github.com/FojleRabbiRabib/Antigravity-Bridge/discussions)
@@ -0,0 +1,321 @@
1
+ # Antigravity Bridge
2
+
3
+ ![CI Status](https://github.com/FojleRabbiRabib/Antigravity-Bridge/actions/workflows/ci.yml/badge.svg)
4
+ ![PyPI Version](https://img.shields.io/pypi/v/antigravity-bridge)
5
+ ![Apache 2.0](https://img.shields.io/badge/license-Apache%202.0-blue.svg)
6
+ ![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)
7
+ ![MCP Compatible](https://img.shields.io/badge/MCP-compatible-green.svg)
8
+
9
+ A lightweight MCP (Model Context Protocol) server that enables AI coding assistants to interact with Antigravity AI through the official CLI. Zero API costs, stateless architecture, minimal dependencies. Production-ready with comprehensive CI/CD automation.
10
+
11
+ ## Features
12
+
13
+ - **Direct Antigravity CLI Integration**: Zero API costs using the official `agy` CLI
14
+ - **Three MCP Tools**: Basic queries, file analysis, and web search capabilities
15
+ - **Stateless Operation**: No sessions, caching, or complex state management
16
+ - **Production Ready**: Robust error handling with configurable timeouts
17
+ - **Minimal Dependencies**: Only requires `mcp>=1.0.0` and Antigravity CLI
18
+ - **Easy Deployment**: Support for both `uvx` and traditional `pip` installation
19
+ - **Universal MCP Compatibility**: Works with Claude Code, Cursor, VS Code, Windsurf, Cline, Void, Cherry Studio, Augment, Roo Code, Zencoder, and any MCP-compatible client
20
+ - **Modern Python**: Python 3.10+ with type hints and pathlib
21
+
22
+ ## Prerequisites
23
+
24
+ Install the Antigravity CLI:
25
+
26
+ ```bash
27
+ # macOS / Linux
28
+ curl -fsSL https://antigravity.google/cli/install.sh | bash
29
+
30
+ # Windows PowerShell
31
+ irm https://antigravity.google/cli/install.ps1 | iex
32
+
33
+ # Verify installation
34
+ agy --version
35
+ ```
36
+
37
+ Authentication is handled internally by Antigravity — no separate login command needed.
38
+
39
+ ## Installation
40
+
41
+ **Recommended: PyPI with uvx**
42
+ ```bash
43
+ claude mcp add antigravity-bridge -s user -- uvx agy
44
+ ```
45
+
46
+ **From PyPI**
47
+ ```bash
48
+ pip install antigravity-bridge
49
+ claude mcp add antigravity-bridge -s user -- uvx agy
50
+ ```
51
+
52
+ **From Source**
53
+ ```bash
54
+ git clone https://github.com/FojleRabbiRabib/Antigravity-Bridge.git
55
+ cd antigravity-bridge
56
+ pip install -e .
57
+
58
+ # Development mode
59
+ claude mcp add antigravity-bridge-dev -s user -- python3 -m src
60
+ ```
61
+
62
+ ## Configuration
63
+
64
+ ### Environment Variables
65
+
66
+ All configuration is done through environment variables prefixed with `ANTIGRAVITY_BRIDGE_`:
67
+
68
+ | Variable | Default | Description |
69
+ |---|---|---|
70
+ | `ANTIGRAVITY_BRIDGE_TIMEOUT` | `120` | Global timeout override (seconds) |
71
+ | `ANTIGRAVITY_BRIDGE_DEFAULT_TIMEOUT` | `120` | Module-level default timeout |
72
+ | `ANTIGRAVITY_BRIDGE_SKIP_PERMISSIONS` | `true` | Add `--dangerously-skip-permissions` for MCP automation |
73
+ | `ANTIGRAVITY_BRIDGE_SANDBOX` | `false` | Add `--sandbox` for restricted execution |
74
+ | `ANTIGRAVITY_BRIDGE_MAX_INLINE_FILE_COUNT` | `30` | Max files in inline mode |
75
+ | `ANTIGRAVITY_BRIDGE_MAX_INLINE_TOTAL_BYTES` | `1048576` (1MB) | Max total inline payload |
76
+ | `ANTIGRAVITY_BRIDGE_MAX_INLINE_FILE_BYTES` | `524288` (512KB) | Max per-file inline size |
77
+ | `ANTIGRAVITY_BRIDGE_INLINE_HEAD_BYTES` | `65536` (64KB) | Head chunk for truncated files |
78
+ | `ANTIGRAVITY_BRIDGE_INLINE_TAIL_BYTES` | `32768` (32KB) | Tail chunk for truncated files |
79
+
80
+ **Timeout example:**
81
+ ```bash
82
+ claude mcp add antigravity-bridge -s user --env ANTIGRAVITY_BRIDGE_TIMEOUT=180 -- uvx agy
83
+ ```
84
+
85
+ ## Available Tools
86
+
87
+ ### `agy_consult`
88
+ Direct CLI bridge for simple queries.
89
+
90
+ **Parameters:**
91
+ - `query` (string, required): The question or prompt to send to Antigravity
92
+ - `directory` (string, required): Working directory for the query
93
+ - `timeout_seconds` (int, optional): Override execution timeout for this request
94
+
95
+ **Example:**
96
+ ```python
97
+ agy_consult(query="What authentication patterns are used?", directory="/path/to/project")
98
+ ```
99
+
100
+ ### `agy_consult_with_files`
101
+ CLI bridge with file attachments for detailed analysis.
102
+
103
+ **Parameters:**
104
+ - `query` (string, required): The question or prompt
105
+ - `directory` (string, required): Working directory
106
+ - `files` (list, required): List of file paths relative to the directory
107
+ - `timeout_seconds` (int, optional): Override execution timeout
108
+ - `mode` (string, optional): `"inline"` (default) or `"at_command"`
109
+
110
+ **File Modes:**
111
+ - `inline` — streams truncated file snippets directly in the prompt
112
+ - `at_command` — emits `@path` directives so Antigravity CLI resolves files itself
113
+
114
+ **Example:**
115
+ ```python
116
+ agy_consult_with_files(
117
+ query="Review these auth files for security issues",
118
+ directory="/path/to/project",
119
+ files=["src/auth.py", "src/middleware.py"],
120
+ mode="at_command"
121
+ )
122
+ ```
123
+
124
+ ### `agy_web_search`
125
+ Queries with web search context. Best-effort — the model decides when to search.
126
+
127
+ **Parameters:**
128
+ - `query` (string, required): Search query or question
129
+ - `directory` (string, required): Working directory for command execution
130
+ - `timeout_seconds` (int, optional): Override execution timeout
131
+
132
+ **Example:**
133
+ ```python
134
+ agy_web_search(query="latest Python 3.13 features")
135
+ ```
136
+
137
+ ## Multi-Client Support
138
+
139
+ Antigravity Bridge works with any MCP-compatible AI coding assistant. The server implementation is identical across clients — only the configuration differs.
140
+
141
+ ### Claude Code
142
+ ```bash
143
+ claude mcp add antigravity-bridge -s user -- uvx agy
144
+ ```
145
+
146
+ ### Cursor
147
+ **Global** (`~/.cursor/mcp.json`):
148
+ ```json
149
+ {
150
+ "mcpServers": {
151
+ "antigravity-bridge": {
152
+ "command": "uvx",
153
+ "args": ["agy"]
154
+ }
155
+ }
156
+ }
157
+ ```
158
+
159
+ ### VS Code
160
+ **Configuration** (`.vscode/mcp.json`):
161
+ ```json
162
+ {
163
+ "servers": {
164
+ "antigravity-bridge": {
165
+ "type": "stdio",
166
+ "command": "uvx",
167
+ "args": ["agy"]
168
+ }
169
+ }
170
+ }
171
+ ```
172
+
173
+ ### Windsurf
174
+ ```json
175
+ {
176
+ "mcpServers": {
177
+ "antigravity-bridge": {
178
+ "command": "uvx",
179
+ "args": ["agy"]
180
+ }
181
+ }
182
+ }
183
+ ```
184
+
185
+ ### Cline (VS Code Extension)
186
+ 1. Click **MCP Servers** in top navigation
187
+ 2. Select **Installed** tab → **Advanced MCP Settings**
188
+ 3. Add to `cline_mcp_settings.json`:
189
+ ```json
190
+ {
191
+ "mcpServers": {
192
+ "antigravity-bridge": {
193
+ "command": "uvx",
194
+ "args": ["agy"]
195
+ }
196
+ }
197
+ }
198
+ ```
199
+
200
+ ### Void
201
+ `Settings` → `MCP` → `Add MCP Server`
202
+ ```json
203
+ {
204
+ "command": "uvx",
205
+ "args": ["agy"]
206
+ }
207
+ ```
208
+
209
+ ### Cherry Studio
210
+ `Settings` → `MCP Servers` → `Add Server`
211
+ - Name: `antigravity-bridge`
212
+ - Type: `STDIO`
213
+ - Command: `uvx`
214
+ - Arguments: `["agy"]`
215
+
216
+ ### Augment
217
+ Click hamburger menu → `Settings` → `Tools` → `+ Add MCP`
218
+ - Command: `uvx agy`
219
+ - Name: Antigravity Bridge
220
+
221
+ ### Roo Code
222
+ `Settings` → `MCP Servers` → `Edit Global Config`
223
+ ```json
224
+ {
225
+ "mcpServers": {
226
+ "antigravity-bridge": {
227
+ "command": "uvx",
228
+ "args": ["agy"]
229
+ }
230
+ }
231
+ }
232
+ ```
233
+
234
+ ### Zencoder
235
+ Zencoder menu → `Tools` → `Add Custom MCP`
236
+ ```json
237
+ {
238
+ "command": "uvx",
239
+ "args": ["agy"]
240
+ }
241
+ ```
242
+
243
+ ## Architecture
244
+
245
+ ### Design Principles
246
+ - **CLI-First**: Direct subprocess calls to `agy --print`
247
+ - **Stateless**: Each tool call is independent with no session state
248
+ - **Adaptive Timeout**: Defaults to 120 seconds, overridable per request or via env var
249
+ - **Attachment Guardrails**: Inline mode enforces byte/quantity caps; `@` mode delegates to Antigravity CLI
250
+ - **Fail-Fast**: Clear error messages with simple error handling
251
+ - **Zero Extra Dependencies**: Only `mcp>=1.0.0` beyond the Antigravity CLI
252
+
253
+ ### Module Structure
254
+ ```
255
+ src/
256
+ ├── __init__.py # Package entry point, version
257
+ ├── __main__.py # Module execution entry point
258
+ ├── config.py # Constants and environment variable configuration
259
+ ├── cli.py # Subprocess calls to agy
260
+ ├── files.py # File handling (inline, @-command, truncation)
261
+ └── tools.py # MCP tool definitions (FastMCP)
262
+ ```
263
+
264
+ ### File Handling Safeguards
265
+ - Inline transfers cap at 512KB per file and 1MB per request
266
+ - Oversized files are truncated to head/tail snippets with warnings
267
+ - Tune caps via `ANTIGRAVITY_BRIDGE_MAX_INLINE_*` env vars
268
+ - Use `mode="at_command"` for larger payloads
269
+
270
+ ## Development
271
+
272
+ ```bash
273
+ # Install in development mode
274
+ pip install -e .
275
+
276
+ # Run tests
277
+ pytest
278
+
279
+ # Run MCP server directly
280
+ python3 -m src
281
+
282
+ # Verify CLI availability
283
+ agy --version
284
+ ```
285
+
286
+ ### Build & Distribution
287
+ ```bash
288
+ # Clean build
289
+ rm -rf dist/ build/ *.egg-info
290
+
291
+ # Build package
292
+ uvx --from build pyproject-build
293
+
294
+ # Verify build
295
+ pip install dist/*.whl
296
+ python3 -c "import src; print(f'v{src.__version__}')"
297
+ ```
298
+
299
+ ## Troubleshooting
300
+
301
+ | Error | Solution |
302
+ |---|---|
303
+ | "Antigravity CLI not found" | `curl -fsSL https://antigravity.google/cli/install.sh \| bash` |
304
+ | "Authentication required" | Verify Antigravity authentication |
305
+ | "Timed out after X seconds" | Increase timeout or simplify query |
306
+ | "Directory does not exist" | Use absolute paths or verify directory |
307
+ | "No files provided" | Provide at least one valid file path |
308
+ | "Unsupported files mode" | Use `"inline"` or `"at_command"` |
309
+
310
+ ## Contributing
311
+
312
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for development guidelines.
313
+
314
+ ## License
315
+
316
+ Apache 2.0 — see [LICENSE](LICENSE).
317
+
318
+ ## Support
319
+
320
+ - **Issues**: [GitHub Issues](https://github.com/FojleRabbiRabib/Antigravity-Bridge/issues)
321
+ - **Discussions**: [GitHub Discussions](https://github.com/FojleRabbiRabib/Antigravity-Bridge/discussions)