@se-studio/contentful-cms 1.3.7 → 2.0.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.
Files changed (184) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/HOSTED.md +25 -72
  3. package/INSTALL.md +2 -2
  4. package/README.md +1 -1
  5. package/dist/cli/program.js +2 -2
  6. package/dist/cli/program.js.map +1 -1
  7. package/dist/commands/entry-search.d.ts.map +1 -1
  8. package/dist/commands/entry-search.js +4 -1
  9. package/dist/commands/entry-search.js.map +1 -1
  10. package/dist/commands/host-scaffold.d.ts +4 -0
  11. package/dist/commands/host-scaffold.d.ts.map +1 -0
  12. package/dist/commands/host-scaffold.js +73 -0
  13. package/dist/commands/host-scaffold.js.map +1 -0
  14. package/dist/commands/{mcpb-pack.d.ts → host-stage.d.ts} +2 -2
  15. package/dist/commands/host-stage.d.ts.map +1 -0
  16. package/dist/commands/host-stage.js +60 -0
  17. package/dist/commands/host-stage.js.map +1 -0
  18. package/dist/commands/host.d.ts +3 -0
  19. package/dist/commands/host.d.ts.map +1 -0
  20. package/dist/commands/host.js +9 -0
  21. package/dist/commands/host.js.map +1 -0
  22. package/dist/commands/list.d.ts.map +1 -1
  23. package/dist/commands/list.js +26 -2
  24. package/dist/commands/list.js.map +1 -1
  25. package/dist/commands/sitemap.d.ts.map +1 -1
  26. package/dist/commands/sitemap.js +17 -2
  27. package/dist/commands/sitemap.js.map +1 -1
  28. package/dist/contentful/cda-sync.d.ts.map +1 -1
  29. package/dist/contentful/cda-sync.js +2 -0
  30. package/dist/contentful/cda-sync.js.map +1 -1
  31. package/dist/contentful/reference-record.d.ts +4 -0
  32. package/dist/contentful/reference-record.d.ts.map +1 -1
  33. package/dist/contentful/reference-record.js +7 -0
  34. package/dist/contentful/reference-record.js.map +1 -1
  35. package/dist/generated/hosted-guide.d.ts +1 -1
  36. package/dist/generated/hosted-guide.d.ts.map +1 -1
  37. package/dist/generated/hosted-guide.js +1 -1
  38. package/dist/generated/hosted-guide.js.map +1 -1
  39. package/dist/generated/version.d.ts +1 -1
  40. package/dist/generated/version.js +1 -1
  41. package/dist/hosted/index.d.ts +7 -0
  42. package/dist/hosted/index.d.ts.map +1 -1
  43. package/dist/hosted/index.js +7 -0
  44. package/dist/hosted/index.js.map +1 -1
  45. package/dist/hosted/next/claude-connect.d.ts +8 -0
  46. package/dist/hosted/next/claude-connect.d.ts.map +1 -0
  47. package/dist/hosted/next/claude-connect.js +23 -0
  48. package/dist/hosted/next/claude-connect.js.map +1 -0
  49. package/dist/hosted/next/context.d.ts +3 -0
  50. package/dist/hosted/next/context.d.ts.map +1 -0
  51. package/dist/hosted/next/context.js +11 -0
  52. package/dist/hosted/next/context.js.map +1 -0
  53. package/dist/hosted/next/editor-pack-path.d.ts +2 -0
  54. package/dist/hosted/next/editor-pack-path.d.ts.map +1 -0
  55. package/dist/hosted/next/editor-pack-path.js +6 -0
  56. package/dist/hosted/next/editor-pack-path.js.map +1 -0
  57. package/dist/hosted/next/page-styles.d.ts +6 -0
  58. package/dist/hosted/next/page-styles.d.ts.map +1 -0
  59. package/dist/hosted/next/page-styles.js +37 -0
  60. package/dist/hosted/next/page-styles.js.map +1 -0
  61. package/dist/hosted/next/pages/CmsEditPage.d.ts +2 -0
  62. package/dist/hosted/next/pages/CmsEditPage.d.ts.map +1 -0
  63. package/dist/hosted/next/pages/CmsEditPage.js +22 -0
  64. package/dist/hosted/next/pages/CmsEditPage.js.map +1 -0
  65. package/dist/hosted/next/pages/ContentfulCallbackPage.d.ts +2 -0
  66. package/dist/hosted/next/pages/ContentfulCallbackPage.d.ts.map +1 -0
  67. package/dist/hosted/next/pages/ContentfulCallbackPage.js +45 -0
  68. package/dist/hosted/next/pages/ContentfulCallbackPage.js.map +1 -0
  69. package/dist/hosted/next/pages/HomePage.d.ts +2 -0
  70. package/dist/hosted/next/pages/HomePage.d.ts.map +1 -0
  71. package/dist/hosted/next/pages/HomePage.js +36 -0
  72. package/dist/hosted/next/pages/HomePage.js.map +1 -0
  73. package/dist/hosted/next/redis.d.ts +5 -0
  74. package/dist/hosted/next/redis.d.ts.map +1 -0
  75. package/dist/hosted/next/redis.js +23 -0
  76. package/dist/hosted/next/redis.js.map +1 -0
  77. package/dist/hosted/next/routes/connect.d.ts +2 -0
  78. package/dist/hosted/next/routes/connect.d.ts.map +1 -0
  79. package/dist/hosted/next/routes/connect.js +19 -0
  80. package/dist/hosted/next/routes/connect.js.map +1 -0
  81. package/dist/hosted/next/routes/health.d.ts +2 -0
  82. package/dist/hosted/next/routes/health.d.ts.map +1 -0
  83. package/dist/hosted/next/routes/health.js +51 -0
  84. package/dist/hosted/next/routes/health.js.map +1 -0
  85. package/dist/hosted/next/routes/link-contentful.d.ts +2 -0
  86. package/dist/hosted/next/routes/link-contentful.d.ts.map +1 -0
  87. package/dist/hosted/next/routes/link-contentful.js +6 -0
  88. package/dist/hosted/next/routes/link-contentful.js.map +1 -0
  89. package/dist/hosted/next/routes/mcp.d.ts +4 -0
  90. package/dist/hosted/next/routes/mcp.d.ts.map +1 -0
  91. package/dist/hosted/next/routes/mcp.js +52 -0
  92. package/dist/hosted/next/routes/mcp.js.map +1 -0
  93. package/dist/hosted/next/routes/oauth-authorization-server.d.ts +2 -0
  94. package/dist/hosted/next/routes/oauth-authorization-server.d.ts.map +1 -0
  95. package/dist/hosted/next/routes/oauth-authorization-server.js +5 -0
  96. package/dist/hosted/next/routes/oauth-authorization-server.js.map +1 -0
  97. package/dist/hosted/next/routes/oauth-authorize.d.ts +2 -0
  98. package/dist/hosted/next/routes/oauth-authorize.d.ts.map +1 -0
  99. package/dist/hosted/next/routes/oauth-authorize.js +6 -0
  100. package/dist/hosted/next/routes/oauth-authorize.js.map +1 -0
  101. package/dist/hosted/next/routes/oauth-protected-resource.d.ts +2 -0
  102. package/dist/hosted/next/routes/oauth-protected-resource.d.ts.map +1 -0
  103. package/dist/hosted/next/routes/oauth-protected-resource.js +5 -0
  104. package/dist/hosted/next/routes/oauth-protected-resource.js.map +1 -0
  105. package/dist/hosted/next/routes/oauth-register.d.ts +2 -0
  106. package/dist/hosted/next/routes/oauth-register.d.ts.map +1 -0
  107. package/dist/hosted/next/routes/oauth-register.js +6 -0
  108. package/dist/hosted/next/routes/oauth-register.js.map +1 -0
  109. package/dist/hosted/next/routes/oauth-token.d.ts +2 -0
  110. package/dist/hosted/next/routes/oauth-token.d.ts.map +1 -0
  111. package/dist/hosted/next/routes/oauth-token.js +6 -0
  112. package/dist/hosted/next/routes/oauth-token.js.map +1 -0
  113. package/dist/hosted/next/stage-site.d.ts +11 -0
  114. package/dist/hosted/next/stage-site.d.ts.map +1 -0
  115. package/dist/hosted/next/stage-site.js +49 -0
  116. package/dist/hosted/next/stage-site.js.map +1 -0
  117. package/dist/hosted/oauth/auth.d.ts +11 -0
  118. package/dist/hosted/oauth/auth.d.ts.map +1 -0
  119. package/dist/hosted/oauth/auth.js +41 -0
  120. package/dist/hosted/oauth/auth.js.map +1 -0
  121. package/dist/hosted/oauth/complete.d.ts +13 -0
  122. package/dist/hosted/oauth/complete.d.ts.map +1 -0
  123. package/dist/hosted/oauth/complete.js +40 -0
  124. package/dist/hosted/oauth/complete.js.map +1 -0
  125. package/dist/hosted/oauth/config.d.ts +7 -0
  126. package/dist/hosted/oauth/config.d.ts.map +1 -0
  127. package/dist/hosted/oauth/config.js +33 -0
  128. package/dist/hosted/oauth/config.js.map +1 -0
  129. package/dist/hosted/oauth/handlers.d.ts +18 -0
  130. package/dist/hosted/oauth/handlers.d.ts.map +1 -0
  131. package/dist/hosted/oauth/handlers.js +212 -0
  132. package/dist/hosted/oauth/handlers.js.map +1 -0
  133. package/dist/hosted/oauth/jwt.d.ts +9 -0
  134. package/dist/hosted/oauth/jwt.d.ts.map +1 -0
  135. package/dist/hosted/oauth/jwt.js +31 -0
  136. package/dist/hosted/oauth/jwt.js.map +1 -0
  137. package/dist/hosted/oauth/pkce.d.ts +3 -0
  138. package/dist/hosted/oauth/pkce.d.ts.map +1 -0
  139. package/dist/hosted/oauth/pkce.js +9 -0
  140. package/dist/hosted/oauth/pkce.js.map +1 -0
  141. package/dist/hosted/oauth/store.d.ts +35 -0
  142. package/dist/hosted/oauth/store.d.ts.map +1 -0
  143. package/dist/hosted/oauth/store.js +70 -0
  144. package/dist/hosted/oauth/store.js.map +1 -0
  145. package/dist/index/db.d.ts.map +1 -1
  146. package/dist/index/db.js +5 -1
  147. package/dist/index/db.js.map +1 -1
  148. package/dist/index/query.d.ts +4 -0
  149. package/dist/index/query.d.ts.map +1 -1
  150. package/dist/index/query.js +13 -2
  151. package/dist/index/query.js.map +1 -1
  152. package/dist/index/reference-lookup.d.ts.map +1 -1
  153. package/dist/index/reference-lookup.js +4 -0
  154. package/dist/index/reference-lookup.js.map +1 -1
  155. package/dist/index/schema.d.ts +5 -3
  156. package/dist/index/schema.d.ts.map +1 -1
  157. package/dist/index/schema.js +8 -3
  158. package/dist/index/schema.js.map +1 -1
  159. package/dist/index/sync.d.ts.map +1 -1
  160. package/dist/index/sync.js +5 -4
  161. package/dist/index/sync.js.map +1 -1
  162. package/dist/mcp/guide.js +5 -5
  163. package/dist/mcp/guide.js.map +1 -1
  164. package/dist/mcp/prompts/onboarding.js +1 -1
  165. package/dist/mcp/tools/cms-edit.d.ts +1 -1
  166. package/dist/mcp/tools/cms-edit.d.ts.map +1 -1
  167. package/dist/mcp/tools/cms-edit.js +10 -2
  168. package/dist/mcp/tools/cms-edit.js.map +1 -1
  169. package/dist/output/json.d.ts.map +1 -1
  170. package/dist/output/json.js +1 -0
  171. package/dist/output/json.js.map +1 -1
  172. package/dist/project/types.d.ts +0 -8
  173. package/dist/project/types.d.ts.map +1 -1
  174. package/dist/project/types.js +0 -8
  175. package/dist/project/types.js.map +1 -1
  176. package/docs/help/fields-article.md +14 -0
  177. package/docs/help/index-sync.md +1 -0
  178. package/docs/mcp/hosted-guide.md +29 -5
  179. package/package.json +34 -6
  180. package/skills/core/SKILL.md +7 -0
  181. package/skills/setup/SKILL.md +12 -15
  182. package/dist/commands/mcpb-pack.d.ts.map +0 -1
  183. package/dist/commands/mcpb-pack.js +0 -60
  184. package/dist/commands/mcpb-pack.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/project/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;iBAsB/B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,iFAAiF;AACjF,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,cAAc,GAAG,kBAAkB,CAOhF"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/project/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;iBAsB/B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
@@ -22,12 +22,4 @@ export const CmsEditProjectSchema = z.object({
22
22
  mcpUrl: z.string().url(),
23
23
  }),
24
24
  });
25
- export function toMcpbCustomerConfig(project) {
26
- return {
27
- projectKey: project.projectKey,
28
- displayName: project.displayName,
29
- mcpUrl: project.hosted.mcpUrl,
30
- description: project.description,
31
- };
32
- }
33
25
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/project/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK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C,CAAC,CAAC,QAAQ,EAAE;QAChD,kFAAkF;QAClF,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;KAC3C,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;KACzB,CAAC;CACH,CAAC,CAAC"}
@@ -31,6 +31,20 @@ This lists all article type entries with their IDs and slugs. Use the `sys.id` v
31
31
 
32
32
  ---
33
33
 
34
+ ## Listing Recent Articles
35
+
36
+ Sort by publication `date` (matches the website), not `sys.updatedAt`:
37
+
38
+ ```bash
39
+ cms-edit list --type article --sort date -n 10
40
+ cms-edit search "keyword" --type article
41
+ cms-edit sitemap --include article --sort date
42
+ ```
43
+
44
+ To find **draft** articles: `cms-edit sitemap --include article --status draft`, then `cms-edit peek --article-slug <slug>` or `cms-edit open --id <id>`. `peek` and `open` load draft content — only `list --published` is published-only.
45
+
46
+ ---
47
+
34
48
  ## Reading Article Fields
35
49
 
36
50
  ```bash
@@ -23,6 +23,7 @@ Each catalog row stores:
23
23
  | `cmsLabel` | `cmsLabel` when present (page, article, pageVariant, tag, template) |
24
24
  | `tagTypeSlug` | Parent tag type slug (tags only) |
25
25
  | `articleTypeSlug` | Parent article type slug (articles only) |
26
+ | `date` | Publication date `YYYY-MM-DD` (articles only; schema v4) |
26
27
 
27
28
  ## When you need it
28
29
 
@@ -1,6 +1,6 @@
1
1
  # cms-edit MCP guide
2
2
 
3
- Use this guide when editing Contentful draft content through Claude Desktop (hosted `.mcpb` extension) or local stdio MCP.
3
+ Use this guide when editing Contentful draft content through Claude Desktop (hosted Integrations + OAuth) or local stdio MCP.
4
4
 
5
5
  {{SITE_INTRO}}
6
6
 
@@ -148,7 +148,7 @@ Asset search and media-by-filename list **require** the index. Template/taxonomy
148
148
  ["search", "pricing"]
149
149
  ```
150
150
 
151
- ## Hosted extension rules
151
+ ## Hosted connector rules
152
152
 
153
153
  {{HOSTED_RULES}}
154
154
 
@@ -177,12 +177,36 @@ Asset search and media-by-filename list **require** the index. Template/taxonomy
177
177
 
178
178
  | Problem | What to do |
179
179
  |---------|------------|
180
- | **401 / invalid token** | Regenerate CMA token in Contentful; update token in Claude Desktop → Settings → Extensions |
181
- | **No cms_edit tool** | Quit Claude fully and reopen; confirm extension is enabled |
180
+ | **401 / connection failed** | Claude → Settings → Integrations → Connect again; complete Contentful sign-in |
181
+ | **No cms_edit tool** | Confirm the integration is connected under Settings → Integrations |
182
182
  | **No active session** | Do not pass `--space` on hosted. Check `/api/health` — `redis` must be ok. MCP uses `_mcp` session automatically. Manual session: `["--session", "name", "open", "--page-slug", "/"]`. Fallback: `["read", "<entry-id>", "--id"]` |
183
- | **Wrong space** | Token must belong to this deployment's Contentful space |
183
+ | **Wrong space** | Your Contentful account must have access to this deployment's space |
184
184
  | **Check version** | Call `cms_edit_version` or `curl /api/health` and read `cmsEdit` |
185
185
 
186
+ ## Articles
187
+
188
+ **Recent articles** (by publication `date`, not last-updated):
189
+
190
+ ```json
191
+ ["list", "--type", "article", "--sort", "date", "-n", "10"]
192
+ ```
193
+
194
+ Alternatives: `["search", "<keyword>", "--type", "article"]` (also sorts by date), `["sitemap", "--include", "article", "--sort", "date"]`.
195
+
196
+ **Draft articles** — `peek` and `open` load drafts via CMA (not published-only). To discover drafts:
197
+
198
+ ```json
199
+ ["sitemap", "--include", "article", "--status", "draft"]
200
+ ["search", "<title>", "--type", "article"]
201
+ ["list", "--type", "article", "--slug", "<slug>"]
202
+ ```
203
+
204
+ Then open: `["peek", "--article-slug", "<slug>"]` or `["open", "--id", "<entry-id>"]`. Use `--article-slug`, not `--page-slug`.
205
+
206
+ **Published-only** is opt-in: `list --published` and `resolve --published` use the Delivery API index and omit never-published drafts.
207
+
208
+ After upgrading cms-edit, run `["index", "sync"]` once so the local index includes article `date` values (schema v4).
209
+
186
210
  ## Command reference (cms_edit args)
187
211
 
188
212
  **Discovery:** `sitemap`, `list --type <type>`, `search <query>`, `schema <contentType>`, `index sync`, `index status`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@se-studio/contentful-cms",
3
- "version": "1.3.7",
3
+ "version": "2.0.0",
4
4
  "description": "CLI tool for AI agents to read and edit Contentful draft content without publish permissions",
5
5
  "repository": {
6
6
  "type": "git",
@@ -22,6 +22,30 @@
22
22
  "./hosted": {
23
23
  "types": "./dist/hosted/index.d.ts",
24
24
  "import": "./dist/hosted/index.js"
25
+ },
26
+ "./hosted/next/*": {
27
+ "types": "./dist/hosted/next/*.d.ts",
28
+ "import": "./dist/hosted/next/*.js"
29
+ }
30
+ },
31
+ "peerDependencies": {
32
+ "@upstash/redis": ">=1.38.0",
33
+ "next": ">=15.0.0",
34
+ "react": ">=19.0.0",
35
+ "react-dom": ">=19.0.0"
36
+ },
37
+ "peerDependenciesMeta": {
38
+ "@upstash/redis": {
39
+ "optional": false
40
+ },
41
+ "next": {
42
+ "optional": true
43
+ },
44
+ "react": {
45
+ "optional": true
46
+ },
47
+ "react-dom": {
48
+ "optional": true
25
49
  }
26
50
  },
27
51
  "bin": {
@@ -45,14 +69,19 @@
45
69
  "contentful": "^11.12.4",
46
70
  "contentful-management": "^12.5.1",
47
71
  "dotenv": "^17.4.2",
72
+ "jose": "^6.2.3",
48
73
  "picocolors": "^1.1.1",
49
74
  "zod": "^4.4.3"
50
75
  },
51
76
  "devDependencies": {
52
- "@anthropic-ai/mcpb": "^2.1.2",
53
77
  "@biomejs/biome": "^2.4.16",
54
- "@types/node": "^24.13.1",
55
- "esbuild": "^0.28.0",
78
+ "@types/node": "^24.13.2",
79
+ "@types/react": "^19.2.17",
80
+ "@types/react-dom": "^19.2.3",
81
+ "@upstash/redis": "^1.38.0",
82
+ "next": "^15.5.19",
83
+ "react": "^19.2.7",
84
+ "react-dom": "^19.2.7",
56
85
  "typescript": "^6.0.3",
57
86
  "vitest": "^4.1.8"
58
87
  },
@@ -72,11 +101,10 @@
72
101
  "generate:embeds": "node scripts/generate-embedded-assets.mjs",
73
102
  "sync:skills": "node scripts/sync-cms-edit-skills.mjs",
74
103
  "build": "node scripts/generate-embedded-assets.mjs && node scripts/sync-cms-edit-skills.mjs && tsc --project tsconfig.build.json",
75
- "build:mcpb-bridge": "esbuild mcpb/bridge/index.ts --bundle --platform=node --target=node20 --format=esm --packages=bundle --outfile=mcpb/.pack/bridge/index.js",
76
104
  "dev": "node scripts/generate-embedded-assets.mjs && node scripts/sync-cms-edit-skills.mjs && tsc --project tsconfig.build.json --watch",
77
105
  "type-check": "node scripts/generate-embedded-assets.mjs && tsc --noEmit",
78
106
  "lint": "biome lint .",
79
- "clean": "rm -rf dist src/generated .turbo *.tsbuildinfo mcpb/.pack mcpb/dist",
107
+ "clean": "rm -rf dist src/generated .turbo *.tsbuildinfo",
80
108
  "test": "node scripts/generate-embedded-assets.mjs && node scripts/sync-cms-edit-skills.mjs && vitest run"
81
109
  }
82
110
  }
@@ -479,10 +479,16 @@ cms-edit types component
479
479
  cms-edit types collection
480
480
 
481
481
  # List entries with filters
482
+ cms-edit list --type article --sort date -n 10 # recent articles by publication date
482
483
  cms-edit list --type article --has-download # articles with a download asset
483
484
  cms-edit list --type article --slug my-article # article with a specific slug
484
485
  cms-edit list --type article --has-field tags # articles where tags field is non-empty
485
486
 
487
+ # Find draft articles, then peek/open (both support drafts via CMA)
488
+ cms-edit sitemap --include article --status draft
489
+ cms-edit peek --article-slug resources/blog/my-post
490
+ # Only list --published / resolve --published are published-only
491
+
486
492
  # Resolve any entry or asset by ID (no open session required)
487
493
  cms-edit resolve --id 4xKj2abcDefGhijK # entry: shows type, title, slug, status
488
494
  cms-edit resolve --id 7pQrStuvWxyzAbc # asset: shows title, fileName, URL
@@ -702,6 +708,7 @@ cms-edit sitemap # All pages, sorted by slug
702
708
  cms-edit sitemap --prefix /blog # Filter by slug prefix
703
709
  cms-edit sitemap --status draft # Draft pages only
704
710
  cms-edit sitemap --sort updated # Most recently updated first
711
+ cms-edit sitemap --include article --sort date # Articles by publication date
705
712
  cms-edit sitemap --tree # Tree rendering
706
713
  cms-edit sitemap --include page,article # Include articles too
707
714
  ```
@@ -11,35 +11,32 @@ Use this skill when the user wants to install or configure the `cms-edit` MCP se
11
11
 
12
12
  | Path | When to use |
13
13
  |------|-------------|
14
- | **Hosted (`.mcpb`)** | User is a content editor; SE sent a `.mcpb` file; no Node.js |
14
+ | **Hosted (Integrations)** | Content editor; SE sent an onboarding URL (e.g. `/cms-edit`); no Node.js |
15
15
  | **Local (setup wizard)** | Developer; multi-space; or no hosted deployment |
16
16
 
17
17
  Ask which applies if unclear.
18
18
 
19
19
  ---
20
20
 
21
- ## Hosted setup (`.mcpb` extension)
21
+ ## Hosted setup (Claude Integrations + OAuth)
22
22
 
23
- Use when the user has a **`.mcpb` file** from SE (e.g. `cms-edit-om1.mcpb`). Do **not** run the setup wizard.
23
+ Use when SE sent an **onboarding link** (e.g. `https://your-site.content.se.studio/cms-edit`). Do **not** run the setup wizard.
24
24
 
25
- ### Step 1: Get a Contentful token
25
+ ### Step 1: Connect to Claude
26
26
 
27
- Same as local — tell the user to create a **personal access token** in Contentful (Settings → CMA tokens), name it `Claude Desktop`, and copy it.
27
+ 1. Open the link SE sent (or **Connect to Claude** on `/cms-edit`)
28
+ 2. Confirm the connector in Claude Desktop or claude.ai
29
+ 3. Sign in with **Contentful** when prompted (same account SE invited to the space)
28
30
 
29
- ### Step 2: Install the extension
30
-
31
- 1. Open [Claude Desktop](https://claude.ai/download)
32
- 2. **Settings → Extensions → Install Extension…** (or double-click the `.mcpb` file)
33
- 3. Paste the Contentful token when prompted
34
- 4. Fully quit and reopen Claude Desktop
31
+ Manual alternative: Claude → **Customize → Connectors** → Add custom connector → paste the MCP URL (`…/api/mcp`) → Connect.
35
32
 
36
33
  Full editor guide: `packages/contentful-cms/HOSTED.md`
37
34
 
38
- ### Step 3: Verify
35
+ ### Step 2: Verify
39
36
 
40
- In Claude, ask to list pages or open the homepage. If `cms_edit` returns content, setup is complete.
37
+ In Claude, ask to read the cms-edit guide or verify the connection. If `cms_edit` returns content, setup is complete.
41
38
 
42
- **Token update:** Settings → Extensions → open the cms-edit extension → update token.
39
+ **Reconnect:** Settings → Integrations → Connect again if the connection stops working.
43
40
 
44
41
  ---
45
42
 
@@ -126,4 +123,4 @@ If it returns a page structure, setup is complete. If it errors, see Troubleshoo
126
123
  It should contain an `mcpServers.cms-edit` entry. If missing, run the wizard again.
127
124
 
128
125
  **Adding another space**
129
- → Run `npx @se-studio/contentful-cms@latest setup` again — it merges the new space into the existing config.
126
+ → Run `npx @se-studio/contentful-cms@latest setup` again — it merges the new space into the existing config.
@@ -1 +0,0 @@
1
- {"version":3,"file":"mcpb-pack.d.ts","sourceRoot":"","sources":["../../src/commands/mcpb-pack.ts"],"names":[],"mappings":"AAAA,uFAAuF;AAOvF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAUzC,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAuDjE"}
@@ -1,60 +0,0 @@
1
- /** biome-ignore-all lint/suspicious/noConsole: Console output is intentional in CLI */
2
- import * as child_process from 'node:child_process';
3
- import * as fs from 'node:fs';
4
- import * as os from 'node:os';
5
- import * as path from 'node:path';
6
- import { fileURLToPath } from 'node:url';
7
- import { isJsonMode } from '../output/mode.js';
8
- import { loadProjectConfig } from '../project/load.js';
9
- import { toMcpbCustomerConfig } from '../project/types.js';
10
- const __dirname = path.dirname(fileURLToPath(import.meta.url));
11
- const PACKAGE_ROOT = path.resolve(__dirname, '..', '..');
12
- const MCPB_DIR = path.join(PACKAGE_ROOT, 'mcpb');
13
- const BUILD_SCRIPT = path.resolve(PACKAGE_ROOT, '..', '..', 'scripts', 'build-cms-edit-mcpb.sh');
14
- export function registerMcpbPackCommand(program) {
15
- const cmd = program.command('mcpb').description('Build Claude Desktop cms-edit extensions');
16
- cmd
17
- .command('pack')
18
- .description('Build a .mcpb extension from cms-edit/<site>/project.json')
19
- .requiredOption('--project-config <path>', 'Path to cms-edit/<site>/project.json')
20
- .option('--output <path>', 'Output .mcpb path')
21
- .action((opts) => {
22
- const project = loadProjectConfig(opts.projectConfig);
23
- const customer = toMcpbCustomerConfig(project);
24
- const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), 'cms-edit-mcpb-'));
25
- const tempConfig = path.join(tempDir, `${project.projectKey}.json`);
26
- fs.writeFileSync(tempConfig, `${JSON.stringify(customer, null, 2)}\n`);
27
- try {
28
- if (!fs.existsSync(BUILD_SCRIPT)) {
29
- throw new Error(`mcpb build script not found: ${BUILD_SCRIPT}`);
30
- }
31
- const args = ['--config', tempConfig];
32
- if (opts.output) {
33
- args.push('--output', path.resolve(opts.output));
34
- }
35
- const result = child_process.spawnSync('bash', [BUILD_SCRIPT, ...args], {
36
- cwd: path.resolve(PACKAGE_ROOT, '..', '..'),
37
- stdio: 'inherit',
38
- env: {
39
- ...process.env,
40
- CMS_EDIT_CUSTOMER_CONFIG: tempConfig,
41
- },
42
- });
43
- if (result.status !== 0) {
44
- throw new Error('mcpb pack failed');
45
- }
46
- const defaultOutput = path.join(MCPB_DIR, 'dist', `cms-edit-${project.projectKey}.mcpb`);
47
- const outputPath = opts.output ? path.resolve(opts.output) : defaultOutput;
48
- if (isJsonMode()) {
49
- console.log(JSON.stringify({ ok: true, output: outputPath, projectKey: project.projectKey }));
50
- return;
51
- }
52
- console.log(`Built extension: ${outputPath}`);
53
- }
54
- finally {
55
- fs.rmSync(tempDir, { recursive: true, force: true });
56
- }
57
- });
58
- return cmd;
59
- }
60
- //# sourceMappingURL=mcpb-pack.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mcpb-pack.js","sourceRoot":"","sources":["../../src/commands/mcpb-pack.ts"],"names":[],"mappings":"AAAA,uFAAuF;AAEvF,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,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