AAI 协议:一个 JSON 文件,让任何桌面应用和 SaaS 都能被 AI Agent 调用

9 阅读2分钟

问题:AI Agent 如何「使用」你的 App?

AI 正在从「对话」走向「行动」。但 Agent 要操作你的桌面软件或 SaaS 应用,目前只有两条路:

  1. 浏览器自动化(Playwright、Selenium)—— 慢、贵、易崩溃
  2. 各家私有 API —— 需要 Agent 厂商逐个对接,门槛高

Google 最近推出了 WebMCP,试图解决这个问题。但它有一个限制:只能用在 Chrome 146+ 浏览器里

我们的做法:AAI 协议

AAI(Agent App Interface)是一个开放协议,让任何桌面应用(macOS/Windows/Linux)和 SaaS 应用都能被 AI Agent 发现和调用。

核心思路:应用只需要提供一个标准的描述文件。

https://yourdomain.com/.well-known/aai.json

这个 JSON 文件描述了你的应用有哪些工具、每个工具接受什么参数、如何授权。

与 WebMCP 的区别

特性WebMCPAAI
浏览器依赖必须用 Chrome 146+任何浏览器/客户端
覆盖平台仅 WebWeb + 桌面
实现方式前端 JavaScript后端 JSON + OAuth
协议开放性Google 主导开放标准

AAI 的关键优势是浏览器无关。你的用户不必用 Chrome,Agent 不必依赖特定浏览器。

支持的平台

桌面应用

  • macOS(AppleScript / Apple Events)
  • Windows(PowerShell / COM)
  • Linux(DBus / CLI)

SaaS 应用

  • REST API / GraphQL
  • OAuth 2.0 授权

技术架构

AAI 由三部分组成:

  1. aai.json 描述符 —— 声明应用能力
  2. Gateway —— 发现应用、执行调用、处理授权
  3. MCP 协议 —— Agent 与 Gateway 的通信标准

Agent 通过 MCP 协议连接 Gateway,Gateway 根据 aai.json 发现应用能力,完成 OAuth 授权后执行调用。

快速开始

1. 创建 aai.json

{
  "schema_version": "1.0",
  "appId": "com.example.myapp",
  "name": "My App",
  "description": "我的应用描述",
  "version": "1.0",
  "platforms": {
    "web": {
      "tools": [
        {
          "name": "send_message",
          "description": "发送消息",
          "inputSchema": {
            "type": "object",
            "properties": {
              "content": { "type": "string" }
            },
            "required": ["content"]
          },
          "handler": {
            "type": "rest",
            "method": "POST",
            "url": "https://api.example.com/messages"
          }
        }
      ],
      "auth": {
        "type": "oauth2",
        "authorizationUrl": "https://example.com/oauth/authorize",
        "tokenUrl": "https://example.com/oauth/token"
      }
    }
  }
}

2. 部署到 .well-known

将 aai.json 放到:

https://yourdomain.com/.well-known/aai.json

3. 配置 Gateway

使用 AAI Gateway 连接你的应用。

开源地址


AAI 是一个开放协议,欢迎参与贡献!