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 +101 -134
- package/dist/cli.js +101 -330
- package/dist/cli.js.map +1 -1
- package/dist/index.js +15 -26
- package/dist/index.js.map +1 -1
- package/dist/server-CJQewAXM.js +6075 -0
- package/dist/server-CJQewAXM.js.map +1 -0
- package/package.json +1 -1
- package/dist/server-DQ0nbmQB.js +0 -5360
- package/dist/server-DQ0nbmQB.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,35 +1,31 @@
|
|
|
1
1
|
# AAI Gateway
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## Why AAI Gateway
|
|
4
4
|
|
|
5
|
-
AAI
|
|
5
|
+
AAI stands for **Agent App Interface**.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
### Three Pain Points of MCP/Skill Configuration
|
|
8
8
|
|
|
9
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
###
|
|
15
|
+
### What AAI Gateway Solves
|
|
16
16
|
|
|
17
|
-
|
|
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
|
-
|
|
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
|
-
|
|
24
|
+
## How To Use
|
|
22
25
|
|
|
23
|
-
|
|
24
|
-
- `keywords` — 紧凑的关键词集合,进一步简化上下文占用
|
|
26
|
+
### 1. Install AAI Gateway MCP
|
|
25
27
|
|
|
26
|
-
|
|
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
|
-
|
|
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.
|
|
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
|
-
|
|
78
|
-
|
|
79
|
-
|
|
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
|
-
|
|
70
|
+
**Recommended Search Source Order**:
|
|
82
71
|
|
|
83
|
-
|
|
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
|
-
|
|
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
|
-
|
|
78
|
+
### 3. Import an MCP Server
|
|
88
79
|
|
|
89
|
-
|
|
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
|
-
|
|
82
|
+
The AI tool will:
|
|
94
83
|
|
|
95
|
-
|
|
96
|
-
|
|
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
|
-
- `
|
|
101
|
-
- `
|
|
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
|
-
|
|
121
|
+
After import, AAI Gateway returns:
|
|
130
122
|
|
|
131
|
-
-
|
|
132
|
-
-
|
|
133
|
-
-
|
|
134
|
-
- 引导工具名称:`app:<id>`
|
|
123
|
+
- The generated app id
|
|
124
|
+
- The generated `summary`
|
|
125
|
+
- The guide tool name: `app:<id>`
|
|
135
126
|
|
|
136
|
-
>
|
|
127
|
+
> AAI Gateway sends `tools/listChanged` after import. Clients that implement this notification can pick up new tools without restart.
|
|
137
128
|
|
|
138
|
-
### 4.
|
|
129
|
+
### 4. Import a Skill
|
|
139
130
|
|
|
140
|
-
|
|
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
|
-
|
|
148
|
-
{
|
|
149
|
-
"path": "/absolute/path/to/skill"
|
|
150
|
-
}
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
**远程技能示例**:
|
|
137
|
+
**Local Skill Example**:
|
|
154
138
|
|
|
155
139
|
```json
|
|
156
140
|
{
|
|
157
|
-
"
|
|
141
|
+
"path": "/absolute/path/to/skill"
|
|
158
142
|
}
|
|
159
143
|
```
|
|
160
144
|
|
|
161
|
-
|
|
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.
|
|
147
|
+
### 5. Supported ACP Agents
|
|
166
148
|
|
|
167
|
-
AAI Gateway
|
|
149
|
+
AAI Gateway can also control app-like agents through ACP.
|
|
168
150
|
|
|
169
|
-
|
|
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
|
|
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 -
|
|
202
|
-
│ │ -
|
|
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
|
-
###
|
|
198
|
+
### Unified Abstraction: Agent App
|
|
217
199
|
|
|
218
|
-
AAI Gateway
|
|
200
|
+
AAI Gateway unifies MCPs, Skills, ACP Agents, and CLI tools into **Agent Apps**.
|
|
219
201
|
|
|
220
|
-
|
|
202
|
+
To integrate an app with AAI Gateway, simply provide an app descriptor file (`aai.json`). The descriptor tells AAI Gateway:
|
|
221
203
|
|
|
222
|
-
-
|
|
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
|
-
"
|
|
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
|
-
##
|
|
303
|
+
## Pre-bundling Apps in AAI Gateway
|
|
326
304
|
|
|
327
|
-
###
|
|
305
|
+
### Submit a Pull Request
|
|
328
306
|
|
|
329
|
-
|
|
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.
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
331
|
+
If you're unsure whether an integration should be bundled, open an issue first to discuss.
|
|
358
332
|
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
发布到:
|
|
362
|
-
|
|
363
|
-
```
|
|
364
|
-
https://<your-host>/.well-known/aai.json
|
|
365
|
-
```
|
|
333
|
+
### Where to Place Descriptors
|
|
366
334
|
|
|
367
|
-
|
|
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
|
-
- `
|
|
398
|
-
-
|
|
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
|
|