> ## Documentation Index
> Fetch the complete documentation index at: https://aisa.one/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> - Base URLs: models `https://api.aisa.one/v1` (Gemini GenerateContent: `https://api.aisa.one/v1beta`); data APIs `https://api.aisa.one/apis/v1`. The `servers` of each operation in https://aisa.one/openapi.yaml is authoritative.
> - Auth: `Authorization: Bearer $AISA_API_KEY`. Never print, log, or commit the key.
> - MCP (preferred for agents): `https://mcp.aisa.one/mcp`, signed in with OAuth, so there is no key to paste.
> - Agent Skill: `npx skills add AIsa-team/agent-skills --skill aisa`. Fallback with the AIsa CLI: `aisa skills install aisa`.
> - Spending: docs, https://aisa.one/models, https://aisa.one/api, `/v1/models`, and MCP `search`, `list_categories`, `get_details`, `batch_quote`, and the `account` operation are free. Quote the exact calls before running them (MCP `batch_quote`, CLI `aisa quote --json`). If the quote reports `auto_execute_eligible: true`, run it unless the user set a tighter limit or asked only for a quote. Otherwise, tell the user in one message the planned calls, the quoted price, and a total USD budget for the task, then wait for approval. Direct HTTP calls follow the stricter rule at https://aisa.one/docs/get-started/cli.md#direct-http-fallback. Do not make paid calls to test availability. Full rule: https://aisa.one/llms.txt

# 在 Antigravity 中使用 AIsa

> 通过远程 MCP，把 Google Antigravity 的 agy CLI 连接到 AIsa 能力。

Google Antigravity 的模型列表由 Google 固定——没有自定义 base URL 或自带 key 的设置，所以 AIsa 无法替换它的内置模型。取而代之，你可以把 AIsa 添加为远程 MCP server，让 Antigravity 的智能体以工具形式调用 AIsa 能力——网页研究、金融、社交、SEO、销售等。

AIsa MCP endpoint：

```txt theme={null}
https://mcp.aisa.one/mcp
```

## 前置条件

开始前，请确认你已经具备：

* AIsa API key（[console.aisa.one/api-keys](https://console.aisa.one/api-keys)）
* macOS、Linux 或 Windows 上的 terminal

## 1. 安装 agy CLI

```bash theme={null}
# macOS / Linux
curl -fsSL https://antigravity.google/cli/install.sh | bash

# Windows (PowerShell)
irm https://antigravity.google/cli/install.ps1 | iex
```

验证安装：

```bash theme={null}
agy --version
```

## 2. 把 AIsa 加入 MCP 配置

打开全局 MCP 配置（不存在就新建）：

| 系统 | 路径 |
| - | - |
| macOS / Linux | `~/.gemini/config/mcp_config.json` |
| Windows | `%USERPROFILE%\.gemini\config\mcp_config.json` |

添加 `aisa` 条目，把 `sk-aisa-...` 换成你的真实 key：

```json theme={null}
{
  "mcpServers": {
    "aisa": {
      "serverUrl": "https://mcp.aisa.one/mcp",
      "headers": {
        "Authorization": "Bearer sk-aisa-..."
      }
    }
  }
}
```

> [!WARNING]
>
> 大多数配置失败都栽在这三点：
>
> * **用 `serverUrl`，不要用 `url`。** Antigravity 对远程 server 会忽略 `url` 和 `httpUrl`。
> * **直接粘贴 key 本身。** Antigravity 不会展开 `headers` 里的环境变量——`"Bearer ${AISA_API_KEY}"` 会被原样发送，返回 401。
> * **用 API key，不要用浏览器登录。** 我们测试时 Antigravity 的 OAuth 流程无法在 AIsa 上完成；`Authorization` header 是可靠的方式。

因为文件里现在有明文 key，把权限限制为仅当前用户可读：

```bash theme={null}
chmod 600 ~/.gemini/config/mcp_config.json
```

> [!TIP]
>
> 建议单独创建一个标记为 `antigravity` 的 key，方便独立轮换或吊销。参见[认证](https://aisa.one/docs/zh/guides/authentication.md)。

## 3. 开启新会话并验证

Antigravity 在会话启动时加载 MCP server，所以修改配置后要开启新的 `agy` 会话。确认 server 已注册：

```bash theme={null}
agy mcp list
```

```txt theme={null}
NAME  TYPE  STATUS   COMMAND/URL
aisa  http  enabled  https://mcp.aisa.one/mcp
```

`agy mcp list` 只显示配置；Antigravity 还会把工具定义缓存在 `~/.gemini/antigravity-cli/mcp/aisa/`——所以能看到 AIsa 工具并不代表 key 可用。请用下一步的真实请求验证。

## 4. 使用 AIsa 能力

在 `agy` 会话中试试：

```txt theme={null}
Use AIsa to check the price of BTC today.
```

Antigravity 会搜索 AIsa 目录、读取匹配操作的 schema，先用 `batch_quote` 为确切调用报价，再用 `batch_use` 执行。发现与报价工具（`list_categories`、`search`、`get_details`、`batch_quote`）免费；`batch_use` 按次计费。

## 快速参考

| 项目 | 值 |
| - | - |
| 配置文件 | `~/.gemini/config/mcp_config.json` |
| Server 字段 | `serverUrl`（不是 `url`） |
| Server URL | `https://mcp.aisa.one/mcp` |
| 认证 | `"Authorization": "Bearer sk-aisa-..."`——明文 key，不支持环境变量 |
| 文件权限 | `chmod 600` |
| 检查注册 | `agy mcp list` |

## 故障排查

| 问题 | 解决方法 |
| - | - |
| 能看到工具，但调用返回 401 | header 有误或仍是 `${AISA_API_KEY}`——粘贴明文 key，然后开启新会话 |
| `agy mcp list` 里没有 `aisa` | 确认 JSON 合法且使用 `serverUrl` |
| 当前会话里没有工具 | 开启新的 `agy` 会话；会话中途修改的配置不会生效 |
| 想在 Antigravity 中使用 AIsa 模型 | 不支持——Antigravity 不接受自定义模型 endpoint。请用 [Claude Code](https://aisa.one/docs/zh/guides/tutorials/use-aisa-in-claude.md#claude-code)、[Codex](https://aisa.one/docs/zh/guides/tutorials/use-aisa-in-codex.md) 或 [Cursor](https://aisa.one/docs/zh/guides/tutorials/use-aisa-in-cursor.md) 运行 AIsa 模型 |

## 相关页面

> [card] [在 Grok Build 中使用 AIsa](https://aisa.one/docs/zh/guides/tutorials/use-aisa-in-grok.md)
>
> 在 xAI 的 Grok CLI 中完成同样的 MCP 设置。

> [card] [认证](https://aisa.one/docs/zh/guides/authentication.md)
>
> API key 创建、轮换和存储最佳实践。

> [card] [Agent Skills](https://aisa.one/docs/zh/agent-skills.md)
>
> 浏览 AIsa 向智能体开放的能力。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.