argsbarg 5.1.16 → 6.0.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/CHANGELOG.md +32 -1
- package/README.md +32 -24
- package/docs/README.md +2 -1
- package/docs/api-server.md +141 -0
- package/docs/bundled-docs.md +24 -10
- package/docs/cli-program.md +17 -2
- package/docs/developing.md +1 -1
- package/docs/mcp.md +5 -5
- package/docs/output-schema.md +3 -3
- package/examples/full-example/README.md +8 -0
- package/examples/full-example/docs/README.md +27 -0
- package/examples/full-example/docs/api.md +511 -0
- package/examples/full-example/docs/cli-schema.json +453 -0
- package/examples/full-example/docs/http.md +81 -0
- package/examples/full-example/docs/mcp.md +159 -0
- package/examples/full-example/docs/openapi.json +222 -0
- package/examples/full-example/docs/skill.md +46 -0
- package/examples/full-example/justfile +6 -2
- package/examples/full-example/scripts/dev-formula.ts +1 -1
- package/examples/full-example/src/commands/echo/command.ts +6 -1
- package/examples/full-example/src/program.ts +3 -0
- package/examples/mcp-test.ts +13 -2
- package/examples/nested.ts +12 -3
- package/examples/servers.ts +72 -0
- package/index.d.ts +66 -7
- package/package.json +1 -1
- package/src/api/openapi.ts +115 -0
- package/src/api/result.ts +89 -0
- package/src/api/server.ts +120 -0
- package/src/api.integration.test.ts +358 -0
- package/src/builtins/api.ts +38 -0
- package/src/builtins/dispatch.ts +26 -0
- package/src/builtins/registry.ts +4 -0
- package/src/capabilities.ts +12 -1
- package/src/cli-tool/full-example-capabilities.test.ts +3 -0
- package/src/cli.ts +60 -8
- package/src/config.integration.test.ts +22 -4
- package/src/context.ts +29 -1
- package/src/docs/api-guide.ts +2 -2
- package/src/docs/builtin.ts +11 -1
- package/src/docs/docs.test.ts +70 -12
- package/src/docs/http-guide.ts +132 -0
- package/src/docs/mcp-guide.ts +3 -3
- package/src/docs/resolve.ts +26 -2
- package/src/docs/save.ts +5 -2
- package/src/headless/tool-call.ts +147 -0
- package/src/headless.test.ts +4 -2
- package/src/headless.ts +10 -5
- package/src/index.ts +5 -0
- package/src/mcp/result.ts +39 -34
- package/src/mcp/server.ts +18 -36
- package/src/mcp/tools.ts +14 -3
- package/src/mcp.integration.test.ts +46 -39
- package/src/parse.test.ts +16 -6
- package/src/respond.ts +48 -0
- package/src/schema.ts +1 -1
- package/src/skill/generate.ts +1 -1
- package/src/types.ts +46 -4
- package/src/validate.ts +7 -0
|
@@ -0,0 +1,453 @@
|
|
|
1
|
+
{
|
|
2
|
+
"key": "full-example",
|
|
3
|
+
"description": "Argsbarg full example reference app",
|
|
4
|
+
"commands": [
|
|
5
|
+
{
|
|
6
|
+
"key": "echo",
|
|
7
|
+
"description": "Echo a message (MCP-friendly leaf).",
|
|
8
|
+
"options": [
|
|
9
|
+
{
|
|
10
|
+
"name": "message",
|
|
11
|
+
"description": "Text to print.",
|
|
12
|
+
"kind": "string",
|
|
13
|
+
"required": true
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
"commands": [
|
|
17
|
+
{
|
|
18
|
+
"key": "version",
|
|
19
|
+
"description": "Print the program version."
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"key": "configure",
|
|
23
|
+
"description": "Set up agent skills, MCP config, and app config for this app (binary via Homebrew).",
|
|
24
|
+
"notes": "Set up agent artifacts after the binary is installed via Homebrew (see README for tap install).\n\nHomebrew post_install runs:\n full-example configure --sync --yes\n\nInteractive setup (per target):\n full-example configure\n\nUpgrade:\n brew upgrade full-example\n\nShell completions are installed by Homebrew during brew install.\nSee: https://docs.brew.sh/Shell-Completion\n\nSee what is installed:\n full-example configure --status\n\nUninstall:\n brew uninstall <tap>/full-example\n\nThe formula uninstall hook runs `configure --remove-all --yes` (skills, MCP, and app config).\n\nRemove app config only:\n full-example configure --remove-config --yes\n\nUse --dry to preview changes without writing files.\nUse --json for machine-readable output.",
|
|
25
|
+
"options": [
|
|
26
|
+
{
|
|
27
|
+
"name": "sync",
|
|
28
|
+
"description": "Refresh installed skills, MCP, and config. Used by Homebrew post_install.",
|
|
29
|
+
"kind": "presence"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"name": "remove-all",
|
|
33
|
+
"description": "Remove all detected agent artifacts (skills and MCP).",
|
|
34
|
+
"kind": "presence"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"name": "remove-config",
|
|
38
|
+
"description": "Remove the app config file only.",
|
|
39
|
+
"kind": "presence"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"name": "status",
|
|
43
|
+
"description": "Print what is currently installed (read-only).",
|
|
44
|
+
"kind": "presence"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"name": "yes",
|
|
48
|
+
"description": "Skip confirmation (required for --sync, --remove-all, --remove-config).",
|
|
49
|
+
"kind": "presence",
|
|
50
|
+
"shortName": "y"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"name": "dry",
|
|
54
|
+
"description": "Show what would change without writing files.",
|
|
55
|
+
"kind": "presence"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"name": "json",
|
|
59
|
+
"description": "Print changed paths or status JSON on stdout.",
|
|
60
|
+
"kind": "presence"
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
"fallbackCommand": "run",
|
|
64
|
+
"fallbackMode": "missingOnly",
|
|
65
|
+
"commands": [
|
|
66
|
+
{
|
|
67
|
+
"key": "get",
|
|
68
|
+
"description": "Print resolved configuration value(s).",
|
|
69
|
+
"options": [
|
|
70
|
+
{
|
|
71
|
+
"name": "json",
|
|
72
|
+
"description": "Emit JSON (compact).",
|
|
73
|
+
"kind": "presence"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"name": "pretty",
|
|
77
|
+
"description": "Pretty-print JSON (requires --json).",
|
|
78
|
+
"kind": "presence"
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"key": "set",
|
|
84
|
+
"description": "Write one configuration key to the config file.",
|
|
85
|
+
"options": [
|
|
86
|
+
{
|
|
87
|
+
"name": "json",
|
|
88
|
+
"description": "Emit JSON (compact).",
|
|
89
|
+
"kind": "presence"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"name": "from-env",
|
|
93
|
+
"description": "Bind this key to its mapped environment variable (no literal value stored).",
|
|
94
|
+
"kind": "presence"
|
|
95
|
+
}
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
]
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"key": "docs",
|
|
102
|
+
"description": "Print bundled CLI documentation.",
|
|
103
|
+
"notes": "Topics print to stdout. Add --save to write files under ./docs/.",
|
|
104
|
+
"options": [
|
|
105
|
+
{
|
|
106
|
+
"name": "save",
|
|
107
|
+
"description": "Write documentation to ./docs/.",
|
|
108
|
+
"kind": "presence"
|
|
109
|
+
}
|
|
110
|
+
],
|
|
111
|
+
"fallbackCommand": "readme",
|
|
112
|
+
"fallbackMode": "missingOnly",
|
|
113
|
+
"commands": [
|
|
114
|
+
{
|
|
115
|
+
"key": "readme",
|
|
116
|
+
"description": "Print README (user guide).",
|
|
117
|
+
"options": [
|
|
118
|
+
{
|
|
119
|
+
"name": "save",
|
|
120
|
+
"description": "Write documentation to ./docs/.",
|
|
121
|
+
"kind": "presence"
|
|
122
|
+
}
|
|
123
|
+
]
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"key": "mcp",
|
|
127
|
+
"description": "Print MCP server setup and tool guidance.",
|
|
128
|
+
"options": [
|
|
129
|
+
{
|
|
130
|
+
"name": "save",
|
|
131
|
+
"description": "Write documentation to ./docs/.",
|
|
132
|
+
"kind": "presence"
|
|
133
|
+
}
|
|
134
|
+
]
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"key": "http",
|
|
138
|
+
"description": "Print HTTP API setup and tool guidance.",
|
|
139
|
+
"options": [
|
|
140
|
+
{
|
|
141
|
+
"name": "save",
|
|
142
|
+
"description": "Write documentation to ./docs/.",
|
|
143
|
+
"kind": "presence"
|
|
144
|
+
}
|
|
145
|
+
]
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"key": "openapi",
|
|
149
|
+
"description": "Print the HTTP OpenAPI 3.1 document as JSON.",
|
|
150
|
+
"options": [
|
|
151
|
+
{
|
|
152
|
+
"name": "save",
|
|
153
|
+
"description": "Write documentation to ./docs/.",
|
|
154
|
+
"kind": "presence"
|
|
155
|
+
}
|
|
156
|
+
]
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"key": "cli-schema",
|
|
160
|
+
"description": "Print the full CLI command tree as JSON.",
|
|
161
|
+
"options": [
|
|
162
|
+
{
|
|
163
|
+
"name": "save",
|
|
164
|
+
"description": "Write documentation to ./docs/.",
|
|
165
|
+
"kind": "presence"
|
|
166
|
+
}
|
|
167
|
+
]
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
"key": "api",
|
|
171
|
+
"description": "Print the full command reference as markdown.",
|
|
172
|
+
"options": [
|
|
173
|
+
{
|
|
174
|
+
"name": "save",
|
|
175
|
+
"description": "Write documentation to ./docs/.",
|
|
176
|
+
"kind": "presence"
|
|
177
|
+
}
|
|
178
|
+
]
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
"key": "skill",
|
|
182
|
+
"description": "Print a reference agent SKILL; run `configure` to install an optimized copy.",
|
|
183
|
+
"options": [
|
|
184
|
+
{
|
|
185
|
+
"name": "save",
|
|
186
|
+
"description": "Write documentation to ./docs/.",
|
|
187
|
+
"kind": "presence"
|
|
188
|
+
}
|
|
189
|
+
]
|
|
190
|
+
}
|
|
191
|
+
]
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
"key": "mcp",
|
|
195
|
+
"description": "MCP server and bundle tools.",
|
|
196
|
+
"notes": "Stdio MCP server. Add to Cursor, Claude Code, or Claude Desktop:\n\n command: full-example\n args: mcp\n\nOr:\n\n full-example configure\n\nFull setup guide: full-example docs mcp",
|
|
197
|
+
"fallbackCommand": "serve",
|
|
198
|
+
"fallbackMode": "missingOnly",
|
|
199
|
+
"commands": [
|
|
200
|
+
{
|
|
201
|
+
"key": "bundle",
|
|
202
|
+
"description": "Pack dist MCP artifacts (`.mcpb`, Claude Code plugin zip) from dist/<key>."
|
|
203
|
+
}
|
|
204
|
+
]
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
"key": "api",
|
|
208
|
+
"description": "HTTP API server for tools.",
|
|
209
|
+
"notes": "HTTP tool server on http://127.0.0.1:3000.\n\nEndpoints: GET /health, GET /openapi.json, GET /openapi-browser, POST /tools/:name\n\nConfigure app settings:\n\n full-example configure\n\nFull setup guide: full-example docs http",
|
|
210
|
+
"fallbackCommand": "serve",
|
|
211
|
+
"fallbackMode": "missingOnly"
|
|
212
|
+
}
|
|
213
|
+
]
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
"key": "status",
|
|
217
|
+
"description": "Show resolved config and app version.",
|
|
218
|
+
"options": [
|
|
219
|
+
{
|
|
220
|
+
"name": "json",
|
|
221
|
+
"description": "Emit JSON.",
|
|
222
|
+
"kind": "presence"
|
|
223
|
+
}
|
|
224
|
+
],
|
|
225
|
+
"outputSchema": {
|
|
226
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
227
|
+
"type": "object",
|
|
228
|
+
"properties": {
|
|
229
|
+
"defaultRegion": {
|
|
230
|
+
"type": "string",
|
|
231
|
+
"description": "Resolved AWS region."
|
|
232
|
+
},
|
|
233
|
+
"maxRetries": {
|
|
234
|
+
"type": "number",
|
|
235
|
+
"description": "Resolved retry count."
|
|
236
|
+
},
|
|
237
|
+
"apiTokenSet": {
|
|
238
|
+
"type": "boolean",
|
|
239
|
+
"description": "Whether apiToken is set (value never included)."
|
|
240
|
+
},
|
|
241
|
+
"version": {
|
|
242
|
+
"type": "string",
|
|
243
|
+
"description": "App version from program root."
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
"required": [
|
|
247
|
+
"apiTokenSet",
|
|
248
|
+
"version"
|
|
249
|
+
],
|
|
250
|
+
"description": "JSON payload for `full-example status --json`.",
|
|
251
|
+
"definitions": {}
|
|
252
|
+
},
|
|
253
|
+
"commands": [
|
|
254
|
+
{
|
|
255
|
+
"key": "version",
|
|
256
|
+
"description": "Print the program version."
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
"key": "configure",
|
|
260
|
+
"description": "Set up agent skills, MCP config, and app config for this app (binary via Homebrew).",
|
|
261
|
+
"notes": "Set up agent artifacts after the binary is installed via Homebrew (see README for tap install).\n\nHomebrew post_install runs:\n full-example configure --sync --yes\n\nInteractive setup (per target):\n full-example configure\n\nUpgrade:\n brew upgrade full-example\n\nShell completions are installed by Homebrew during brew install.\nSee: https://docs.brew.sh/Shell-Completion\n\nSee what is installed:\n full-example configure --status\n\nUninstall:\n brew uninstall <tap>/full-example\n\nThe formula uninstall hook runs `configure --remove-all --yes` (skills, MCP, and app config).\n\nRemove app config only:\n full-example configure --remove-config --yes\n\nUse --dry to preview changes without writing files.\nUse --json for machine-readable output.",
|
|
262
|
+
"options": [
|
|
263
|
+
{
|
|
264
|
+
"name": "sync",
|
|
265
|
+
"description": "Refresh installed skills, MCP, and config. Used by Homebrew post_install.",
|
|
266
|
+
"kind": "presence"
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
"name": "remove-all",
|
|
270
|
+
"description": "Remove all detected agent artifacts (skills and MCP).",
|
|
271
|
+
"kind": "presence"
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
"name": "remove-config",
|
|
275
|
+
"description": "Remove the app config file only.",
|
|
276
|
+
"kind": "presence"
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
"name": "status",
|
|
280
|
+
"description": "Print what is currently installed (read-only).",
|
|
281
|
+
"kind": "presence"
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
"name": "yes",
|
|
285
|
+
"description": "Skip confirmation (required for --sync, --remove-all, --remove-config).",
|
|
286
|
+
"kind": "presence",
|
|
287
|
+
"shortName": "y"
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
"name": "dry",
|
|
291
|
+
"description": "Show what would change without writing files.",
|
|
292
|
+
"kind": "presence"
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
"name": "json",
|
|
296
|
+
"description": "Print changed paths or status JSON on stdout.",
|
|
297
|
+
"kind": "presence"
|
|
298
|
+
}
|
|
299
|
+
],
|
|
300
|
+
"fallbackCommand": "run",
|
|
301
|
+
"fallbackMode": "missingOnly",
|
|
302
|
+
"commands": [
|
|
303
|
+
{
|
|
304
|
+
"key": "get",
|
|
305
|
+
"description": "Print resolved configuration value(s).",
|
|
306
|
+
"options": [
|
|
307
|
+
{
|
|
308
|
+
"name": "json",
|
|
309
|
+
"description": "Emit JSON (compact).",
|
|
310
|
+
"kind": "presence"
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
"name": "pretty",
|
|
314
|
+
"description": "Pretty-print JSON (requires --json).",
|
|
315
|
+
"kind": "presence"
|
|
316
|
+
}
|
|
317
|
+
]
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
"key": "set",
|
|
321
|
+
"description": "Write one configuration key to the config file.",
|
|
322
|
+
"options": [
|
|
323
|
+
{
|
|
324
|
+
"name": "json",
|
|
325
|
+
"description": "Emit JSON (compact).",
|
|
326
|
+
"kind": "presence"
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
"name": "from-env",
|
|
330
|
+
"description": "Bind this key to its mapped environment variable (no literal value stored).",
|
|
331
|
+
"kind": "presence"
|
|
332
|
+
}
|
|
333
|
+
]
|
|
334
|
+
}
|
|
335
|
+
]
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
"key": "docs",
|
|
339
|
+
"description": "Print bundled CLI documentation.",
|
|
340
|
+
"notes": "Topics print to stdout. Add --save to write files under ./docs/.",
|
|
341
|
+
"options": [
|
|
342
|
+
{
|
|
343
|
+
"name": "save",
|
|
344
|
+
"description": "Write documentation to ./docs/.",
|
|
345
|
+
"kind": "presence"
|
|
346
|
+
}
|
|
347
|
+
],
|
|
348
|
+
"fallbackCommand": "readme",
|
|
349
|
+
"fallbackMode": "missingOnly",
|
|
350
|
+
"commands": [
|
|
351
|
+
{
|
|
352
|
+
"key": "readme",
|
|
353
|
+
"description": "Print README (user guide).",
|
|
354
|
+
"options": [
|
|
355
|
+
{
|
|
356
|
+
"name": "save",
|
|
357
|
+
"description": "Write documentation to ./docs/.",
|
|
358
|
+
"kind": "presence"
|
|
359
|
+
}
|
|
360
|
+
]
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
"key": "mcp",
|
|
364
|
+
"description": "Print MCP server setup and tool guidance.",
|
|
365
|
+
"options": [
|
|
366
|
+
{
|
|
367
|
+
"name": "save",
|
|
368
|
+
"description": "Write documentation to ./docs/.",
|
|
369
|
+
"kind": "presence"
|
|
370
|
+
}
|
|
371
|
+
]
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
"key": "http",
|
|
375
|
+
"description": "Print HTTP API setup and tool guidance.",
|
|
376
|
+
"options": [
|
|
377
|
+
{
|
|
378
|
+
"name": "save",
|
|
379
|
+
"description": "Write documentation to ./docs/.",
|
|
380
|
+
"kind": "presence"
|
|
381
|
+
}
|
|
382
|
+
]
|
|
383
|
+
},
|
|
384
|
+
{
|
|
385
|
+
"key": "openapi",
|
|
386
|
+
"description": "Print the HTTP OpenAPI 3.1 document as JSON.",
|
|
387
|
+
"options": [
|
|
388
|
+
{
|
|
389
|
+
"name": "save",
|
|
390
|
+
"description": "Write documentation to ./docs/.",
|
|
391
|
+
"kind": "presence"
|
|
392
|
+
}
|
|
393
|
+
]
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
"key": "cli-schema",
|
|
397
|
+
"description": "Print the full CLI command tree as JSON.",
|
|
398
|
+
"options": [
|
|
399
|
+
{
|
|
400
|
+
"name": "save",
|
|
401
|
+
"description": "Write documentation to ./docs/.",
|
|
402
|
+
"kind": "presence"
|
|
403
|
+
}
|
|
404
|
+
]
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
"key": "api",
|
|
408
|
+
"description": "Print the full command reference as markdown.",
|
|
409
|
+
"options": [
|
|
410
|
+
{
|
|
411
|
+
"name": "save",
|
|
412
|
+
"description": "Write documentation to ./docs/.",
|
|
413
|
+
"kind": "presence"
|
|
414
|
+
}
|
|
415
|
+
]
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
"key": "skill",
|
|
419
|
+
"description": "Print a reference agent SKILL; run `configure` to install an optimized copy.",
|
|
420
|
+
"options": [
|
|
421
|
+
{
|
|
422
|
+
"name": "save",
|
|
423
|
+
"description": "Write documentation to ./docs/.",
|
|
424
|
+
"kind": "presence"
|
|
425
|
+
}
|
|
426
|
+
]
|
|
427
|
+
}
|
|
428
|
+
]
|
|
429
|
+
},
|
|
430
|
+
{
|
|
431
|
+
"key": "mcp",
|
|
432
|
+
"description": "MCP server and bundle tools.",
|
|
433
|
+
"notes": "Stdio MCP server. Add to Cursor, Claude Code, or Claude Desktop:\n\n command: full-example\n args: mcp\n\nOr:\n\n full-example configure\n\nFull setup guide: full-example docs mcp",
|
|
434
|
+
"fallbackCommand": "serve",
|
|
435
|
+
"fallbackMode": "missingOnly",
|
|
436
|
+
"commands": [
|
|
437
|
+
{
|
|
438
|
+
"key": "bundle",
|
|
439
|
+
"description": "Pack dist MCP artifacts (`.mcpb`, Claude Code plugin zip) from dist/<key>."
|
|
440
|
+
}
|
|
441
|
+
]
|
|
442
|
+
},
|
|
443
|
+
{
|
|
444
|
+
"key": "api",
|
|
445
|
+
"description": "HTTP API server for tools.",
|
|
446
|
+
"notes": "HTTP tool server on http://127.0.0.1:3000.\n\nEndpoints: GET /health, GET /openapi.json, GET /openapi-browser, POST /tools/:name\n\nConfigure app settings:\n\n full-example configure\n\nFull setup guide: full-example docs http",
|
|
447
|
+
"fallbackCommand": "serve",
|
|
448
|
+
"fallbackMode": "missingOnly"
|
|
449
|
+
}
|
|
450
|
+
]
|
|
451
|
+
}
|
|
452
|
+
]
|
|
453
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# HTTP API (full-example)
|
|
2
|
+
|
|
3
|
+
full-example exposes the same callable tools over HTTP as MCP.
|
|
4
|
+
|
|
5
|
+
## Running
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
full-example api
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Listens on **http://127.0.0.1:3000** by default (`apiServer.host` / `apiServer.port`).
|
|
12
|
+
|
|
13
|
+
Bind is localhost-only in v0 — use a reverse proxy for remote access.
|
|
14
|
+
|
|
15
|
+
## Endpoints
|
|
16
|
+
|
|
17
|
+
| Method | Path | Purpose |
|
|
18
|
+
| --- | --- | --- |
|
|
19
|
+
| `GET` | `/health` | Liveness check |
|
|
20
|
+
| `GET` | `/openapi.json` | OpenAPI 3.1 document (tool paths and request shapes) |
|
|
21
|
+
| `GET` | `/openapi-browser` | Interactive Scalar API reference |
|
|
22
|
+
| `POST` | `/tools/:name` | Invoke with flat JSON args object in the body |
|
|
23
|
+
| `OPTIONS` | `*` | CORS preflight |
|
|
24
|
+
|
|
25
|
+
Replace `{tool-key}` below with a path segment from `openapi.json` (`paths` keys are `/tools/{tool-key}`). Match body keys to that tool's `requestBody` schema in the spec.
|
|
26
|
+
|
|
27
|
+
## Examples
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
curl -s http://127.0.0.1:3000/health
|
|
31
|
+
curl -s http://127.0.0.1:3000/openapi.json
|
|
32
|
+
curl -s -X POST http://127.0.0.1:3000/tools/{tool-key} \
|
|
33
|
+
-H "content-type: application/json" \
|
|
34
|
+
-d '{...}'
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Responses
|
|
38
|
+
|
|
39
|
+
Success (`200`): raw response body (JSON object, string, or binary). No `{ ok, stdout }` envelope.
|
|
40
|
+
|
|
41
|
+
Handlers must use `ctx.respond()` or return a value for API/MCP tool calls.
|
|
42
|
+
|
|
43
|
+
Errors use `{ "error": "..." }` with `400`, `404`, `503`, or `500`.
|
|
44
|
+
|
|
45
|
+
## Configuration
|
|
46
|
+
|
|
47
|
+
Configure before first use: `full-example configure`.
|
|
48
|
+
|
|
49
|
+
Default config file: `~/.local/lib/full_example/config.json`.
|
|
50
|
+
|
|
51
|
+
- **apiToken** (`apiToken`, required → env `FULL_EXAMPLE_API_TOKEN`) — Create at https://example.com/settings/tokens
|
|
52
|
+
- **defaultRegion** (`defaultRegion`, optional) — AWS region for API calls.
|
|
53
|
+
- **maxRetries** (`maxRetries`, optional) — HTTP retry count (0–10).
|
|
54
|
+
- **prefs** (`prefs`, optional) — Local cache preferences (not exported to env).
|
|
55
|
+
|
|
56
|
+
## Exposed tools
|
|
57
|
+
|
|
58
|
+
- `echo` (MCP: `echo`, CLI: `full-example echo`) — echo — Echo a message (MCP-friendly leaf).
|
|
59
|
+
- `status` (MCP: `status`, CLI: `full-example status`) — status — Show resolved config and app version. (flags: --json)
|
|
60
|
+
|
|
61
|
+
## Tool arguments
|
|
62
|
+
|
|
63
|
+
POST bodies are a flat JSON object keyed by long option and positional names (hyphenated option names are valid keys).
|
|
64
|
+
|
|
65
|
+
For HTTP clients, use **`GET /openapi.json`** (or **`GET /openapi-browser`**) for per-tool request shapes — each `POST /tools/{name}` path has a `requestBody` schema.
|
|
66
|
+
|
|
67
|
+
Varargs positionals accept a JSON array of strings (not a comma-separated string).
|
|
68
|
+
Options with `format: comma-list` accept a comma-separated string or JSON array.
|
|
69
|
+
Options with a schema `default` are applied when omitted.
|
|
70
|
+
|
|
71
|
+
Shell invocation reference: `full-example docs api`. Full CLI tree JSON: `full-example docs cli-schema`.
|
|
72
|
+
|
|
73
|
+
## OpenAPI
|
|
74
|
+
|
|
75
|
+
The HTTP API is described in OpenAPI 3.1.
|
|
76
|
+
|
|
77
|
+
- **Browse** — [http://127.0.0.1:3000/openapi-browser](http://127.0.0.1:3000/openapi-browser) (Scalar UI; loads `/openapi.json`)
|
|
78
|
+
- **Fetch** — `curl -s http://127.0.0.1:3000/openapi.json`
|
|
79
|
+
- **Save offline** — `full-example docs openapi --save` → `./docs/openapi.json` (or `just docgen` in app repos)
|
|
80
|
+
|
|
81
|
+
Use the spec to discover tool names (`paths`) and request/response shapes before calling `POST /tools/:name`.
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
<!-- Generated by full-example docs mcp --save; do not edit. -->
|
|
2
|
+
|
|
3
|
+
# MCP server (full-example)
|
|
4
|
+
|
|
5
|
+
full-example exposes an MCP server with features similar to the CLI.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
### `configure`
|
|
10
|
+
|
|
11
|
+
Install the CLI first so `full-example` is on your PATH (e.g. `brew install full-example`). Host configs reference the app by name.
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
full-example configure --sync --yes
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Merges the server entry below into host config when each host is present:
|
|
18
|
+
|
|
19
|
+
| Host | Config file |
|
|
20
|
+
| --- | --- |
|
|
21
|
+
| Cursor | `~/.cursor/mcp.json` (when `~/.cursor` exists) |
|
|
22
|
+
| Claude Code | `~/.claude.json` |
|
|
23
|
+
| Claude Desktop | `claude_desktop_config.json` (when Claude Desktop app data exists) |
|
|
24
|
+
| OpenCode | `~/.config/opencode/*` (when `~/.config/opencode` exists) |
|
|
25
|
+
| OpenAI Codex | `~/.codex/config.toml` via `codex mcp add` (when `codex` is on PATH) |
|
|
26
|
+
| ChatGPT desktop | `chatgpt_mcp_config.json` (when ChatGPT app data exists) |
|
|
27
|
+
|
|
28
|
+
Claude Desktop paths by platform:
|
|
29
|
+
|
|
30
|
+
- **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
31
|
+
- **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
|
|
32
|
+
- **Linux:** `~/.config/Claude/claude_desktop_config.json`
|
|
33
|
+
|
|
34
|
+
ChatGPT desktop JSON (when auto-installed):
|
|
35
|
+
|
|
36
|
+
- **macOS:** `~/Library/Application Support/ChatGPT/chatgpt_mcp_config.json`
|
|
37
|
+
- **Windows:** `%APPDATA%\OpenAI\ChatGPT\chatgpt_mcp_config.json`
|
|
38
|
+
|
|
39
|
+
Restart Claude Desktop and ChatGPT desktop after changing their config files.
|
|
40
|
+
|
|
41
|
+
### Manual fallbacks
|
|
42
|
+
|
|
43
|
+
**OpenCode** (no `~/.config/opencode` yet):
|
|
44
|
+
|
|
45
|
+
```json
|
|
46
|
+
{
|
|
47
|
+
"$schema": "https://opencode.ai/config.json",
|
|
48
|
+
"mcp": {
|
|
49
|
+
"full_example": {
|
|
50
|
+
"type": "local",
|
|
51
|
+
"command": [
|
|
52
|
+
"full-example",
|
|
53
|
+
"mcp"
|
|
54
|
+
],
|
|
55
|
+
"enabled": true
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
**Codex** (`codex` not on PATH):
|
|
62
|
+
|
|
63
|
+
```toml
|
|
64
|
+
[mcp_servers.full_example]
|
|
65
|
+
command = "full-example"
|
|
66
|
+
args = ["mcp"]
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Or after installing Codex CLI: `codex mcp add full_example -- full-example mcp`.
|
|
70
|
+
|
|
71
|
+
### ChatGPT web (Connectors)
|
|
72
|
+
|
|
73
|
+
OpenAI's documented path for **ChatGPT web/desktop** is **Settings → Connectors → Developer mode** with a **remote HTTPS MCP URL** — not local stdio. ChatGPT does not spawn `full-example mcp` directly.
|
|
74
|
+
|
|
75
|
+
For local stdio, bridge and tunnel, then register the HTTPS URL in Connectors:
|
|
76
|
+
|
|
77
|
+
1. Expose `full-example mcp` over HTTP (e.g. `mcp-remote`).
|
|
78
|
+
2. Tunnel if needed (ngrok, Cloudflare Tunnel).
|
|
79
|
+
3. Add the public URL as a custom connector.
|
|
80
|
+
|
|
81
|
+
Desktop `chatgpt_mcp_config.json` is merged when the ChatGPT app is installed; support varies by build. Use Connectors when local JSON is absent or tools do not appear.
|
|
82
|
+
|
|
83
|
+
### Manual `mcpServers` entry
|
|
84
|
+
|
|
85
|
+
For Cursor, Claude, and ChatGPT desktop JSON configs, add under `mcpServers`:
|
|
86
|
+
|
|
87
|
+
```json
|
|
88
|
+
{
|
|
89
|
+
"mcpServers": {
|
|
90
|
+
"full_example": {
|
|
91
|
+
"command": "full-example",
|
|
92
|
+
"args": [
|
|
93
|
+
"mcp"
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Running directly
|
|
101
|
+
|
|
102
|
+
Start the stdio MCP server without editing host config:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
full-example mcp
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Environment
|
|
109
|
+
|
|
110
|
+
- **`shellEnv`** — on by default; captures login-shell environment at MCP startup (PATH, toolchain shims, exports). Opt out with `shellEnv: false`.
|
|
111
|
+
|
|
112
|
+
## Configuration
|
|
113
|
+
|
|
114
|
+
Configure before first use in Cursor or Claude Desktop (MCP hosts are non-interactive): `full-example configure`.
|
|
115
|
+
|
|
116
|
+
Default config file: `~/.local/lib/full_example/config.json` (flat JSON keys).
|
|
117
|
+
|
|
118
|
+
- **apiToken** (`apiToken`, required → env `FULL_EXAMPLE_API_TOKEN`) — Create at https://example.com/settings/tokens
|
|
119
|
+
- **defaultRegion** (`defaultRegion`, optional) — AWS region for API calls.
|
|
120
|
+
- **maxRetries** (`maxRetries`, optional) — HTTP retry count (0–10).
|
|
121
|
+
- **prefs** (`prefs`, optional) — Local cache preferences (not exported to env).
|
|
122
|
+
|
|
123
|
+
Example:
|
|
124
|
+
|
|
125
|
+
```typescript
|
|
126
|
+
config: {
|
|
127
|
+
schema: {
|
|
128
|
+
apiToken: { description: "…", env: "API_TOKEN", sensitive: true },
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## What agents get
|
|
134
|
+
|
|
135
|
+
| Mechanism | Purpose |
|
|
136
|
+
|-----------|---------|
|
|
137
|
+
| `tools/list` | Callable tools for exposed leaf commands |
|
|
138
|
+
| `tools/call` | Runs handlers headlessly; JSON stdout becomes `structuredContent` when valid |
|
|
139
|
+
| Schema resource | `full_example://schema` — same JSON as `full-example docs cli-schema` |
|
|
140
|
+
| Docs topic `readme` | `full_example://docs/readme` — same markdown as `full-example docs readme` |
|
|
141
|
+
|
|
142
|
+
## Exposed tools
|
|
143
|
+
|
|
144
|
+
- `full-example echo` — echo — Echo a message (MCP-friendly leaf).
|
|
145
|
+
- `full-example status` — status — Show resolved config and app version. (flags: --json)
|
|
146
|
+
|
|
147
|
+
## Tool arguments
|
|
148
|
+
|
|
149
|
+
Arguments are a flat JSON object keyed by long option and positional names (hyphenated option names are valid keys).
|
|
150
|
+
See `full-example docs cli-schema` or the schema resource for per-tool shapes.
|
|
151
|
+
|
|
152
|
+
Varargs positionals accept a JSON array of strings (not a comma-separated string).
|
|
153
|
+
Options with `format: comma-list` accept a comma-separated string or JSON array.
|
|
154
|
+
Options with a schema `default` are applied when omitted.
|
|
155
|
+
|
|
156
|
+
## Protocol
|
|
157
|
+
|
|
158
|
+
Stdio NDJSON JSON-RPC. Help and `docs cli-schema` are not available through tool calls.
|
|
159
|
+
Run `full-example docs` for bundled user documentation.
|