caplets 0.2.1 → 0.4.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 +139 -20
- package/dist/index.js +21457 -3608
- package/package.json +4 -1
- package/schemas/caplet.schema.json +286 -0
- package/schemas/caplets-config.schema.json +130 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "caplets",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Progressive disclosure gateway for MCP servers.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"caplets",
|
|
@@ -37,8 +37,11 @@
|
|
|
37
37
|
"access": "public"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
+
"@apidevtools/swagger-parser": "^12.1.0",
|
|
40
41
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
41
42
|
"commander": "^14.0.3",
|
|
43
|
+
"vfile": "^6.0.3",
|
|
44
|
+
"vfile-matter": "^5.0.1",
|
|
42
45
|
"zod": "^4.4.3"
|
|
43
46
|
},
|
|
44
47
|
"devDependencies": {
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://raw.githubusercontent.com/spiritledsoftware/caplets/main/schemas/caplet.schema.json",
|
|
4
|
+
"title": "Caplet file frontmatter",
|
|
5
|
+
"description": "YAML frontmatter schema for a Markdown Caplet file.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"$schema": {
|
|
9
|
+
"description": "Optional JSON Schema URL for editor validation.",
|
|
10
|
+
"type": "string",
|
|
11
|
+
"format": "uri"
|
|
12
|
+
},
|
|
13
|
+
"name": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"minLength": 1,
|
|
16
|
+
"maxLength": 80,
|
|
17
|
+
"description": "Human-readable Caplet display name."
|
|
18
|
+
},
|
|
19
|
+
"description": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"description": "Compact capability description shown before the full Caplet card is disclosed."
|
|
22
|
+
},
|
|
23
|
+
"tags": {
|
|
24
|
+
"description": "Optional tags for grouping or searching Caplets.",
|
|
25
|
+
"type": "array",
|
|
26
|
+
"items": {
|
|
27
|
+
"type": "string",
|
|
28
|
+
"minLength": 1,
|
|
29
|
+
"maxLength": 80
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"mcpServer": {
|
|
33
|
+
"type": "object",
|
|
34
|
+
"properties": {
|
|
35
|
+
"transport": {
|
|
36
|
+
"description": "Downstream MCP transport. Defaults to stdio when command is present.",
|
|
37
|
+
"type": "string",
|
|
38
|
+
"enum": ["stdio", "http", "sse"]
|
|
39
|
+
},
|
|
40
|
+
"command": {
|
|
41
|
+
"description": "Executable command for stdio servers.",
|
|
42
|
+
"type": "string",
|
|
43
|
+
"minLength": 1
|
|
44
|
+
},
|
|
45
|
+
"args": {
|
|
46
|
+
"description": "Arguments passed to the stdio command.",
|
|
47
|
+
"type": "array",
|
|
48
|
+
"items": {
|
|
49
|
+
"type": "string"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"env": {
|
|
53
|
+
"description": "Environment variables for stdio servers. Supports ${VAR} and $env:VAR.",
|
|
54
|
+
"type": "object",
|
|
55
|
+
"propertyNames": {
|
|
56
|
+
"type": "string"
|
|
57
|
+
},
|
|
58
|
+
"additionalProperties": {
|
|
59
|
+
"type": "string"
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"cwd": {
|
|
63
|
+
"description": "Working directory for stdio servers.",
|
|
64
|
+
"type": "string",
|
|
65
|
+
"minLength": 1
|
|
66
|
+
},
|
|
67
|
+
"url": {
|
|
68
|
+
"description": "Remote MCP server URL for http or sse transport.",
|
|
69
|
+
"type": "string",
|
|
70
|
+
"minLength": 1
|
|
71
|
+
},
|
|
72
|
+
"auth": {
|
|
73
|
+
"oneOf": [
|
|
74
|
+
{
|
|
75
|
+
"type": "object",
|
|
76
|
+
"properties": {
|
|
77
|
+
"type": {
|
|
78
|
+
"type": "string",
|
|
79
|
+
"const": "none"
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
"required": ["type"],
|
|
83
|
+
"additionalProperties": false
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"type": "object",
|
|
87
|
+
"properties": {
|
|
88
|
+
"type": {
|
|
89
|
+
"type": "string",
|
|
90
|
+
"const": "bearer"
|
|
91
|
+
},
|
|
92
|
+
"token": {
|
|
93
|
+
"type": "string",
|
|
94
|
+
"minLength": 1
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
"required": ["type", "token"],
|
|
98
|
+
"additionalProperties": false
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"type": "object",
|
|
102
|
+
"properties": {
|
|
103
|
+
"type": {
|
|
104
|
+
"type": "string",
|
|
105
|
+
"const": "headers"
|
|
106
|
+
},
|
|
107
|
+
"headers": {
|
|
108
|
+
"type": "object",
|
|
109
|
+
"propertyNames": {
|
|
110
|
+
"type": "string"
|
|
111
|
+
},
|
|
112
|
+
"additionalProperties": {
|
|
113
|
+
"type": "string",
|
|
114
|
+
"minLength": 1
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
"required": ["type", "headers"],
|
|
119
|
+
"additionalProperties": false
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"type": "object",
|
|
123
|
+
"properties": {
|
|
124
|
+
"type": {
|
|
125
|
+
"type": "string",
|
|
126
|
+
"const": "oauth2"
|
|
127
|
+
},
|
|
128
|
+
"authorizationUrl": {
|
|
129
|
+
"type": "string",
|
|
130
|
+
"minLength": 1
|
|
131
|
+
},
|
|
132
|
+
"tokenUrl": {
|
|
133
|
+
"type": "string",
|
|
134
|
+
"minLength": 1
|
|
135
|
+
},
|
|
136
|
+
"issuer": {
|
|
137
|
+
"type": "string",
|
|
138
|
+
"minLength": 1
|
|
139
|
+
},
|
|
140
|
+
"clientId": {
|
|
141
|
+
"type": "string",
|
|
142
|
+
"minLength": 1
|
|
143
|
+
},
|
|
144
|
+
"clientSecret": {
|
|
145
|
+
"type": "string",
|
|
146
|
+
"minLength": 1
|
|
147
|
+
},
|
|
148
|
+
"scopes": {
|
|
149
|
+
"type": "array",
|
|
150
|
+
"items": {
|
|
151
|
+
"type": "string",
|
|
152
|
+
"minLength": 1
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
"redirectUri": {
|
|
156
|
+
"type": "string",
|
|
157
|
+
"minLength": 1
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
"required": ["type"],
|
|
161
|
+
"additionalProperties": false
|
|
162
|
+
}
|
|
163
|
+
],
|
|
164
|
+
"description": "Authentication settings for a remote MCP server."
|
|
165
|
+
},
|
|
166
|
+
"startupTimeoutMs": {
|
|
167
|
+
"description": "Timeout in milliseconds for starting or checking a downstream server.",
|
|
168
|
+
"type": "integer",
|
|
169
|
+
"exclusiveMinimum": 0,
|
|
170
|
+
"maximum": 9007199254740991
|
|
171
|
+
},
|
|
172
|
+
"callTimeoutMs": {
|
|
173
|
+
"description": "Timeout in milliseconds for downstream tool calls.",
|
|
174
|
+
"type": "integer",
|
|
175
|
+
"exclusiveMinimum": 0,
|
|
176
|
+
"maximum": 9007199254740991
|
|
177
|
+
},
|
|
178
|
+
"toolCacheTtlMs": {
|
|
179
|
+
"description": "Milliseconds downstream tool metadata stays fresh. Set 0 to refresh every time.",
|
|
180
|
+
"type": "integer",
|
|
181
|
+
"minimum": 0,
|
|
182
|
+
"maximum": 9007199254740991
|
|
183
|
+
},
|
|
184
|
+
"disabled": {
|
|
185
|
+
"description": "When true, omit this Caplet from discovery and do not start its MCP server.",
|
|
186
|
+
"type": "boolean"
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
"additionalProperties": false,
|
|
190
|
+
"description": "MCP server backend configuration for this Caplet."
|
|
191
|
+
},
|
|
192
|
+
"openapiEndpoint": {
|
|
193
|
+
"type": "object",
|
|
194
|
+
"properties": {
|
|
195
|
+
"specPath": {
|
|
196
|
+
"description": "Local OpenAPI specification path.",
|
|
197
|
+
"type": "string",
|
|
198
|
+
"minLength": 1
|
|
199
|
+
},
|
|
200
|
+
"specUrl": {
|
|
201
|
+
"description": "Remote OpenAPI specification URL.",
|
|
202
|
+
"type": "string",
|
|
203
|
+
"minLength": 1
|
|
204
|
+
},
|
|
205
|
+
"baseUrl": {
|
|
206
|
+
"description": "Override base URL for OpenAPI requests.",
|
|
207
|
+
"type": "string",
|
|
208
|
+
"minLength": 1
|
|
209
|
+
},
|
|
210
|
+
"auth": {
|
|
211
|
+
"oneOf": [
|
|
212
|
+
{
|
|
213
|
+
"type": "object",
|
|
214
|
+
"properties": {
|
|
215
|
+
"type": {
|
|
216
|
+
"type": "string",
|
|
217
|
+
"const": "none"
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
"required": ["type"],
|
|
221
|
+
"additionalProperties": false
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
"type": "object",
|
|
225
|
+
"properties": {
|
|
226
|
+
"type": {
|
|
227
|
+
"type": "string",
|
|
228
|
+
"const": "bearer"
|
|
229
|
+
},
|
|
230
|
+
"token": {
|
|
231
|
+
"type": "string",
|
|
232
|
+
"minLength": 1
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
"required": ["type", "token"],
|
|
236
|
+
"additionalProperties": false
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
"type": "object",
|
|
240
|
+
"properties": {
|
|
241
|
+
"type": {
|
|
242
|
+
"type": "string",
|
|
243
|
+
"const": "headers"
|
|
244
|
+
},
|
|
245
|
+
"headers": {
|
|
246
|
+
"type": "object",
|
|
247
|
+
"propertyNames": {
|
|
248
|
+
"type": "string"
|
|
249
|
+
},
|
|
250
|
+
"additionalProperties": {
|
|
251
|
+
"type": "string",
|
|
252
|
+
"minLength": 1
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
},
|
|
256
|
+
"required": ["type", "headers"],
|
|
257
|
+
"additionalProperties": false
|
|
258
|
+
}
|
|
259
|
+
],
|
|
260
|
+
"description": "Explicit OpenAPI request auth config. Use {\"type\":\"none\"} for public APIs."
|
|
261
|
+
},
|
|
262
|
+
"requestTimeoutMs": {
|
|
263
|
+
"description": "Timeout in milliseconds for OpenAPI HTTP requests.",
|
|
264
|
+
"type": "integer",
|
|
265
|
+
"exclusiveMinimum": 0,
|
|
266
|
+
"maximum": 9007199254740991
|
|
267
|
+
},
|
|
268
|
+
"operationCacheTtlMs": {
|
|
269
|
+
"description": "Milliseconds OpenAPI operation metadata stays fresh. Set 0 to refresh every time.",
|
|
270
|
+
"type": "integer",
|
|
271
|
+
"minimum": 0,
|
|
272
|
+
"maximum": 9007199254740991
|
|
273
|
+
},
|
|
274
|
+
"disabled": {
|
|
275
|
+
"description": "When true, omit this Caplet from discovery.",
|
|
276
|
+
"type": "boolean"
|
|
277
|
+
}
|
|
278
|
+
},
|
|
279
|
+
"required": ["auth"],
|
|
280
|
+
"additionalProperties": false,
|
|
281
|
+
"description": "OpenAPI endpoint backend configuration for this Caplet."
|
|
282
|
+
}
|
|
283
|
+
},
|
|
284
|
+
"required": ["name", "description"],
|
|
285
|
+
"additionalProperties": false
|
|
286
|
+
}
|
|
@@ -31,6 +31,8 @@
|
|
|
31
31
|
"maximum": 50
|
|
32
32
|
},
|
|
33
33
|
"mcpServers": {
|
|
34
|
+
"default": {},
|
|
35
|
+
"description": "Downstream MCP servers keyed by stable server ID.",
|
|
34
36
|
"type": "object",
|
|
35
37
|
"propertyNames": {
|
|
36
38
|
"type": "string",
|
|
@@ -180,6 +182,14 @@
|
|
|
180
182
|
],
|
|
181
183
|
"description": "Authentication settings for a remote MCP server."
|
|
182
184
|
},
|
|
185
|
+
"tags": {
|
|
186
|
+
"type": "array",
|
|
187
|
+
"items": {
|
|
188
|
+
"type": "string",
|
|
189
|
+
"minLength": 1,
|
|
190
|
+
"maxLength": 80
|
|
191
|
+
}
|
|
192
|
+
},
|
|
183
193
|
"startupTimeoutMs": {
|
|
184
194
|
"default": 10000,
|
|
185
195
|
"description": "Timeout in milliseconds for starting or checking a downstream server.",
|
|
@@ -209,10 +219,128 @@
|
|
|
209
219
|
},
|
|
210
220
|
"required": ["name", "description"],
|
|
211
221
|
"additionalProperties": false
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
"openapiEndpoints": {
|
|
225
|
+
"default": {},
|
|
226
|
+
"description": "OpenAPI endpoints keyed by stable Caplet ID.",
|
|
227
|
+
"type": "object",
|
|
228
|
+
"propertyNames": {
|
|
229
|
+
"type": "string",
|
|
230
|
+
"pattern": "^[a-zA-Z0-9_-]{1,64}$"
|
|
212
231
|
},
|
|
213
|
-
"
|
|
232
|
+
"additionalProperties": {
|
|
233
|
+
"type": "object",
|
|
234
|
+
"properties": {
|
|
235
|
+
"name": {
|
|
236
|
+
"type": "string",
|
|
237
|
+
"minLength": 1,
|
|
238
|
+
"maxLength": 80,
|
|
239
|
+
"description": "Human-readable OpenAPI display name."
|
|
240
|
+
},
|
|
241
|
+
"description": {
|
|
242
|
+
"type": "string",
|
|
243
|
+
"description": "Capability description shown to agents before OpenAPI operations are disclosed."
|
|
244
|
+
},
|
|
245
|
+
"specPath": {
|
|
246
|
+
"description": "Local OpenAPI specification path.",
|
|
247
|
+
"type": "string",
|
|
248
|
+
"minLength": 1
|
|
249
|
+
},
|
|
250
|
+
"specUrl": {
|
|
251
|
+
"description": "Remote OpenAPI specification URL.",
|
|
252
|
+
"type": "string",
|
|
253
|
+
"format": "uri"
|
|
254
|
+
},
|
|
255
|
+
"baseUrl": {
|
|
256
|
+
"description": "Override base URL for OpenAPI requests.",
|
|
257
|
+
"type": "string",
|
|
258
|
+
"format": "uri"
|
|
259
|
+
},
|
|
260
|
+
"auth": {
|
|
261
|
+
"oneOf": [
|
|
262
|
+
{
|
|
263
|
+
"type": "object",
|
|
264
|
+
"properties": {
|
|
265
|
+
"type": {
|
|
266
|
+
"type": "string",
|
|
267
|
+
"const": "none"
|
|
268
|
+
}
|
|
269
|
+
},
|
|
270
|
+
"required": ["type"],
|
|
271
|
+
"additionalProperties": false
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
"type": "object",
|
|
275
|
+
"properties": {
|
|
276
|
+
"type": {
|
|
277
|
+
"type": "string",
|
|
278
|
+
"const": "bearer"
|
|
279
|
+
},
|
|
280
|
+
"token": {
|
|
281
|
+
"type": "string",
|
|
282
|
+
"minLength": 1
|
|
283
|
+
}
|
|
284
|
+
},
|
|
285
|
+
"required": ["type", "token"],
|
|
286
|
+
"additionalProperties": false
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
"type": "object",
|
|
290
|
+
"properties": {
|
|
291
|
+
"type": {
|
|
292
|
+
"type": "string",
|
|
293
|
+
"const": "headers"
|
|
294
|
+
},
|
|
295
|
+
"headers": {
|
|
296
|
+
"type": "object",
|
|
297
|
+
"propertyNames": {
|
|
298
|
+
"type": "string"
|
|
299
|
+
},
|
|
300
|
+
"additionalProperties": {
|
|
301
|
+
"type": "string",
|
|
302
|
+
"minLength": 1
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
},
|
|
306
|
+
"required": ["type", "headers"],
|
|
307
|
+
"additionalProperties": false
|
|
308
|
+
}
|
|
309
|
+
],
|
|
310
|
+
"description": "Explicit OpenAPI request auth config. Use {\"type\":\"none\"} for public APIs."
|
|
311
|
+
},
|
|
312
|
+
"tags": {
|
|
313
|
+
"type": "array",
|
|
314
|
+
"items": {
|
|
315
|
+
"type": "string",
|
|
316
|
+
"minLength": 1,
|
|
317
|
+
"maxLength": 80
|
|
318
|
+
}
|
|
319
|
+
},
|
|
320
|
+
"requestTimeoutMs": {
|
|
321
|
+
"default": 60000,
|
|
322
|
+
"description": "Timeout in milliseconds for OpenAPI HTTP requests.",
|
|
323
|
+
"type": "integer",
|
|
324
|
+
"exclusiveMinimum": 0,
|
|
325
|
+
"maximum": 9007199254740991
|
|
326
|
+
},
|
|
327
|
+
"operationCacheTtlMs": {
|
|
328
|
+
"default": 30000,
|
|
329
|
+
"description": "Milliseconds OpenAPI operation metadata stays fresh. Set 0 to refresh every time.",
|
|
330
|
+
"type": "integer",
|
|
331
|
+
"minimum": 0,
|
|
332
|
+
"maximum": 9007199254740991
|
|
333
|
+
},
|
|
334
|
+
"disabled": {
|
|
335
|
+
"default": false,
|
|
336
|
+
"description": "When true, omit this OpenAPI Caplet from discovery.",
|
|
337
|
+
"type": "boolean"
|
|
338
|
+
}
|
|
339
|
+
},
|
|
340
|
+
"required": ["name", "description", "auth"],
|
|
341
|
+
"additionalProperties": false
|
|
342
|
+
}
|
|
214
343
|
}
|
|
215
344
|
},
|
|
216
|
-
"required": ["mcpServers"],
|
|
217
345
|
"additionalProperties": false
|
|
218
346
|
}
|