@h0wzy/mcp-server-antigravity 1.0.0
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.
- package/NOTICE +9 -0
- package/bin/cli.js +6 -0
- package/package.json +20 -0
- package/src/index.js +103 -0
package/NOTICE
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
H0wZy/mcp - Google Antigravity Server Bridge
|
|
2
|
+
Original inspiration: antigravity-claude-mcp (https://github.com/arjunthilak05/antigravity-claude-mcp)
|
|
3
|
+
Originally authored by Arjun Thilak under the MIT License.
|
|
4
|
+
|
|
5
|
+
Enhanced & Unified for H0wZy/mcp by Marcos (H0wZy):
|
|
6
|
+
- Modularized to speak generic MCP to any client (Claude Code, OpenAI Codex, Antigravity IDE, Cursor)
|
|
7
|
+
- Universal cross-platform binary resolution (PATHEXT, LOCALAPPDATA, delimiter)
|
|
8
|
+
- Direct zero-latency local execution
|
|
9
|
+
- Resilient Rate Limit (HTTP 429) and ResourceExhausted handling
|
package/bin/cli.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@h0wzy/mcp-server-antigravity",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Google Antigravity MCP Server connecting any MCP client to Gemini 3.1 Pro / Flash",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"h0wzy-mcp-antigravity": "bin/cli.js"
|
|
8
|
+
},
|
|
9
|
+
"main": "./src/index.js",
|
|
10
|
+
"author": "Marcos (H0wZy) <h0wzymarcos@gmail.com>",
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "git+https://github.com/H0wZy/mcp.git",
|
|
15
|
+
"directory": "servers/antigravity"
|
|
16
|
+
},
|
|
17
|
+
"publishConfig": {
|
|
18
|
+
"access": "public"
|
|
19
|
+
}
|
|
20
|
+
}
|
package/src/index.js
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
// H0wZy/mcp — Antigravity MCP Server
|
|
2
|
+
// Minimal, DRY bridge exposing Google Antigravity (Gemini 3.1 Pro / Flash) to any MCP client.
|
|
3
|
+
|
|
4
|
+
import { statSync } from 'node:fs';
|
|
5
|
+
import { dirname } from 'node:path';
|
|
6
|
+
import { createMcpServer, resolveBinary, executeProcess, formatResilientResponse } from '../../../shared/index.js';
|
|
7
|
+
|
|
8
|
+
const DEFAULT_MODEL = process.env.AGY_MODEL || 'Gemini 3.1 Pro (High)';
|
|
9
|
+
const TIMEOUT_MS = 300000; // 5 minutes
|
|
10
|
+
|
|
11
|
+
export const askAntigravityTool = {
|
|
12
|
+
name: 'ask_antigravity',
|
|
13
|
+
description:
|
|
14
|
+
'Get an INDEPENDENT second opinion or code review from Google Antigravity ' +
|
|
15
|
+
'(default model: Gemini 3.1 Pro High) — a different model family than Claude or OpenAI, ' +
|
|
16
|
+
'ensuring an unbiased cross-check. Provide a `prompt`; optionally pass `paths` (file or folder ' +
|
|
17
|
+
'paths) and Antigravity will read the entire context before answering.',
|
|
18
|
+
inputSchema: {
|
|
19
|
+
type: 'object',
|
|
20
|
+
properties: {
|
|
21
|
+
prompt: {
|
|
22
|
+
type: 'string',
|
|
23
|
+
description: 'The question, architectural proposal, or code review request.',
|
|
24
|
+
},
|
|
25
|
+
paths: {
|
|
26
|
+
type: 'array',
|
|
27
|
+
items: { type: 'string' },
|
|
28
|
+
description: 'Optional file or directory paths to include as full context.',
|
|
29
|
+
},
|
|
30
|
+
model: {
|
|
31
|
+
type: 'string',
|
|
32
|
+
description: 'Optional model override (e.g. "Gemini 3.1 Pro (High)", "Gemini 3.1 Flash").',
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
required: ['prompt'],
|
|
36
|
+
},
|
|
37
|
+
handler: async ({ prompt, paths = [], model }) => {
|
|
38
|
+
if (!prompt) {
|
|
39
|
+
return { text: 'Missing required argument: prompt', isError: true };
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const agyBin = resolveBinary('agy', 'AGY_BIN');
|
|
43
|
+
if (!agyBin) {
|
|
44
|
+
return {
|
|
45
|
+
isError: true,
|
|
46
|
+
text:
|
|
47
|
+
'❌ Google Antigravity CLI (`agy`) not found on system.\n' +
|
|
48
|
+
'Please ensure Antigravity is installed:\n' +
|
|
49
|
+
' - Windows: Check %LOCALAPPDATA%\\agy\\bin\\agy.exe or run installer\n' +
|
|
50
|
+
' - macOS/Linux: curl -fsSL https://antigravity.google/cli/install.sh | bash\n' +
|
|
51
|
+
'Or set AGY_BIN to its absolute path.',
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const dirs = new Set();
|
|
56
|
+
for (const p of paths) {
|
|
57
|
+
try {
|
|
58
|
+
dirs.add(statSync(p).isDirectory() ? p : dirname(p));
|
|
59
|
+
} catch {
|
|
60
|
+
/* skip unreadable path */
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const fullPrompt = paths.length
|
|
65
|
+
? `Context files/folders to read and consider in full:\n${paths.map((p) => `- ${p}`).join('\n')}\n\n${prompt}`
|
|
66
|
+
: prompt;
|
|
67
|
+
|
|
68
|
+
const args = [
|
|
69
|
+
'-p',
|
|
70
|
+
fullPrompt,
|
|
71
|
+
'--model',
|
|
72
|
+
model || DEFAULT_MODEL,
|
|
73
|
+
'--print-timeout',
|
|
74
|
+
'5m',
|
|
75
|
+
'--dangerously-skip-permissions',
|
|
76
|
+
];
|
|
77
|
+
for (const d of dirs) args.push('--add-dir', d);
|
|
78
|
+
|
|
79
|
+
const res = await executeProcess(agyBin, args, { timeoutMs: TIMEOUT_MS, toolName: 'agy' });
|
|
80
|
+
|
|
81
|
+
if (res.ok) {
|
|
82
|
+
return {
|
|
83
|
+
text: res.stdout || '(Antigravity completed with no output)',
|
|
84
|
+
isError: false,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const formatted = formatResilientResponse({
|
|
89
|
+
provider: 'Google Antigravity',
|
|
90
|
+
rawOutput: res.stderr || res.stdout,
|
|
91
|
+
exitCode: res.exitCode,
|
|
92
|
+
});
|
|
93
|
+
return formatted;
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export function createServer() {
|
|
98
|
+
return createMcpServer({
|
|
99
|
+
name: 'antigravity',
|
|
100
|
+
version: '1.0.0',
|
|
101
|
+
tools: [askAntigravityTool],
|
|
102
|
+
});
|
|
103
|
+
}
|