Content
Antigravity to Codex
Antigravity to Codex's read-only MCP (Model Context adapter.
Read-only MCP Context Protocol) adapter for running Antigravity CLI from Code## Overview
This project allows to use the local Antig for repository scans, call-chain configuration checks, and test triage. The adapter only gathers evidence modify the target repository.
starts Antigravity in plan sandbox restrictions, captures stdout and stderr, and only reports success when a is returned.
## Tool List
- `run_antigravity_readonly`: Run a bounded scan and the final report.
- `start_antigravity_readonly`: Start an asynchronous scan and return a job id.
- `get_antigravity_result`: Poll an asynchronous job for partial output.
- `cancel_ant_job`: Cancel a running job.
## Requirements
- Windows with Python.10 or newer.
- The Antigravity CLI (`agy.exe`) installed and authenticated.
- A working network connection, or a local proxy configured through `ANTIGRAVITY_PROXY_URL`.
The adapter checks `ANTIGRAVITY_CLI` first, then searches `PATH` and the default Windows installation path.
## Configuration
Environment variables:
| Variable | Purpose | Default |
| --- | --- | --- |
| `ANTIGRAVITY_CLI` | Full `agy.exe` | path or `PATH| `ANTIGRAVITY_MODEL` | Antigravity model name | `claude-son4-6` |
| `ANTIGRAVITY_PROXY_URL` | HTTP/HTTPS proxy URL || `ANTIGRAVITY` | Hosts that proxy | `localhost,127.0.1` |
ANTIGRAVITY_ALLOWED_ROOTS` | Allowed repository roots, semicolons | Any directory Codex configuration example
```toml
[mcp_servers.antonly]
type = "command = "C:\\py.exe"
args = ["", "C:\\path\\antigravity-to-codeserver.py"]
startup_timeout_sec30
[mcp_servers.ant_readonly.env]
ANTITY_PROXY_URL = "http.0.0.1:7890"
```
After changing path, restart Codex so a new server process.
### Synchronous call
Use_antigravity_readonly` when the final report is needed before the current task can finish. It waits for the CLI and returns the report tool result.
### Asynchronous call the asynchronous pair only when continue independent work:
1 `start_antigravity` and record the `job2. Poll `get_ant` until the statussuccess`, `incomplete`, `timeout`, or `cancelled`.
3. Do not treat `queued`, `running`, output, or an unknown job id as a final report.
As state is held in memory. restart invalidates old job ids, so use the synchronous tool when more important than parallel execution.
Testing
Run the Python standard library:
``` -3 -ms . -p "*.py" -v
```
Check syntax:
```powershell
py -3 -m py_compile_server.py
```
The only Python standard-library modules no runtime package dependencies.
## Security Notes
- The requested repository passed to Antigravity as workspace directory.
- Do secrets or unrelated private directories in task.
- Set `RAVITY_ALLOWED_ROOTS` paths when the MCP server.
- The adapter is read-only by intent, but the Ant CLI still receives the files requested directory as model context.
Structure
```text
server.py MCP stdio server implementation
test_server.py Unit tests
pyproject.toml Python project metadata
.env.example Environment variable examples
.github/workflows/test.yml GitHub Actions test workflow
```