@aerostack/gateway 0.11.2 → 0.11.4
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 +297 -76
- package/dist/index.js +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
# @aerostack/gateway
|
|
2
2
|
|
|
3
|
-
Connect any MCP client
|
|
3
|
+
Connect any MCP client to an [Aerostack Workspace](https://aerostack.dev) — one URL, all your tools, with built-in human approval gates.
|
|
4
4
|
|
|
5
5
|
[](https://opensource.org/licenses/MIT)
|
|
6
6
|
[](https://www.npmjs.com/package/@aerostack/gateway)
|
|
7
7
|
|
|
8
8
|
## Why?
|
|
9
9
|
|
|
10
|
-
Many MCP clients only support **stdio** transport. Aerostack Workspaces use **HTTP**. This bridge connects them — no code required.
|
|
11
|
-
|
|
12
10
|
Instead of configuring dozens of separate MCP servers in your AI tool, point at one Aerostack Workspace and get:
|
|
13
11
|
|
|
14
12
|
- **All tools in one place** — composed from multiple MCP servers
|
|
@@ -17,17 +15,33 @@ Instead of configuring dozens of separate MCP servers in your AI tool, point at
|
|
|
17
15
|
- **Local Guardian** — approval gates for local operations (file delete, shell, git push, deploy)
|
|
18
16
|
- **Per-tool permissions** — workspace tokens scope exactly which tools are accessible
|
|
19
17
|
- **Usage tracking & audit** — every tool call logged and metered
|
|
20
|
-
- **Rate limiting** — per-token, plan-tiered
|
|
21
18
|
|
|
22
19
|
## Quick Start
|
|
23
20
|
|
|
24
|
-
### 1. Get
|
|
21
|
+
### 1. Get your workspace URL and token
|
|
22
|
+
|
|
23
|
+
In your [Aerostack Dashboard](https://app.aerostack.dev), open your workspace and copy:
|
|
24
|
+
- **Workspace URL:** `https://mcp.aerostack.dev/ws/your-slug`
|
|
25
|
+
- **Token:** generate one from the Tokens tab (`mwt_...`)
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Setup by Client
|
|
30
|
+
|
|
31
|
+
Two connection modes:
|
|
32
|
+
|
|
33
|
+
| Mode | How | Best for |
|
|
34
|
+
|------|-----|----------|
|
|
35
|
+
| **URL** | Client connects directly over HTTP | Cursor, Windsurf, VS Code, Goose — HTTP-native clients |
|
|
36
|
+
| **NPX** | Runs a local bridge process | Claude Desktop, Cline, OpenClaw — stdio-only clients |
|
|
25
37
|
|
|
26
|
-
|
|
38
|
+
---
|
|
27
39
|
|
|
28
|
-
###
|
|
40
|
+
### Claude Desktop
|
|
29
41
|
|
|
30
|
-
**
|
|
42
|
+
**NPX (recommended):**
|
|
43
|
+
|
|
44
|
+
Edit `~/Library/Application Support/Claude/claude_desktop_config.json`:
|
|
31
45
|
|
|
32
46
|
```json
|
|
33
47
|
{
|
|
@@ -36,7 +50,7 @@ In your [Aerostack Admin Dashboard](https://app.aerostack.dev), open your worksp
|
|
|
36
50
|
"command": "npx",
|
|
37
51
|
"args": ["-y", "@aerostack/gateway"],
|
|
38
52
|
"env": {
|
|
39
|
-
"AEROSTACK_WORKSPACE_URL": "https://
|
|
53
|
+
"AEROSTACK_WORKSPACE_URL": "https://mcp.aerostack.dev/ws/your-slug",
|
|
40
54
|
"AEROSTACK_TOKEN": "mwt_your_token_here"
|
|
41
55
|
}
|
|
42
56
|
}
|
|
@@ -44,127 +58,334 @@ In your [Aerostack Admin Dashboard](https://app.aerostack.dev), open your worksp
|
|
|
44
58
|
}
|
|
45
59
|
```
|
|
46
60
|
|
|
47
|
-
**
|
|
61
|
+
**URL:**
|
|
48
62
|
|
|
49
63
|
```json
|
|
50
64
|
{
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
"AEROSTACK_WORKSPACE_URL": "https://api.aerostack.dev/api/gateway/ws/my-workspace",
|
|
56
|
-
"AEROSTACK_TOKEN": "mwt_your_token_here"
|
|
65
|
+
"mcpServers": {
|
|
66
|
+
"aerostack": {
|
|
67
|
+
"url": "https://mcp.aerostack.dev/ws/your-slug",
|
|
68
|
+
"headers": { "Authorization": "Bearer mwt_your_token_here" }
|
|
57
69
|
}
|
|
58
70
|
}
|
|
59
71
|
}
|
|
60
72
|
```
|
|
61
73
|
|
|
62
|
-
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
### Claude Code
|
|
77
|
+
|
|
78
|
+
**NPX (recommended):**
|
|
63
79
|
|
|
80
|
+
```bash
|
|
81
|
+
claude mcp add aerostack \
|
|
82
|
+
--command "npx" \
|
|
83
|
+
--args "-y,@aerostack/gateway" \
|
|
84
|
+
--env "AEROSTACK_WORKSPACE_URL=https://mcp.aerostack.dev/ws/your-slug" \
|
|
85
|
+
--env "AEROSTACK_TOKEN=mwt_your_token_here"
|
|
64
86
|
```
|
|
65
|
-
|
|
66
|
-
|
|
87
|
+
|
|
88
|
+
Or edit `.claude/mcp.json`:
|
|
89
|
+
|
|
90
|
+
```json
|
|
91
|
+
{
|
|
92
|
+
"mcpServers": {
|
|
93
|
+
"aerostack": {
|
|
94
|
+
"command": "npx",
|
|
95
|
+
"args": ["-y", "@aerostack/gateway"],
|
|
96
|
+
"env": {
|
|
97
|
+
"AEROSTACK_WORKSPACE_URL": "https://mcp.aerostack.dev/ws/your-slug",
|
|
98
|
+
"AEROSTACK_TOKEN": "mwt_your_token_here"
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
67
103
|
```
|
|
68
104
|
|
|
69
|
-
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
### Cursor
|
|
70
108
|
|
|
109
|
+
**URL (recommended — no install needed):**
|
|
110
|
+
|
|
111
|
+
Open Cursor Settings → MCP → Add Server:
|
|
112
|
+
|
|
113
|
+
```json
|
|
114
|
+
{
|
|
115
|
+
"mcpServers": {
|
|
116
|
+
"aerostack": {
|
|
117
|
+
"url": "https://mcp.aerostack.dev/ws/your-slug",
|
|
118
|
+
"headers": { "Authorization": "Bearer mwt_your_token_here" }
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
71
122
|
```
|
|
72
|
-
|
|
73
|
-
|
|
123
|
+
|
|
124
|
+
**NPX:**
|
|
125
|
+
|
|
126
|
+
```json
|
|
127
|
+
{
|
|
128
|
+
"mcpServers": {
|
|
129
|
+
"aerostack": {
|
|
130
|
+
"command": "npx",
|
|
131
|
+
"args": ["-y", "@aerostack/gateway"],
|
|
132
|
+
"env": {
|
|
133
|
+
"AEROSTACK_WORKSPACE_URL": "https://mcp.aerostack.dev/ws/your-slug",
|
|
134
|
+
"AEROSTACK_TOKEN": "mwt_your_token_here"
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
74
139
|
```
|
|
75
140
|
|
|
76
|
-
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
### Windsurf
|
|
144
|
+
|
|
145
|
+
**URL (recommended):**
|
|
77
146
|
|
|
78
|
-
|
|
147
|
+
Edit `~/.codeium/windsurf/mcp_config.json`:
|
|
79
148
|
|
|
149
|
+
```json
|
|
150
|
+
{
|
|
151
|
+
"mcpServers": {
|
|
152
|
+
"aerostack": {
|
|
153
|
+
"serverUrl": "https://mcp.aerostack.dev/ws/your-slug",
|
|
154
|
+
"headers": { "Authorization": "Bearer mwt_your_token_here" }
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
80
158
|
```
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
159
|
+
|
|
160
|
+
**NPX:**
|
|
161
|
+
|
|
162
|
+
```json
|
|
163
|
+
{
|
|
164
|
+
"mcpServers": {
|
|
165
|
+
"aerostack": {
|
|
166
|
+
"command": "npx",
|
|
167
|
+
"args": ["-y", "@aerostack/gateway"],
|
|
168
|
+
"env": {
|
|
169
|
+
"AEROSTACK_WORKSPACE_URL": "https://mcp.aerostack.dev/ws/your-slug",
|
|
170
|
+
"AEROSTACK_TOKEN": "mwt_your_token_here"
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
88
175
|
```
|
|
89
176
|
|
|
90
|
-
|
|
177
|
+
---
|
|
91
178
|
|
|
92
|
-
|
|
93
|
-
2. Forwards all JSON-RPC requests to your workspace over HTTPS
|
|
94
|
-
3. Handles SSE streaming responses transparently
|
|
95
|
-
4. Manages the approval gate flow automatically
|
|
179
|
+
### VS Code
|
|
96
180
|
|
|
97
|
-
|
|
181
|
+
**URL:**
|
|
98
182
|
|
|
99
|
-
|
|
183
|
+
Edit `.vscode/mcp.json`:
|
|
100
184
|
|
|
185
|
+
```json
|
|
186
|
+
{
|
|
187
|
+
"servers": {
|
|
188
|
+
"aerostack": {
|
|
189
|
+
"type": "http",
|
|
190
|
+
"url": "https://mcp.aerostack.dev/ws/your-slug",
|
|
191
|
+
"headers": { "Authorization": "Bearer mwt_your_token_here" }
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
101
195
|
```
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
196
|
+
|
|
197
|
+
**NPX:**
|
|
198
|
+
|
|
199
|
+
```json
|
|
200
|
+
{
|
|
201
|
+
"servers": {
|
|
202
|
+
"aerostack": {
|
|
203
|
+
"type": "stdio",
|
|
204
|
+
"command": "npx",
|
|
205
|
+
"args": ["-y", "@aerostack/gateway"],
|
|
206
|
+
"env": {
|
|
207
|
+
"AEROSTACK_WORKSPACE_URL": "https://mcp.aerostack.dev/ws/your-slug",
|
|
208
|
+
"AEROSTACK_TOKEN": "mwt_your_token_here"
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
108
213
|
```
|
|
109
214
|
|
|
110
|
-
|
|
215
|
+
---
|
|
111
216
|
|
|
112
|
-
|
|
217
|
+
### Cline
|
|
218
|
+
|
|
219
|
+
**NPX:**
|
|
220
|
+
|
|
221
|
+
Open VS Code Settings → search `Cline MCP` → Edit in `settings.json`:
|
|
222
|
+
|
|
223
|
+
```json
|
|
224
|
+
{
|
|
225
|
+
"cline.mcpServers": {
|
|
226
|
+
"aerostack": {
|
|
227
|
+
"command": "npx",
|
|
228
|
+
"args": ["-y", "@aerostack/gateway"],
|
|
229
|
+
"env": {
|
|
230
|
+
"AEROSTACK_WORKSPACE_URL": "https://mcp.aerostack.dev/ws/your-slug",
|
|
231
|
+
"AEROSTACK_TOKEN": "mwt_your_token_here"
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
**URL:**
|
|
239
|
+
|
|
240
|
+
```json
|
|
241
|
+
{
|
|
242
|
+
"cline.mcpServers": {
|
|
243
|
+
"aerostack": {
|
|
244
|
+
"url": "https://mcp.aerostack.dev/ws/your-slug",
|
|
245
|
+
"headers": { "Authorization": "Bearer mwt_your_token_here" }
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
---
|
|
252
|
+
|
|
253
|
+
### Goose
|
|
254
|
+
|
|
255
|
+
**URL (recommended — Goose is HTTP-native):**
|
|
113
256
|
|
|
114
|
-
|
|
257
|
+
Edit `~/.config/goose/config.yaml`:
|
|
115
258
|
|
|
116
|
-
|
|
259
|
+
```yaml
|
|
260
|
+
mcp:
|
|
261
|
+
servers:
|
|
262
|
+
aerostack:
|
|
263
|
+
url: https://mcp.aerostack.dev/ws/your-slug
|
|
264
|
+
headers:
|
|
265
|
+
Authorization: Bearer mwt_your_token_here
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
**NPX:**
|
|
269
|
+
|
|
270
|
+
```yaml
|
|
271
|
+
mcp:
|
|
272
|
+
servers:
|
|
273
|
+
aerostack:
|
|
274
|
+
command: npx
|
|
275
|
+
args: ["-y", "@aerostack/gateway"]
|
|
276
|
+
env:
|
|
277
|
+
AEROSTACK_WORKSPACE_URL: https://mcp.aerostack.dev/ws/your-slug
|
|
278
|
+
AEROSTACK_TOKEN: mwt_your_token_here
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
---
|
|
282
|
+
|
|
283
|
+
### OpenClaw
|
|
284
|
+
|
|
285
|
+
**NPX:**
|
|
286
|
+
|
|
287
|
+
```json
|
|
288
|
+
{
|
|
289
|
+
"mcp": {
|
|
290
|
+
"servers": {
|
|
291
|
+
"aerostack": {
|
|
292
|
+
"command": "npx",
|
|
293
|
+
"args": ["-y", "@aerostack/gateway"],
|
|
294
|
+
"env": {
|
|
295
|
+
"AEROSTACK_WORKSPACE_URL": "https://mcp.aerostack.dev/ws/your-slug",
|
|
296
|
+
"AEROSTACK_TOKEN": "mwt_your_token_here"
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
---
|
|
305
|
+
|
|
306
|
+
### Any HTTP-native client
|
|
307
|
+
|
|
308
|
+
Use the workspace URL directly — no package needed:
|
|
309
|
+
|
|
310
|
+
```
|
|
311
|
+
URL: https://mcp.aerostack.dev/ws/your-slug
|
|
312
|
+
Header: Authorization: Bearer mwt_your_token_here
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
---
|
|
316
|
+
|
|
317
|
+
## Debugging
|
|
318
|
+
|
|
319
|
+
If the connection isn't working, run the bridge directly in your terminal:
|
|
320
|
+
|
|
321
|
+
```bash
|
|
322
|
+
AEROSTACK_LOG_LEVEL=debug \
|
|
323
|
+
AEROSTACK_WORKSPACE_URL=https://mcp.aerostack.dev/ws/your-slug \
|
|
324
|
+
AEROSTACK_TOKEN=mwt_your_token_here \
|
|
325
|
+
npx -y @aerostack/gateway
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
Or test the workspace endpoint with curl:
|
|
329
|
+
|
|
330
|
+
```bash
|
|
331
|
+
curl -X POST https://mcp.aerostack.dev/ws/your-slug \
|
|
332
|
+
-H "Authorization: Bearer mwt_your_token_here" \
|
|
333
|
+
-H "Content-Type: application/json" \
|
|
334
|
+
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
**Common issues:**
|
|
338
|
+
|
|
339
|
+
| Symptom | Cause | Fix |
|
|
340
|
+
|---------|-------|-----|
|
|
341
|
+
| `401 Unauthorized` | Invalid or expired token | Generate a new token from the Tokens tab |
|
|
342
|
+
| `404 Not Found` | Wrong workspace slug | Check the slug in your dashboard URL |
|
|
343
|
+
| Tools list is empty | No servers added to workspace | Add MCP servers from the marketplace |
|
|
344
|
+
| `npx: command not found` | Node.js not installed | Install Node.js 18+ from nodejs.org |
|
|
345
|
+
| Old version cached by npx | Stale npx cache | Run `npx --yes @aerostack/gateway@latest` |
|
|
346
|
+
|
|
347
|
+
---
|
|
348
|
+
|
|
349
|
+
## Approval Gates
|
|
350
|
+
|
|
351
|
+
When workspace approval rules are configured, the bridge handles them transparently:
|
|
117
352
|
|
|
118
353
|
```
|
|
119
|
-
|
|
120
|
-
→
|
|
121
|
-
→
|
|
122
|
-
→
|
|
123
|
-
→
|
|
354
|
+
AI calls a gated tool
|
|
355
|
+
→ Workspace returns "needs approval"
|
|
356
|
+
→ Bridge waits (WebSocket for instant wake, polling as fallback)
|
|
357
|
+
→ You approve or reject from dashboard or mobile app
|
|
358
|
+
→ Bridge retries on approval, returns error on rejection
|
|
124
359
|
```
|
|
125
360
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
| `config_modify` | `.env`, credentials, production configs |
|
|
132
|
-
| `deploy` | Deploy, publish, release to any environment |
|
|
133
|
-
| `database` | Direct database mutations outside migrations |
|
|
361
|
+
Your agent sees either a successful result or a clear error — no special handling needed.
|
|
362
|
+
|
|
363
|
+
## Local Guardian
|
|
364
|
+
|
|
365
|
+
Approval gates for local operations — file deletion, shell commands, git push, deploys. The `aerostack__local_guardian` tool is injected automatically when enabled in your workspace settings.
|
|
134
366
|
|
|
135
367
|
## Configuration
|
|
136
368
|
|
|
137
369
|
| Variable | Required | Default | Description |
|
|
138
370
|
|----------|----------|---------|-------------|
|
|
139
|
-
| `AEROSTACK_WORKSPACE_URL` | Yes | — |
|
|
371
|
+
| `AEROSTACK_WORKSPACE_URL` | Yes | — | `https://mcp.aerostack.dev/ws/your-slug` |
|
|
140
372
|
| `AEROSTACK_TOKEN` | Yes | — | Workspace token (`mwt_...`) |
|
|
141
373
|
| `AEROSTACK_APPROVAL_POLL_MS` | No | `3000` | Approval polling interval (ms) |
|
|
142
374
|
| `AEROSTACK_APPROVAL_TIMEOUT_MS` | No | `300000` | Max approval wait time (5 min) |
|
|
143
375
|
| `AEROSTACK_REQUEST_TIMEOUT_MS` | No | `30000` | HTTP request timeout (30s) |
|
|
144
376
|
| `AEROSTACK_LOCAL_GUARDIAN` | No | `true` | Set `false` to disable Local Guardian |
|
|
145
|
-
| `AEROSTACK_LOG_LEVEL` | No | `info` | Log level: debug
|
|
146
|
-
|
|
147
|
-
## Supported MCP Methods
|
|
148
|
-
|
|
149
|
-
| Method | Description |
|
|
150
|
-
|--------|-------------|
|
|
151
|
-
| `tools/list` | List all tools from all workspace servers |
|
|
152
|
-
| `tools/call` | Call a namespaced tool (with approval handling) |
|
|
153
|
-
| `resources/list` | List resources from all workspace servers |
|
|
154
|
-
| `resources/read` | Read a specific resource |
|
|
155
|
-
| `prompts/list` | List prompts from all workspace servers |
|
|
156
|
-
| `prompts/get` | Get a prompt with arguments |
|
|
377
|
+
| `AEROSTACK_LOG_LEVEL` | No | `info` | Log level: `debug`, `info`, `warn`, `error` |
|
|
157
378
|
|
|
158
379
|
## Requirements
|
|
159
380
|
|
|
160
|
-
- Node.js 18+
|
|
381
|
+
- Node.js 18+ (for NPX mode only)
|
|
161
382
|
- An Aerostack account with a configured workspace
|
|
162
383
|
- A workspace token (`mwt_...`)
|
|
163
384
|
|
|
164
385
|
## Links
|
|
165
386
|
|
|
387
|
+
- [Aerostack Dashboard](https://app.aerostack.dev)
|
|
166
388
|
- [Aerostack Docs](https://docs.aerostack.dev)
|
|
167
|
-
- [Aerostack Admin](https://app.aerostack.dev)
|
|
168
389
|
- [MCP Specification](https://modelcontextprotocol.io)
|
|
169
390
|
|
|
170
391
|
## License
|
package/dist/index.js
CHANGED
|
File without changes
|