@docxkit/mcp 0.3.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 +21 -0
- package/README.md +18 -0
- package/dist/index.d.ts +1301 -0
- package/dist/index.js +793 -0
- package/package.json +49 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1301 @@
|
|
|
1
|
+
import { AiTemplateInfo } from "@docxkit/ai";
|
|
2
|
+
import { DocxPlugin, DocxSchema } from "@docxkit/core";
|
|
3
|
+
|
|
4
|
+
//#region src/resources/schema.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* MCP resource: DocxSchema JSON Schema.
|
|
7
|
+
*
|
|
8
|
+
* Provides a complete JSON Schema for the DocxSchema type,
|
|
9
|
+
* enabling LLMs to understand the expected document structure.
|
|
10
|
+
*
|
|
11
|
+
* @module mcp-server/resources/schema
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* DocxSchema JSON Schema for MCP resource exposure.
|
|
15
|
+
*
|
|
16
|
+
* This schema describes the expected structure of a
|
|
17
|
+
* docx-kit document schema, suitable for LLM reference.
|
|
18
|
+
*/
|
|
19
|
+
declare const docxSchemaResource: {
|
|
20
|
+
mimeType: string;
|
|
21
|
+
name: string;
|
|
22
|
+
description: string;
|
|
23
|
+
schema: {
|
|
24
|
+
$id: string;
|
|
25
|
+
$schema: string;
|
|
26
|
+
description: string;
|
|
27
|
+
required: string[];
|
|
28
|
+
title: string;
|
|
29
|
+
type: string;
|
|
30
|
+
definitions: {
|
|
31
|
+
blockNode: {
|
|
32
|
+
oneOf: ({
|
|
33
|
+
description: string;
|
|
34
|
+
required: string[];
|
|
35
|
+
type: string;
|
|
36
|
+
properties: {
|
|
37
|
+
type: {
|
|
38
|
+
const: string;
|
|
39
|
+
};
|
|
40
|
+
items: {
|
|
41
|
+
items: {
|
|
42
|
+
type: string;
|
|
43
|
+
};
|
|
44
|
+
type: string;
|
|
45
|
+
};
|
|
46
|
+
className?: undefined;
|
|
47
|
+
level?: undefined;
|
|
48
|
+
style?: undefined;
|
|
49
|
+
text?: undefined;
|
|
50
|
+
url?: undefined;
|
|
51
|
+
children?: undefined;
|
|
52
|
+
alt?: undefined;
|
|
53
|
+
data?: undefined;
|
|
54
|
+
height?: undefined;
|
|
55
|
+
width?: undefined;
|
|
56
|
+
imageType?: undefined;
|
|
57
|
+
name?: undefined;
|
|
58
|
+
options?: undefined;
|
|
59
|
+
config?: undefined;
|
|
60
|
+
header?: undefined;
|
|
61
|
+
striped?: undefined;
|
|
62
|
+
columns?: undefined;
|
|
63
|
+
};
|
|
64
|
+
} | {
|
|
65
|
+
description: string;
|
|
66
|
+
required: string[];
|
|
67
|
+
type: string;
|
|
68
|
+
properties: {
|
|
69
|
+
className: {
|
|
70
|
+
type: string;
|
|
71
|
+
};
|
|
72
|
+
level: {
|
|
73
|
+
enum: number[];
|
|
74
|
+
type: string;
|
|
75
|
+
};
|
|
76
|
+
style: {
|
|
77
|
+
additionalProperties: boolean;
|
|
78
|
+
type: string;
|
|
79
|
+
};
|
|
80
|
+
text: {
|
|
81
|
+
type: string;
|
|
82
|
+
};
|
|
83
|
+
type: {
|
|
84
|
+
const: string;
|
|
85
|
+
};
|
|
86
|
+
items?: undefined;
|
|
87
|
+
url?: undefined;
|
|
88
|
+
children?: undefined;
|
|
89
|
+
alt?: undefined;
|
|
90
|
+
data?: undefined;
|
|
91
|
+
height?: undefined;
|
|
92
|
+
width?: undefined;
|
|
93
|
+
imageType?: undefined;
|
|
94
|
+
name?: undefined;
|
|
95
|
+
options?: undefined;
|
|
96
|
+
config?: undefined;
|
|
97
|
+
header?: undefined;
|
|
98
|
+
striped?: undefined;
|
|
99
|
+
columns?: undefined;
|
|
100
|
+
};
|
|
101
|
+
} | {
|
|
102
|
+
description: string;
|
|
103
|
+
required: string[];
|
|
104
|
+
type: string;
|
|
105
|
+
properties: {
|
|
106
|
+
type: {
|
|
107
|
+
const: string;
|
|
108
|
+
};
|
|
109
|
+
url: {
|
|
110
|
+
type: string;
|
|
111
|
+
};
|
|
112
|
+
children: {
|
|
113
|
+
items: {
|
|
114
|
+
type: string;
|
|
115
|
+
additionalProperties?: undefined;
|
|
116
|
+
};
|
|
117
|
+
type: string;
|
|
118
|
+
};
|
|
119
|
+
items?: undefined;
|
|
120
|
+
className?: undefined;
|
|
121
|
+
level?: undefined;
|
|
122
|
+
style?: undefined;
|
|
123
|
+
text?: undefined;
|
|
124
|
+
alt?: undefined;
|
|
125
|
+
data?: undefined;
|
|
126
|
+
height?: undefined;
|
|
127
|
+
width?: undefined;
|
|
128
|
+
imageType?: undefined;
|
|
129
|
+
name?: undefined;
|
|
130
|
+
options?: undefined;
|
|
131
|
+
config?: undefined;
|
|
132
|
+
header?: undefined;
|
|
133
|
+
striped?: undefined;
|
|
134
|
+
columns?: undefined;
|
|
135
|
+
};
|
|
136
|
+
} | {
|
|
137
|
+
description: string;
|
|
138
|
+
required: string[];
|
|
139
|
+
type: string;
|
|
140
|
+
properties: {
|
|
141
|
+
alt: {
|
|
142
|
+
type: string;
|
|
143
|
+
};
|
|
144
|
+
data: {
|
|
145
|
+
type: string;
|
|
146
|
+
items?: undefined;
|
|
147
|
+
};
|
|
148
|
+
height: {
|
|
149
|
+
type: string;
|
|
150
|
+
};
|
|
151
|
+
type: {
|
|
152
|
+
const: string;
|
|
153
|
+
};
|
|
154
|
+
width: {
|
|
155
|
+
type: string;
|
|
156
|
+
};
|
|
157
|
+
imageType: {
|
|
158
|
+
enum: string[];
|
|
159
|
+
type: string;
|
|
160
|
+
};
|
|
161
|
+
items?: undefined;
|
|
162
|
+
className?: undefined;
|
|
163
|
+
level?: undefined;
|
|
164
|
+
style?: undefined;
|
|
165
|
+
text?: undefined;
|
|
166
|
+
url?: undefined;
|
|
167
|
+
children?: undefined;
|
|
168
|
+
name?: undefined;
|
|
169
|
+
options?: undefined;
|
|
170
|
+
config?: undefined;
|
|
171
|
+
header?: undefined;
|
|
172
|
+
striped?: undefined;
|
|
173
|
+
columns?: undefined;
|
|
174
|
+
};
|
|
175
|
+
} | {
|
|
176
|
+
description: string;
|
|
177
|
+
properties: {
|
|
178
|
+
type: {
|
|
179
|
+
const: string;
|
|
180
|
+
};
|
|
181
|
+
items?: undefined;
|
|
182
|
+
className?: undefined;
|
|
183
|
+
level?: undefined;
|
|
184
|
+
style?: undefined;
|
|
185
|
+
text?: undefined;
|
|
186
|
+
url?: undefined;
|
|
187
|
+
children?: undefined;
|
|
188
|
+
alt?: undefined;
|
|
189
|
+
data?: undefined;
|
|
190
|
+
height?: undefined;
|
|
191
|
+
width?: undefined;
|
|
192
|
+
imageType?: undefined;
|
|
193
|
+
name?: undefined;
|
|
194
|
+
options?: undefined;
|
|
195
|
+
config?: undefined;
|
|
196
|
+
header?: undefined;
|
|
197
|
+
striped?: undefined;
|
|
198
|
+
columns?: undefined;
|
|
199
|
+
};
|
|
200
|
+
required: string[];
|
|
201
|
+
type: string;
|
|
202
|
+
} | {
|
|
203
|
+
description: string;
|
|
204
|
+
required: string[];
|
|
205
|
+
type: string;
|
|
206
|
+
properties: {
|
|
207
|
+
className: {
|
|
208
|
+
type: string;
|
|
209
|
+
};
|
|
210
|
+
style: {
|
|
211
|
+
additionalProperties: boolean;
|
|
212
|
+
type: string;
|
|
213
|
+
};
|
|
214
|
+
text: {
|
|
215
|
+
type: string;
|
|
216
|
+
};
|
|
217
|
+
type: {
|
|
218
|
+
const: string;
|
|
219
|
+
};
|
|
220
|
+
children: {
|
|
221
|
+
items: {
|
|
222
|
+
additionalProperties: boolean;
|
|
223
|
+
type: string;
|
|
224
|
+
};
|
|
225
|
+
type: string;
|
|
226
|
+
};
|
|
227
|
+
items?: undefined;
|
|
228
|
+
level?: undefined;
|
|
229
|
+
url?: undefined;
|
|
230
|
+
alt?: undefined;
|
|
231
|
+
data?: undefined;
|
|
232
|
+
height?: undefined;
|
|
233
|
+
width?: undefined;
|
|
234
|
+
imageType?: undefined;
|
|
235
|
+
name?: undefined;
|
|
236
|
+
options?: undefined;
|
|
237
|
+
config?: undefined;
|
|
238
|
+
header?: undefined;
|
|
239
|
+
striped?: undefined;
|
|
240
|
+
columns?: undefined;
|
|
241
|
+
};
|
|
242
|
+
} | {
|
|
243
|
+
description: string;
|
|
244
|
+
required: string[];
|
|
245
|
+
type: string;
|
|
246
|
+
properties: {
|
|
247
|
+
name: {
|
|
248
|
+
type: string;
|
|
249
|
+
};
|
|
250
|
+
options: {
|
|
251
|
+
additionalProperties: boolean;
|
|
252
|
+
type: string;
|
|
253
|
+
};
|
|
254
|
+
type: {
|
|
255
|
+
const: string;
|
|
256
|
+
};
|
|
257
|
+
items?: undefined;
|
|
258
|
+
className?: undefined;
|
|
259
|
+
level?: undefined;
|
|
260
|
+
style?: undefined;
|
|
261
|
+
text?: undefined;
|
|
262
|
+
url?: undefined;
|
|
263
|
+
children?: undefined;
|
|
264
|
+
alt?: undefined;
|
|
265
|
+
data?: undefined;
|
|
266
|
+
height?: undefined;
|
|
267
|
+
width?: undefined;
|
|
268
|
+
imageType?: undefined;
|
|
269
|
+
config?: undefined;
|
|
270
|
+
header?: undefined;
|
|
271
|
+
striped?: undefined;
|
|
272
|
+
columns?: undefined;
|
|
273
|
+
};
|
|
274
|
+
} | {
|
|
275
|
+
description: string;
|
|
276
|
+
required: string[];
|
|
277
|
+
type: string;
|
|
278
|
+
properties: {
|
|
279
|
+
config: {
|
|
280
|
+
additionalProperties: boolean;
|
|
281
|
+
type: string;
|
|
282
|
+
};
|
|
283
|
+
type: {
|
|
284
|
+
const: string;
|
|
285
|
+
};
|
|
286
|
+
items?: undefined;
|
|
287
|
+
className?: undefined;
|
|
288
|
+
level?: undefined;
|
|
289
|
+
style?: undefined;
|
|
290
|
+
text?: undefined;
|
|
291
|
+
url?: undefined;
|
|
292
|
+
children?: undefined;
|
|
293
|
+
alt?: undefined;
|
|
294
|
+
data?: undefined;
|
|
295
|
+
height?: undefined;
|
|
296
|
+
width?: undefined;
|
|
297
|
+
imageType?: undefined;
|
|
298
|
+
name?: undefined;
|
|
299
|
+
options?: undefined;
|
|
300
|
+
header?: undefined;
|
|
301
|
+
striped?: undefined;
|
|
302
|
+
columns?: undefined;
|
|
303
|
+
};
|
|
304
|
+
} | {
|
|
305
|
+
description: string;
|
|
306
|
+
required: string[];
|
|
307
|
+
type: string;
|
|
308
|
+
properties: {
|
|
309
|
+
header: {
|
|
310
|
+
type: string;
|
|
311
|
+
};
|
|
312
|
+
striped: {
|
|
313
|
+
type: string;
|
|
314
|
+
};
|
|
315
|
+
type: {
|
|
316
|
+
const: string;
|
|
317
|
+
};
|
|
318
|
+
columns: {
|
|
319
|
+
type: string;
|
|
320
|
+
items: {
|
|
321
|
+
required: string[];
|
|
322
|
+
type: string;
|
|
323
|
+
properties: {
|
|
324
|
+
key: {
|
|
325
|
+
type: string;
|
|
326
|
+
};
|
|
327
|
+
title: {
|
|
328
|
+
type: string;
|
|
329
|
+
};
|
|
330
|
+
width: {
|
|
331
|
+
type: string;
|
|
332
|
+
};
|
|
333
|
+
align: {
|
|
334
|
+
enum: string[];
|
|
335
|
+
type: string;
|
|
336
|
+
};
|
|
337
|
+
};
|
|
338
|
+
};
|
|
339
|
+
};
|
|
340
|
+
data: {
|
|
341
|
+
items: {
|
|
342
|
+
additionalProperties: boolean;
|
|
343
|
+
type: string;
|
|
344
|
+
};
|
|
345
|
+
type: string;
|
|
346
|
+
};
|
|
347
|
+
items?: undefined;
|
|
348
|
+
className?: undefined;
|
|
349
|
+
level?: undefined;
|
|
350
|
+
style?: undefined;
|
|
351
|
+
text?: undefined;
|
|
352
|
+
url?: undefined;
|
|
353
|
+
children?: undefined;
|
|
354
|
+
alt?: undefined;
|
|
355
|
+
height?: undefined;
|
|
356
|
+
width?: undefined;
|
|
357
|
+
imageType?: undefined;
|
|
358
|
+
name?: undefined;
|
|
359
|
+
options?: undefined;
|
|
360
|
+
config?: undefined;
|
|
361
|
+
};
|
|
362
|
+
})[];
|
|
363
|
+
};
|
|
364
|
+
styleRule: {
|
|
365
|
+
additionalProperties: boolean;
|
|
366
|
+
description: string;
|
|
367
|
+
type: string;
|
|
368
|
+
properties: {
|
|
369
|
+
backgroundColor: {
|
|
370
|
+
type: string;
|
|
371
|
+
};
|
|
372
|
+
borderBottom: {
|
|
373
|
+
type: string;
|
|
374
|
+
};
|
|
375
|
+
borderLeft: {
|
|
376
|
+
type: string;
|
|
377
|
+
};
|
|
378
|
+
borderRight: {
|
|
379
|
+
type: string;
|
|
380
|
+
};
|
|
381
|
+
borderTop: {
|
|
382
|
+
type: string;
|
|
383
|
+
};
|
|
384
|
+
color: {
|
|
385
|
+
type: string;
|
|
386
|
+
};
|
|
387
|
+
fontFamily: {
|
|
388
|
+
type: string;
|
|
389
|
+
};
|
|
390
|
+
fontSize: {
|
|
391
|
+
type: string;
|
|
392
|
+
};
|
|
393
|
+
fontWeight: {
|
|
394
|
+
enum: string[];
|
|
395
|
+
type: string;
|
|
396
|
+
};
|
|
397
|
+
lineHeight: {
|
|
398
|
+
type: string;
|
|
399
|
+
};
|
|
400
|
+
marginBottom: {
|
|
401
|
+
type: string;
|
|
402
|
+
};
|
|
403
|
+
marginLeft: {
|
|
404
|
+
type: string;
|
|
405
|
+
};
|
|
406
|
+
marginTop: {
|
|
407
|
+
type: string;
|
|
408
|
+
};
|
|
409
|
+
textAlign: {
|
|
410
|
+
enum: string[];
|
|
411
|
+
type: string;
|
|
412
|
+
};
|
|
413
|
+
};
|
|
414
|
+
};
|
|
415
|
+
};
|
|
416
|
+
properties: {
|
|
417
|
+
content: {
|
|
418
|
+
description: string;
|
|
419
|
+
items: {
|
|
420
|
+
$ref: string;
|
|
421
|
+
};
|
|
422
|
+
type: string;
|
|
423
|
+
};
|
|
424
|
+
page: {
|
|
425
|
+
description: string;
|
|
426
|
+
type: string;
|
|
427
|
+
properties: {
|
|
428
|
+
margin: {
|
|
429
|
+
type: string;
|
|
430
|
+
};
|
|
431
|
+
orientation: {
|
|
432
|
+
enum: string[];
|
|
433
|
+
type: string;
|
|
434
|
+
};
|
|
435
|
+
size: {
|
|
436
|
+
enum: string[];
|
|
437
|
+
type: string;
|
|
438
|
+
};
|
|
439
|
+
};
|
|
440
|
+
};
|
|
441
|
+
plugins: {
|
|
442
|
+
description: string;
|
|
443
|
+
type: string;
|
|
444
|
+
items: {
|
|
445
|
+
required: string[];
|
|
446
|
+
type: string;
|
|
447
|
+
properties: {
|
|
448
|
+
plugin: {
|
|
449
|
+
description: string;
|
|
450
|
+
type: string;
|
|
451
|
+
};
|
|
452
|
+
type: {
|
|
453
|
+
enum: string[];
|
|
454
|
+
type: string;
|
|
455
|
+
};
|
|
456
|
+
};
|
|
457
|
+
};
|
|
458
|
+
};
|
|
459
|
+
styles: {
|
|
460
|
+
additionalProperties: {
|
|
461
|
+
$ref: string;
|
|
462
|
+
};
|
|
463
|
+
description: string;
|
|
464
|
+
type: string;
|
|
465
|
+
};
|
|
466
|
+
};
|
|
467
|
+
};
|
|
468
|
+
};
|
|
469
|
+
//#endregion
|
|
470
|
+
//#region src/tools/createDocx.d.ts
|
|
471
|
+
/**
|
|
472
|
+
* Input schema for the create_document MCP tool.
|
|
473
|
+
*/
|
|
474
|
+
interface CreateDocumentInput {
|
|
475
|
+
/** File path for the output .docx file. */
|
|
476
|
+
outputPath: string;
|
|
477
|
+
/** The docx-kit DocxSchema defining the document. */
|
|
478
|
+
schema: DocxSchema;
|
|
479
|
+
}
|
|
480
|
+
/**
|
|
481
|
+
* Output from the create_document MCP tool.
|
|
482
|
+
*/
|
|
483
|
+
interface CreateDocumentOutput {
|
|
484
|
+
/** Path of the created file. */
|
|
485
|
+
filePath: string;
|
|
486
|
+
/** File size in bytes. */
|
|
487
|
+
size: number;
|
|
488
|
+
}
|
|
489
|
+
/**
|
|
490
|
+
* MCP tool definition for `create_document`.
|
|
491
|
+
*
|
|
492
|
+
* Creates a new .docx file from a docx-kit JSON schema.
|
|
493
|
+
* Takes an `outputPath` and a `schema` (DocxSchema JSON object).
|
|
494
|
+
*
|
|
495
|
+
* @remarks Used by the MCP server as a tool registration.
|
|
496
|
+
*/
|
|
497
|
+
declare const createDocxToolDefinition: {
|
|
498
|
+
name: string;
|
|
499
|
+
description: string;
|
|
500
|
+
inputSchema: {
|
|
501
|
+
required: string[];
|
|
502
|
+
type: string;
|
|
503
|
+
properties: {
|
|
504
|
+
outputPath: {
|
|
505
|
+
description: string;
|
|
506
|
+
type: string;
|
|
507
|
+
};
|
|
508
|
+
schema: {
|
|
509
|
+
type: string;
|
|
510
|
+
description: string;
|
|
511
|
+
};
|
|
512
|
+
};
|
|
513
|
+
};
|
|
514
|
+
};
|
|
515
|
+
//#endregion
|
|
516
|
+
//#region src/tools/applyTemplate.d.ts
|
|
517
|
+
/**
|
|
518
|
+
* Input for the apply_template MCP tool.
|
|
519
|
+
*/
|
|
520
|
+
interface ApplyTemplateInput {
|
|
521
|
+
/** Template parameter values (match template schema). */
|
|
522
|
+
data: Record<string, unknown>;
|
|
523
|
+
/** Name of the template to apply. */
|
|
524
|
+
template: string;
|
|
525
|
+
}
|
|
526
|
+
/**
|
|
527
|
+
* Output from the apply_template MCP tool.
|
|
528
|
+
*/
|
|
529
|
+
interface ApplyTemplateOutput {
|
|
530
|
+
/** The generated DocxSchema. */
|
|
531
|
+
schema: DocxSchema;
|
|
532
|
+
/** Name of the template used. */
|
|
533
|
+
templateName: string;
|
|
534
|
+
}
|
|
535
|
+
/**
|
|
536
|
+
* MCP tool definition for `apply_template`.
|
|
537
|
+
*
|
|
538
|
+
* Generates a DocxSchema from a named template + data params.
|
|
539
|
+
*/
|
|
540
|
+
declare const applyTemplateToolDefinition: {
|
|
541
|
+
name: string;
|
|
542
|
+
description: string;
|
|
543
|
+
inputSchema: {
|
|
544
|
+
required: string[];
|
|
545
|
+
type: string;
|
|
546
|
+
properties: {
|
|
547
|
+
data: {
|
|
548
|
+
description: string;
|
|
549
|
+
type: string;
|
|
550
|
+
};
|
|
551
|
+
template: {
|
|
552
|
+
type: string;
|
|
553
|
+
description: string;
|
|
554
|
+
};
|
|
555
|
+
};
|
|
556
|
+
};
|
|
557
|
+
};
|
|
558
|
+
/**
|
|
559
|
+
* Apply a template with given data to produce a DocxSchema.
|
|
560
|
+
*
|
|
561
|
+
* @param templateName - — Template name (e.g. 'report')
|
|
562
|
+
* @param data - — Template parameters
|
|
563
|
+
* @returns Generated DocxSchema and template name, or null if template not found
|
|
564
|
+
*/
|
|
565
|
+
declare function applyTemplate(templateName: string, data: Record<string, unknown>): ApplyTemplateOutput | null;
|
|
566
|
+
//#endregion
|
|
567
|
+
//#region src/tools/getPluginHelp.d.ts
|
|
568
|
+
/**
|
|
569
|
+
* Plugin help info returned by get_plugin_help.
|
|
570
|
+
*/
|
|
571
|
+
interface PluginHelpInfo {
|
|
572
|
+
/** Detailed description of the plugin. */
|
|
573
|
+
description: string;
|
|
574
|
+
/** Plugin name. */
|
|
575
|
+
name: string;
|
|
576
|
+
/** Example usage in JSON DSL. */
|
|
577
|
+
usageExample: string;
|
|
578
|
+
}
|
|
579
|
+
/**
|
|
580
|
+
* MCP tool definition for `get_plugin_help`.
|
|
581
|
+
*
|
|
582
|
+
* Returns usage help and option schema for a named plugin.
|
|
583
|
+
*/
|
|
584
|
+
declare const getPluginHelpToolDefinition: {
|
|
585
|
+
name: string;
|
|
586
|
+
description: string;
|
|
587
|
+
inputSchema: {
|
|
588
|
+
required: string[];
|
|
589
|
+
type: string;
|
|
590
|
+
properties: {
|
|
591
|
+
pluginName: {
|
|
592
|
+
description: string;
|
|
593
|
+
type: string;
|
|
594
|
+
};
|
|
595
|
+
};
|
|
596
|
+
};
|
|
597
|
+
};
|
|
598
|
+
/**
|
|
599
|
+
* Build help info for a plugin.
|
|
600
|
+
*
|
|
601
|
+
* Provides a usage example based on the plugin name,
|
|
602
|
+
* referencing a built-in map of known plugins.
|
|
603
|
+
*
|
|
604
|
+
* @param plugin - — The DocxPlugin to build help for
|
|
605
|
+
* @returns PluginHelpInfo with description, name, and usage example
|
|
606
|
+
*/
|
|
607
|
+
declare function buildPluginHelp(plugin: DocxPlugin): PluginHelpInfo;
|
|
608
|
+
//#endregion
|
|
609
|
+
//#region src/tools/listPlugins.d.ts
|
|
610
|
+
/**
|
|
611
|
+
* Plugin info returned by the list_plugins tool.
|
|
612
|
+
*/
|
|
613
|
+
interface PluginInfo {
|
|
614
|
+
/** Plugin description (derived from name and render signature). */
|
|
615
|
+
description: string;
|
|
616
|
+
/** Plugin name. */
|
|
617
|
+
name: string;
|
|
618
|
+
}
|
|
619
|
+
/**
|
|
620
|
+
* MCP tool definition for `list_plugins`.
|
|
621
|
+
*
|
|
622
|
+
* Returns metadata for all registered plugins.
|
|
623
|
+
*/
|
|
624
|
+
declare const listPluginsToolDefinition: {
|
|
625
|
+
name: string;
|
|
626
|
+
description: string;
|
|
627
|
+
inputSchema: {
|
|
628
|
+
type: string;
|
|
629
|
+
properties: {
|
|
630
|
+
filter: {
|
|
631
|
+
description: string;
|
|
632
|
+
type: string;
|
|
633
|
+
};
|
|
634
|
+
};
|
|
635
|
+
};
|
|
636
|
+
};
|
|
637
|
+
/**
|
|
638
|
+
* Build plugin info from a list of DocxPlugin instances.
|
|
639
|
+
*
|
|
640
|
+
* Optionally filters by a case-insensitive name substring.
|
|
641
|
+
*
|
|
642
|
+
* @param plugins - — Registered plugins
|
|
643
|
+
* @param filter - — Optional name filter pattern (case-insensitive)
|
|
644
|
+
* @returns Array of PluginInfo objects
|
|
645
|
+
*/
|
|
646
|
+
declare function buildPluginInfoList(plugins: DocxPlugin[], filter?: string): PluginInfo[];
|
|
647
|
+
//#endregion
|
|
648
|
+
//#region src/tools/validateSchema.d.ts
|
|
649
|
+
/**
|
|
650
|
+
* MCP tool: validate a docx-kit JSON schema.
|
|
651
|
+
*
|
|
652
|
+
* @module mcp-server/tools/validateSchema
|
|
653
|
+
*/
|
|
654
|
+
/**
|
|
655
|
+
* Output from the validate_schema MCP tool.
|
|
656
|
+
*/
|
|
657
|
+
interface ValidateSchemaOutput {
|
|
658
|
+
/** List of validation errors (empty if valid). */
|
|
659
|
+
errors: ValidationError[];
|
|
660
|
+
/** Whether the schema is valid. */
|
|
661
|
+
valid: boolean;
|
|
662
|
+
}
|
|
663
|
+
/**
|
|
664
|
+
* Validation error detail.
|
|
665
|
+
*/
|
|
666
|
+
interface ValidationError {
|
|
667
|
+
/** Error description. */
|
|
668
|
+
message: string;
|
|
669
|
+
/** JSON path to the invalid field. */
|
|
670
|
+
path: string;
|
|
671
|
+
}
|
|
672
|
+
/**
|
|
673
|
+
* MCP tool definition for `validate_schema`.
|
|
674
|
+
*
|
|
675
|
+
* Validates a docx-kit JSON schema and returns
|
|
676
|
+
* detailed error information.
|
|
677
|
+
*/
|
|
678
|
+
declare const validateSchemaToolDefinition: {
|
|
679
|
+
name: string;
|
|
680
|
+
description: string;
|
|
681
|
+
inputSchema: {
|
|
682
|
+
required: string[];
|
|
683
|
+
type: string;
|
|
684
|
+
properties: {
|
|
685
|
+
schema: {
|
|
686
|
+
description: string;
|
|
687
|
+
type: string;
|
|
688
|
+
};
|
|
689
|
+
};
|
|
690
|
+
};
|
|
691
|
+
};
|
|
692
|
+
/**
|
|
693
|
+
* Validate a DocxSchema object.
|
|
694
|
+
*
|
|
695
|
+
* Checks for:
|
|
696
|
+
* - Required `content` array
|
|
697
|
+
* - Valid node types in content
|
|
698
|
+
* - Required fields per node type
|
|
699
|
+
*
|
|
700
|
+
* @param schema - — The schema to validate
|
|
701
|
+
* @returns Validation result with errors
|
|
702
|
+
*/
|
|
703
|
+
declare function validateSchema(schema: unknown): ValidateSchemaOutput;
|
|
704
|
+
//#endregion
|
|
705
|
+
//#region src/tools/listTemplates.d.ts
|
|
706
|
+
/**
|
|
707
|
+
* MCP tool definition for `list_templates`.
|
|
708
|
+
*
|
|
709
|
+
* Returns all available docx-kit AI templates.
|
|
710
|
+
*/
|
|
711
|
+
declare const listTemplatesToolDefinition: {
|
|
712
|
+
name: string;
|
|
713
|
+
description: string;
|
|
714
|
+
inputSchema: {
|
|
715
|
+
properties: {};
|
|
716
|
+
type: string;
|
|
717
|
+
};
|
|
718
|
+
};
|
|
719
|
+
/**
|
|
720
|
+
* Build template info list from built-in templates.
|
|
721
|
+
*
|
|
722
|
+
* @returns Array of template info (without generator)
|
|
723
|
+
*/
|
|
724
|
+
declare function buildTemplateInfoList(): AiTemplateInfo[];
|
|
725
|
+
//#endregion
|
|
726
|
+
//#region src/index.d.ts
|
|
727
|
+
/**
|
|
728
|
+
* docx-kit MCP server — AI agent integration via
|
|
729
|
+
* Model Context Protocol.
|
|
730
|
+
*
|
|
731
|
+
* Provides tools for document creation, validation,
|
|
732
|
+
* plugin discovery, template application, and schema resources.
|
|
733
|
+
*
|
|
734
|
+
* The server uses `@modelcontextprotocol/sdk` (optional peer dep)
|
|
735
|
+
* for MCP protocol handling. If the SDK is not installed,
|
|
736
|
+
* individual tool/resource definitions and execution logic
|
|
737
|
+
* can still be used programmatically.
|
|
738
|
+
*
|
|
739
|
+
* @module mcp-server
|
|
740
|
+
*/
|
|
741
|
+
/**
|
|
742
|
+
* All MCP tool definitions for docx-kit.
|
|
743
|
+
*/
|
|
744
|
+
declare const TOOL_DEFINITIONS: readonly [{
|
|
745
|
+
name: string;
|
|
746
|
+
description: string;
|
|
747
|
+
inputSchema: {
|
|
748
|
+
required: string[];
|
|
749
|
+
type: string;
|
|
750
|
+
properties: {
|
|
751
|
+
data: {
|
|
752
|
+
description: string;
|
|
753
|
+
type: string;
|
|
754
|
+
};
|
|
755
|
+
template: {
|
|
756
|
+
type: string;
|
|
757
|
+
description: string;
|
|
758
|
+
};
|
|
759
|
+
};
|
|
760
|
+
};
|
|
761
|
+
}, {
|
|
762
|
+
name: string;
|
|
763
|
+
description: string;
|
|
764
|
+
inputSchema: {
|
|
765
|
+
required: string[];
|
|
766
|
+
type: string;
|
|
767
|
+
properties: {
|
|
768
|
+
outputPath: {
|
|
769
|
+
description: string;
|
|
770
|
+
type: string;
|
|
771
|
+
};
|
|
772
|
+
schema: {
|
|
773
|
+
type: string;
|
|
774
|
+
description: string;
|
|
775
|
+
};
|
|
776
|
+
};
|
|
777
|
+
};
|
|
778
|
+
}, {
|
|
779
|
+
name: string;
|
|
780
|
+
description: string;
|
|
781
|
+
inputSchema: {
|
|
782
|
+
required: string[];
|
|
783
|
+
type: string;
|
|
784
|
+
properties: {
|
|
785
|
+
pluginName: {
|
|
786
|
+
description: string;
|
|
787
|
+
type: string;
|
|
788
|
+
};
|
|
789
|
+
};
|
|
790
|
+
};
|
|
791
|
+
}, {
|
|
792
|
+
name: string;
|
|
793
|
+
description: string;
|
|
794
|
+
inputSchema: {
|
|
795
|
+
type: string;
|
|
796
|
+
properties: {
|
|
797
|
+
filter: {
|
|
798
|
+
description: string;
|
|
799
|
+
type: string;
|
|
800
|
+
};
|
|
801
|
+
};
|
|
802
|
+
};
|
|
803
|
+
}, {
|
|
804
|
+
name: string;
|
|
805
|
+
description: string;
|
|
806
|
+
inputSchema: {
|
|
807
|
+
properties: {};
|
|
808
|
+
type: string;
|
|
809
|
+
};
|
|
810
|
+
}, {
|
|
811
|
+
name: string;
|
|
812
|
+
description: string;
|
|
813
|
+
inputSchema: {
|
|
814
|
+
required: string[];
|
|
815
|
+
type: string;
|
|
816
|
+
properties: {
|
|
817
|
+
schema: {
|
|
818
|
+
description: string;
|
|
819
|
+
type: string;
|
|
820
|
+
};
|
|
821
|
+
};
|
|
822
|
+
};
|
|
823
|
+
}];
|
|
824
|
+
/**
|
|
825
|
+
* All MCP resource definitions for docx-kit.
|
|
826
|
+
*/
|
|
827
|
+
declare const RESOURCE_DEFINITIONS: readonly [{
|
|
828
|
+
mimeType: string;
|
|
829
|
+
name: string;
|
|
830
|
+
description: string;
|
|
831
|
+
schema: {
|
|
832
|
+
$id: string;
|
|
833
|
+
$schema: string;
|
|
834
|
+
description: string;
|
|
835
|
+
required: string[];
|
|
836
|
+
title: string;
|
|
837
|
+
type: string;
|
|
838
|
+
definitions: {
|
|
839
|
+
blockNode: {
|
|
840
|
+
oneOf: ({
|
|
841
|
+
description: string;
|
|
842
|
+
required: string[];
|
|
843
|
+
type: string;
|
|
844
|
+
properties: {
|
|
845
|
+
type: {
|
|
846
|
+
const: string;
|
|
847
|
+
};
|
|
848
|
+
items: {
|
|
849
|
+
items: {
|
|
850
|
+
type: string;
|
|
851
|
+
};
|
|
852
|
+
type: string;
|
|
853
|
+
};
|
|
854
|
+
className?: undefined;
|
|
855
|
+
level?: undefined;
|
|
856
|
+
style?: undefined;
|
|
857
|
+
text?: undefined;
|
|
858
|
+
url?: undefined;
|
|
859
|
+
children?: undefined;
|
|
860
|
+
alt?: undefined;
|
|
861
|
+
data?: undefined;
|
|
862
|
+
height?: undefined;
|
|
863
|
+
width?: undefined;
|
|
864
|
+
imageType?: undefined;
|
|
865
|
+
name?: undefined;
|
|
866
|
+
options?: undefined;
|
|
867
|
+
config?: undefined;
|
|
868
|
+
header?: undefined;
|
|
869
|
+
striped?: undefined;
|
|
870
|
+
columns?: undefined;
|
|
871
|
+
};
|
|
872
|
+
} | {
|
|
873
|
+
description: string;
|
|
874
|
+
required: string[];
|
|
875
|
+
type: string;
|
|
876
|
+
properties: {
|
|
877
|
+
className: {
|
|
878
|
+
type: string;
|
|
879
|
+
};
|
|
880
|
+
level: {
|
|
881
|
+
enum: number[];
|
|
882
|
+
type: string;
|
|
883
|
+
};
|
|
884
|
+
style: {
|
|
885
|
+
additionalProperties: boolean;
|
|
886
|
+
type: string;
|
|
887
|
+
};
|
|
888
|
+
text: {
|
|
889
|
+
type: string;
|
|
890
|
+
};
|
|
891
|
+
type: {
|
|
892
|
+
const: string;
|
|
893
|
+
};
|
|
894
|
+
items?: undefined;
|
|
895
|
+
url?: undefined;
|
|
896
|
+
children?: undefined;
|
|
897
|
+
alt?: undefined;
|
|
898
|
+
data?: undefined;
|
|
899
|
+
height?: undefined;
|
|
900
|
+
width?: undefined;
|
|
901
|
+
imageType?: undefined;
|
|
902
|
+
name?: undefined;
|
|
903
|
+
options?: undefined;
|
|
904
|
+
config?: undefined;
|
|
905
|
+
header?: undefined;
|
|
906
|
+
striped?: undefined;
|
|
907
|
+
columns?: undefined;
|
|
908
|
+
};
|
|
909
|
+
} | {
|
|
910
|
+
description: string;
|
|
911
|
+
required: string[];
|
|
912
|
+
type: string;
|
|
913
|
+
properties: {
|
|
914
|
+
type: {
|
|
915
|
+
const: string;
|
|
916
|
+
};
|
|
917
|
+
url: {
|
|
918
|
+
type: string;
|
|
919
|
+
};
|
|
920
|
+
children: {
|
|
921
|
+
items: {
|
|
922
|
+
type: string;
|
|
923
|
+
additionalProperties?: undefined;
|
|
924
|
+
};
|
|
925
|
+
type: string;
|
|
926
|
+
};
|
|
927
|
+
items?: undefined;
|
|
928
|
+
className?: undefined;
|
|
929
|
+
level?: undefined;
|
|
930
|
+
style?: undefined;
|
|
931
|
+
text?: undefined;
|
|
932
|
+
alt?: undefined;
|
|
933
|
+
data?: undefined;
|
|
934
|
+
height?: undefined;
|
|
935
|
+
width?: undefined;
|
|
936
|
+
imageType?: undefined;
|
|
937
|
+
name?: undefined;
|
|
938
|
+
options?: undefined;
|
|
939
|
+
config?: undefined;
|
|
940
|
+
header?: undefined;
|
|
941
|
+
striped?: undefined;
|
|
942
|
+
columns?: undefined;
|
|
943
|
+
};
|
|
944
|
+
} | {
|
|
945
|
+
description: string;
|
|
946
|
+
required: string[];
|
|
947
|
+
type: string;
|
|
948
|
+
properties: {
|
|
949
|
+
alt: {
|
|
950
|
+
type: string;
|
|
951
|
+
};
|
|
952
|
+
data: {
|
|
953
|
+
type: string;
|
|
954
|
+
items?: undefined;
|
|
955
|
+
};
|
|
956
|
+
height: {
|
|
957
|
+
type: string;
|
|
958
|
+
};
|
|
959
|
+
type: {
|
|
960
|
+
const: string;
|
|
961
|
+
};
|
|
962
|
+
width: {
|
|
963
|
+
type: string;
|
|
964
|
+
};
|
|
965
|
+
imageType: {
|
|
966
|
+
enum: string[];
|
|
967
|
+
type: string;
|
|
968
|
+
};
|
|
969
|
+
items?: undefined;
|
|
970
|
+
className?: undefined;
|
|
971
|
+
level?: undefined;
|
|
972
|
+
style?: undefined;
|
|
973
|
+
text?: undefined;
|
|
974
|
+
url?: undefined;
|
|
975
|
+
children?: undefined;
|
|
976
|
+
name?: undefined;
|
|
977
|
+
options?: undefined;
|
|
978
|
+
config?: undefined;
|
|
979
|
+
header?: undefined;
|
|
980
|
+
striped?: undefined;
|
|
981
|
+
columns?: undefined;
|
|
982
|
+
};
|
|
983
|
+
} | {
|
|
984
|
+
description: string;
|
|
985
|
+
properties: {
|
|
986
|
+
type: {
|
|
987
|
+
const: string;
|
|
988
|
+
};
|
|
989
|
+
items?: undefined;
|
|
990
|
+
className?: undefined;
|
|
991
|
+
level?: undefined;
|
|
992
|
+
style?: undefined;
|
|
993
|
+
text?: undefined;
|
|
994
|
+
url?: undefined;
|
|
995
|
+
children?: undefined;
|
|
996
|
+
alt?: undefined;
|
|
997
|
+
data?: undefined;
|
|
998
|
+
height?: undefined;
|
|
999
|
+
width?: undefined;
|
|
1000
|
+
imageType?: undefined;
|
|
1001
|
+
name?: undefined;
|
|
1002
|
+
options?: undefined;
|
|
1003
|
+
config?: undefined;
|
|
1004
|
+
header?: undefined;
|
|
1005
|
+
striped?: undefined;
|
|
1006
|
+
columns?: undefined;
|
|
1007
|
+
};
|
|
1008
|
+
required: string[];
|
|
1009
|
+
type: string;
|
|
1010
|
+
} | {
|
|
1011
|
+
description: string;
|
|
1012
|
+
required: string[];
|
|
1013
|
+
type: string;
|
|
1014
|
+
properties: {
|
|
1015
|
+
className: {
|
|
1016
|
+
type: string;
|
|
1017
|
+
};
|
|
1018
|
+
style: {
|
|
1019
|
+
additionalProperties: boolean;
|
|
1020
|
+
type: string;
|
|
1021
|
+
};
|
|
1022
|
+
text: {
|
|
1023
|
+
type: string;
|
|
1024
|
+
};
|
|
1025
|
+
type: {
|
|
1026
|
+
const: string;
|
|
1027
|
+
};
|
|
1028
|
+
children: {
|
|
1029
|
+
items: {
|
|
1030
|
+
additionalProperties: boolean;
|
|
1031
|
+
type: string;
|
|
1032
|
+
};
|
|
1033
|
+
type: string;
|
|
1034
|
+
};
|
|
1035
|
+
items?: undefined;
|
|
1036
|
+
level?: undefined;
|
|
1037
|
+
url?: undefined;
|
|
1038
|
+
alt?: undefined;
|
|
1039
|
+
data?: undefined;
|
|
1040
|
+
height?: undefined;
|
|
1041
|
+
width?: undefined;
|
|
1042
|
+
imageType?: undefined;
|
|
1043
|
+
name?: undefined;
|
|
1044
|
+
options?: undefined;
|
|
1045
|
+
config?: undefined;
|
|
1046
|
+
header?: undefined;
|
|
1047
|
+
striped?: undefined;
|
|
1048
|
+
columns?: undefined;
|
|
1049
|
+
};
|
|
1050
|
+
} | {
|
|
1051
|
+
description: string;
|
|
1052
|
+
required: string[];
|
|
1053
|
+
type: string;
|
|
1054
|
+
properties: {
|
|
1055
|
+
name: {
|
|
1056
|
+
type: string;
|
|
1057
|
+
};
|
|
1058
|
+
options: {
|
|
1059
|
+
additionalProperties: boolean;
|
|
1060
|
+
type: string;
|
|
1061
|
+
};
|
|
1062
|
+
type: {
|
|
1063
|
+
const: string;
|
|
1064
|
+
};
|
|
1065
|
+
items?: undefined;
|
|
1066
|
+
className?: undefined;
|
|
1067
|
+
level?: undefined;
|
|
1068
|
+
style?: undefined;
|
|
1069
|
+
text?: undefined;
|
|
1070
|
+
url?: undefined;
|
|
1071
|
+
children?: undefined;
|
|
1072
|
+
alt?: undefined;
|
|
1073
|
+
data?: undefined;
|
|
1074
|
+
height?: undefined;
|
|
1075
|
+
width?: undefined;
|
|
1076
|
+
imageType?: undefined;
|
|
1077
|
+
config?: undefined;
|
|
1078
|
+
header?: undefined;
|
|
1079
|
+
striped?: undefined;
|
|
1080
|
+
columns?: undefined;
|
|
1081
|
+
};
|
|
1082
|
+
} | {
|
|
1083
|
+
description: string;
|
|
1084
|
+
required: string[];
|
|
1085
|
+
type: string;
|
|
1086
|
+
properties: {
|
|
1087
|
+
config: {
|
|
1088
|
+
additionalProperties: boolean;
|
|
1089
|
+
type: string;
|
|
1090
|
+
};
|
|
1091
|
+
type: {
|
|
1092
|
+
const: string;
|
|
1093
|
+
};
|
|
1094
|
+
items?: undefined;
|
|
1095
|
+
className?: undefined;
|
|
1096
|
+
level?: undefined;
|
|
1097
|
+
style?: undefined;
|
|
1098
|
+
text?: undefined;
|
|
1099
|
+
url?: undefined;
|
|
1100
|
+
children?: undefined;
|
|
1101
|
+
alt?: undefined;
|
|
1102
|
+
data?: undefined;
|
|
1103
|
+
height?: undefined;
|
|
1104
|
+
width?: undefined;
|
|
1105
|
+
imageType?: undefined;
|
|
1106
|
+
name?: undefined;
|
|
1107
|
+
options?: undefined;
|
|
1108
|
+
header?: undefined;
|
|
1109
|
+
striped?: undefined;
|
|
1110
|
+
columns?: undefined;
|
|
1111
|
+
};
|
|
1112
|
+
} | {
|
|
1113
|
+
description: string;
|
|
1114
|
+
required: string[];
|
|
1115
|
+
type: string;
|
|
1116
|
+
properties: {
|
|
1117
|
+
header: {
|
|
1118
|
+
type: string;
|
|
1119
|
+
};
|
|
1120
|
+
striped: {
|
|
1121
|
+
type: string;
|
|
1122
|
+
};
|
|
1123
|
+
type: {
|
|
1124
|
+
const: string;
|
|
1125
|
+
};
|
|
1126
|
+
columns: {
|
|
1127
|
+
type: string;
|
|
1128
|
+
items: {
|
|
1129
|
+
required: string[];
|
|
1130
|
+
type: string;
|
|
1131
|
+
properties: {
|
|
1132
|
+
key: {
|
|
1133
|
+
type: string;
|
|
1134
|
+
};
|
|
1135
|
+
title: {
|
|
1136
|
+
type: string;
|
|
1137
|
+
};
|
|
1138
|
+
width: {
|
|
1139
|
+
type: string;
|
|
1140
|
+
};
|
|
1141
|
+
align: {
|
|
1142
|
+
enum: string[];
|
|
1143
|
+
type: string;
|
|
1144
|
+
};
|
|
1145
|
+
};
|
|
1146
|
+
};
|
|
1147
|
+
};
|
|
1148
|
+
data: {
|
|
1149
|
+
items: {
|
|
1150
|
+
additionalProperties: boolean;
|
|
1151
|
+
type: string;
|
|
1152
|
+
};
|
|
1153
|
+
type: string;
|
|
1154
|
+
};
|
|
1155
|
+
items?: undefined;
|
|
1156
|
+
className?: undefined;
|
|
1157
|
+
level?: undefined;
|
|
1158
|
+
style?: undefined;
|
|
1159
|
+
text?: undefined;
|
|
1160
|
+
url?: undefined;
|
|
1161
|
+
children?: undefined;
|
|
1162
|
+
alt?: undefined;
|
|
1163
|
+
height?: undefined;
|
|
1164
|
+
width?: undefined;
|
|
1165
|
+
imageType?: undefined;
|
|
1166
|
+
name?: undefined;
|
|
1167
|
+
options?: undefined;
|
|
1168
|
+
config?: undefined;
|
|
1169
|
+
};
|
|
1170
|
+
})[];
|
|
1171
|
+
};
|
|
1172
|
+
styleRule: {
|
|
1173
|
+
additionalProperties: boolean;
|
|
1174
|
+
description: string;
|
|
1175
|
+
type: string;
|
|
1176
|
+
properties: {
|
|
1177
|
+
backgroundColor: {
|
|
1178
|
+
type: string;
|
|
1179
|
+
};
|
|
1180
|
+
borderBottom: {
|
|
1181
|
+
type: string;
|
|
1182
|
+
};
|
|
1183
|
+
borderLeft: {
|
|
1184
|
+
type: string;
|
|
1185
|
+
};
|
|
1186
|
+
borderRight: {
|
|
1187
|
+
type: string;
|
|
1188
|
+
};
|
|
1189
|
+
borderTop: {
|
|
1190
|
+
type: string;
|
|
1191
|
+
};
|
|
1192
|
+
color: {
|
|
1193
|
+
type: string;
|
|
1194
|
+
};
|
|
1195
|
+
fontFamily: {
|
|
1196
|
+
type: string;
|
|
1197
|
+
};
|
|
1198
|
+
fontSize: {
|
|
1199
|
+
type: string;
|
|
1200
|
+
};
|
|
1201
|
+
fontWeight: {
|
|
1202
|
+
enum: string[];
|
|
1203
|
+
type: string;
|
|
1204
|
+
};
|
|
1205
|
+
lineHeight: {
|
|
1206
|
+
type: string;
|
|
1207
|
+
};
|
|
1208
|
+
marginBottom: {
|
|
1209
|
+
type: string;
|
|
1210
|
+
};
|
|
1211
|
+
marginLeft: {
|
|
1212
|
+
type: string;
|
|
1213
|
+
};
|
|
1214
|
+
marginTop: {
|
|
1215
|
+
type: string;
|
|
1216
|
+
};
|
|
1217
|
+
textAlign: {
|
|
1218
|
+
enum: string[];
|
|
1219
|
+
type: string;
|
|
1220
|
+
};
|
|
1221
|
+
};
|
|
1222
|
+
};
|
|
1223
|
+
};
|
|
1224
|
+
properties: {
|
|
1225
|
+
content: {
|
|
1226
|
+
description: string;
|
|
1227
|
+
items: {
|
|
1228
|
+
$ref: string;
|
|
1229
|
+
};
|
|
1230
|
+
type: string;
|
|
1231
|
+
};
|
|
1232
|
+
page: {
|
|
1233
|
+
description: string;
|
|
1234
|
+
type: string;
|
|
1235
|
+
properties: {
|
|
1236
|
+
margin: {
|
|
1237
|
+
type: string;
|
|
1238
|
+
};
|
|
1239
|
+
orientation: {
|
|
1240
|
+
enum: string[];
|
|
1241
|
+
type: string;
|
|
1242
|
+
};
|
|
1243
|
+
size: {
|
|
1244
|
+
enum: string[];
|
|
1245
|
+
type: string;
|
|
1246
|
+
};
|
|
1247
|
+
};
|
|
1248
|
+
};
|
|
1249
|
+
plugins: {
|
|
1250
|
+
description: string;
|
|
1251
|
+
type: string;
|
|
1252
|
+
items: {
|
|
1253
|
+
required: string[];
|
|
1254
|
+
type: string;
|
|
1255
|
+
properties: {
|
|
1256
|
+
plugin: {
|
|
1257
|
+
description: string;
|
|
1258
|
+
type: string;
|
|
1259
|
+
};
|
|
1260
|
+
type: {
|
|
1261
|
+
enum: string[];
|
|
1262
|
+
type: string;
|
|
1263
|
+
};
|
|
1264
|
+
};
|
|
1265
|
+
};
|
|
1266
|
+
};
|
|
1267
|
+
styles: {
|
|
1268
|
+
additionalProperties: {
|
|
1269
|
+
$ref: string;
|
|
1270
|
+
};
|
|
1271
|
+
description: string;
|
|
1272
|
+
type: string;
|
|
1273
|
+
};
|
|
1274
|
+
};
|
|
1275
|
+
};
|
|
1276
|
+
}];
|
|
1277
|
+
/**
|
|
1278
|
+
* Create a docx-kit MCP server.
|
|
1279
|
+
*
|
|
1280
|
+
* Uses `@modelcontextprotocol/sdk` to create a fully compliant
|
|
1281
|
+
* MCP server with all docx-kit tools and resources registered.
|
|
1282
|
+
*
|
|
1283
|
+
* Requires `@modelcontextprotocol/sdk` to be installed.
|
|
1284
|
+
* Connect via `StdioServerTransport` for CLI usage or
|
|
1285
|
+
* `StreamableHTTPServerTransport` for HTTP access.
|
|
1286
|
+
*
|
|
1287
|
+
* @returns An MCP server instance ready to connect
|
|
1288
|
+
*
|
|
1289
|
+
* @example
|
|
1290
|
+
* ```ts
|
|
1291
|
+
* import { createDocxKitServer } from 'docx-kit/mcp'
|
|
1292
|
+
* import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'
|
|
1293
|
+
*
|
|
1294
|
+
* const server = createDocxKitServer()
|
|
1295
|
+
* const transport = new StdioServerTransport()
|
|
1296
|
+
* await server.connect(transport)
|
|
1297
|
+
* ```
|
|
1298
|
+
*/
|
|
1299
|
+
declare function createDocxKitServer(): Promise<unknown>;
|
|
1300
|
+
//#endregion
|
|
1301
|
+
export { type ApplyTemplateInput, type ApplyTemplateOutput, type CreateDocumentInput, type CreateDocumentOutput, type PluginHelpInfo, type PluginInfo, RESOURCE_DEFINITIONS, TOOL_DEFINITIONS, type ValidateSchemaOutput, type ValidationError, applyTemplate, applyTemplateToolDefinition, buildPluginHelp, buildPluginInfoList, buildTemplateInfoList, createDocxKitServer, createDocxToolDefinition, docxSchemaResource, getPluginHelpToolDefinition, listPluginsToolDefinition, listTemplatesToolDefinition, validateSchema, validateSchemaToolDefinition };
|