Antigravity 设置

Antigravity 是一个在终端中通过 agy 命令运行的编码 agent。把 WEEGLOO MCP 服务器连接到它之后,Antigravity 就能直接创建、读取和修改 Content TypeContentMedia 等资源。安装工具在安装 MCP 服务器的同时,也会安装 Skills 和 Rules,帮助 Antigravity 按预期的方式使用 WEEGLOO API。Skills 是讲解如何出色完成特定任务的指南,Rules 则是贯穿各项任务都要遵守的规则。先用安装工具一次性完成设置,然后完成 MCP 连接认证即可。

关于 MCP 服务器和 Skills、Rules 的详细内容,分别在 MCPSkills 与 Rules 页面中介绍。本页只讲如何连接到 Antigravity。

准备工作

要运行下面的安装命令,需要 Node.js。请先用以下命令确认是否已安装,以及版本是否为 18 及以上。

终端
node --version # 显示 v18 及以上即可 npx --version # 显示版本号即可

如果已安装 Node.js 但没有 npx,请用下面的命令把 npm 更新到最新版本。更新 npm 会一并安装 npx。

终端
npm install -g npm@latest

如果尚未安装 Node.js 或版本过低,请按照所用操作系统对应的方法安装 Node.js。

终端
brew install node

如果没有 Homebrew,请先在 brew.sh 安装,或在 nodejs.org 直接下载 Node.js。

终端
winget install OpenJS.NodeJS.LTS

如果没有 winget 或无法识别,请在 nodejs.org 下载 LTS 安装文件。安装后需要重新打开终端。

发行版自带的软件包可能是旧版本,因此推荐使用可在多个发行版上使用的 nvm 来安装。

终端
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.5/install.sh | bash source ~/.bashrc nvm install --lts

如需直接下载安装文件,请在 nodejs.org 查看。

Antigravity 也需要已安装,以便在终端中通过 agy 命令运行。如果还没有,请参阅 Antigravity 安装指南

进行连接

默认安装只需复制本页的安装命令,在终端中执行一次即可。若想逐步自行选择安装过程,请打开 自定义安装

在 Antigravity 中 MCP 认证可能不稳定

weegloo MCP 服务器使用常规的 stateful HTTP MCP 连接,但 Antigravity 对 stateful MCP 连接的支持尚不稳定,认证可能失败或需要重试。如果希望更稳定的设置流程,建议使用 Claude Code、Codex 或 Cursor。

安装位置
1

安装 MCP · Skills

复制安装命令并在终端中执行。

终端
$ npx weegloo@latest -y \ --agent antigravity \ --token <Personal Access Token>
2

连接 MCP 认证

请按以下顺序进行认证。

  1. agy 运行 Antigravity。

    终端
    agy
  2. 在提示符中输入 /mcp

    终端
    /mcp
  3. 请选择 weegloo

    终端
    MCP Servers Plugins (~/.gemini/config/plugins) > ✗ weegloo error: calling "initialize": sending "initialize": Unauthorized [Auth Needed] ✓ weegloo-upload Tools: CreateUpload Keyboard: ↑/↓ Navigate enter Actions
  4. 请选择 Authenticate

    终端
    MCP Servers Plugins (~/.gemini/config/plugins) > ✗ weegloo error: calling "initialize": sending "initialize": Unauthorized [Auth Needed] Restart Disable [Authenticate] ✓ weegloo-upload Tools: CreateUpload Keyboard: ←/→ Navigate enter Actions
  5. 在打开的认证页面的令牌输入框中粘贴下面的令牌。

  6. 复制 Google Antigravity 页面上显示的 Code,回到 Antigravity 粘贴并按 Enter

    显示认证失败时

    如果显示 Authentication failed: no pending auth state for server weegloo 消息,可能是 Antigravity 一侧的临时问题。该现象主要出现在低于 1.0.16 的版本,但在最新版本中也可能发生,可按以下步骤重新连接。

    1. Esc 返回 MCP Servers 界面。
    2. 再按一次 Esc 返回提示符输入界面。
    3. 再次输入 /mcp,经过 initializing 阶段后即可连接。
1

安装 MCP · Skills

复制安装命令并在终端中执行。必须在要连接的项目文件夹内执行。

终端
$ npx weegloo@latest -y \ --agent antigravity \ --location project \ --token <Personal Access Token>
2

连接 MCP 认证

请按以下顺序进行认证。

  1. agy 运行 Antigravity。

    终端
    agy
  2. 在提示符中输入 /mcp

    终端
    /mcp
  3. 请选择 weegloo

    终端
    MCP Servers Plugins (~/.gemini/config/plugins) > ✗ weegloo error: calling "initialize": sending "initialize": Unauthorized [Auth Needed] ✓ weegloo-upload Tools: CreateUpload Keyboard: ↑/↓ Navigate enter Actions
  4. 请选择 Authenticate

    终端
    MCP Servers Plugins (~/.gemini/config/plugins) > ✗ weegloo error: calling "initialize": sending "initialize": Unauthorized [Auth Needed] Restart Disable [Authenticate] ✓ weegloo-upload Tools: CreateUpload Keyboard: ←/→ Navigate enter Actions
  5. 在打开的认证页面的令牌输入框中粘贴下面的令牌。

  6. 复制 Google Antigravity 页面上显示的 Code,回到 Antigravity 粘贴并按 Enter

    显示认证失败时

    如果显示 Authentication failed: no pending auth state for server weegloo 消息,可能是 Antigravity 一侧的临时问题。该现象主要出现在低于 1.0.16 的版本,但在最新版本中也可能发生,可按以下步骤重新连接。

    1. Esc 返回 MCP Servers 界面。
    2. 再按一次 Esc 返回提示符输入界面。
    3. 再次输入 /mcp,经过 initializing 阶段后即可连接。

以交互方式运行 npx weegloo,逐项回答提示来完成安装。

在 Antigravity 中 MCP 认证可能不稳定

weegloo MCP 服务器使用常规的 stateful HTTP MCP 连接,但 Antigravity 对 stateful MCP 连接的支持尚不稳定,认证可能失败或需要重试。如果希望更稳定的设置流程,建议使用 Claude Code、Codex 或 Cursor。

安装位置
1

运行安装工具

在终端中执行下面的命令,并逐项选择提示的内容。在询问令牌的位置,用下面的 复制令牌 按钮复制令牌并粘贴。

终端
npx weegloo@latest
终端
✔ Select your IDE: Antigravity CLI ✔ What would you like to install? MCP server, Skills and Rules ✔ Enter your Weegloo Personal Access Token: **** ← 复制的令牌 ✔ Select the MCP server group: default ✔ Where would you like to install the configuration? Global … ✔ Installation complete!
2

连接 MCP 认证

请按以下顺序进行认证。

  1. agy 运行 Antigravity。

    终端
    agy
  2. 在提示符中输入 /mcp

    终端
    /mcp
  3. 请选择 weegloo

    终端
    MCP Servers Plugins (~/.gemini/config/plugins) > ✗ weegloo error: calling "initialize": sending "initialize": Unauthorized [Auth Needed] ✓ weegloo-upload Tools: CreateUpload Keyboard: ↑/↓ Navigate enter Actions
  4. 请选择 Authenticate

    终端
    MCP Servers Plugins (~/.gemini/config/plugins) > ✗ weegloo error: calling "initialize": sending "initialize": Unauthorized [Auth Needed] Restart Disable [Authenticate] ✓ weegloo-upload Tools: CreateUpload Keyboard: ←/→ Navigate enter Actions
  5. 在打开的认证页面的令牌输入框中粘贴下面的令牌。

  6. 复制 Google Antigravity 页面上显示的 Code,回到 Antigravity 粘贴并按 Enter

    显示认证失败时

    如果显示 Authentication failed: no pending auth state for server weegloo 消息,可能是 Antigravity 一侧的临时问题。该现象主要出现在低于 1.0.16 的版本,但在最新版本中也可能发生,可按以下步骤重新连接。

    1. Esc 返回 MCP Servers 界面。
    2. 再按一次 Esc 返回提示符输入界面。
    3. 再次输入 /mcp,经过 initializing 阶段后即可连接。
1

运行安装工具

先进入要连接的项目文件夹,然后在该文件夹中执行下面的命令并逐项选择提示的内容。在询问令牌的位置,用下面的 复制令牌 按钮复制令牌并粘贴。务必在该项目文件夹内执行。

终端
npx weegloo@latest
终端
✔ Select your IDE: Antigravity CLI ✔ What would you like to install? MCP server, Skills and Rules ✔ Enter your Weegloo Personal Access Token: **** ← 复制的令牌 ✔ Select the MCP server group: default ✔ Where would you like to install the configuration? Project … ✔ Installation complete!
2

连接 MCP 认证

请按以下顺序进行认证。

  1. agy 运行 Antigravity。

    终端
    agy
  2. 在提示符中输入 /mcp

    终端
    /mcp
  3. 请选择 weegloo

    终端
    MCP Servers Plugins (~/.gemini/config/plugins) > ✗ weegloo error: calling "initialize": sending "initialize": Unauthorized [Auth Needed] ✓ weegloo-upload Tools: CreateUpload Keyboard: ↑/↓ Navigate enter Actions
  4. 请选择 Authenticate

    终端
    MCP Servers Plugins (~/.gemini/config/plugins) > ✗ weegloo error: calling "initialize": sending "initialize": Unauthorized [Auth Needed] Restart Disable [Authenticate] ✓ weegloo-upload Tools: CreateUpload Keyboard: ←/→ Navigate enter Actions
  5. 在打开的认证页面的令牌输入框中粘贴下面的令牌。

  6. 复制 Google Antigravity 页面上显示的 Code,回到 Antigravity 粘贴并按 Enter

    显示认证失败时

    如果显示 Authentication failed: no pending auth state for server weegloo 消息,可能是 Antigravity 一侧的临时问题。该现象主要出现在低于 1.0.16 的版本,但在最新版本中也可能发生,可按以下步骤重新连接。

    1. Esc 返回 MCP Servers 界面。
    2. 再按一次 Esc 返回提示符输入界面。
    3. 再次输入 /mcp,经过 initializing 阶段后即可连接。

MCP 服务器配置文件

安装工具会自动创建并管理配置文件,因此用户无需自行查看。以下内容是为需要具体配置文件结构和路径的用户提供的参考资料。

weegloo 服务器以 HTTP 方式连接到 https://ai.weegloo.com/mcp,处理文件的 weegloo-upload 服务器通过 npx 运行,并使用 Personal Access Token 进行认证。全局安装会注册到用户主目录的 ~/.gemini/config/mcp_config.json项目安装会注册到项目文件夹中的 .agents/mcp_config.json

{
  "mcpServers": {
    "weegloo": {
      "serverUrl": "https://ai.weegloo.com/mcp"
    },
    "weegloo-upload": {
      "command": "npx",
      "args": ["-y", "weegloo-upload"],
      "env": {
        "UPLOAD_API_URL": "https://upload.weegloo.com/v1",
        "AUTH_BEARER_TOKEN": "<Personal Access Token>"
      }
    }
  }
}

要更换服务器分组,请在 weegloo 服务器的 serverUrl 末尾附加 group 值。例如,要使用所有工具,就写成 https://ai.weegloo.com/mcp?group=all。各分组的工具构成请参阅 MCP 服务器分组

Skills

安装工具会把每个 Skill 作为一个目录放入。全局安装是 ~/.gemini/skills/,项目安装放在项目文件夹的 .agents/skills/

Rules

Antigravity 没有 Rules 这样的独立概念。因此安装工具会把相当于 Rules 的内容,也就是与 Claude Code 的 Rules 起相同作用的内容,放入上下文文件。全局安装是 ~/.gemini/GEMINI.md,项目安装是项目文件夹中的 AGENTS.md

下一步

  • MCP:介绍服务器分组、文件上传服务器等作为连接基础的内容。
  • Skills 与 Rules:介绍安装工具一并安装的 Skills 和 Rules 是什么。
  • 保持最新状态:介绍如何让已安装的 Skills 和 Rules 保持最新。
  • 用 AI 迁移静态页面:跟随流程,用已连接的 MCP 把实际页面迁移为基于内容的服务。