Universal LLM Tool Server - Connect Claude, OpenAI, and Gemini to your workspace
Antigravity is a production-ready tool server that lets AI models interact with your filesystem safely. It works with:
| Provider | Protocol | Status |
|---|---|---|
| Claude | MCP (Model Context Protocol) | β Full Support |
| OpenAI/ChatGPT | Function Calling API | β Full Support |
| Google Gemini | Function Calling API | β Full Support |
| Azure OpenAI | Function Calling API | β Full Support |
| Vertex AI | Function Calling API | β Full Support |
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Claude β β OpenAI β β Gemini β
β (MCP stdio) β β (HTTP API) β β (HTTP API) β
ββββββββββ¬βββββββββ ββββββββββ¬βββββββββ ββββββββββ¬βββββββββ
β β β
βββββββββββββββββββββββββΌββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββ
β ANTIGRAVITY β
β Universal Server β
β β
β ββββββββββββββββββββ β
β β Tool Registry β β
β β β’ filesystem β β
β β β’ (extensible) β β
β ββββββββββββββββββββ β
β β
β ββββββββββββββββββββ β
β β Permissions β β
β β & Sandbox β β
β ββββββββββββββββββββ β
ββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββ
β Your Workspace β
β (Safe & Auditable) β
ββββββββββββββββββββββββββ
- π Sandboxed Execution - Files operations restricted to allowed paths
- π Full Auditability - Every action is logged and traceable
- π Permission System - Fine-grained control (
FILE_READ,FILE_WRITE, etc.) - π§© Extensible - Easy to add custom tools
- π Multi-Provider - One server, all LLMs
- β‘ Production-Ready - TypeScript strict mode, comprehensive tests
# Global install (recommended for CLI)
npm install -g @stifler7/antigravity
# Or as a project dependency
npm install @stifler7/antigravity# Start the server
antigravity serve
# With custom workspace
antigravity serve -w /path/to/project
# HTTP only (for OpenAI/Gemini)
antigravity serve --http-only -p 3000
# MCP only (for Claude Desktop)
antigravity serve --mcp-only
# List available tools
antigravity tools
# Help
antigravity --helpAdd to your claude_desktop_config.json:
Windows: %APPDATA%\Claude\claude_desktop_config.json
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"antigravity": {
"command": "antigravity",
"args": ["serve", "-w", "C:/path/to/your/project"]
}
}
}Restart Claude Desktop, then ask Claude:
"List the files in my project"
"Read the README.md file"
"Create a new file called hello.ts"
import OpenAI from 'openai';
const openai = new OpenAI();
// 1. Get available tools
const toolsResponse = await fetch('http://localhost:3000/openai/tools');
const tools = await toolsResponse.json();
// 2. Call OpenAI with tools
const response = await openai.chat.completions.create({
model: 'gpt-4o',
messages: [{ role: 'user', content: 'List files in the src directory' }],
tools: tools,
});
// 3. If OpenAI wants to call a tool
if (response.choices[0].message.tool_calls) {
for (const toolCall of response.choices[0].message.tool_calls) {
const result = await fetch('http://localhost:3000/openai/execute', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(toolCall),
});
console.log(await result.json());
}
}import { GoogleGenerativeAI } from '@google/generative-ai';
const genAI = new GoogleGenerativeAI(process.env.GEMINI_API_KEY);
// 1. Get available tools
const toolsResponse = await fetch('http://localhost:3000/gemini/tools');
const tools = await toolsResponse.json();
// 2. Call Gemini with tools
const model = genAI.getGenerativeModel({
model: 'gemini-1.5-pro',
tools: [tools],
});
const result = await model.generateContent('Read the package.json file');
// 3. Handle function calls
const functionCall = result.response.candidates[0].content.parts[0].functionCall;
if (functionCall) {
const toolResult = await fetch('http://localhost:3000/gemini/execute', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(functionCall),
});
console.log(await toolResult.json());
}import {
UnifiedServer,
ToolRegistry,
filesystemTools,
ToolPermission,
LLMProvider,
createOpenAIProvider,
} from '@stifler7/antigravity';
// Option 1: Use the unified server
const server = new UnifiedServer({
workspaceRoot: '/path/to/project',
enableMCP: true,
enableHTTP: true,
httpPort: 3000,
});
await server.start();
// Option 2: Use providers directly
const openai = createOpenAIProvider();
const tools = filesystemTools.map(t => openai.formatTool(t));
// Use tools array in your OpenAI API calls
// Option 3: Use tool registry directly
const registry = new ToolRegistry({
grantedPermissions: [ToolPermission.FILE_READ],
});
filesystemTools.forEach(tool => registry.register(tool));
const result = await registry.invoke({
toolId: 'filesystem.read_file',
input: { path: 'README.md' },
context: myContext,
});| Tool | Description | Permission |
|---|---|---|
filesystem.list_directory |
List directory contents | FILE_READ |
filesystem.read_file |
Read file content | FILE_READ |
filesystem.write_file |
Write content to file | FILE_WRITE |
| Permission | Description |
|---|---|
FILE_READ |
Read files and list directories |
FILE_WRITE |
Create and modify files |
FILE_DELETE |
Delete files and directories |
SHELL_EXECUTE |
Run shell commands |
NETWORK |
Make network requests |
# Read-only mode
antigravity serve --read-only
# Full access (be careful!)
antigravity serve --full-accessAntigravity is designed with security in mind:
- Path Sandboxing - All file operations are restricted to the workspace
- Permission Validation - Each tool declares required permissions
- Input Validation - All inputs are validated with Zod schemas
- Audit Logging - Every operation is logged
- API Key Support - Optional authentication for HTTP endpoints
# Require API key for HTTP requests
antigravity serve --api-key your-secret-key| Endpoint | Method | Description |
|---|---|---|
/health |
GET | Server health check |
/tools |
GET | List all tools (generic format) |
/openai/tools |
GET | List tools (OpenAI format) |
/openai/execute |
POST | Execute tool (OpenAI format) |
/gemini/tools |
GET | List tools (Gemini format) |
/gemini/execute |
POST | Execute tool (Gemini format) |
/execute |
POST | Execute tool (generic format) |
POST /execute
{
"provider": "openai" | "gemini" | "generic",
"tool": "filesystem.read_file",
"arguments": {
"path": "README.md"
}
}import { UnifiedServer, ToolPermission } from '@stifler7/antigravity';
import { z } from 'zod';
const myCustomTool = {
id: 'custom.greet',
name: 'Greet',
description: 'Returns a greeting message',
category: 'custom',
requiredPermissions: [],
inputSchema: z.object({
name: z.string().describe('Name to greet'),
}),
outputSchema: z.object({
message: z.string(),
}),
execute: async (input) => ({
message: `Hello, ${input.name}!`,
}),
};
const server = new UnifiedServer({
workspaceRoot: '/path/to/project',
customTools: [myCustomTool],
});# Clone
git clone https://github.com/STiFLeR7/antigravity.git
cd antigravity
# Install
npm install
# Build
npm run build
# Test
npm test
# Start locally
npm startantigravity/
βββ src/
β βββ index.ts # Main exports
β βββ cli/ # CLI application
β βββ providers/ # LLM provider adapters
β β βββ base.ts # Abstract provider interface
β β βββ claude.ts # Claude MCP adapter
β β βββ openai.ts # OpenAI function calling adapter
β β βββ gemini.ts # Google Gemini adapter
β βββ server/ # Server implementations
β β βββ unified.ts # Multi-provider server
β βββ mcp/ # MCP runtime
β β βββ context-manager.ts
β β βββ tool-registry.ts
β βββ agent/ # Agent runtime
β β βββ lifecycle.ts
β β βββ decision-loop.ts
β βββ tools/ # Built-in tools
β β βββ filesystem.ts
β βββ observability/ # Logging & tracing
β β βββ logger.ts
β β βββ tracer.ts
β βββ types/ # TypeScript definitions
βββ examples/ # Usage examples
βββ tests/ # Test suites
βββ README.md
MIT Β© STiFLeR7
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing) - Open a Pull Request
- Anthropic for the Model Context Protocol
- OpenAI for function calling API design
- Google for Gemini API
Made with β€οΈ for the AI developer community