Antigravity Base MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Antigravity Base MCP Serverscaffold a new tool called get_weather with a Zod schema"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
๐ Antigravity Base MCP Server Template (Model Context Protocol Starter Kit)
An enterprise-grade, clean, and extensible Base MCP (Model Context Protocol) Server Template built with TypeScript, Zod, Vite, and Vitest.
Designed to be your foundational starter kit: whenever you need a new MCP server with custom tools for a new project, simply copy this directory, define your tools in src/tools/, and use it instantly across Claude Desktop, Google Antigravity, Cursor, and VS Code.
โก Autonomous On-Demand Auto-Start (Zero Manual Startup)
No Manual Startup Required! You do NOT need to manually launch, keep terminal windows open, or run background daemons for this MCP server.
When an AI Agent (Claude, Antigravity, Cursor) sends its first request, the client automatically spawns
bin/mcp-server.json-demand over Stdio.Self-Healing Bootstrap: If
node_modules/ordist/is missing, the launcher automatically runsnpm installand compiles the project on the fly in milliseconds before handling the request!
Related MCP server: MCP Server Boilerplate
๐ Key Features & Capabilities
โก Strict Protocol Compliance: Implements MCP Specification 2024-11-05 and JSON-RPC 2.0 (
initialize,ping,tools/list,tools/call,resources/list,resources/read,prompts/list,prompts/get,completion/complete).๐ก๏ธ Zero Stdout Pollution: Clean Stdio transport with all logger output strictly routed to stderr and optional file logging.
๐งฉ Modular Tool Architecture: Abstract
BaseToolclass with automatic Zod schema-to-JSON-Schema conversion and safe runtime validation.๐ ๏ธ Instant Tool Generator: Run
npm run new-tool <tool_name>to scaffold a new tool with types and schema in seconds.๐งช Complete Test Suite: Integrated Vitest unit tests and real-stdio end-to-end integration tests (
npm run test:all).๐ฅ๏ธ Windows 1-Click Automation:
.batfiles for installation, building, testing, and running.๐ Bilingual Guides: Includes English and comprehensive Persian documentation (GUIDE_FA.md).
๐ Why Use This Base MCP Instead of Building from Scratch?
Comparison Criteria | Building from Scratch (From 0) | Using Antigravity Base MCP |
Setup Time | 2 to 4 hours of tedious boilerplate | Under 1 minute (copy folder & rename) |
Stdio Stream Corruption | High risk ( | 100% Protected with stderr-isolated Logger |
Parameter Validation | Manual, error-prone JSON Schema definitions | Type-safe Zod Schemas with auto JSON Schema conversion |
Server Lifecycle | Manual script startup and background management | Autonomous on-demand wake-up and auto-build |
Error Handling | Repetitive try/catch boilerplate per tool | Standardized error wrappers with detailed diagnostics |
Testability | Hard to test without full LLM client | Built-in CLI & Vitest for immediate isolated testing |
Multi-Client Support | Unpredictable protocol quirks | Battle-tested across Claude, Antigravity, Cursor |
๐๏ธ Foundational Capabilities for Future Expansion
This template gives you the complete architecture to build:
๐๏ธ Database MCPs: Connect to SQLite, PostgreSQL, MongoDB, or Redis and expose query tools to AI agents.
๐ฑ Flutter / Dart MCPs: Expose AST analyzers, automated widget generators, and emulator controllers.
๐ป OS & File Automation MCPs: Create secure file management, process execution, and system diagnostics tools.
๐ API Gateway & Webhook MCPs: Integrate third-party APIs, payments, messaging bots, and internal microservices.
๐ Dynamic Resources: Expose live project state, documentation, and database schemas directly to agents.
๐ก Prompt Engineering Templates: Provide structured multi-step reasoning prompts for refactoring and security reviews.
๐ Directory Structure
base_mcp/
โโโ .agents/
โ โโโ skills/
โ โโโ base-mcp-starter/
โ โโโ SKILL.md # AI Agent skill documentation
โโโ bin/
โ โโโ cli.ts # Interactive Developer CLI
โ โโโ mcp-server.ts # Direct TS runner
โ โโโ mcp-server.js # Autonomous zero-config Node runner
โโโ src/
โ โโโ index.ts # Main library exports
โ โโโ server.ts # Core BaseMCPServer JSON-RPC router
โ โโโ config/
โ โ โโโ index.ts # Server configuration & environment
โ โโโ core/
โ โ โโโ types.ts # Protocol types
โ โ โโโ logger.ts # Stderr / file logger
โ โ โโโ errors.ts # JSON-RPC error codes & classes
โ โ โโโ transport.ts # Stdio transport engine
โ โโโ tools/
โ โ โโโ base-tool.ts # Abstract base tool with Zod parsing
โ โ โโโ registry.ts # Central tool registry
โ โ โโโ index.ts # Tool registry loader & registrations
โ โ โโโ examples/
โ โ โโโ echo.tool.ts # Echo sample tool
โ โ โโโ system-info.tool.ts # System diagnostics sample tool
โ โ โโโ custom-template.tool.ts # Copy-paste blueprint
โ โโโ resources/
โ โ โโโ index.ts # Resource manager
โ โ โโโ examples/
โ โ โโโ sample-resource.ts # Sample dynamic resource
โ โโโ prompts/
โ โโโ index.ts # Prompt manager
โ โโโ examples/
โ โโโ sample-prompt.ts # Sample prompt template
โโโ scripts/
โ โโโ create-tool.ts # Tool scaffolding generator
โ โโโ test-stdio.ts # End-to-end stdio protocol tester
โ โโโ export-schemas.ts # Schema exporter to JSON files
โโโ templates/
โ โโโ mcp_config.example.json # Client configuration snippets
โโโ tests/
โ โโโ server.test.ts # Server protocol tests
โ โโโ tools.test.ts # Tool execution tests
โโโ package.json
โโโ tsconfig.json
โโโ vite.config.ts
โโโ vitest.config.ts
โโโ Build.bat
โโโ Run-Tests.bat
โโโ Start-Server.bat
โโโ Install-Dependencies.batโก Quick Start
1. Install Dependencies
npm install
# or double click Install-Dependencies.bat2. Build the Server
npm run build
# or double click Build.bat3. Run Automated Tests
npm run test:all
# or double click Run-Tests.bat4. Test Interactive CLI
# List all registered tools:
npm run cli list
# Call a tool directly:
npm run cli call echo '{"message": "Hello World!", "repeat": 2}'๐ ๏ธ How to Create a New Tool in 3 Steps
Step 1: Generate Scaffolding
npm run new-tool calculate_taxThis generates src/tools/calculate-tax.tool.ts.
Step 2: Define Schema & Implement Logic
Open src/tools/calculate-tax.tool.ts:
import { z } from 'zod';
import { BaseTool } from './base-tool';
import { MCPToolCallResult } from '../core/types';
export const CalculateTaxSchema = z.object({
amount: z.number().positive().describe('Total amount in USD'),
taxRate: z.number().min(0).max(1).default(0.09).describe('Tax rate decimal (e.g. 0.09 for 9%)'),
});
export type CalculateTaxInput = z.infer<typeof CalculateTaxSchema>;
export class CalculateTaxTool extends BaseTool<typeof CalculateTaxSchema> {
public readonly name = 'calculate_tax';
public readonly description = 'Calculates total tax and grand total for a given amount.';
public readonly schema = CalculateTaxSchema;
public async execute(args: CalculateTaxInput): Promise<MCPToolCallResult> {
const tax = args.amount * args.taxRate;
const total = args.amount + tax;
return this.jsonResult({
originalAmount: args.amount,
taxRate: args.taxRate,
taxAmount: Math.round(tax * 100) / 100,
grandTotal: Math.round(total * 100) / 100,
});
}
}Step 3: Register in src/tools/index.ts
import { CalculateTaxTool } from './calculate-tax.tool';
export function createDefaultToolRegistry(): ToolRegistry {
const registry = new ToolRegistry();
// Register your new tool:
registry.register(new CalculateTaxTool());
return registry;
}Rebuild (npm run build) and test:
npm run cli call calculate_tax '{"amount": 100, "taxRate": 0.15}'๐ Connecting to AI Clients
Claude Desktop (claude_desktop_config.json)
{
"mcpServers": {
"my-mcp": {
"command": "node",
"args": ["C:/Users/ASUS/Desktop/flutter_project/base_mcp/bin/mcp-server.js"]
}
}
}Google Antigravity / Gemini CLI (mcp_config.json)
{
"mcpServers": {
"my-mcp": {
"command": "node",
"args": ["C:/Users/ASUS/Desktop/flutter_project/base_mcp/bin/mcp-server.js"],
"env": {
"MCP_LOG_LEVEL": "info"
}
}
}
}Cursor IDE (.cursor/mcp.json)
{
"mcpServers": {
"my-mcp": {
"command": "node",
"args": ["C:/Users/ASUS/Desktop/flutter_project/base_mcp/bin/mcp-server.js"]
}
}
}๐ License
MIT License. Created by Antigravity Engineering.
This server cannot be deployed
Maintenance
Related MCP Connectors
Nifty's MCP server โ exposes tasks, projects, messages, and files as tools for AI agents.
MCP server for progressive tool usage at any scale (see https://klavis.ai)
MCP-first toolbox for agents: KV storage, auth, queue, and utility tools. Free in early access.
MCP server connecting AI agents to 100+ apps (Gmail, Slack, Notion, GitHub) via one-click OAuth.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA starter template for building MCP servers with TypeScript support, example tools, and automated installation scripts for Claude Desktop, Cursor, and other MCP-compatible AI assistants. Provides a foundation for creating custom tools, resource providers, and prompt templates.5-
- FlicenseBqualityDmaintenanceA starter template for building custom MCP servers that can integrate with Claude Desktop, Cursor, and other AI assistants. Provides example tools, TypeScript support, and automated publishing workflows to help developers quickly create their own MCP integrations.112-
- FlicenseAqualityDmaintenanceA starter template for building custom MCP servers that can integrate with Claude Desktop, Cursor, and other AI assistants. Provides example tools, TypeScript support, and automated publishing workflows to help developers quickly create their own MCP servers.711-
- FlicenseCqualityDmaintenanceA starter template for building custom MCP servers that can integrate with Claude, Cursor, or other MCP-compatible AI assistants. Provides a clean foundation with TypeScript support, example implementations, and easy installation scripts for quickly creating tools, resources, and prompt templates.26-