aai-gateway 0.5.0 → 0.5.2

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
@@ -4,54 +4,48 @@
4
4
 
5
5
  AAI Gateway turns many apps, agents, skills, and MCP servers into one MCP server.
6
6
 
7
- You connect your AI tool once. AAI Gateway handles discovery, import, routing, and exposure control behind that single entrypoint.
7
+ ## 核心价值
8
8
 
9
- Why this matters:
9
+ ### 价值 1:自然语言驱动的工具接入
10
10
 
11
- - One MCP connection instead of one MCP per app
12
- - Smaller context through progressive disclosure — AAI Gateway never exposes raw tool definitions upfront
11
+ 安装 AAI Gateway MCP 之后,你可以通过自然语言描述快速接入其他任意 MCP、技能,并操控其他 AI Agent 工具(包括 Claude Code、Codex、OpenCode 等)。
13
12
 
14
- **App-level exposure, not tool-level.** Tools are grouped into apps and only the app interface is visible initially. Users interact through `app:<id>` guides instead of seeing dozens of individual tools.
13
+ AAI Gateway 还集成搜索工具,可以帮助你从权威、主流的网站上搜索官方、安全的 MCP 和技能,并实现一句话安装。
15
14
 
16
- **Two app interfaces, user chooses:**
17
- - `summary` — a natural language description; good for automatic triggering
18
- - `keywords` — a compact keyword set; further reduces context overhead when users reference tools explicitly
15
+ ### 价值 2:渐进式披露策略
19
16
 
20
- Both modes keep the full tool capability available downstream — it just stays hidden until actually needed.
17
+ AAI Gateway 不会一次性向大模型上下文中塞入所有工具的描述,而是采用渐进式披露策略:
21
18
 
22
- - A cleaner path to mix MCP servers, skills, ACP agents, and CLI-backed apps
19
+ **MCP Server 级别**:先只暴露 MCP Server 的整体描述。当大模型发现需要使用某个具体工具时,会先返回工具使用指导,然后 Agent 根据指导调用统一的 `aai:exec` 去执行。`aai:exec` 接受 `appId`、`tool`、`tool args` 作为参数。
23
20
 
24
- AAI Gateway is for one goal: make tool ecosystems feel smaller, sharper, and easier for agents to use.
21
+ **MCP / 技能 描述级别**:提供两个层级的披露策略:
25
22
 
26
- ## How To Use
23
+ - `summary` 自然语言描述,适合自动触发
24
+ - `keywords` — 紧凑的关键词集合,进一步简化上下文占用
27
25
 
28
- ### 1. Connect Your AI Tool To AAI Gateway
26
+ 这让 OpenCode 这种需要大量工具和技能的场景下依然能良好运行。
29
27
 
30
- You do not need to preinstall `aai-gateway`.
28
+ ## 使用方案
31
29
 
32
- Use the same style users already know from mainstream MCP setups: launch it through `npx`.
30
+ ### 1. 安装 AAI Gateway MCP
33
31
 
34
- ### Claude Code
32
+ 你不需要预装 `aai-gateway`。只需将其注册为用户级 MCP 服务器,通过 `npx` 启动即可。
35
33
 
36
- Official docs: <https://code.claude.com/docs/en/mcp>
34
+ #### Claude Code
37
35
 
38
36
  ```bash
39
- claude mcp add --transport stdio aai-gateway -- npx -y aai-gateway
37
+ claude mcp add --scope user --transport stdio aai-gateway -- npx -y aai-gateway
40
38
  ```
41
39
 
42
- ### Codex
43
-
44
- Official docs: <https://developers.openai.com/learn/docs-mcp>
40
+ #### Codex
45
41
 
46
42
  ```bash
47
43
  codex mcp add aai-gateway -- npx -y aai-gateway
48
44
  ```
49
45
 
50
- ### OpenCode
51
-
52
- Official docs: <https://opencode.ai/docs/config> and <https://opencode.ai/docs/mcp-servers/>
46
+ #### OpenCode
53
47
 
54
- Add this to `~/.config/opencode/opencode.json` or your project `opencode.json`:
48
+ `~/.config/opencode/opencode.json` 中添加:
55
49
 
56
50
  ```json
57
51
  {
@@ -66,81 +60,47 @@ Add this to `~/.config/opencode/opencode.json` or your project `opencode.json`:
66
60
  }
67
61
  ```
68
62
 
69
- ### What You Get After Connecting
70
-
71
- Once connected, your AI tool can use AAI Gateway tools such as:
72
-
73
- - `remote:discover`
74
- - `aai:exec`
75
- - `import:search`
76
- - `mcp:import`
77
- - `skill:import`
78
- - `mcp:refresh`
79
- - `import:config`
80
-
81
- `import:search` also has a compatibility alias: `ability_search`.
82
-
83
- ### 2. Search For MCP Servers Or Skills
84
-
85
- If you do not already know which MCP server or skill to install, ask the AI tool to call `import:search` first.
63
+ ### 2. 搜索并安装 MCP 或技能
86
64
 
87
- This tool does not perform the web search for you. Instead, it:
65
+ 如果你不知道该安装哪个 MCP 或技能,可以让 AI 工具调用 `import:search`。
88
66
 
89
- - turns the user request into search keywords
90
- - recommends safer mainstream sources to search first
91
- - normalizes the agent's gathered results into a shortlist
92
- - gives each shortlist item a temporary id for user confirmation
93
- - routes confirmed items into existing `mcp:import` or `skill:import` flows
67
+ `import:search` 会:
94
68
 
95
- Recommended source order:
69
+ - 将用户请求转换为搜索关键词
70
+ - 推荐更安全的权威来源优先搜索
71
+ - 将搜索结果规范化为候选列表
72
+ - 为每个候选项生成临时 ID 供用户确认
73
+ - 将确认的项目路由到 `mcp:import` 或 `skill:import` 流程
96
74
 
97
- - Official catalogs first:
98
- - `modelcontextprotocol/registry`
99
- - `modelcontextprotocol/servers`
100
- - `openai/skills`
101
- - Community-curated GitHub lists second:
102
- - `punkpeye/awesome-mcp-servers`
103
- - `ComposioHQ/awesome-claude-skills`
104
- - Higher-scrutiny sources:
105
- - open marketplaces such as ClawHub
75
+ **推荐的搜索来源顺序**:
106
76
 
107
- Important:
77
+ 1. 官方目录:`modelcontextprotocol/registry`、`modelcontextprotocol/servers`、`openai/skills`
78
+ 2. 社区精选列表:`punkpeye/awesome-mcp-servers`、`ComposioHQ/awesome-claude-skills`
79
+ 3. 高审查来源:如 ClawHub 等开放市场(需额外谨慎)
108
80
 
109
- - The recommended list is a preferred starting point, not a hard allowlist.
110
- - Do not casually suggest tools from random small websites.
111
- - Outside the preferred list, inspect maintainer identity, repository activity, README quality, license visibility, and whether the source actually exposes an importable MCP config or real skill root.
112
- - Open marketplaces such as ClawHub should be treated with extra caution. They are not default-trust sources.
113
-
114
- If the AI tool does not already have a retrieval tool, it can first import a fetch MCP through AAI Gateway, for example:
115
-
116
- ```json
117
- {
118
- "command": "npx",
119
- "args": ["-y", "mcp-fetch-server"]
120
- }
121
- ```
81
+ > 注意:推荐列表是首选起点,而非硬性白名单。请勿随意推荐来自不知名小网站工具。对于市场平台,请额外检查维护者身份、仓库活跃度、README 质量和许可证是否可见。
122
82
 
123
- ### 3. Import An MCP Server
83
+ ### 3. 导入 MCP Server
124
84
 
125
- The main workflow is: copy a mainstream MCP config snippet into your AI tool and ask it to import that server through AAI Gateway.
85
+ 主流程:复制主流 MCP 配置片段到 AI 工具,让它通过 AAI Gateway 导入。
126
86
 
127
- The AI tool should:
87
+ AI 工具会:
128
88
 
129
- 1. read the MCP config you pasted
130
- 2. ask you to choose an exposure mode
131
- 3. call `mcp:import`
89
+ 1. 读取你粘贴的 MCP 配置
90
+ 2. 询问你选择暴露模式
91
+ 3. 调用 `mcp:import`
132
92
 
133
- AAI Gateway keeps the import parameters close to normal MCP config shapes:
93
+ AAI Gateway 保持导入参数与标准 MCP 配置格式一致:
134
94
 
135
- - stdio MCP: `command`, `args`, `env`, `cwd`
136
- - remote MCP: `url`, optional `transport`, optional `headers`
95
+ - stdio MCP:`command`、`args`、`env`、`cwd`
96
+ - remote MCP:`url`、可选 `transport`、可选 `headers`
137
97
 
138
- Before import, the AI tool should ask you to choose:
98
+ 导入前请选择暴露模式:
139
99
 
140
- - `summary`: easier automatic triggering
141
- - `keywords`: leaves room for more tools, but usually needs more explicit keyword mentions
100
+ - `summary`:更容易自动触发
101
+ - `keywords`:为更多工具留出空间,但通常需要更明确的关键词提及
142
102
 
143
- Example: import a normal stdio MCP config
103
+ **stdio MCP 示例**:
144
104
 
145
105
  ```json
146
106
  {
@@ -149,7 +109,7 @@ Example: import a normal stdio MCP config
149
109
  }
150
110
  ```
151
111
 
152
- Example: import a normal remote Streamable HTTP MCP config
112
+ **Remote Streamable HTTP MCP 示例**:
153
113
 
154
114
  ```json
155
115
  {
@@ -157,7 +117,7 @@ Example: import a normal remote Streamable HTTP MCP config
157
117
  }
158
118
  ```
159
119
 
160
- Example: import a normal remote SSE MCP config
120
+ **Remote SSE MCP 示例**:
161
121
 
162
122
  ```json
163
123
  {
@@ -166,29 +126,23 @@ Example: import a normal remote SSE MCP config
166
126
  }
167
127
  ```
168
128
 
169
- After import, AAI Gateway returns:
129
+ 导入完成后,AAI Gateway 返回:
170
130
 
171
- - the generated app id
172
- - the generated `keywords`
173
- - the generated `summary`
174
- - the guide tool name: `app:<id>`
131
+ - 生成的 app id
132
+ - 生成的 `keywords`
133
+ - 生成的 `summary`
134
+ - 引导工具名称:`app:<id>`
175
135
 
176
- Important:
136
+ > **重要**:导入后需重启 AI 工具才能使用新导入的工具。重启后,导入的应用将显示为 `app:<id>`,使用 `aai:exec` 执行实际操作。
177
137
 
178
- - Restart your AI tool before using the newly imported tool.
179
- - After restart, the imported app will appear as `app:<id>`.
180
- - Use `aai:exec` to actually run the imported app’s operations.
138
+ ### 4. 导入技能 (Skill)
181
139
 
182
- ### 4. Import A Skill
140
+ 技能导入同样通过 AI 工具完成。告诉 AI 工具调用 `skill:import`,然后提供:
183
141
 
184
- Skills are imported through the AI tool as well.
142
+ - 本地技能路径
143
+ - 或暴露 `SKILL.md` 的远程技能根 URL
185
144
 
186
- Ask the AI tool to call `skill:import`, then give it either:
187
-
188
- - a local skill path
189
- - a remote skill root URL that exposes `SKILL.md`
190
-
191
- Examples:
145
+ **本地技能示例**:
192
146
 
193
147
  ```json
194
148
  {
@@ -196,49 +150,82 @@ Examples:
196
150
  }
197
151
  ```
198
152
 
153
+ **远程技能示例**:
154
+
199
155
  ```json
200
156
  {
201
157
  "url": "https://example.com/skill"
202
158
  }
203
159
  ```
204
160
 
205
- Just like MCP import, skill import returns:
206
-
207
- - the generated app id
208
- - generated `keywords`
209
- - generated `summary`
210
- - the guide tool name: `app:<id>`
161
+ MCP 导入一样,技能导入返回 `app id`、`keywords`、`summary` 和 `app:<id>` 引导工具名称。
211
162
 
212
- Then restart your AI tool before using the imported skill.
163
+ 导入后需重启 AI 工具。
213
164
 
214
- ### 5. Supported ACP Agents
165
+ ### 5. 支持的 ACP Agents
215
166
 
216
- AAI Gateway can also control app-like agents through ACP.
167
+ AAI Gateway 还能通过 ACP 控制类应用的 Agent。
217
168
 
218
- Currently supported ACP agent types:
169
+ 当前支持的 ACP Agent 类型:
219
170
 
220
171
  - OpenCode
221
172
  - Claude Code
222
173
  - Codex
223
174
 
224
- ## App Auto Discovery
175
+ ## 原理
225
176
 
226
- AAI Gateway discovers apps from four places:
177
+ ### 架构图
178
+
179
+ ```
180
+ ┌─────────────────────────────────────────────────────────────┐
181
+ │ AI Agent │
182
+ │ (Claude Code / Codex / OpenCode) │
183
+ └────────────────────────┬────────────────────────────────────┘
184
+ │ One MCP Connection
185
+
186
+ ┌─────────────────────────────────────────────────────────────┐
187
+ │ AAI Gateway │
188
+ │ ┌─────────────────────────────────────────────────────────┐│
189
+ │ │ Progressive Disclosure Layer ││
190
+ │ │ - App-level exposure (not tool-level) ││
191
+ │ │ - Summary / Keywords modes ││
192
+ │ │ - Lazy tool loading on demand ││
193
+ │ └─────────────────────────────────────────────────────────┘│
194
+ │ ┌─────────────────────────────────────────────────────────┐│
195
+ │ │ App Registry ││
196
+ │ │ - MCP Servers - Skills ││
197
+ │ │ - ACP Agents - CLI Tools ││
198
+ │ └─────────────────────────────────────────────────────────┘│
199
+ │ ┌─────────────────────────────────────────────────────────┐│
200
+ │ │ Discovery Layer ││
201
+ │ │ - Desktop Descriptors - Web Descriptors ││
202
+ │ │ - Gateway Imports - Built-in Descriptors ││
203
+ │ └─────────────────────────────────────────────────────────┘│
204
+ └────────────────────────┬────────────────────────────────────┘
205
+ │ Native Protocol
206
+
207
+ ┌─────────────────────────────────────────────────────────────┐
208
+ │ External Apps │
209
+ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
210
+ │ │ MCP │ │ Skill │ │ ACP │ │ CLI │ │
211
+ │ │ Servers │ │ │ │ Agents │ │ Tools │ │
212
+ │ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │
213
+ └─────────────────────────────────────────────────────────────┘
214
+ ```
227
215
 
228
- - desktop descriptors
229
- - web descriptors
230
- - gateway-managed imports
231
- - built-in ACP agent descriptors
216
+ ### 统一抽象:Agent App
232
217
 
233
- ### The AAI Descriptor
218
+ AAI Gateway MCP、技能、ACP Agent、CLI 工具统一抽象为 **Agent App**。
234
219
 
235
- The descriptor is a small `aai.json` file. It tells AAI Gateway:
220
+ 只要提供一个 App 的描述文件 (`aai.json`),即可接入 AAI Gateway。描述文件告诉 AAI Gateway
236
221
 
237
- - what the app is
238
- - how to connect to it
239
- - how to expose it at low context cost
222
+ - App 是什么
223
+ - 如何连接
224
+ - 如何以低上下文成本暴露
240
225
 
241
- Minimal example:
226
+ ### 描述文件示例
227
+
228
+ #### MCP Server 描述文件
242
229
 
243
230
  ```json
244
231
  {
@@ -246,7 +233,80 @@ Minimal example:
246
233
  "version": "1.0.0",
247
234
  "app": {
248
235
  "name": {
249
- "default": "Example App"
236
+ "default": "Filesystem Server"
237
+ }
238
+ },
239
+ "access": {
240
+ "protocol": "mcp",
241
+ "config": {
242
+ "command": "npx",
243
+ "args": ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"]
244
+ }
245
+ },
246
+ "exposure": {
247
+ "keywords": ["file", "filesystem", "read", "write"],
248
+ "summary": "Use this app when the user wants to read from or write to the local filesystem."
249
+ }
250
+ }
251
+ ```
252
+
253
+ #### Skill 描述文件
254
+
255
+ ```json
256
+ {
257
+ "schemaVersion": "2.0",
258
+ "version": "1.0.0",
259
+ "app": {
260
+ "name": {
261
+ "default": "Git Commit Skill"
262
+ }
263
+ },
264
+ "access": {
265
+ "protocol": "skill",
266
+ "config": {
267
+ "url": "https://github.com/example/git-commit-skill"
268
+ }
269
+ },
270
+ "exposure": {
271
+ "keywords": ["git", "commit", "version control"],
272
+ "summary": "Use this app when the user wants to create git commits with auto-generated messages."
273
+ }
274
+ }
275
+ ```
276
+
277
+ #### ACP Agent 描述文件
278
+
279
+ ```json
280
+ {
281
+ "schemaVersion": "2.0",
282
+ "version": "1.0.0",
283
+ "app": {
284
+ "name": {
285
+ "default": "Claude Code"
286
+ }
287
+ },
288
+ "access": {
289
+ "protocol": "acp-agent",
290
+ "config": {
291
+ "agentType": "claude-code"
292
+ }
293
+ },
294
+ "exposure": {
295
+ "keywords": ["claude", "code", "coding", "agent"],
296
+ "summary": "Use this app when the user wants Claude Code to perform coding tasks."
297
+ }
298
+ }
299
+ ```
300
+
301
+ #### CLI 工具描述文件
302
+
303
+ ```json
304
+ {
305
+ "schemaVersion": "2.0",
306
+ "version": "1.0.0",
307
+ "app": {
308
+ "name": {
309
+ "default": "Example CLI"
250
310
  }
251
311
  },
252
312
  "access": {
@@ -262,28 +322,53 @@ Minimal example:
262
322
  }
263
323
  ```
264
324
 
265
- Supported `access.protocol` values today:
325
+ ## 如何将更多 App 预置集成到 AAI Gateway
326
+
327
+ ### 提交 Pull Request
328
+
329
+ 如果你希望 AAI Gateway 默认打包某个 App 的描述文件,可以提交 PR。
330
+
331
+ PR 需要包含:
266
332
 
267
- - `mcp`
268
- - `skill`
269
- - `acp-agent`
270
- - `cli`
333
+ 1. 描述文件本身
334
+ 2. 安全的发现规则(证明 App 确实已安装)
335
+ 3. 连接配置
336
+ 4. 说明为什么这个集成应该被捆绑
271
337
 
272
- ### Where To Put `aai.json`
338
+ 内置 ACP Agent 描述文件位于:
339
+
340
+ - `src/discovery/descriptors/`
341
+
342
+ 它们在以下文件中注册:
343
+
344
+ - `src/discovery/agent-registry.ts`
345
+
346
+ 标准 PR 流程:
347
+
348
+ 1. 添加描述文件
349
+ 2. 添加或更新发现检查
350
+ 3. 在适当的发现源中注册
351
+ 4. 如果新集成面向用户,更新 README
352
+
353
+ 如果你不确定某个集成是否应该被捆绑,请先提交 Issue 讨论。
354
+
355
+ ### 描述文件放置位置
356
+
357
+ AAI Gateway 从以下位置发现 App:
273
358
 
274
359
  #### Web Apps
275
360
 
276
- Publish it at:
361
+ 发布到:
277
362
 
278
- ```text
363
+ ```
279
364
  https://<your-host>/.well-known/aai.json
280
365
  ```
281
366
 
282
- AAI Gateway fetches that path when the user calls `remote:discover`.
367
+ 用户调用 `remote:discover` 时,AAI Gateway 会获取该路径。
283
368
 
284
369
  #### macOS Apps
285
370
 
286
- Recommended locations scanned by the gateway:
371
+ 推荐位置:
287
372
 
288
373
  - `<YourApp>.app/Contents/Resources/aai.json`
289
374
  - `~/Library/Containers/<container>/Data/Library/Application Support/aai.json`
@@ -291,7 +376,7 @@ Recommended locations scanned by the gateway:
291
376
 
292
377
  #### Linux Apps
293
378
 
294
- The gateway scans for `aai.json` under:
379
+ 扫描以下位置:
295
380
 
296
381
  - `/usr/share`
297
382
  - `/usr/local/share`
@@ -299,50 +384,20 @@ The gateway scans for `aai.json` under:
299
384
 
300
385
  #### Windows Apps
301
386
 
302
- The gateway scans for `aai.json` under:
387
+ 扫描以下位置:
303
388
 
304
389
  - `C:\Program Files`
305
390
  - `C:\Program Files (x86)`
306
391
  - `%LOCALAPPDATA%`
307
392
 
308
- ### Descriptor Guidelines
309
-
310
- Keep descriptors small and practical:
311
-
312
- - make `app.name.default` clear
313
- - keep `keywords` short and high-signal
314
- - make `summary` explain when the app should be used
315
- - put detailed capability data in the downstream protocol, not in the descriptor
316
-
317
- If your app already speaks MCP, keep the descriptor minimal and let MCP provide tool detail lazily.
318
-
319
- ## Submit A Pull Request To Preload A Descriptor
320
-
321
- If you want AAI Gateway to ship with a descriptor by default, open a PR.
322
-
323
- What to include:
324
-
325
- - the descriptor itself
326
- - a safe discovery rule that proves the app is actually installed
327
- - the connection config
328
- - a short explanation of why the integration should be bundled
329
-
330
- Today, built-in ACP agent descriptors live in:
331
-
332
- - `src/discovery/descriptors/`
333
-
334
- And they are registered in:
335
-
336
- - `src/discovery/agent-registry.ts`
337
-
338
- For a typical PR:
339
-
340
- 1. Add the descriptor file.
341
- 2. Add or update discovery checks.
342
- 3. Register it in the appropriate discovery source.
343
- 4. Update the README if the new integration is user-facing.
393
+ #### 描述文件编写建议
344
394
 
345
- If you are unsure whether an integration should be bundled, open an issue first.
395
+ - 保持描述文件小而实用
396
+ - `app.name.default` 要清晰
397
+ - `keywords` 要短且高信号
398
+ - `summary` 要解释何时应该使用该 App
399
+ - 详细能力数据放在下游协议中,而非描述文件中
400
+ - 如果你的 App 已使用 MCP,保持描述文件最小化,让 MCP 提供惰性工具详情
346
401
 
347
402
  ## Disclaimer
348
403