Skip to content

Universal LLM Tool Server - Connect Claude, OpenAI, and Gemini to your workspace

License

Notifications You must be signed in to change notification settings

STiFLeR7/antigravity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ Antigravity

Universal LLM Tool Server - Connect Claude, OpenAI, and Gemini to your workspace

npm version License: MIT TypeScript Node.js


🎯 What is Antigravity?

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)   β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

✨ Features

  • πŸ”’ 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

πŸ“¦ Installation

# Global install (recommended for CLI)
npm install -g @stifler7/antigravity

# Or as a project dependency
npm install @stifler7/antigravity

πŸš€ Quick Start

CLI Usage

# 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 --help

Claude Desktop

Add 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"

OpenAI / ChatGPT

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());
  }
}

Google Gemini

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());
}

As a Library

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,
});

πŸ”§ Available Tools

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

πŸ” Permissions

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-access

πŸ›‘οΈ Security

Antigravity is designed with security in mind:

  1. Path Sandboxing - All file operations are restricted to the workspace
  2. Permission Validation - Each tool declares required permissions
  3. Input Validation - All inputs are validated with Zod schemas
  4. Audit Logging - Every operation is logged
  5. API Key Support - Optional authentication for HTTP endpoints
# Require API key for HTTP requests
antigravity serve --api-key your-secret-key

πŸ“‘ API Reference

HTTP Endpoints

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)

Generic Execute Request

POST /execute
{
  "provider": "openai" | "gemini" | "generic",
  "tool": "filesystem.read_file",
  "arguments": {
    "path": "README.md"
  }
}

πŸ”Œ Adding Custom Tools

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],
});

πŸ§ͺ Development

# Clone
git clone https://github.com/STiFLeR7/antigravity.git
cd antigravity

# Install
npm install

# Build
npm run build

# Test
npm test

# Start locally
npm start

πŸ“ Project Structure

antigravity/
β”œβ”€β”€ 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

πŸ“„ License

MIT Β© STiFLeR7


🀝 Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing)
  5. Open a Pull Request

πŸ™ Acknowledgments


Made with ❀️ for the AI developer community

About

Universal LLM Tool Server - Connect Claude, OpenAI, and Gemini to your workspace

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published