@mostra/mcp 0.0.0-stage → 0.10.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/LICENSE +202 -0
- package/README.md +27 -2
- package/dist/index.d.ts +283 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1405 -0
- package/dist/index.js.map +1 -0
- package/package.json +64 -3
- package/schemas/mcp-tools.draft-07.json +421 -0
- package/schemas/mcp-tools.schema.json +421 -0
- package/src/http.ts +188 -0
- package/src/index.ts +52 -0
- package/src/patch.ts +232 -0
- package/src/ports.ts +116 -0
- package/src/results.ts +45 -0
- package/src/search.ts +98 -0
- package/src/server.ts +273 -0
- package/src/tools.ts +812 -0
- package/src/workspace.ts +351 -0
|
@@ -0,0 +1,421 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"title": "Mostra's MCP tools: the input schema of each tool",
|
|
4
|
+
"x-mostra-revisions": {},
|
|
5
|
+
"definitions": {
|
|
6
|
+
"ArtifactCreateInput": {
|
|
7
|
+
"type": "object",
|
|
8
|
+
"properties": {
|
|
9
|
+
"dir": {
|
|
10
|
+
"description": "Where to create it: a directory that doesn't exist yet or is empty. Without it, a new folder in the workspace, named after the title.",
|
|
11
|
+
"type": "string",
|
|
12
|
+
"minLength": 1
|
|
13
|
+
},
|
|
14
|
+
"title": {
|
|
15
|
+
"description": "The artifact's title.",
|
|
16
|
+
"type": "string",
|
|
17
|
+
"minLength": 1,
|
|
18
|
+
"maxLength": 200
|
|
19
|
+
},
|
|
20
|
+
"template": {
|
|
21
|
+
"description": "A template to start from (none by default).",
|
|
22
|
+
"type": "string",
|
|
23
|
+
"minLength": 1
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"ArtifactListInput": {
|
|
28
|
+
"type": "object",
|
|
29
|
+
"properties": {
|
|
30
|
+
"filter": {
|
|
31
|
+
"type": "object",
|
|
32
|
+
"properties": {
|
|
33
|
+
"family": {
|
|
34
|
+
"description": "Only artifacts of this family.",
|
|
35
|
+
"type": "string",
|
|
36
|
+
"minLength": 1
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"ArtifactOpenInput": {
|
|
43
|
+
"type": "object",
|
|
44
|
+
"properties": {
|
|
45
|
+
"artifact": {
|
|
46
|
+
"type": "string",
|
|
47
|
+
"minLength": 1,
|
|
48
|
+
"description": "The artifact: its ID (art_…), or its directory as artifact_create returned it."
|
|
49
|
+
},
|
|
50
|
+
"version": {
|
|
51
|
+
"description": "A new link that opens only this version (its number or ID).",
|
|
52
|
+
"anyOf": [
|
|
53
|
+
{
|
|
54
|
+
"type": "integer",
|
|
55
|
+
"minimum": 1,
|
|
56
|
+
"maximum": 9007199254740991
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"type": "string",
|
|
60
|
+
"minLength": 1
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
"viewer": {
|
|
65
|
+
"description": "A new link for one person: their own draft and, under once per-viewer, their own submission.",
|
|
66
|
+
"type": "object",
|
|
67
|
+
"properties": {
|
|
68
|
+
"ref": {
|
|
69
|
+
"type": "string",
|
|
70
|
+
"minLength": 1,
|
|
71
|
+
"maxLength": 256,
|
|
72
|
+
"description": "Your own stable key for the person, such as their email."
|
|
73
|
+
},
|
|
74
|
+
"name": {
|
|
75
|
+
"description": "Their display name.",
|
|
76
|
+
"type": "string",
|
|
77
|
+
"minLength": 1,
|
|
78
|
+
"maxLength": 200
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
"required": [
|
|
82
|
+
"ref"
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
"scopes": {
|
|
86
|
+
"description": "A new link that allows only these: view, draft, submit, review, signal, action:*, action:<name>.",
|
|
87
|
+
"minItems": 1,
|
|
88
|
+
"type": "array",
|
|
89
|
+
"items": {
|
|
90
|
+
"type": "string",
|
|
91
|
+
"pattern": "^(view|draft|submit|review|signal|action:(\\*|[^\\s#*]+(#[^\\s#*]+)?))$"
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
"ttl": {
|
|
95
|
+
"description": "A new link that stops working after this long, such as 24h or 7d.",
|
|
96
|
+
"type": "string",
|
|
97
|
+
"pattern": "^[1-9][0-9]{0,8}[smhd]$"
|
|
98
|
+
},
|
|
99
|
+
"open": {
|
|
100
|
+
"description": "Also open the link in a browser on this computer, for the person sitting at it.",
|
|
101
|
+
"type": "boolean"
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
"required": [
|
|
105
|
+
"artifact"
|
|
106
|
+
]
|
|
107
|
+
},
|
|
108
|
+
"ArtifactPatchInput": {
|
|
109
|
+
"type": "object",
|
|
110
|
+
"properties": {
|
|
111
|
+
"dir": {
|
|
112
|
+
"type": "string",
|
|
113
|
+
"minLength": 1,
|
|
114
|
+
"description": "The artifact's directory: an absolute path, or a name inside the workspace folder (the server's instructions name it)."
|
|
115
|
+
},
|
|
116
|
+
"path": {
|
|
117
|
+
"description": "The file to change, relative to the artifact's directory. Needed with edits; with a diff, it overrides the file the diff names.",
|
|
118
|
+
"type": "string",
|
|
119
|
+
"minLength": 1
|
|
120
|
+
},
|
|
121
|
+
"edits": {
|
|
122
|
+
"description": "Exact replacements, applied in order.",
|
|
123
|
+
"minItems": 1,
|
|
124
|
+
"type": "array",
|
|
125
|
+
"items": {
|
|
126
|
+
"type": "object",
|
|
127
|
+
"properties": {
|
|
128
|
+
"old": {
|
|
129
|
+
"type": "string",
|
|
130
|
+
"description": "Text that appears exactly once in the file (empty to write a new file)."
|
|
131
|
+
},
|
|
132
|
+
"new": {
|
|
133
|
+
"type": "string",
|
|
134
|
+
"description": "What replaces it."
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
"required": [
|
|
138
|
+
"old",
|
|
139
|
+
"new"
|
|
140
|
+
]
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
"diff": {
|
|
144
|
+
"description": "A unified diff of one or more files.",
|
|
145
|
+
"type": "string",
|
|
146
|
+
"minLength": 1
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
"required": [
|
|
150
|
+
"dir"
|
|
151
|
+
]
|
|
152
|
+
},
|
|
153
|
+
"ArtifactPublishInput": {
|
|
154
|
+
"type": "object",
|
|
155
|
+
"properties": {
|
|
156
|
+
"dir": {
|
|
157
|
+
"type": "string",
|
|
158
|
+
"minLength": 1,
|
|
159
|
+
"description": "The artifact's directory: an absolute path, or a name inside the workspace folder (the server's instructions name it)."
|
|
160
|
+
},
|
|
161
|
+
"force": {
|
|
162
|
+
"description": "Publish even though verify reports errors; the version records them.",
|
|
163
|
+
"type": "boolean"
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
"required": [
|
|
167
|
+
"dir"
|
|
168
|
+
]
|
|
169
|
+
},
|
|
170
|
+
"ArtifactResultsInput": {
|
|
171
|
+
"type": "object",
|
|
172
|
+
"properties": {
|
|
173
|
+
"artifact": {
|
|
174
|
+
"type": "string",
|
|
175
|
+
"minLength": 1,
|
|
176
|
+
"description": "The artifact: its ID (art_…), or its directory as artifact_create returned it."
|
|
177
|
+
},
|
|
178
|
+
"submission": {
|
|
179
|
+
"description": "A submission's ID (sub_…); the latest by default.",
|
|
180
|
+
"type": "string",
|
|
181
|
+
"minLength": 1
|
|
182
|
+
},
|
|
183
|
+
"format": {
|
|
184
|
+
"description": "md (the default): Markdown to read; json: the full Results structure.",
|
|
185
|
+
"type": "string",
|
|
186
|
+
"enum": [
|
|
187
|
+
"md",
|
|
188
|
+
"json"
|
|
189
|
+
]
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
"required": [
|
|
193
|
+
"artifact"
|
|
194
|
+
]
|
|
195
|
+
},
|
|
196
|
+
"ArtifactVerifyInput": {
|
|
197
|
+
"type": "object",
|
|
198
|
+
"properties": {
|
|
199
|
+
"dir": {
|
|
200
|
+
"type": "string",
|
|
201
|
+
"minLength": 1,
|
|
202
|
+
"description": "The artifact's directory: an absolute path, or a name inside the workspace folder (the server's instructions name it)."
|
|
203
|
+
},
|
|
204
|
+
"screenshots": {
|
|
205
|
+
"description": "Which screenshots come back as images: on-failure (the default), always (to look at the page), or never.",
|
|
206
|
+
"type": "string",
|
|
207
|
+
"enum": [
|
|
208
|
+
"on-failure",
|
|
209
|
+
"always",
|
|
210
|
+
"never"
|
|
211
|
+
]
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
"required": [
|
|
215
|
+
"dir"
|
|
216
|
+
]
|
|
217
|
+
},
|
|
218
|
+
"ArtifactWaitInput": {
|
|
219
|
+
"type": "object",
|
|
220
|
+
"properties": {
|
|
221
|
+
"artifact": {
|
|
222
|
+
"type": "string",
|
|
223
|
+
"minLength": 1,
|
|
224
|
+
"description": "The artifact: its ID (art_…), or its directory as artifact_create returned it."
|
|
225
|
+
},
|
|
226
|
+
"until": {
|
|
227
|
+
"type": "string",
|
|
228
|
+
"pattern": "^(submitted|signal:[A-Za-z0-9][A-Za-z0-9._-]{0,63}|state:[^\\u0000-\\u001f\\u007f]{1,256}|event:[a-z][a-zA-Z0-9_-]*(\\.[a-zA-Z0-9_-]+)*(\\.\\*)?)$",
|
|
229
|
+
"description": "submitted, signal:<name>, state:<fieldId> or event:<type> (event:submission.* matches a family)."
|
|
230
|
+
},
|
|
231
|
+
"after": {
|
|
232
|
+
"description": "Wait for what happens after this cursor: the one a previous wait returned.",
|
|
233
|
+
"type": "string",
|
|
234
|
+
"pattern": "^[0-9]{1,20}$"
|
|
235
|
+
},
|
|
236
|
+
"timeoutSeconds": {
|
|
237
|
+
"description": "How long to wait, at most 50 seconds (the default); 0 checks once.",
|
|
238
|
+
"type": "integer",
|
|
239
|
+
"minimum": 0,
|
|
240
|
+
"maximum": 50
|
|
241
|
+
}
|
|
242
|
+
},
|
|
243
|
+
"required": [
|
|
244
|
+
"artifact",
|
|
245
|
+
"until"
|
|
246
|
+
]
|
|
247
|
+
},
|
|
248
|
+
"ArtifactWriteInput": {
|
|
249
|
+
"type": "object",
|
|
250
|
+
"properties": {
|
|
251
|
+
"dir": {
|
|
252
|
+
"type": "string",
|
|
253
|
+
"minLength": 1,
|
|
254
|
+
"description": "The artifact's directory: an absolute path, or a name inside the workspace folder (the server's instructions name it)."
|
|
255
|
+
},
|
|
256
|
+
"files": {
|
|
257
|
+
"default": [],
|
|
258
|
+
"description": "Files to write, each replaced whole.",
|
|
259
|
+
"type": "array",
|
|
260
|
+
"items": {
|
|
261
|
+
"type": "object",
|
|
262
|
+
"properties": {
|
|
263
|
+
"path": {
|
|
264
|
+
"type": "string",
|
|
265
|
+
"minLength": 1,
|
|
266
|
+
"description": "Relative to the artifact's directory, such as index.tsx or components/chart.tsx."
|
|
267
|
+
},
|
|
268
|
+
"content": {
|
|
269
|
+
"type": "string",
|
|
270
|
+
"description": "The file's whole content."
|
|
271
|
+
},
|
|
272
|
+
"encoding": {
|
|
273
|
+
"description": "utf8 (the default) for text; base64 for an image or other binary file.",
|
|
274
|
+
"type": "string",
|
|
275
|
+
"enum": [
|
|
276
|
+
"utf8",
|
|
277
|
+
"base64"
|
|
278
|
+
]
|
|
279
|
+
}
|
|
280
|
+
},
|
|
281
|
+
"required": [
|
|
282
|
+
"path",
|
|
283
|
+
"content"
|
|
284
|
+
]
|
|
285
|
+
}
|
|
286
|
+
},
|
|
287
|
+
"deletes": {
|
|
288
|
+
"description": "Files to delete, relative to the artifact's directory.",
|
|
289
|
+
"type": "array",
|
|
290
|
+
"items": {
|
|
291
|
+
"type": "string",
|
|
292
|
+
"minLength": 1
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
},
|
|
296
|
+
"required": [
|
|
297
|
+
"dir"
|
|
298
|
+
]
|
|
299
|
+
},
|
|
300
|
+
"DocsSearchInput": {
|
|
301
|
+
"type": "object",
|
|
302
|
+
"properties": {
|
|
303
|
+
"query": {
|
|
304
|
+
"description": "What you want to know, in a few words.",
|
|
305
|
+
"type": "string",
|
|
306
|
+
"minLength": 1,
|
|
307
|
+
"maxLength": 500
|
|
308
|
+
},
|
|
309
|
+
"topic": {
|
|
310
|
+
"description": "A topic to read whole instead, such as guide, guide/answers or a diagnostic code.",
|
|
311
|
+
"type": "string",
|
|
312
|
+
"minLength": 1,
|
|
313
|
+
"maxLength": 128
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
},
|
|
317
|
+
"LivePushInput": {
|
|
318
|
+
"type": "object",
|
|
319
|
+
"properties": {
|
|
320
|
+
"artifact": {
|
|
321
|
+
"type": "string",
|
|
322
|
+
"minLength": 1,
|
|
323
|
+
"description": "The artifact: its ID (art_…), or its directory as artifact_create returned it."
|
|
324
|
+
},
|
|
325
|
+
"key": {
|
|
326
|
+
"type": "string",
|
|
327
|
+
"minLength": 1,
|
|
328
|
+
"maxLength": 128,
|
|
329
|
+
"description": "The live source's key."
|
|
330
|
+
},
|
|
331
|
+
"value": {
|
|
332
|
+
"description": "Any JSON value, at most 4 MiB."
|
|
333
|
+
},
|
|
334
|
+
"mode": {
|
|
335
|
+
"description": "replace (the default): the new latest value; append: also kept in the source's ring.",
|
|
336
|
+
"type": "string",
|
|
337
|
+
"enum": [
|
|
338
|
+
"replace",
|
|
339
|
+
"append"
|
|
340
|
+
]
|
|
341
|
+
}
|
|
342
|
+
},
|
|
343
|
+
"required": [
|
|
344
|
+
"artifact",
|
|
345
|
+
"key",
|
|
346
|
+
"value"
|
|
347
|
+
]
|
|
348
|
+
},
|
|
349
|
+
"StateGetInput": {
|
|
350
|
+
"type": "object",
|
|
351
|
+
"properties": {
|
|
352
|
+
"artifact": {
|
|
353
|
+
"type": "string",
|
|
354
|
+
"minLength": 1,
|
|
355
|
+
"description": "The artifact: its ID (art_…), or its directory as artifact_create returned it."
|
|
356
|
+
},
|
|
357
|
+
"ids": {
|
|
358
|
+
"description": "Only these field IDs; every field by default.",
|
|
359
|
+
"type": "array",
|
|
360
|
+
"items": {
|
|
361
|
+
"type": "string",
|
|
362
|
+
"minLength": 1
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
},
|
|
366
|
+
"required": [
|
|
367
|
+
"artifact"
|
|
368
|
+
]
|
|
369
|
+
},
|
|
370
|
+
"StatePatchInput": {
|
|
371
|
+
"type": "object",
|
|
372
|
+
"properties": {
|
|
373
|
+
"artifact": {
|
|
374
|
+
"type": "string",
|
|
375
|
+
"minLength": 1,
|
|
376
|
+
"description": "The artifact: its ID (art_…), or its directory as artifact_create returned it."
|
|
377
|
+
},
|
|
378
|
+
"ops": {
|
|
379
|
+
"minItems": 1,
|
|
380
|
+
"type": "array",
|
|
381
|
+
"items": {
|
|
382
|
+
"type": "object",
|
|
383
|
+
"properties": {
|
|
384
|
+
"id": {
|
|
385
|
+
"type": "string",
|
|
386
|
+
"minLength": 1,
|
|
387
|
+
"description": "The field ID."
|
|
388
|
+
},
|
|
389
|
+
"value": {
|
|
390
|
+
"description": "The new value, any JSON."
|
|
391
|
+
},
|
|
392
|
+
"delete": {
|
|
393
|
+
"description": "Remove the field instead.",
|
|
394
|
+
"type": "boolean",
|
|
395
|
+
"const": true
|
|
396
|
+
}
|
|
397
|
+
},
|
|
398
|
+
"required": [
|
|
399
|
+
"id"
|
|
400
|
+
]
|
|
401
|
+
},
|
|
402
|
+
"description": "The changes, applied together."
|
|
403
|
+
},
|
|
404
|
+
"baseRevision": {
|
|
405
|
+
"description": "The revision you last read: fields changed after it aren't overwritten and come back in conflicts.",
|
|
406
|
+
"type": "string",
|
|
407
|
+
"minLength": 1
|
|
408
|
+
},
|
|
409
|
+
"mutationId": {
|
|
410
|
+
"description": "Your ID for this change (mut_ and a ULID), so a retry applies it once; one is made when you leave it out.",
|
|
411
|
+
"type": "string",
|
|
412
|
+
"pattern": "^mut_[0-7][0-9A-HJKMNP-TV-Z]{25}$"
|
|
413
|
+
}
|
|
414
|
+
},
|
|
415
|
+
"required": [
|
|
416
|
+
"artifact",
|
|
417
|
+
"ops"
|
|
418
|
+
]
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
}
|