@contentful/mcp-tools 0.4.4 → 0.4.5
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/dist/index.d.ts +13 -33
- package/dist/index.js +6 -14
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -57,6 +57,10 @@ interface ContentfulConfig {
|
|
|
57
57
|
appId?: string;
|
|
58
58
|
/** Version number to use for MCP tool calls */
|
|
59
59
|
mcpVersion: string;
|
|
60
|
+
/** Contentful CDA token for exporting only published content */
|
|
61
|
+
deliveryToken?: string;
|
|
62
|
+
/** Contentful Delivery API host (used with deliveryToken for custom CDA endpoints) */
|
|
63
|
+
hostDelivery?: string;
|
|
60
64
|
}
|
|
61
65
|
|
|
62
66
|
/**
|
|
@@ -5982,11 +5986,11 @@ declare class ContentfulMcpTools {
|
|
|
5982
5986
|
} | undefined;
|
|
5983
5987
|
downloadAssets?: boolean | undefined;
|
|
5984
5988
|
maxAllowedLimit?: number | undefined;
|
|
5989
|
+
errorLogFile?: string | undefined;
|
|
5990
|
+
useVerboseRenderer?: boolean | undefined;
|
|
5985
5991
|
deliveryToken?: string | undefined;
|
|
5986
5992
|
hostDelivery?: string | undefined;
|
|
5987
5993
|
rawProxy?: boolean | undefined;
|
|
5988
|
-
errorLogFile?: string | undefined;
|
|
5989
|
-
useVerboseRenderer?: boolean | undefined;
|
|
5990
5994
|
}, {
|
|
5991
5995
|
config?: string | undefined;
|
|
5992
5996
|
spaceId?: string | undefined;
|
|
@@ -6025,11 +6029,11 @@ declare class ContentfulMcpTools {
|
|
|
6025
6029
|
} | undefined;
|
|
6026
6030
|
downloadAssets?: boolean | undefined;
|
|
6027
6031
|
maxAllowedLimit?: number | undefined;
|
|
6032
|
+
errorLogFile?: string | undefined;
|
|
6033
|
+
useVerboseRenderer?: boolean | undefined;
|
|
6028
6034
|
deliveryToken?: string | undefined;
|
|
6029
6035
|
hostDelivery?: string | undefined;
|
|
6030
6036
|
rawProxy?: boolean | undefined;
|
|
6031
|
-
errorLogFile?: string | undefined;
|
|
6032
|
-
useVerboseRenderer?: boolean | undefined;
|
|
6033
6037
|
}>>;
|
|
6034
6038
|
import: zod.ZodOptional<zod.ZodObject<{
|
|
6035
6039
|
spaceId: zod.ZodOptional<zod.ZodString>;
|
|
@@ -6066,9 +6070,9 @@ declare class ContentfulMcpTools {
|
|
|
6066
6070
|
timeout?: number | undefined;
|
|
6067
6071
|
contentFile?: string | undefined;
|
|
6068
6072
|
skipContentModel?: boolean | undefined;
|
|
6069
|
-
rawProxy?: boolean | undefined;
|
|
6070
6073
|
errorLogFile?: string | undefined;
|
|
6071
6074
|
useVerboseRenderer?: boolean | undefined;
|
|
6075
|
+
rawProxy?: boolean | undefined;
|
|
6072
6076
|
contentModelOnly?: boolean | undefined;
|
|
6073
6077
|
skipLocales?: boolean | undefined;
|
|
6074
6078
|
skipContentUpdates?: boolean | undefined;
|
|
@@ -6089,9 +6093,9 @@ declare class ContentfulMcpTools {
|
|
|
6089
6093
|
timeout?: number | undefined;
|
|
6090
6094
|
contentFile?: string | undefined;
|
|
6091
6095
|
skipContentModel?: boolean | undefined;
|
|
6092
|
-
rawProxy?: boolean | undefined;
|
|
6093
6096
|
errorLogFile?: string | undefined;
|
|
6094
6097
|
useVerboseRenderer?: boolean | undefined;
|
|
6098
|
+
rawProxy?: boolean | undefined;
|
|
6095
6099
|
contentModelOnly?: boolean | undefined;
|
|
6096
6100
|
skipLocales?: boolean | undefined;
|
|
6097
6101
|
skipContentUpdates?: boolean | undefined;
|
|
@@ -6148,11 +6152,11 @@ declare class ContentfulMcpTools {
|
|
|
6148
6152
|
} | undefined;
|
|
6149
6153
|
downloadAssets?: boolean | undefined;
|
|
6150
6154
|
maxAllowedLimit?: number | undefined;
|
|
6155
|
+
errorLogFile?: string | undefined;
|
|
6156
|
+
useVerboseRenderer?: boolean | undefined;
|
|
6151
6157
|
deliveryToken?: string | undefined;
|
|
6152
6158
|
hostDelivery?: string | undefined;
|
|
6153
6159
|
rawProxy?: boolean | undefined;
|
|
6154
|
-
errorLogFile?: string | undefined;
|
|
6155
|
-
useVerboseRenderer?: boolean | undefined;
|
|
6156
6160
|
} | undefined;
|
|
6157
6161
|
import?: {
|
|
6158
6162
|
config?: string | undefined;
|
|
@@ -6166,9 +6170,9 @@ declare class ContentfulMcpTools {
|
|
|
6166
6170
|
timeout?: number | undefined;
|
|
6167
6171
|
contentFile?: string | undefined;
|
|
6168
6172
|
skipContentModel?: boolean | undefined;
|
|
6169
|
-
rawProxy?: boolean | undefined;
|
|
6170
6173
|
errorLogFile?: string | undefined;
|
|
6171
6174
|
useVerboseRenderer?: boolean | undefined;
|
|
6175
|
+
rawProxy?: boolean | undefined;
|
|
6172
6176
|
contentModelOnly?: boolean | undefined;
|
|
6173
6177
|
skipLocales?: boolean | undefined;
|
|
6174
6178
|
skipContentUpdates?: boolean | undefined;
|
|
@@ -6246,15 +6250,8 @@ declare class ContentfulMcpTools {
|
|
|
6246
6250
|
}>>;
|
|
6247
6251
|
downloadAssets: zod.ZodDefault<zod.ZodOptional<zod.ZodBoolean>>;
|
|
6248
6252
|
maxAllowedLimit: zod.ZodDefault<zod.ZodOptional<zod.ZodNumber>>;
|
|
6249
|
-
deliveryToken: zod.ZodOptional<zod.ZodString>;
|
|
6250
|
-
host: zod.ZodOptional<zod.ZodString>;
|
|
6251
|
-
hostDelivery: zod.ZodOptional<zod.ZodString>;
|
|
6252
|
-
proxy: zod.ZodOptional<zod.ZodString>;
|
|
6253
|
-
rawProxy: zod.ZodOptional<zod.ZodBoolean>;
|
|
6254
|
-
headers: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodString>>;
|
|
6255
6253
|
errorLogFile: zod.ZodOptional<zod.ZodString>;
|
|
6256
6254
|
useVerboseRenderer: zod.ZodOptional<zod.ZodBoolean>;
|
|
6257
|
-
config: zod.ZodOptional<zod.ZodString>;
|
|
6258
6255
|
};
|
|
6259
6256
|
annotations: {
|
|
6260
6257
|
readOnlyHint: boolean;
|
|
@@ -6276,10 +6273,6 @@ declare class ContentfulMcpTools {
|
|
|
6276
6273
|
contentOnly: boolean;
|
|
6277
6274
|
downloadAssets: boolean;
|
|
6278
6275
|
maxAllowedLimit: number;
|
|
6279
|
-
config?: string | undefined;
|
|
6280
|
-
host?: string | undefined;
|
|
6281
|
-
proxy?: string | undefined;
|
|
6282
|
-
headers?: Record<string, string> | undefined;
|
|
6283
6276
|
exportDir?: string | undefined;
|
|
6284
6277
|
contentFile?: string | undefined;
|
|
6285
6278
|
queryEntries?: {
|
|
@@ -6298,9 +6291,6 @@ declare class ContentfulMcpTools {
|
|
|
6298
6291
|
order?: string | undefined;
|
|
6299
6292
|
mimetype_group?: string | undefined;
|
|
6300
6293
|
} | undefined;
|
|
6301
|
-
deliveryToken?: string | undefined;
|
|
6302
|
-
hostDelivery?: string | undefined;
|
|
6303
|
-
rawProxy?: boolean | undefined;
|
|
6304
6294
|
errorLogFile?: string | undefined;
|
|
6305
6295
|
useVerboseRenderer?: boolean | undefined;
|
|
6306
6296
|
}, extra?: _modelcontextprotocol_sdk_shared_protocol_js.RequestHandlerExtra<_modelcontextprotocol_sdk_types_js.ServerRequest, _modelcontextprotocol_sdk_types_js.ServerNotification>) => Promise<ToolResponse>;
|
|
@@ -6324,14 +6314,9 @@ declare class ContentfulMcpTools {
|
|
|
6324
6314
|
assetsDirectory: zod.ZodOptional<zod.ZodString>;
|
|
6325
6315
|
timeout: zod.ZodDefault<zod.ZodOptional<zod.ZodNumber>>;
|
|
6326
6316
|
retryLimit: zod.ZodDefault<zod.ZodOptional<zod.ZodNumber>>;
|
|
6327
|
-
host: zod.ZodOptional<zod.ZodString>;
|
|
6328
|
-
proxy: zod.ZodOptional<zod.ZodString>;
|
|
6329
|
-
rawProxy: zod.ZodOptional<zod.ZodBoolean>;
|
|
6330
6317
|
rateLimit: zod.ZodDefault<zod.ZodOptional<zod.ZodNumber>>;
|
|
6331
|
-
headers: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodAny>>;
|
|
6332
6318
|
errorLogFile: zod.ZodOptional<zod.ZodString>;
|
|
6333
6319
|
useVerboseRenderer: zod.ZodOptional<zod.ZodBoolean>;
|
|
6334
|
-
config: zod.ZodOptional<zod.ZodString>;
|
|
6335
6320
|
};
|
|
6336
6321
|
annotations: {
|
|
6337
6322
|
readOnlyHint: boolean;
|
|
@@ -6352,13 +6337,8 @@ declare class ContentfulMcpTools {
|
|
|
6352
6337
|
uploadAssets: boolean;
|
|
6353
6338
|
skipAssetUpdates: boolean;
|
|
6354
6339
|
rateLimit: number;
|
|
6355
|
-
config?: string | undefined;
|
|
6356
6340
|
content?: Record<string, any> | undefined;
|
|
6357
|
-
host?: string | undefined;
|
|
6358
|
-
proxy?: string | undefined;
|
|
6359
|
-
headers?: Record<string, any> | undefined;
|
|
6360
6341
|
contentFile?: string | undefined;
|
|
6361
|
-
rawProxy?: boolean | undefined;
|
|
6362
6342
|
errorLogFile?: string | undefined;
|
|
6363
6343
|
useVerboseRenderer?: boolean | undefined;
|
|
6364
6344
|
assetsDirectory?: string | undefined;
|
package/dist/index.js
CHANGED
|
@@ -4394,15 +4394,8 @@ var ExportSpaceToolParams = BaseToolSchema.extend({
|
|
|
4394
4394
|
),
|
|
4395
4395
|
downloadAssets: z72.boolean().optional().default(false).describe("Download actual asset files"),
|
|
4396
4396
|
maxAllowedLimit: z72.number().optional().default(1e3).describe("Maximum number of items per request"),
|
|
4397
|
-
deliveryToken: z72.string().optional().describe("CDA token to export only published content (excludes tags)"),
|
|
4398
|
-
host: z72.string().optional().describe("Management API host"),
|
|
4399
|
-
hostDelivery: z72.string().optional().describe("Delivery API host"),
|
|
4400
|
-
proxy: z72.string().optional().describe("HTTP/HTTPS proxy config"),
|
|
4401
|
-
rawProxy: z72.boolean().optional().describe("Pass raw proxy config directly to Axios"),
|
|
4402
|
-
headers: z72.record(z72.string()).optional().describe("Additional headers to include in requests"),
|
|
4403
4397
|
errorLogFile: z72.string().optional().describe("Path to error log output file"),
|
|
4404
|
-
useVerboseRenderer: z72.boolean().optional().describe("Line-by-line logging, useful for CI")
|
|
4405
|
-
config: z72.string().optional().describe("Path to a JSON config file with all options")
|
|
4398
|
+
useVerboseRenderer: z72.boolean().optional().describe("Line-by-line logging, useful for CI")
|
|
4406
4399
|
});
|
|
4407
4400
|
function createExportSpaceTool(config) {
|
|
4408
4401
|
async function tool2(args) {
|
|
@@ -4414,6 +4407,9 @@ function createExportSpaceTool(config) {
|
|
|
4414
4407
|
const exportOptions = {
|
|
4415
4408
|
...args,
|
|
4416
4409
|
managementToken,
|
|
4410
|
+
host: config.host ?? "api.contentful.com",
|
|
4411
|
+
...config.deliveryToken && { deliveryToken: config.deliveryToken },
|
|
4412
|
+
...config.hostDelivery && { hostDelivery: config.hostDelivery },
|
|
4417
4413
|
environmentId: args.environmentId || "master",
|
|
4418
4414
|
exportDir: args.exportDir || process.cwd(),
|
|
4419
4415
|
contentFile: args.contentFile || `contentful-export-${args.spaceId}.json`
|
|
@@ -4644,14 +4640,9 @@ var ImportSpaceToolParams = BaseToolSchema.extend({
|
|
|
4644
4640
|
assetsDirectory: z74.string().optional().describe("Path to directory containing exported asset files"),
|
|
4645
4641
|
timeout: z74.number().optional().default(3e3).describe("Time between retries during asset processing (ms)"),
|
|
4646
4642
|
retryLimit: z74.number().optional().default(10).describe("Max retries for asset processing"),
|
|
4647
|
-
host: z74.string().optional().describe("Management API host"),
|
|
4648
|
-
proxy: z74.string().optional().describe("HTTP/HTTPS proxy string (host:port or user:pass@host:port)"),
|
|
4649
|
-
rawProxy: z74.boolean().optional().describe("Pass proxy config directly to Axios"),
|
|
4650
4643
|
rateLimit: z74.number().optional().default(7).describe("Max requests per second to the API"),
|
|
4651
|
-
headers: z74.record(z74.any()).optional().describe("Additional headers to attach to requests"),
|
|
4652
4644
|
errorLogFile: z74.string().optional().describe("Path to error log file"),
|
|
4653
|
-
useVerboseRenderer: z74.boolean().optional().describe("Line-by-line progress output (good for CI)")
|
|
4654
|
-
config: z74.string().optional().describe("Path to config JSON file (merged with CLI args)")
|
|
4645
|
+
useVerboseRenderer: z74.boolean().optional().describe("Line-by-line progress output (good for CI)")
|
|
4655
4646
|
});
|
|
4656
4647
|
function createImportSpaceTool(config) {
|
|
4657
4648
|
async function tool2(args) {
|
|
@@ -4663,6 +4654,7 @@ function createImportSpaceTool(config) {
|
|
|
4663
4654
|
const importOptions = {
|
|
4664
4655
|
...args,
|
|
4665
4656
|
managementToken,
|
|
4657
|
+
host: config.host ?? "api.contentful.com",
|
|
4666
4658
|
environmentId: args.environmentId || "master"
|
|
4667
4659
|
};
|
|
4668
4660
|
try {
|