Skip to main content

Google Antigravity Configuration Guide

After configuration, you can directly operate CloudBase services in Google Antigravity's AI conversations.

For example:

  • "Create user table" - AI automatically creates database collection
  • "Deploy this function" - AI automatically uploads and configures cloud function
  • "Deploy frontend to CDN" - AI automatically uploads files and configures hosting

No need to switch to cloud console, all operations can be completed in Google Antigravity using natural language.

Prerequisites

Before starting configuration, please ensure the following conditions are met:

Node.js environment and CloudBase environment are ready

Node.js Environment: Ensure Node.js v18.15.0 or higher is installed:

node --version

If not installed, please download and install from Node.js official website.

CloudBase Environment: Please refer to the documentation Create CloudBase Environment. New users can sign up for free.


Client

Configure your MCP client to connect with your CloudBase environment

Step 1: Installation

Use project template (recommended) - Template includes MCP configuration and AI rulesView templates

Or add this configuration to .agent/rules/:

json
1{
2 "mcpServers": {
3 "cloudbase": {
4 "command": "npx",
5 "args": ["@cloudbase/cloudbase-mcp@latest"],
6 "env": {
7 "INTEGRATION_IDE": "Antigravity"
8 }
9 }
10 }
11}

Step 2: Verify connection

After configuration, enter the following in your AI chat to verify:

prompt
检查 CloudBase 工具是否可用, 下载 CloudBase AI 开发规则到当前项目

Configuration Steps

Using project template can automatically configure MCP and rule files:

npx @cloudbase/cloudbase-mcp downloadTemplate --template rules --ide antigravity

Method 2: Manual Configuration

  1. Create Rules Directory

    Create .agent/rules/ directory in project root:

    mkdir -p .agent/rules
  2. Configure MCP Server

    Create .mcp.json file in project root, add the following configuration:

    {
    "mcpServers": {
    "cloudbase": {
    "command": "npx",
    "args": ["@cloudbase/cloudbase-mcp@latest"],
    "env": {
    "INTEGRATION_IDE": "Antigravity"
    }
    }
    }
    }
  3. Add Rule Files

    Copy CloudBase rule files to .agent/rules/ directory. Rule files support the following activation methods:

    • Manual: Manually activate via @ mention
    • Always On: Always applied
    • Model Decision: Based on natural language description, model decides whether to apply
    • Glob: Based on glob patterns (such as .js, src/**/.ts), matching files will automatically apply rules

Verify Connection

After configuration is complete, enter in Google Antigravity's AI conversation:

Check if CloudBase tools are available

If configuration is successful, AI should be able to recognize and use CloudBase tools.

Common Questions

Q: MCP connection failed? A: Check if configuration file format is correct, restart Google Antigravity, confirm network connection is normal.

Q: Rule files not taking effect? A: Check if rule file activation method settings are correct, ensure files are located in .agent/rules/ directory.

Q: Tool count shows 0? A: Please refer to FAQ.

More questions please check: Complete FAQ

相关资源