关于 AAI Gateway
AAI Gateway 是面向 AI Agent 的统一网关,用于管理 MCP 服务和 Skill 包,并以 Agent App 的形式在多个 Agent 之间共享。它将工具的完整说明按需加载,以减少上下文中的 token 占用。
主要功能
- 01统一管理 MCP 服务与 Skill 包
- 02Agent App 摘要按需加载,节省上下文 token
- 03通过自然语言搜索并安装新工具
- 04导入一次,多个 Agent 共享配置
- 05支持按 Agent 启用或禁用 Agent App
适用场景
- 01在 Claude Code、Codex 和 OpenCode 之间共享同一套工具配置
- 02减少大量 MCP 工具定义占用的上下文空间
- 03让 Agent 通过自然语言查找并安装浏览器自动化等工具
MCP 相关
AAI Gateway 本身是一个 MCP 服务,向客户端暴露 search:discover、mcp:import、aai:exec 等内置工具,并将导入的 MCP 服务注册为 Agent App。
配置
本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。
工具
8收录的工具列表 · 更新于 2 周前
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| app | string | 否 | app 工具必填;对于 gateway 工具,请省略或使用 "gateway"。 |
| args | object | 否 | 所选工具的参数。 |
| tool | string | 是 | 应用内的工具名称,不带 app id 前缀。 |
详细介绍
AAI Gateway:统一管理 MCP 和 Skill,供多个 AI Agent 共享,节省 99% 上下文令牌
它是什么
AAI = Agent App Interface
AAI Gateway 是 Agent App 的交互网关。
什么是 Agent App?Agent App 是 Agent 可使用的一组能力。例如:
- MCP 服务是一种 Agent App,提供一组工具
- Skill 包是一种 Agent App,提供一个或多个 Skill
在 AAI Gateway 中,它们被抽象为统一管理的 Agent App。只需导入一次,所有 AI Agent 就能立即使用。
它解决了什么问题
上下文膨胀
传统方式:10 个 MCP × 5 个工具 = 50 个完整架构 ≈ 7,500 个令牌,注入每次对话。
AAI Gateway:每个 Agent App 只需不到 50 个令牌的摘要,详情按需加载。节省 99% 令牌。
查找工具很困难
传统方式:搜索 GitHub → 阅读 README → 复制 JSON 配置 → 调试连接 → 重启 Agent。
AAI Gateway:告诉 Agent“使用 AAI 搜索 xxx”——自动搜索、安装,即可使用。
“使用 AAI 搜索浏览器自动化工具”
→ 搜索 → 找到 Playwright MCP → Agent 生成一行 Agent App 摘要 → 安装 → 即可使用,无需重启
“使用 AAI 搜索 PPT 制作 Skill”
→ 搜索 → 找到 PPT Skill → 使用 Skill 描述作为 Agent App 摘要 → 安装 → 即可使用,无需重启
配置重复
需要在 Claude Code、Codex 和 OpenCode 中分别配置相同内容?通过 AAI Gateway 导入一次,所有 Agent 即刻共享。
快速开始(30 秒)
Claude Code:
claude mcp add --scope user --transport stdio aai-gateway -- npx -y aai-gateway
Codex:
codex mcp add aai-gateway -- npx -y aai-gateway
OpenCode — 添加到 ~/.config/opencode/opencode.json:
{
"mcp": {
"aai-gateway": {
"type": "local",
"command": ["npx", "-y", "aai-gateway"],
"enabled": true
}
}
}
openclaw plugins install openclaw-aai-gateway-plugin
安装完成后,只需告诉 Agent 你想做什么。
内置工具
| 工具 | 描述 |
|---|---|
search:discover | 使用自然语言搜索并安装新工具 |
mcp:import | 将 MCP Server 导入为 Agent App |
skill:import | 将 Skill 包导入为 Agent App |
listAllAaiApps | 列出所有已注册的 Agent App |
enableApp / disableApp | 为每个 Agent 启用或停用 Agent App |
removeApp | 移除 Agent App |
aai:exec | 在 Agent App 中执行指定工具 |
每个导入的 Agent App 都会生成一个 app_<app-id> 工具,调用时会返回完整的操作指南和工具列表。
预设 Agent App(本地安装后自动发现)
| App ID | 名称 | 描述 |
|---|---|---|
claude | Claude Code | 用于代码编辑、分析和开发的 AI 编码助手 |
codex | Codex | 由 OpenAI 提供支持的 AI 编码助手 |
opencode | OpenCode | 用于编辑文件和运行命令的 AI 开发助手 |
架构

开发者:让你的 Agent App 自动被发现
创建一个 aai.json 描述文件,并将其提交到 src/discovery/descriptors/。当用户的本地环境满足 discovery.checks 条件时,Agent 将自动发现你的 Agent App。
{
"schemaVersion": "2.0",
"version": "1.0.0",
"app": {
"name": { "default": "My App" }
},
"discovery": {
"checks": [
{ "kind": "command", "command": "my-app" }
]
},
"access": {
"protocol": "mcp",
"config": {
"command": "my-app-mcp",
"args": ["--stdio"]
}
},
"exposure": {
"summary": "Use when the user wants to do X."
}
}
discovery.checks 支持三种检查类型:command(命令存在)、file(文件存在)、path(目录存在)。
支持的协议:mcp、skill、acp-agent
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。