aai-gateway 0.5.2 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,35 +1,31 @@
1
1
  # AAI Gateway
2
2
 
3
- ## One MCP. Many Apps. Less Context.
3
+ ## Why AAI Gateway
4
4
 
5
- AAI Gateway turns many apps, agents, skills, and MCP servers into one MCP server.
5
+ AAI stands for **Agent App Interface**.
6
6
 
7
- ## 核心价值
7
+ ### Three Pain Points of MCP/Skill Configuration
8
8
 
9
- ### 价值 1:自然语言驱动的工具接入
9
+ **1. Context Token Waste**: Every MCP server injects its schema, descriptions, and tool lists into the prompt. As you add more servers, the model spends more tokens understanding tools than executing tasks.
10
10
 
11
- 安装 AAI Gateway MCP 之后,你可以通过自然语言描述快速接入其他任意 MCP、技能,并操控其他 AI Agent 工具(包括 Claude Code、Codex、OpenCode 等)。
11
+ **2. Config Cannot Be Shared Across Agents**: MCP/Skill configured in Claude Code cannot be directly used in OpenCode or Codex. You have to configure it separately for each agent tool.
12
12
 
13
- AAI Gateway 还集成搜索工具,可以帮助你从权威、主流的网站上搜索官方、安全的 MCP 和技能,并实现一句话安装。
13
+ **3. Requires Agent Restart After Installation**: Traditionally, adding a new MCP or Skill requires restarting the agent tool to take effect.
14
14
 
15
- ### 价值 2:渐进式披露策略
15
+ ### What AAI Gateway Solves
16
16
 
17
- AAI Gateway 不会一次性向大模型上下文中塞入所有工具的描述,而是采用渐进式披露策略:
17
+ - **Progressive Disclosure**: Expose app overview first, reveal tool details only when needed, avoiding context explosion
18
+ - **Centralized Config Management**: Import MCP/Skill once, share across all agent tools
19
+ - **Hot Loading**: Auto-notify agents after import, **no restart required**
20
+ - **Natural Language Interaction**: Search, import, and manage MCPs/Skills through simple conversation
18
21
 
19
- **MCP Server 级别**:先只暴露 MCP Server 的整体描述。当大模型发现需要使用某个具体工具时,会先返回工具使用指导,然后 Agent 根据指导调用统一的 `aai:exec` 去执行。`aai:exec` 接受 `appId`、`tool`、`tool args` 作为参数。
22
+ AAI Gateway unifies MCP servers, Skills, ACP agents, and CLI tools under one roof, making it simple and efficient for agents to discover and use software.
20
23
 
21
- **MCP / 技能 描述级别**:提供两个层级的披露策略:
24
+ ## How To Use
22
25
 
23
- - `summary` 自然语言描述,适合自动触发
24
- - `keywords` — 紧凑的关键词集合,进一步简化上下文占用
26
+ ### 1. Install AAI Gateway MCP
25
27
 
26
- 这让 OpenCode 这种需要大量工具和技能的场景下依然能良好运行。
27
-
28
- ## 使用方案
29
-
30
- ### 1. 安装 AAI Gateway MCP
31
-
32
- 你不需要预装 `aai-gateway`。只需将其注册为用户级 MCP 服务器,通过 `npx` 启动即可。
28
+ You do not need to preinstall `aai-gateway`. Simply register it as a user-level MCP server and launch it via `npx`.
33
29
 
34
30
  #### Claude Code
35
31
 
@@ -45,7 +41,7 @@ codex mcp add aai-gateway -- npx -y aai-gateway
45
41
 
46
42
  #### OpenCode
47
43
 
48
- `~/.config/opencode/opencode.json` 中添加:
44
+ Add to `~/.config/opencode/opencode.json`:
49
45
 
50
46
  ```json
51
47
  {
@@ -60,47 +56,43 @@ codex mcp add aai-gateway -- npx -y aai-gateway
60
56
  }
61
57
  ```
62
58
 
63
- ### 2. 搜索并安装 MCP 或技能
64
-
65
- 如果你不知道该安装哪个 MCP 或技能,可以让 AI 工具调用 `import:search`。
66
-
67
- `import:search` 会:
59
+ ### 2. Search and Install MCP or Skill
68
60
 
69
- - 将用户请求转换为搜索关键词
70
- - 推荐更安全的权威来源优先搜索
71
- - 将搜索结果规范化为候选列表
72
- - 为每个候选项生成临时 ID 供用户确认
73
- - 将确认的项目路由到 `mcp:import` 或 `skill:import` 流程
61
+ If you don't know which MCP or skill to install, just ask your AI tool to search for what you need using AAI Gateway (e.g., "please search for a filesystem MCP" or "find me a git commit skill").
74
62
 
75
- **推荐的搜索来源顺序**:
63
+ The search will:
76
64
 
77
- 1. 官方目录:`modelcontextprotocol/registry`、`modelcontextprotocol/servers`、`openai/skills`
78
- 2. 社区精选列表:`punkpeye/awesome-mcp-servers`、`ComposioHQ/awesome-claude-skills`
79
- 3. 高审查来源:如 ClawHub 等开放市场(需额外谨慎)
65
+ - Convert your request into search keywords
66
+ - Recommend safer authoritative sources to search first
67
+ - Normalize search results into a shortlist for your confirmation
68
+ - Route confirmed items into the import flow
80
69
 
81
- > 注意:推荐列表是首选起点,而非硬性白名单。请勿随意推荐来自不知名小网站工具。对于市场平台,请额外检查维护者身份、仓库活跃度、README 质量和许可证是否可见。
70
+ **Recommended Search Source Order**:
82
71
 
83
- ### 3. 导入 MCP Server
72
+ 1. Official catalogs: `modelcontextprotocol/registry`, `modelcontextprotocol/servers`, `openai/skills`
73
+ 2. Community-curated lists: `punkpeye/awesome-mcp-servers`, `ComposioHQ/awesome-claude-skills`
74
+ 3. Higher-scrutiny sources: Open marketplaces like ClawHub (use with extra caution)
84
75
 
85
- 主流程:复制主流 MCP 配置片段到 AI 工具,让它通过 AAI Gateway 导入。
76
+ > Note: The recommended list is a starting point, not a hard allowlist. Do not casually suggest tools from unknown websites. For marketplace platforms, also verify the maintainer's identity, repository activity, README quality, and license visibility.
86
77
 
87
- AI 工具会:
78
+ ### 3. Import an MCP Server
88
79
 
89
- 1. 读取你粘贴的 MCP 配置
90
- 2. 询问你选择暴露模式
91
- 3. 调用 `mcp:import`
80
+ Main workflow: Copy a mainstream MCP config snippet into your AI tool and ask it to import that server through AAI Gateway.
92
81
 
93
- AAI Gateway 保持导入参数与标准 MCP 配置格式一致:
82
+ The AI tool will:
94
83
 
95
- - stdio MCP:`command`、`args`、`env`、`cwd`
96
- - remote MCP:`url`、可选 `transport`、可选 `headers`
84
+ 1. Read the MCP config you pasted
85
+ 2. Inspect the downstream MCP tools through AAI Gateway
86
+ 3. Summarize when the MCP should be used
87
+ 4. Ask whether it should be enabled for the current agent only or for all agents
88
+ 5. Call `mcp:import`
97
89
 
98
- 导入前请选择暴露模式:
90
+ AAI Gateway keeps import parameters consistent with standard MCP config shapes:
99
91
 
100
- - `summary`:更容易自动触发
101
- - `keywords`:为更多工具留出空间,但通常需要更明确的关键词提及
92
+ - stdio MCP: `command`, `args`, `env`, `cwd`
93
+ - remote MCP: `url`, optional `transport`, optional `headers`
102
94
 
103
- **stdio MCP 示例**:
95
+ **stdio MCP Example**:
104
96
 
105
97
  ```json
106
98
  {
@@ -109,7 +101,7 @@ AAI Gateway 保持导入参数与标准 MCP 配置格式一致:
109
101
  }
110
102
  ```
111
103
 
112
- **Remote Streamable HTTP MCP 示例**:
104
+ **Remote Streamable HTTP MCP Example**:
113
105
 
114
106
  ```json
115
107
  {
@@ -117,7 +109,7 @@ AAI Gateway 保持导入参数与标准 MCP 配置格式一致:
117
109
  }
118
110
  ```
119
111
 
120
- **Remote SSE MCP 示例**:
112
+ **Remote SSE MCP Example**:
121
113
 
122
114
  ```json
123
115
  {
@@ -126,55 +118,45 @@ AAI Gateway 保持导入参数与标准 MCP 配置格式一致:
126
118
  }
127
119
  ```
128
120
 
129
- 导入完成后,AAI Gateway 返回:
121
+ After import, AAI Gateway returns:
130
122
 
131
- - 生成的 app id
132
- - 生成的 `keywords`
133
- - 生成的 `summary`
134
- - 引导工具名称:`app:<id>`
123
+ - The generated app id
124
+ - The generated `summary`
125
+ - The guide tool name: `app:<id>`
135
126
 
136
- > **重要**:导入后需重启 AI 工具才能使用新导入的工具。重启后,导入的应用将显示为 `app:<id>`,使用 `aai:exec` 执行实际操作。
127
+ > AAI Gateway sends `tools/listChanged` after import. Clients that implement this notification can pick up new tools without restart.
137
128
 
138
- ### 4. 导入技能 (Skill)
129
+ ### 4. Import a Skill
139
130
 
140
- 技能导入同样通过 AI 工具完成。告诉 AI 工具调用 `skill:import`,然后提供:
131
+ Skills are imported through the AI tool as well. Tell the AI tool to import a skill using AAI Gateway, then provide:
141
132
 
142
- - 本地技能路径
143
- - 或暴露 `SKILL.md` 的远程技能根 URL
133
+ - A local skill path
144
134
 
145
- **本地技能示例**:
135
+ If the skill is remote, download and extract the whole skill directory first. AAI Gateway only imports from a local directory and copies the full directory into managed storage.
146
136
 
147
- ```json
148
- {
149
- "path": "/absolute/path/to/skill"
150
- }
151
- ```
152
-
153
- **远程技能示例**:
137
+ **Local Skill Example**:
154
138
 
155
139
  ```json
156
140
  {
157
- "url": "https://example.com/skill"
141
+ "path": "/absolute/path/to/skill"
158
142
  }
159
143
  ```
160
144
 
161
- MCP 导入一样,技能导入返回 `app id`、`keywords`、`summary` `app:<id>` 引导工具名称。
162
-
163
- 导入后需重启 AI 工具。
145
+ AAI Gateway derives the imported skill summary from the skill's own `SKILL.md` description. It can also generate a lightweight proxy `SKILL.md` for the current agent so the agent can discover the skill automatically.
164
146
 
165
- ### 5. 支持的 ACP Agents
147
+ ### 5. Supported ACP Agents
166
148
 
167
- AAI Gateway 还能通过 ACP 控制类应用的 Agent。
149
+ AAI Gateway can also control app-like agents through ACP.
168
150
 
169
- 当前支持的 ACP Agent 类型:
151
+ Currently supported ACP agent types:
170
152
 
171
153
  - OpenCode
172
154
  - Claude Code
173
155
  - Codex
174
156
 
175
- ## 原理
157
+ ## How It Works
176
158
 
177
- ### 架构图
159
+ ### Architecture
178
160
 
179
161
  ```
180
162
  ┌─────────────────────────────────────────────────────────────┐
@@ -188,7 +170,7 @@ AAI Gateway 还能通过 ACP 控制类应用的 Agent。
188
170
  │ ┌─────────────────────────────────────────────────────────┐│
189
171
  │ │ Progressive Disclosure Layer ││
190
172
  │ │ - App-level exposure (not tool-level) ││
191
- │ │ - Summary / Keywords modes ││
173
+ │ │ - Summary-only disclosure ││
192
174
  │ │ - Lazy tool loading on demand ││
193
175
  │ └─────────────────────────────────────────────────────────┘│
194
176
  │ ┌─────────────────────────────────────────────────────────┐│
@@ -198,8 +180,8 @@ AAI Gateway 还能通过 ACP 控制类应用的 Agent。
198
180
  │ └─────────────────────────────────────────────────────────┘│
199
181
  │ ┌─────────────────────────────────────────────────────────┐│
200
182
  │ │ Discovery Layer ││
201
- │ │ - Desktop Descriptors - Web Descriptors ││
202
- │ │ - Gateway Imports - Built-in Descriptors ││
183
+ │ │ - Desktop Descriptors - Managed Imports ││
184
+ │ │ - Built-in Descriptors ││
203
185
  │ └─────────────────────────────────────────────────────────┘│
204
186
  └────────────────────────┬────────────────────────────────────┘
205
187
  │ Native Protocol
@@ -213,19 +195,19 @@ AAI Gateway 还能通过 ACP 控制类应用的 Agent。
213
195
  └─────────────────────────────────────────────────────────────┘
214
196
  ```
215
197
 
216
- ### 统一抽象:Agent App
198
+ ### Unified Abstraction: Agent App
217
199
 
218
- AAI Gateway MCP、技能、ACP Agent、CLI 工具统一抽象为 **Agent App**。
200
+ AAI Gateway unifies MCPs, Skills, ACP Agents, and CLI tools into **Agent Apps**.
219
201
 
220
- 只要提供一个 App 的描述文件 (`aai.json`),即可接入 AAI Gateway。描述文件告诉 AAI Gateway
202
+ To integrate an app with AAI Gateway, simply provide an app descriptor file (`aai.json`). The descriptor tells AAI Gateway:
221
203
 
222
- - App 是什么
223
- - 如何连接
224
- - 如何以低上下文成本暴露
204
+ - What the app is
205
+ - How to connect to it
206
+ - How to expose it at low context cost
225
207
 
226
- ### 描述文件示例
208
+ ### Descriptor Examples
227
209
 
228
- #### MCP Server 描述文件
210
+ #### MCP Server Descriptor
229
211
 
230
212
  ```json
231
213
  {
@@ -244,13 +226,12 @@ AAI Gateway 将 MCP、技能、ACP Agent、CLI 工具统一抽象为 **Agent App
244
226
  }
245
227
  },
246
228
  "exposure": {
247
- "keywords": ["file", "filesystem", "read", "write"],
248
229
  "summary": "Use this app when the user wants to read from or write to the local filesystem."
249
230
  }
250
231
  }
251
232
  ```
252
233
 
253
- #### Skill 描述文件
234
+ #### Skill Descriptor
254
235
 
255
236
  ```json
256
237
  {
@@ -264,17 +245,16 @@ AAI Gateway 将 MCP、技能、ACP Agent、CLI 工具统一抽象为 **Agent App
264
245
  "access": {
265
246
  "protocol": "skill",
266
247
  "config": {
267
- "url": "https://github.com/example/git-commit-skill"
248
+ "path": "/absolute/path/to/git-commit-skill"
268
249
  }
269
250
  },
270
251
  "exposure": {
271
- "keywords": ["git", "commit", "version control"],
272
252
  "summary": "Use this app when the user wants to create git commits with auto-generated messages."
273
253
  }
274
254
  }
275
255
  ```
276
256
 
277
- #### ACP Agent 描述文件
257
+ #### ACP Agent Descriptor
278
258
 
279
259
  ```json
280
260
  {
@@ -292,13 +272,12 @@ AAI Gateway 将 MCP、技能、ACP Agent、CLI 工具统一抽象为 **Agent App
292
272
  }
293
273
  },
294
274
  "exposure": {
295
- "keywords": ["claude", "code", "coding", "agent"],
296
275
  "summary": "Use this app when the user wants Claude Code to perform coding tasks."
297
276
  }
298
277
  }
299
278
  ```
300
279
 
301
- #### CLI 工具描述文件
280
+ #### CLI Tool Descriptor
302
281
 
303
282
  ```json
304
283
  {
@@ -316,59 +295,48 @@ AAI Gateway 将 MCP、技能、ACP Agent、CLI 工具统一抽象为 **Agent App
316
295
  }
317
296
  },
318
297
  "exposure": {
319
- "keywords": ["example", "utility"],
320
298
  "summary": "Use this app when the user wants to work with Example App."
321
299
  }
322
300
  }
323
301
  ```
324
302
 
325
- ## 如何将更多 App 预置集成到 AAI Gateway
303
+ ## Pre-bundling Apps in AAI Gateway
326
304
 
327
- ### 提交 Pull Request
305
+ ### Submit a Pull Request
328
306
 
329
- 如果你希望 AAI Gateway 默认打包某个 App 的描述文件,可以提交 PR
307
+ If you want AAI Gateway to ship with a descriptor for an app by default, open a PR.
330
308
 
331
- PR 需要包含:
309
+ A PR should include:
332
310
 
333
- 1. 描述文件本身
334
- 2. 安全的发现规则(证明 App 确实已安装)
335
- 3. 连接配置
336
- 4. 说明为什么这个集成应该被捆绑
311
+ 1. The descriptor itself
312
+ 2. A safe discovery rule that proves the app is actually installed
313
+ 3. The connection config
314
+ 4. An explanation of why the integration should be bundled
337
315
 
338
- 内置 ACP Agent 描述文件位于:
316
+ Built-in ACP agent descriptors live in:
339
317
 
340
318
  - `src/discovery/descriptors/`
341
319
 
342
- 它们在以下文件中注册:
320
+ They are registered in:
343
321
 
344
322
  - `src/discovery/agent-registry.ts`
345
323
 
346
- 标准 PR 流程:
347
-
348
- 1. 添加描述文件
349
- 2. 添加或更新发现检查
350
- 3. 在适当的发现源中注册
351
- 4. 如果新集成面向用户,更新 README
352
-
353
- 如果你不确定某个集成是否应该被捆绑,请先提交 Issue 讨论。
324
+ Standard PR workflow:
354
325
 
355
- ### 描述文件放置位置
326
+ 1. Add the descriptor file
327
+ 2. Add or update discovery checks
328
+ 3. Register it in the appropriate discovery source
329
+ 4. Update the README if the new integration is user-facing
356
330
 
357
- AAI Gateway 从以下位置发现 App:
331
+ If you're unsure whether an integration should be bundled, open an issue first to discuss.
358
332
 
359
- #### Web Apps
360
-
361
- 发布到:
362
-
363
- ```
364
- https://<your-host>/.well-known/aai.json
365
- ```
333
+ ### Where to Place Descriptors
366
334
 
367
- 用户调用 `remote:discover` 时,AAI Gateway 会获取该路径。
335
+ AAI Gateway discovers apps from the following locations:
368
336
 
369
337
  #### macOS Apps
370
338
 
371
- 推荐位置:
339
+ Recommended locations:
372
340
 
373
341
  - `<YourApp>.app/Contents/Resources/aai.json`
374
342
  - `~/Library/Containers/<container>/Data/Library/Application Support/aai.json`
@@ -376,7 +344,7 @@ https://<your-host>/.well-known/aai.json
376
344
 
377
345
  #### Linux Apps
378
346
 
379
- 扫描以下位置:
347
+ Scanned locations:
380
348
 
381
349
  - `/usr/share`
382
350
  - `/usr/local/share`
@@ -384,20 +352,19 @@ https://<your-host>/.well-known/aai.json
384
352
 
385
353
  #### Windows Apps
386
354
 
387
- 扫描以下位置:
355
+ Scanned locations:
388
356
 
389
357
  - `C:\Program Files`
390
358
  - `C:\Program Files (x86)`
391
359
  - `%LOCALAPPDATA%`
392
360
 
393
- #### 描述文件编写建议
361
+ #### Descriptor Guidelines
394
362
 
395
- - 保持描述文件小而实用
396
- - `app.name.default` 要清晰
397
- - `keywords` 要短且高信号
398
- - `summary` 要解释何时应该使用该 App
399
- - 详细能力数据放在下游协议中,而非描述文件中
400
- - 如果你的 App 已使用 MCP,保持描述文件最小化,让 MCP 提供惰性工具详情
363
+ - Keep descriptors small and practical
364
+ - Make `app.name.default` clear
365
+ - Make `summary` explain when the app should be used
366
+ - Put detailed capability data in the downstream protocol, not in the descriptor
367
+ - If your app already speaks MCP, keep the descriptor minimal and let MCP provide lazy tool details
401
368
 
402
369
  ## Disclaimer
403
370