@contentful/mcp-server 1.13.0 → 1.15.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 +9 -8
- package/dist/index.js +21 -6
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -63,14 +63,15 @@ 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
|
|
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.
|
|
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. |
|
|
74
|
+
| `ENABLE_EXO_TOOLS` | ❌ No | `false` | Opt in to Experience Orchestration (ExO) tools. Set to `true` to register the ExO tool collections (components, data assemblies, experiences, experience templates, experience fragments). Also requires the token to hold the `exoM1` entitlement in at least one accessible org — both gates must pass. |
|
|
74
75
|
|
|
75
76
|
### Configuration
|
|
76
77
|
|
package/dist/index.js
CHANGED
|
@@ -21,7 +21,7 @@ function registerAllResources(_server) {
|
|
|
21
21
|
|
|
22
22
|
// src/tools/register.ts
|
|
23
23
|
init_esm_shims();
|
|
24
|
-
import { ContentfulMcpTools } from "@contentful/mcp-tools";
|
|
24
|
+
import { ContentfulMcpTools, hasExoM1Entitlement } from "@contentful/mcp-tools";
|
|
25
25
|
|
|
26
26
|
// src/config/env.ts
|
|
27
27
|
init_esm_shims();
|
|
@@ -4105,6 +4105,9 @@ var EnvSchema = external_exports.object({
|
|
|
4105
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
4106
|
),
|
|
4107
4107
|
ORGANIZATION_ID: external_exports.string().optional().describe("Contentful organization ID"),
|
|
4108
|
+
ENABLE_EXO_TOOLS: external_exports.string().optional().transform((v) => v === "true").describe(
|
|
4109
|
+
'Opt in to Experience Orchestration (ExO) tools. Set to "true" to register the ExO tool collections (components, data assemblies, experiences, experience templates, experience fragments). Tools register only if the token also holds the exoM1 entitlement in at least one accessible org \u2014 both gates must pass. Defaults to off.'
|
|
4110
|
+
),
|
|
4108
4111
|
CONTENTFUL_DELIVERY_TOKEN: external_exports.string().optional().describe(
|
|
4109
4112
|
"Contentful CDA token (used with export_space to export only published content)"
|
|
4110
4113
|
),
|
|
@@ -4123,7 +4126,7 @@ init_esm_shims();
|
|
|
4123
4126
|
|
|
4124
4127
|
// src/mcpVersion.ts
|
|
4125
4128
|
init_esm_shims();
|
|
4126
|
-
var MCP_VERSION = "1.
|
|
4129
|
+
var MCP_VERSION = "1.14.0";
|
|
4127
4130
|
|
|
4128
4131
|
// src/getVersion.ts
|
|
4129
4132
|
var getVersion = () => {
|
|
@@ -4131,14 +4134,14 @@ var getVersion = () => {
|
|
|
4131
4134
|
};
|
|
4132
4135
|
|
|
4133
4136
|
// src/tools/register.ts
|
|
4134
|
-
function registerAllTools(server) {
|
|
4137
|
+
async function registerAllTools(server) {
|
|
4135
4138
|
if (!env.success || !env.data) {
|
|
4136
4139
|
throw new Error("Environment variables are not properly configured");
|
|
4137
4140
|
}
|
|
4138
4141
|
const parsedProtectedEnvs = env.data.PROTECTED_ENVIRONMENTS ? env.data.PROTECTED_ENVIRONMENTS.split(",").map((e) => e.trim()).filter(Boolean) : void 0;
|
|
4139
4142
|
const protectedEnvironments = parsedProtectedEnvs?.length ? parsedProtectedEnvs : void 0;
|
|
4140
4143
|
const maxBulkSize = env.data.MAX_BULK_SIZE ? Number(env.data.MAX_BULK_SIZE) : void 0;
|
|
4141
|
-
const
|
|
4144
|
+
const baseConfig = {
|
|
4142
4145
|
accessToken: env.data.CONTENTFUL_MANAGEMENT_ACCESS_TOKEN,
|
|
4143
4146
|
host: env.data.CONTENTFUL_HOST,
|
|
4144
4147
|
spaceId: env.data.SPACE_ID,
|
|
@@ -4150,6 +4153,11 @@ function registerAllTools(server) {
|
|
|
4150
4153
|
hostDelivery: env.data.CONTENTFUL_DELIVERY_HOST,
|
|
4151
4154
|
protectedEnvironments,
|
|
4152
4155
|
maxBulkSize
|
|
4156
|
+
};
|
|
4157
|
+
const registerExoTools = env.data.ENABLE_EXO_TOOLS && await hasExoM1Entitlement(baseConfig);
|
|
4158
|
+
const tools = new ContentfulMcpTools({
|
|
4159
|
+
...baseConfig,
|
|
4160
|
+
exoToolsRegistered: registerExoTools
|
|
4153
4161
|
});
|
|
4154
4162
|
const aiActionTools = tools.getAiActionTools();
|
|
4155
4163
|
const assetTools = tools.getAssetTools();
|
|
@@ -4175,7 +4183,14 @@ function registerAllTools(server) {
|
|
|
4175
4183
|
orgTools,
|
|
4176
4184
|
spaceTools,
|
|
4177
4185
|
tagTools,
|
|
4178
|
-
taxonomyTools
|
|
4186
|
+
taxonomyTools,
|
|
4187
|
+
...registerExoTools ? [
|
|
4188
|
+
tools.getComponentTools(),
|
|
4189
|
+
tools.getDataAssemblyTools(),
|
|
4190
|
+
tools.getExperienceTools(),
|
|
4191
|
+
tools.getExperienceTemplateTools(),
|
|
4192
|
+
tools.getExperienceFragmentTools()
|
|
4193
|
+
] : []
|
|
4179
4194
|
];
|
|
4180
4195
|
allToolCollections.forEach((toolCollection) => {
|
|
4181
4196
|
Object.values(toolCollection).forEach((tool) => {
|
|
@@ -4238,7 +4253,7 @@ async function initializeServer() {
|
|
|
4238
4253
|
name: MCP_SERVER_NAME,
|
|
4239
4254
|
version: getVersion()
|
|
4240
4255
|
});
|
|
4241
|
-
registerAllTools(server);
|
|
4256
|
+
await registerAllTools(server);
|
|
4242
4257
|
registerAllPrompts(server);
|
|
4243
4258
|
registerAllResources(server);
|
|
4244
4259
|
return server;
|