@contentful/mcp-server 1.7.19 → 1.9.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 CHANGED
@@ -63,13 +63,14 @@ npm run build
63
63
 
64
64
  ### Environment Variables
65
65
 
66
- | Environment Variable | Required | Default Value | Description |
67
- | ------------------------------------ | -------- | -------------------- | ---------------------------------------------------- |
68
- | `CONTENTFUL_MANAGEMENT_ACCESS_TOKEN` | ✅ Yes | - | Your Contentful Management API personal access token |
69
- | `SPACE_ID` | ✅ Yes | - | Your Contentful Space ID |
70
- | `ENVIRONMENT_ID` | ❌ No | `master` | Target environment within your space |
71
- | `CONTENTFUL_HOST` | ❌ No | `api.contentful.com` | Contentful API host |
72
- | `NODE_ENV` | ❌ No | `production` | Node Environment to run in |
66
+ | Environment Variable | Required | Default Value | Description |
67
+ | ------------------------------------ | -------- | -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
68
+ | `CONTENTFUL_MANAGEMENT_ACCESS_TOKEN` | ✅ Yes | - | Your Contentful Management API personal access token |
69
+ | `SPACE_ID` | ✅ Yes | - | Your Contentful Space ID |
70
+ | `ENVIRONMENT_ID` | ❌ No | `master` | Target environment within your space |
71
+ | `CONTENTFUL_HOST` | ❌ No | `api.contentful.com` | Contentful API host |
72
+ | `NODE_ENV` | ❌ No | `production` | Node Environment to run in |
73
+ | `MAX_BULK_SIZE` | ❌ No | `10` | Maximum number of IDs allowed in a single bulk-operation tool call (1–100). Caps publish/unpublish/archive/unarchive on entries and assets. Mitigates accidental mass operations from AI hallucinations. |
73
74
 
74
75
  ### Configuration
75
76
 
package/dist/index.js CHANGED
@@ -4095,6 +4095,15 @@ var EnvSchema = external_exports.object({
4095
4095
  APP_ID: external_exports.string().optional().describe("Contentful App ID"),
4096
4096
  SPACE_ID: external_exports.string().optional().describe("Contentful Space ID"),
4097
4097
  ENVIRONMENT_ID: external_exports.string().optional().default("master").describe("Contentful environment ID"),
4098
+ PROTECTED_ENVIRONMENTS: external_exports.string().optional().describe(
4099
+ "Comma-separated list of environment IDs protected from write/delete operations (e.g., master,staging)"
4100
+ ),
4101
+ MAX_BULK_SIZE: external_exports.string().optional().refine(
4102
+ (v) => v === void 0 || /^\d+$/.test(v) && Number(v) > 0 && Number(v) <= 100,
4103
+ { message: "MAX_BULK_SIZE must be a positive integer between 1 and 100" }
4104
+ ).describe(
4105
+ "Maximum number of IDs allowed in a single bulk-operation tool call (default: 10, max: 100). Mitigates accidental mass operations from AI hallucinations."
4106
+ ),
4098
4107
  ORGANIZATION_ID: external_exports.string().optional().describe("Contentful organization ID"),
4099
4108
  CONTENTFUL_DELIVERY_TOKEN: external_exports.string().optional().describe(
4100
4109
  "Contentful CDA token (used with export_space to export only published content)"
@@ -4114,7 +4123,7 @@ init_esm_shims();
4114
4123
 
4115
4124
  // src/mcpVersion.ts
4116
4125
  init_esm_shims();
4117
- var MCP_VERSION = "1.7.18";
4126
+ var MCP_VERSION = "1.8.1";
4118
4127
 
4119
4128
  // src/getVersion.ts
4120
4129
  var getVersion = () => {
@@ -4126,6 +4135,9 @@ function registerAllTools(server) {
4126
4135
  if (!env.success || !env.data) {
4127
4136
  throw new Error("Environment variables are not properly configured");
4128
4137
  }
4138
+ const parsedProtectedEnvs = env.data.PROTECTED_ENVIRONMENTS ? env.data.PROTECTED_ENVIRONMENTS.split(",").map((e) => e.trim()).filter(Boolean) : void 0;
4139
+ const protectedEnvironments = parsedProtectedEnvs?.length ? parsedProtectedEnvs : void 0;
4140
+ const maxBulkSize = env.data.MAX_BULK_SIZE ? Number(env.data.MAX_BULK_SIZE) : void 0;
4129
4141
  const tools = new ContentfulMcpTools({
4130
4142
  accessToken: env.data.CONTENTFUL_MANAGEMENT_ACCESS_TOKEN,
4131
4143
  host: env.data.CONTENTFUL_HOST,
@@ -4135,7 +4147,9 @@ function registerAllTools(server) {
4135
4147
  appId: env.data.APP_ID,
4136
4148
  mcpVersion: getVersion(),
4137
4149
  deliveryToken: env.data.CONTENTFUL_DELIVERY_TOKEN,
4138
- hostDelivery: env.data.CONTENTFUL_DELIVERY_HOST
4150
+ hostDelivery: env.data.CONTENTFUL_DELIVERY_HOST,
4151
+ protectedEnvironments,
4152
+ maxBulkSize
4139
4153
  });
4140
4154
  const aiActionTools = tools.getAiActionTools();
4141
4155
  const assetTools = tools.getAssetTools();