antigravity-cli-mcp-slim 0.1.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.
- antigravity_cli_mcp_slim-0.1.0/LICENSE +21 -0
- antigravity_cli_mcp_slim-0.1.0/PKG-INFO +246 -0
- antigravity_cli_mcp_slim-0.1.0/README.md +212 -0
- antigravity_cli_mcp_slim-0.1.0/pyproject.toml +80 -0
- antigravity_cli_mcp_slim-0.1.0/setup.cfg +4 -0
- antigravity_cli_mcp_slim-0.1.0/src/antigravity_cli_mcp_slim/__init__.py +8 -0
- antigravity_cli_mcp_slim-0.1.0/src/antigravity_cli_mcp_slim/py.typed +0 -0
- antigravity_cli_mcp_slim-0.1.0/src/antigravity_cli_mcp_slim/server.py +304 -0
- antigravity_cli_mcp_slim-0.1.0/src/antigravity_cli_mcp_slim.egg-info/PKG-INFO +246 -0
- antigravity_cli_mcp_slim-0.1.0/src/antigravity_cli_mcp_slim.egg-info/SOURCES.txt +15 -0
- antigravity_cli_mcp_slim-0.1.0/src/antigravity_cli_mcp_slim.egg-info/dependency_links.txt +1 -0
- antigravity_cli_mcp_slim-0.1.0/src/antigravity_cli_mcp_slim.egg-info/entry_points.txt +2 -0
- antigravity_cli_mcp_slim-0.1.0/src/antigravity_cli_mcp_slim.egg-info/requires.txt +8 -0
- antigravity_cli_mcp_slim-0.1.0/src/antigravity_cli_mcp_slim.egg-info/top_level.txt +1 -0
- antigravity_cli_mcp_slim-0.1.0/tests/test_basic.py +89 -0
- antigravity_cli_mcp_slim-0.1.0/tests/test_call_tool.py +40 -0
- antigravity_cli_mcp_slim-0.1.0/tests/test_subprocess_stdin_isolation.py +78 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 tksfjt1024
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: antigravity-cli-mcp-slim
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A thin, auditable MCP server wrapping the Antigravity CLI (agy). Forward-compatible with future CLI flags via extra_args passthrough.
|
|
5
|
+
Author-email: tksfjt1024 <tksfjt1024@gmail.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/tksfjt1024/antigravity-cli-mcp-slim
|
|
8
|
+
Project-URL: Repository, https://github.com/tksfjt1024/antigravity-cli-mcp-slim
|
|
9
|
+
Project-URL: Issues, https://github.com/tksfjt1024/antigravity-cli-mcp-slim/issues
|
|
10
|
+
Keywords: mcp,model-context-protocol,antigravity,antigravity-cli,agy,claude,anthropic,ai,llm,coding-agent
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Operating System :: OS Independent
|
|
15
|
+
Classifier: Programming Language :: Python
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
22
|
+
Classifier: Topic :: Utilities
|
|
23
|
+
Classifier: Typing :: Typed
|
|
24
|
+
Requires-Python: >=3.10
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
License-File: LICENSE
|
|
27
|
+
Requires-Dist: mcp>=1.0.0
|
|
28
|
+
Provides-Extra: test
|
|
29
|
+
Requires-Dist: pytest>=8.0; extra == "test"
|
|
30
|
+
Requires-Dist: pytest-asyncio>=0.23; extra == "test"
|
|
31
|
+
Provides-Extra: dev
|
|
32
|
+
Requires-Dist: ruff>=0.6; extra == "dev"
|
|
33
|
+
Dynamic: license-file
|
|
34
|
+
|
|
35
|
+
# antigravity-cli-mcp-slim
|
|
36
|
+
|
|
37
|
+
A thin, auditable [MCP](https://modelcontextprotocol.io) server wrapping the [Antigravity CLI](https://github.com/google-antigravity/antigravity-cli) (`agy`).
|
|
38
|
+
|
|
39
|
+
[](https://pypi.org/project/antigravity-cli-mcp-slim/)
|
|
40
|
+
[](https://pypi.org/project/antigravity-cli-mcp-slim/)
|
|
41
|
+
[](https://opensource.org/licenses/MIT)
|
|
42
|
+
[](https://github.com/tksfjt1024/antigravity-cli-mcp-slim/actions/workflows/ci.yml)
|
|
43
|
+
|
|
44
|
+
## Why
|
|
45
|
+
|
|
46
|
+
When you add an MCP server to your AI coding tool, every prompt and code snippet
|
|
47
|
+
you send flows through that wrapper. Most CLI-wrapping MCP servers are small,
|
|
48
|
+
individually maintained packages — and recent supply-chain incidents
|
|
49
|
+
(`xz-utils`, `postmark-mcp`, the npm `chalk`/`debug` compromise) show that
|
|
50
|
+
"small and useful" is not the same as "safe to trust blindly."
|
|
51
|
+
|
|
52
|
+
This project takes the opposite stance: instead of asking you to trust it, it
|
|
53
|
+
tries to be **easy to audit**.
|
|
54
|
+
|
|
55
|
+
- **Single file** — the whole server is `src/antigravity_cli_mcp_slim/server.py`,
|
|
56
|
+
readable end-to-end in one sitting
|
|
57
|
+
- **One third-party dependency** (`mcp`) — minimal supply-chain surface
|
|
58
|
+
- **Faithful CLI mapping** — every typed parameter mirrors a real `agy` flag by
|
|
59
|
+
name, so it is obvious which flags an invocation actually sets
|
|
60
|
+
- **Forward-compatible** — any new or uncommon `agy` flag is reachable via
|
|
61
|
+
`extra_args` without touching this server
|
|
62
|
+
- **Configurable binary path** — `$AGY_CMD` lets you swap or wrap the `agy` binary
|
|
63
|
+
- **Transparent** — every invocation logs the exact argv to stderr
|
|
64
|
+
|
|
65
|
+
Read `server.py` before you install. That is the point.
|
|
66
|
+
|
|
67
|
+
## Prerequisites
|
|
68
|
+
|
|
69
|
+
- The `agy` CLI installed and on `$PATH` (or pointed to via `$AGY_CMD`). See the
|
|
70
|
+
[official Antigravity CLI repository](https://github.com/google-antigravity/antigravity-cli)
|
|
71
|
+
and [install docs](https://antigravity.google/docs/cli-overview).
|
|
72
|
+
- `agy` already **authenticated** — this wrapper does not manage login; it
|
|
73
|
+
surfaces `agy`'s own error output if the CLI is not ready.
|
|
74
|
+
|
|
75
|
+
## Installation
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
# Run directly without installing
|
|
79
|
+
uvx antigravity-cli-mcp-slim
|
|
80
|
+
|
|
81
|
+
# Install from PyPI
|
|
82
|
+
pip install antigravity-cli-mcp-slim
|
|
83
|
+
|
|
84
|
+
# Run from GitHub HEAD
|
|
85
|
+
uvx --from git+https://github.com/tksfjt1024/antigravity-cli-mcp-slim antigravity-cli-mcp-slim
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Usage as an MCP server
|
|
89
|
+
|
|
90
|
+
### Claude Code
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
claude mcp add antigravity-cli uvx antigravity-cli-mcp-slim
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Or manually in `~/.claude.json`:
|
|
97
|
+
|
|
98
|
+
```json
|
|
99
|
+
{
|
|
100
|
+
"mcpServers": {
|
|
101
|
+
"antigravity-cli": {
|
|
102
|
+
"type": "stdio",
|
|
103
|
+
"command": "uvx",
|
|
104
|
+
"args": ["antigravity-cli-mcp-slim"]
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
If `agy` is not on the launching process's `$PATH`, point `$AGY_CMD` at it:
|
|
111
|
+
|
|
112
|
+
```json
|
|
113
|
+
{
|
|
114
|
+
"mcpServers": {
|
|
115
|
+
"antigravity-cli": {
|
|
116
|
+
"type": "stdio",
|
|
117
|
+
"command": "uvx",
|
|
118
|
+
"args": ["antigravity-cli-mcp-slim"],
|
|
119
|
+
"env": { "AGY_CMD": "/absolute/path/to/agy" }
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Other MCP clients
|
|
126
|
+
|
|
127
|
+
Any MCP-compatible client can launch the server via stdio:
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
uvx antigravity-cli-mcp-slim
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Tool: `consult_agy`
|
|
134
|
+
|
|
135
|
+
Runs a single `agy` invocation in non-interactive print mode (`agy --print`).
|
|
136
|
+
`agy` is an agentic assistant: it autonomously reads files in `directory`
|
|
137
|
+
(and any `add_dir`) to fulfill the request, then prints the response.
|
|
138
|
+
|
|
139
|
+
| Parameter | Type | Description |
|
|
140
|
+
| ------------------------------- | -------- | --------------------------------------------------------------------------------------------- |
|
|
141
|
+
| `query` (required) | string | Prompt sent verbatim to `agy --print` |
|
|
142
|
+
| `directory` (required) | string | Working directory (`agy` cwd); the default workspace root |
|
|
143
|
+
| `add_dir` | string[] | Extra workspace directories; each maps to one `--add-dir` (repeatable, not comma-joined) |
|
|
144
|
+
| `dangerously_skip_permissions` | bool | Pass `--dangerously-skip-permissions` (auto-approve all tool requests). See warning below |
|
|
145
|
+
| `sandbox` | bool | Pass `--sandbox` (terminal restrictions enabled) |
|
|
146
|
+
| `continue` | bool | Pass `--continue` (resume the most recent conversation). Mutually exclusive with `conversation` |
|
|
147
|
+
| `conversation` | string | Pass `--conversation <ID>` (resume a specific conversation). Mutually exclusive with `continue` |
|
|
148
|
+
| `print_timeout` | string | Pass `--print-timeout` (Go duration, e.g. `5m0s`). Keep shorter than `timeout_seconds` |
|
|
149
|
+
| `extra_args` | string[] | Raw CLI flags appended verbatim. Use for new/uncommon `agy` flags |
|
|
150
|
+
| `env` | object | Extra environment variables for the `agy` subprocess |
|
|
151
|
+
| `timeout_seconds` | int | Hard wall-clock timeout for the subprocess (default 660) |
|
|
152
|
+
|
|
153
|
+
### Security note: `dangerously_skip_permissions`
|
|
154
|
+
|
|
155
|
+
`dangerously_skip_permissions: true` passes `--dangerously-skip-permissions`,
|
|
156
|
+
which auto-approves **all** of `agy`'s tool permission requests — including
|
|
157
|
+
running shell commands and editing files — with no prompt. The parameter keeps
|
|
158
|
+
the `dangerously_` prefix on purpose: enable it only in a trusted, isolated
|
|
159
|
+
workspace where you fully trust the prompt. It defaults to `false`.
|
|
160
|
+
|
|
161
|
+
## Cross-repository analysis example
|
|
162
|
+
|
|
163
|
+
Analyze multiple repositories from a single invocation by adding directories to
|
|
164
|
+
the workspace:
|
|
165
|
+
|
|
166
|
+
```jsonc
|
|
167
|
+
{
|
|
168
|
+
"name": "consult_agy",
|
|
169
|
+
"arguments": {
|
|
170
|
+
"query": "Compare the API surface of the main service with the clients that call it",
|
|
171
|
+
"directory": "/path/to/main-service",
|
|
172
|
+
"add_dir": [
|
|
173
|
+
"/path/to/client-a",
|
|
174
|
+
"/path/to/client-b"
|
|
175
|
+
]
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
This launches `agy --print "..." --add-dir /path/to/client-a --add-dir /path/to/client-b`,
|
|
181
|
+
giving the agent read access to all three workspaces in one session.
|
|
182
|
+
|
|
183
|
+
## Conversation continuity
|
|
184
|
+
|
|
185
|
+
`agy` can resume prior conversations. This wrapper exposes that directly and
|
|
186
|
+
stays stateless itself:
|
|
187
|
+
|
|
188
|
+
- `continue: true` resumes the most recent conversation. Because "most recent"
|
|
189
|
+
is shared state, concurrent calls can race on it — prefer `conversation` when
|
|
190
|
+
it matters.
|
|
191
|
+
- `conversation: "<ID>"` resumes a specific conversation by id.
|
|
192
|
+
|
|
193
|
+
The two are mutually exclusive; passing both returns an error.
|
|
194
|
+
|
|
195
|
+
## Timeout configuration
|
|
196
|
+
|
|
197
|
+
There are two independent timeouts:
|
|
198
|
+
|
|
199
|
+
- `print_timeout` — `agy`'s own wait timeout (Go duration; `agy` defaults to
|
|
200
|
+
about 5 minutes).
|
|
201
|
+
- `timeout_seconds` — this wrapper's hard wall-clock limit (default 660).
|
|
202
|
+
|
|
203
|
+
Keep `timeout_seconds` longer than `print_timeout` so `agy` can finish or time
|
|
204
|
+
out cleanly before the wrapper force-kills the subprocess. When you raise
|
|
205
|
+
`print_timeout` for a long task, raise `timeout_seconds` to match.
|
|
206
|
+
|
|
207
|
+
## Forward-compatibility example
|
|
208
|
+
|
|
209
|
+
If a future `agy` release adds a new flag (say `--super-mode`), use it
|
|
210
|
+
immediately without updating this server:
|
|
211
|
+
|
|
212
|
+
```jsonc
|
|
213
|
+
{
|
|
214
|
+
"name": "consult_agy",
|
|
215
|
+
"arguments": {
|
|
216
|
+
"query": "...",
|
|
217
|
+
"directory": "...",
|
|
218
|
+
"extra_args": ["--super-mode"]
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
## Configuration
|
|
224
|
+
|
|
225
|
+
| Environment variable | Default | Purpose |
|
|
226
|
+
| ------------------------------------- | ------- | ---------------------------------------- |
|
|
227
|
+
| `AGY_CMD` | `agy` | Path to the `agy` CLI binary |
|
|
228
|
+
| `ANTIGRAVITY_CLI_MCP_SLIM_TIMEOUT` | `660` | Default subprocess timeout in seconds |
|
|
229
|
+
| `ANTIGRAVITY_CLI_MCP_SLIM_LOG_LEVEL` | `INFO` | Logging level for stderr diagnostics |
|
|
230
|
+
|
|
231
|
+
## Development
|
|
232
|
+
|
|
233
|
+
```bash
|
|
234
|
+
# Install dev dependencies
|
|
235
|
+
pip install -e ".[test,dev]"
|
|
236
|
+
|
|
237
|
+
# Lint
|
|
238
|
+
ruff check .
|
|
239
|
+
|
|
240
|
+
# Test
|
|
241
|
+
pytest
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
## License
|
|
245
|
+
|
|
246
|
+
[MIT](./LICENSE) © tksfjt1024
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
# antigravity-cli-mcp-slim
|
|
2
|
+
|
|
3
|
+
A thin, auditable [MCP](https://modelcontextprotocol.io) server wrapping the [Antigravity CLI](https://github.com/google-antigravity/antigravity-cli) (`agy`).
|
|
4
|
+
|
|
5
|
+
[](https://pypi.org/project/antigravity-cli-mcp-slim/)
|
|
6
|
+
[](https://pypi.org/project/antigravity-cli-mcp-slim/)
|
|
7
|
+
[](https://opensource.org/licenses/MIT)
|
|
8
|
+
[](https://github.com/tksfjt1024/antigravity-cli-mcp-slim/actions/workflows/ci.yml)
|
|
9
|
+
|
|
10
|
+
## Why
|
|
11
|
+
|
|
12
|
+
When you add an MCP server to your AI coding tool, every prompt and code snippet
|
|
13
|
+
you send flows through that wrapper. Most CLI-wrapping MCP servers are small,
|
|
14
|
+
individually maintained packages — and recent supply-chain incidents
|
|
15
|
+
(`xz-utils`, `postmark-mcp`, the npm `chalk`/`debug` compromise) show that
|
|
16
|
+
"small and useful" is not the same as "safe to trust blindly."
|
|
17
|
+
|
|
18
|
+
This project takes the opposite stance: instead of asking you to trust it, it
|
|
19
|
+
tries to be **easy to audit**.
|
|
20
|
+
|
|
21
|
+
- **Single file** — the whole server is `src/antigravity_cli_mcp_slim/server.py`,
|
|
22
|
+
readable end-to-end in one sitting
|
|
23
|
+
- **One third-party dependency** (`mcp`) — minimal supply-chain surface
|
|
24
|
+
- **Faithful CLI mapping** — every typed parameter mirrors a real `agy` flag by
|
|
25
|
+
name, so it is obvious which flags an invocation actually sets
|
|
26
|
+
- **Forward-compatible** — any new or uncommon `agy` flag is reachable via
|
|
27
|
+
`extra_args` without touching this server
|
|
28
|
+
- **Configurable binary path** — `$AGY_CMD` lets you swap or wrap the `agy` binary
|
|
29
|
+
- **Transparent** — every invocation logs the exact argv to stderr
|
|
30
|
+
|
|
31
|
+
Read `server.py` before you install. That is the point.
|
|
32
|
+
|
|
33
|
+
## Prerequisites
|
|
34
|
+
|
|
35
|
+
- The `agy` CLI installed and on `$PATH` (or pointed to via `$AGY_CMD`). See the
|
|
36
|
+
[official Antigravity CLI repository](https://github.com/google-antigravity/antigravity-cli)
|
|
37
|
+
and [install docs](https://antigravity.google/docs/cli-overview).
|
|
38
|
+
- `agy` already **authenticated** — this wrapper does not manage login; it
|
|
39
|
+
surfaces `agy`'s own error output if the CLI is not ready.
|
|
40
|
+
|
|
41
|
+
## Installation
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
# Run directly without installing
|
|
45
|
+
uvx antigravity-cli-mcp-slim
|
|
46
|
+
|
|
47
|
+
# Install from PyPI
|
|
48
|
+
pip install antigravity-cli-mcp-slim
|
|
49
|
+
|
|
50
|
+
# Run from GitHub HEAD
|
|
51
|
+
uvx --from git+https://github.com/tksfjt1024/antigravity-cli-mcp-slim antigravity-cli-mcp-slim
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Usage as an MCP server
|
|
55
|
+
|
|
56
|
+
### Claude Code
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
claude mcp add antigravity-cli uvx antigravity-cli-mcp-slim
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Or manually in `~/.claude.json`:
|
|
63
|
+
|
|
64
|
+
```json
|
|
65
|
+
{
|
|
66
|
+
"mcpServers": {
|
|
67
|
+
"antigravity-cli": {
|
|
68
|
+
"type": "stdio",
|
|
69
|
+
"command": "uvx",
|
|
70
|
+
"args": ["antigravity-cli-mcp-slim"]
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
If `agy` is not on the launching process's `$PATH`, point `$AGY_CMD` at it:
|
|
77
|
+
|
|
78
|
+
```json
|
|
79
|
+
{
|
|
80
|
+
"mcpServers": {
|
|
81
|
+
"antigravity-cli": {
|
|
82
|
+
"type": "stdio",
|
|
83
|
+
"command": "uvx",
|
|
84
|
+
"args": ["antigravity-cli-mcp-slim"],
|
|
85
|
+
"env": { "AGY_CMD": "/absolute/path/to/agy" }
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Other MCP clients
|
|
92
|
+
|
|
93
|
+
Any MCP-compatible client can launch the server via stdio:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
uvx antigravity-cli-mcp-slim
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Tool: `consult_agy`
|
|
100
|
+
|
|
101
|
+
Runs a single `agy` invocation in non-interactive print mode (`agy --print`).
|
|
102
|
+
`agy` is an agentic assistant: it autonomously reads files in `directory`
|
|
103
|
+
(and any `add_dir`) to fulfill the request, then prints the response.
|
|
104
|
+
|
|
105
|
+
| Parameter | Type | Description |
|
|
106
|
+
| ------------------------------- | -------- | --------------------------------------------------------------------------------------------- |
|
|
107
|
+
| `query` (required) | string | Prompt sent verbatim to `agy --print` |
|
|
108
|
+
| `directory` (required) | string | Working directory (`agy` cwd); the default workspace root |
|
|
109
|
+
| `add_dir` | string[] | Extra workspace directories; each maps to one `--add-dir` (repeatable, not comma-joined) |
|
|
110
|
+
| `dangerously_skip_permissions` | bool | Pass `--dangerously-skip-permissions` (auto-approve all tool requests). See warning below |
|
|
111
|
+
| `sandbox` | bool | Pass `--sandbox` (terminal restrictions enabled) |
|
|
112
|
+
| `continue` | bool | Pass `--continue` (resume the most recent conversation). Mutually exclusive with `conversation` |
|
|
113
|
+
| `conversation` | string | Pass `--conversation <ID>` (resume a specific conversation). Mutually exclusive with `continue` |
|
|
114
|
+
| `print_timeout` | string | Pass `--print-timeout` (Go duration, e.g. `5m0s`). Keep shorter than `timeout_seconds` |
|
|
115
|
+
| `extra_args` | string[] | Raw CLI flags appended verbatim. Use for new/uncommon `agy` flags |
|
|
116
|
+
| `env` | object | Extra environment variables for the `agy` subprocess |
|
|
117
|
+
| `timeout_seconds` | int | Hard wall-clock timeout for the subprocess (default 660) |
|
|
118
|
+
|
|
119
|
+
### Security note: `dangerously_skip_permissions`
|
|
120
|
+
|
|
121
|
+
`dangerously_skip_permissions: true` passes `--dangerously-skip-permissions`,
|
|
122
|
+
which auto-approves **all** of `agy`'s tool permission requests — including
|
|
123
|
+
running shell commands and editing files — with no prompt. The parameter keeps
|
|
124
|
+
the `dangerously_` prefix on purpose: enable it only in a trusted, isolated
|
|
125
|
+
workspace where you fully trust the prompt. It defaults to `false`.
|
|
126
|
+
|
|
127
|
+
## Cross-repository analysis example
|
|
128
|
+
|
|
129
|
+
Analyze multiple repositories from a single invocation by adding directories to
|
|
130
|
+
the workspace:
|
|
131
|
+
|
|
132
|
+
```jsonc
|
|
133
|
+
{
|
|
134
|
+
"name": "consult_agy",
|
|
135
|
+
"arguments": {
|
|
136
|
+
"query": "Compare the API surface of the main service with the clients that call it",
|
|
137
|
+
"directory": "/path/to/main-service",
|
|
138
|
+
"add_dir": [
|
|
139
|
+
"/path/to/client-a",
|
|
140
|
+
"/path/to/client-b"
|
|
141
|
+
]
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
This launches `agy --print "..." --add-dir /path/to/client-a --add-dir /path/to/client-b`,
|
|
147
|
+
giving the agent read access to all three workspaces in one session.
|
|
148
|
+
|
|
149
|
+
## Conversation continuity
|
|
150
|
+
|
|
151
|
+
`agy` can resume prior conversations. This wrapper exposes that directly and
|
|
152
|
+
stays stateless itself:
|
|
153
|
+
|
|
154
|
+
- `continue: true` resumes the most recent conversation. Because "most recent"
|
|
155
|
+
is shared state, concurrent calls can race on it — prefer `conversation` when
|
|
156
|
+
it matters.
|
|
157
|
+
- `conversation: "<ID>"` resumes a specific conversation by id.
|
|
158
|
+
|
|
159
|
+
The two are mutually exclusive; passing both returns an error.
|
|
160
|
+
|
|
161
|
+
## Timeout configuration
|
|
162
|
+
|
|
163
|
+
There are two independent timeouts:
|
|
164
|
+
|
|
165
|
+
- `print_timeout` — `agy`'s own wait timeout (Go duration; `agy` defaults to
|
|
166
|
+
about 5 minutes).
|
|
167
|
+
- `timeout_seconds` — this wrapper's hard wall-clock limit (default 660).
|
|
168
|
+
|
|
169
|
+
Keep `timeout_seconds` longer than `print_timeout` so `agy` can finish or time
|
|
170
|
+
out cleanly before the wrapper force-kills the subprocess. When you raise
|
|
171
|
+
`print_timeout` for a long task, raise `timeout_seconds` to match.
|
|
172
|
+
|
|
173
|
+
## Forward-compatibility example
|
|
174
|
+
|
|
175
|
+
If a future `agy` release adds a new flag (say `--super-mode`), use it
|
|
176
|
+
immediately without updating this server:
|
|
177
|
+
|
|
178
|
+
```jsonc
|
|
179
|
+
{
|
|
180
|
+
"name": "consult_agy",
|
|
181
|
+
"arguments": {
|
|
182
|
+
"query": "...",
|
|
183
|
+
"directory": "...",
|
|
184
|
+
"extra_args": ["--super-mode"]
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
## Configuration
|
|
190
|
+
|
|
191
|
+
| Environment variable | Default | Purpose |
|
|
192
|
+
| ------------------------------------- | ------- | ---------------------------------------- |
|
|
193
|
+
| `AGY_CMD` | `agy` | Path to the `agy` CLI binary |
|
|
194
|
+
| `ANTIGRAVITY_CLI_MCP_SLIM_TIMEOUT` | `660` | Default subprocess timeout in seconds |
|
|
195
|
+
| `ANTIGRAVITY_CLI_MCP_SLIM_LOG_LEVEL` | `INFO` | Logging level for stderr diagnostics |
|
|
196
|
+
|
|
197
|
+
## Development
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
# Install dev dependencies
|
|
201
|
+
pip install -e ".[test,dev]"
|
|
202
|
+
|
|
203
|
+
# Lint
|
|
204
|
+
ruff check .
|
|
205
|
+
|
|
206
|
+
# Test
|
|
207
|
+
pytest
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
## License
|
|
211
|
+
|
|
212
|
+
[MIT](./LICENSE) © tksfjt1024
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "antigravity-cli-mcp-slim"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "A thin, auditable MCP server wrapping the Antigravity CLI (agy). Forward-compatible with future CLI flags via extra_args passthrough."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = { text = "MIT" }
|
|
12
|
+
authors = [
|
|
13
|
+
{ name = "tksfjt1024", email = "tksfjt1024@gmail.com" },
|
|
14
|
+
]
|
|
15
|
+
keywords = [
|
|
16
|
+
"mcp",
|
|
17
|
+
"model-context-protocol",
|
|
18
|
+
"antigravity",
|
|
19
|
+
"antigravity-cli",
|
|
20
|
+
"agy",
|
|
21
|
+
"claude",
|
|
22
|
+
"anthropic",
|
|
23
|
+
"ai",
|
|
24
|
+
"llm",
|
|
25
|
+
"coding-agent",
|
|
26
|
+
]
|
|
27
|
+
classifiers = [
|
|
28
|
+
"Development Status :: 4 - Beta",
|
|
29
|
+
"Intended Audience :: Developers",
|
|
30
|
+
"License :: OSI Approved :: MIT License",
|
|
31
|
+
"Operating System :: OS Independent",
|
|
32
|
+
"Programming Language :: Python",
|
|
33
|
+
"Programming Language :: Python :: 3",
|
|
34
|
+
"Programming Language :: Python :: 3.10",
|
|
35
|
+
"Programming Language :: Python :: 3.11",
|
|
36
|
+
"Programming Language :: Python :: 3.12",
|
|
37
|
+
"Programming Language :: Python :: 3.13",
|
|
38
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
39
|
+
"Topic :: Utilities",
|
|
40
|
+
"Typing :: Typed",
|
|
41
|
+
]
|
|
42
|
+
dependencies = [
|
|
43
|
+
"mcp>=1.0.0",
|
|
44
|
+
]
|
|
45
|
+
|
|
46
|
+
[project.optional-dependencies]
|
|
47
|
+
test = [
|
|
48
|
+
"pytest>=8.0",
|
|
49
|
+
"pytest-asyncio>=0.23",
|
|
50
|
+
]
|
|
51
|
+
dev = [
|
|
52
|
+
"ruff>=0.6",
|
|
53
|
+
]
|
|
54
|
+
|
|
55
|
+
[project.urls]
|
|
56
|
+
Homepage = "https://github.com/tksfjt1024/antigravity-cli-mcp-slim"
|
|
57
|
+
Repository = "https://github.com/tksfjt1024/antigravity-cli-mcp-slim"
|
|
58
|
+
Issues = "https://github.com/tksfjt1024/antigravity-cli-mcp-slim/issues"
|
|
59
|
+
|
|
60
|
+
[project.scripts]
|
|
61
|
+
antigravity-cli-mcp-slim = "antigravity_cli_mcp_slim.server:main"
|
|
62
|
+
|
|
63
|
+
[tool.setuptools.packages.find]
|
|
64
|
+
where = ["src"]
|
|
65
|
+
|
|
66
|
+
[tool.setuptools.package-data]
|
|
67
|
+
antigravity_cli_mcp_slim = ["py.typed"]
|
|
68
|
+
|
|
69
|
+
[tool.ruff]
|
|
70
|
+
line-length = 100
|
|
71
|
+
target-version = "py310"
|
|
72
|
+
|
|
73
|
+
[tool.ruff.lint]
|
|
74
|
+
select = ["E", "F", "W", "I", "UP", "B", "SIM"]
|
|
75
|
+
ignore = []
|
|
76
|
+
|
|
77
|
+
[tool.pytest.ini_options]
|
|
78
|
+
testpaths = ["tests"]
|
|
79
|
+
python_files = ["test_*.py"]
|
|
80
|
+
asyncio_mode = "auto"
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"""antigravity_cli_mcp_slim - thin auditable MCP wrapper around the Antigravity CLI (agy)."""
|
|
2
|
+
|
|
3
|
+
from importlib.metadata import version as _pkg_version
|
|
4
|
+
|
|
5
|
+
from .server import main
|
|
6
|
+
|
|
7
|
+
__version__ = _pkg_version("antigravity-cli-mcp-slim")
|
|
8
|
+
__all__ = ["__version__", "main"]
|
|
File without changes
|