@se-studio/contentful-cms 1.4.0 → 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 (145) hide show
  1. package/CHANGELOG.md +6 -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/host-scaffold.d.ts +4 -0
  8. package/dist/commands/host-scaffold.d.ts.map +1 -0
  9. package/dist/commands/host-scaffold.js +73 -0
  10. package/dist/commands/host-scaffold.js.map +1 -0
  11. package/dist/commands/{mcpb-pack.d.ts → host-stage.d.ts} +2 -2
  12. package/dist/commands/host-stage.d.ts.map +1 -0
  13. package/dist/commands/host-stage.js +60 -0
  14. package/dist/commands/host-stage.js.map +1 -0
  15. package/dist/commands/host.d.ts +3 -0
  16. package/dist/commands/host.d.ts.map +1 -0
  17. package/dist/commands/host.js +9 -0
  18. package/dist/commands/host.js.map +1 -0
  19. package/dist/generated/hosted-guide.d.ts +1 -1
  20. package/dist/generated/hosted-guide.d.ts.map +1 -1
  21. package/dist/generated/hosted-guide.js +1 -1
  22. package/dist/generated/hosted-guide.js.map +1 -1
  23. package/dist/generated/version.d.ts +1 -1
  24. package/dist/generated/version.js +1 -1
  25. package/dist/hosted/index.d.ts +7 -0
  26. package/dist/hosted/index.d.ts.map +1 -1
  27. package/dist/hosted/index.js +7 -0
  28. package/dist/hosted/index.js.map +1 -1
  29. package/dist/hosted/next/claude-connect.d.ts +8 -0
  30. package/dist/hosted/next/claude-connect.d.ts.map +1 -0
  31. package/dist/hosted/next/claude-connect.js +23 -0
  32. package/dist/hosted/next/claude-connect.js.map +1 -0
  33. package/dist/hosted/next/context.d.ts +3 -0
  34. package/dist/hosted/next/context.d.ts.map +1 -0
  35. package/dist/hosted/next/context.js +11 -0
  36. package/dist/hosted/next/context.js.map +1 -0
  37. package/dist/hosted/next/editor-pack-path.d.ts +2 -0
  38. package/dist/hosted/next/editor-pack-path.d.ts.map +1 -0
  39. package/dist/hosted/next/editor-pack-path.js +6 -0
  40. package/dist/hosted/next/editor-pack-path.js.map +1 -0
  41. package/dist/hosted/next/page-styles.d.ts +6 -0
  42. package/dist/hosted/next/page-styles.d.ts.map +1 -0
  43. package/dist/hosted/next/page-styles.js +37 -0
  44. package/dist/hosted/next/page-styles.js.map +1 -0
  45. package/dist/hosted/next/pages/CmsEditPage.d.ts +2 -0
  46. package/dist/hosted/next/pages/CmsEditPage.d.ts.map +1 -0
  47. package/dist/hosted/next/pages/CmsEditPage.js +22 -0
  48. package/dist/hosted/next/pages/CmsEditPage.js.map +1 -0
  49. package/dist/hosted/next/pages/ContentfulCallbackPage.d.ts +2 -0
  50. package/dist/hosted/next/pages/ContentfulCallbackPage.d.ts.map +1 -0
  51. package/dist/hosted/next/pages/ContentfulCallbackPage.js +45 -0
  52. package/dist/hosted/next/pages/ContentfulCallbackPage.js.map +1 -0
  53. package/dist/hosted/next/pages/HomePage.d.ts +2 -0
  54. package/dist/hosted/next/pages/HomePage.d.ts.map +1 -0
  55. package/dist/hosted/next/pages/HomePage.js +36 -0
  56. package/dist/hosted/next/pages/HomePage.js.map +1 -0
  57. package/dist/hosted/next/redis.d.ts +5 -0
  58. package/dist/hosted/next/redis.d.ts.map +1 -0
  59. package/dist/hosted/next/redis.js +23 -0
  60. package/dist/hosted/next/redis.js.map +1 -0
  61. package/dist/hosted/next/routes/connect.d.ts +2 -0
  62. package/dist/hosted/next/routes/connect.d.ts.map +1 -0
  63. package/dist/hosted/next/routes/connect.js +19 -0
  64. package/dist/hosted/next/routes/connect.js.map +1 -0
  65. package/dist/hosted/next/routes/health.d.ts +2 -0
  66. package/dist/hosted/next/routes/health.d.ts.map +1 -0
  67. package/dist/hosted/next/routes/health.js +51 -0
  68. package/dist/hosted/next/routes/health.js.map +1 -0
  69. package/dist/hosted/next/routes/link-contentful.d.ts +2 -0
  70. package/dist/hosted/next/routes/link-contentful.d.ts.map +1 -0
  71. package/dist/hosted/next/routes/link-contentful.js +6 -0
  72. package/dist/hosted/next/routes/link-contentful.js.map +1 -0
  73. package/dist/hosted/next/routes/mcp.d.ts +4 -0
  74. package/dist/hosted/next/routes/mcp.d.ts.map +1 -0
  75. package/dist/hosted/next/routes/mcp.js +52 -0
  76. package/dist/hosted/next/routes/mcp.js.map +1 -0
  77. package/dist/hosted/next/routes/oauth-authorization-server.d.ts +2 -0
  78. package/dist/hosted/next/routes/oauth-authorization-server.d.ts.map +1 -0
  79. package/dist/hosted/next/routes/oauth-authorization-server.js +5 -0
  80. package/dist/hosted/next/routes/oauth-authorization-server.js.map +1 -0
  81. package/dist/hosted/next/routes/oauth-authorize.d.ts +2 -0
  82. package/dist/hosted/next/routes/oauth-authorize.d.ts.map +1 -0
  83. package/dist/hosted/next/routes/oauth-authorize.js +6 -0
  84. package/dist/hosted/next/routes/oauth-authorize.js.map +1 -0
  85. package/dist/hosted/next/routes/oauth-protected-resource.d.ts +2 -0
  86. package/dist/hosted/next/routes/oauth-protected-resource.d.ts.map +1 -0
  87. package/dist/hosted/next/routes/oauth-protected-resource.js +5 -0
  88. package/dist/hosted/next/routes/oauth-protected-resource.js.map +1 -0
  89. package/dist/hosted/next/routes/oauth-register.d.ts +2 -0
  90. package/dist/hosted/next/routes/oauth-register.d.ts.map +1 -0
  91. package/dist/hosted/next/routes/oauth-register.js +6 -0
  92. package/dist/hosted/next/routes/oauth-register.js.map +1 -0
  93. package/dist/hosted/next/routes/oauth-token.d.ts +2 -0
  94. package/dist/hosted/next/routes/oauth-token.d.ts.map +1 -0
  95. package/dist/hosted/next/routes/oauth-token.js +6 -0
  96. package/dist/hosted/next/routes/oauth-token.js.map +1 -0
  97. package/dist/hosted/next/stage-site.d.ts +11 -0
  98. package/dist/hosted/next/stage-site.d.ts.map +1 -0
  99. package/dist/hosted/next/stage-site.js +49 -0
  100. package/dist/hosted/next/stage-site.js.map +1 -0
  101. package/dist/hosted/oauth/auth.d.ts +11 -0
  102. package/dist/hosted/oauth/auth.d.ts.map +1 -0
  103. package/dist/hosted/oauth/auth.js +41 -0
  104. package/dist/hosted/oauth/auth.js.map +1 -0
  105. package/dist/hosted/oauth/complete.d.ts +13 -0
  106. package/dist/hosted/oauth/complete.d.ts.map +1 -0
  107. package/dist/hosted/oauth/complete.js +40 -0
  108. package/dist/hosted/oauth/complete.js.map +1 -0
  109. package/dist/hosted/oauth/config.d.ts +7 -0
  110. package/dist/hosted/oauth/config.d.ts.map +1 -0
  111. package/dist/hosted/oauth/config.js +33 -0
  112. package/dist/hosted/oauth/config.js.map +1 -0
  113. package/dist/hosted/oauth/handlers.d.ts +18 -0
  114. package/dist/hosted/oauth/handlers.d.ts.map +1 -0
  115. package/dist/hosted/oauth/handlers.js +212 -0
  116. package/dist/hosted/oauth/handlers.js.map +1 -0
  117. package/dist/hosted/oauth/jwt.d.ts +9 -0
  118. package/dist/hosted/oauth/jwt.d.ts.map +1 -0
  119. package/dist/hosted/oauth/jwt.js +31 -0
  120. package/dist/hosted/oauth/jwt.js.map +1 -0
  121. package/dist/hosted/oauth/pkce.d.ts +3 -0
  122. package/dist/hosted/oauth/pkce.d.ts.map +1 -0
  123. package/dist/hosted/oauth/pkce.js +9 -0
  124. package/dist/hosted/oauth/pkce.js.map +1 -0
  125. package/dist/hosted/oauth/store.d.ts +35 -0
  126. package/dist/hosted/oauth/store.d.ts.map +1 -0
  127. package/dist/hosted/oauth/store.js +70 -0
  128. package/dist/hosted/oauth/store.js.map +1 -0
  129. package/dist/mcp/guide.js +5 -5
  130. package/dist/mcp/guide.js.map +1 -1
  131. package/dist/mcp/prompts/onboarding.js +1 -1
  132. package/dist/mcp/tools/cms-edit.d.ts +1 -1
  133. package/dist/mcp/tools/cms-edit.d.ts.map +1 -1
  134. package/dist/mcp/tools/cms-edit.js +2 -2
  135. package/dist/mcp/tools/cms-edit.js.map +1 -1
  136. package/dist/project/types.d.ts +0 -8
  137. package/dist/project/types.d.ts.map +1 -1
  138. package/dist/project/types.js +0 -8
  139. package/dist/project/types.js.map +1 -1
  140. package/docs/mcp/hosted-guide.md +5 -5
  141. package/package.json +34 -6
  142. package/skills/setup/SKILL.md +12 -15
  143. package/dist/commands/mcpb-pack.d.ts.map +0 -1
  144. package/dist/commands/mcpb-pack.js +0 -60
  145. package/dist/commands/mcpb-pack.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @se-studio/contentful-cms Changelog
2
2
 
3
+ ## 2.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - Replace `.mcpb` bridge with OAuth-first hosted MCP. Add `@se-studio/contentful-cms/hosted/next` exports and `cms-edit host scaffold` / `cms-edit host stage` CLI commands. Remove `cms-edit mcpb pack` and the `mcpb/` package tree.
8
+
3
9
  ## 1.4.0
4
10
 
5
11
  ### Minor Changes
package/HOSTED.md CHANGED
@@ -1,17 +1,17 @@
1
1
  # Hosted cms-edit for Claude Desktop
2
2
 
3
- Use this guide when your team hosts cms-edit on Vercel (one deployment per client). **You do not need Node.js or any config files** — only Claude Desktop, the extension file SE sends you, and a Contentful account.
3
+ Use this guide when your team hosts cms-edit on Vercel (one deployment per client). **You do not need Node.js, tokens, or config files** — only Claude Desktop and a Contentful account.
4
4
 
5
- Edits you make appear in Contentful under **your name**, because you use your own personal access token.
5
+ Edits you make appear in Contentful under **your name**, because you sign in with your own Contentful account.
6
6
 
7
7
  ---
8
8
 
9
9
  ## What SE sends you
10
10
 
11
- 1. A **`.mcpb` file** (e.g. `cms-edit-om1.mcpb`) — the cms-edit desktop extension for your site
11
+ 1. A link to your site's setup page (e.g. `https://dev.content.se.studio/cms-edit`)
12
12
  2. This guide
13
13
 
14
- You do **not** need to edit JSON, install Node.js, or configure connector URLs yourself.
14
+ You do **not** need to edit JSON, install Node.js, create API tokens, or configure connector URLs yourself.
15
15
 
16
16
  ---
17
17
 
@@ -22,61 +22,29 @@ For each editor:
22
22
  1. Invite them to the Contentful space.
23
23
  2. Assign the **AI Editor** role (draft edit only — no publish). See [README — Contentful Role Setup](./README.md#contentful-role-setup-required).
24
24
  3. Deploy `apps/cms-edit-host` to Vercel for this client (see [cms-edit-host README](../../apps/cms-edit-host/README.md)).
25
- 4. Build the desktop extension: `pnpm mcpb:pack -- --customer <projectKey>` (see [mcpb/README.md](./mcpb/README.md)).
26
- 5. Send them the `.mcpb` file and this guide.
25
+ 4. Send them the setup page URL and this guide.
27
26
 
28
27
  ---
29
28
 
30
- ## Step 1 — Get your Contentful token
29
+ ## Step 1 — Install Claude Desktop
31
30
 
32
- 1. Log in to [contentful.com](https://app.contentful.com).
33
- 2. Open the correct space (top-left selector).
34
- 3. Go to **Settings → CMA tokens** (Content management tokens).
35
- 4. Click **Create personal access token**.
36
- 5. Name it `Claude Desktop` and click **Generate**.
37
- 6. **Copy the token now** — you will not see it again.
38
-
39
- This token is tied to **you**. Changes you save through Claude will show your name in Contentful.
31
+ Install [Claude Desktop](https://claude.ai/download) if you have not already.
40
32
 
41
33
  ---
42
34
 
43
- ## Step 2 — Install the cms-edit extension
44
-
45
- 1. Install [Claude Desktop](https://claude.ai/download) if you have not already.
46
- 2. Install the extension SE sent you:
47
- - **Option A:** Double-click the `.mcpb` file, or drag it into the Claude Desktop window.
48
- - **Option B:** Open Claude Desktop → **Settings → Extensions** → **Install Extension…** → select the `.mcpb` file.
49
- 3. When prompted, paste your **Contentful personal access token** from Step 1.
50
- 4. Confirm the extension appears as **cms-edit (Your Site Name)** and is enabled.
51
- 5. Fully **quit** Claude Desktop and reopen it (on Mac: right-click Dock icon → Quit).
52
-
53
- Your token is stored securely on your machine (Claude Desktop treats it as sensitive configuration).
54
-
55
- ### About the install warning
56
-
57
- Claude Desktop may show a red warning when you install the extension:
58
-
59
- > Installing will grant this extension access to everything on your computer. Any developer information shown has not been verified by Anthropic.
60
-
61
- This is **Claude’s generic message for all local desktop extensions**, not something specific to cms-edit. You will see similar wording for any `.mcpb` file that is not listed in Anthropic’s verified extension directory.
62
-
63
- **What actually installs on your computer:** a small proxy (~50 lines of logic) that:
35
+ ## Step 2 — Connect to Claude
64
36
 
65
- - Relays messages between Claude Desktop and SE Studio’s hosted cms-edit server
66
- - Connects only to the fixed URL baked into your extension (your site’s `/api/mcp` endpoint)
67
- - Attaches your Contentful token from the OS keychain on each HTTPS request
37
+ **Easiest:** Open the link SE sent you (e.g. `https://dev.content.se.studio/connect` or **Connect to Claude** on `/cms-edit`). This opens Claude with the connector name and URL prefilled — confirm, then sign in with Contentful.
68
38
 
69
- It does **not** read your files, scan your disk, or run arbitrary commands on your machine. The editing tools run on SE’s hosted server, not locally.
39
+ **Manual:** Claude Desktop → **Customize → Connectors** → **Add custom connector** → paste the MCP URL (e.g. `https://dev.content.se.studio/api/mcp`) → **Connect** → sign in with Contentful.
70
40
 
71
- **What limits what Claude can change:** your Contentful token should use the **AI Editor** role (draft edit only, no publish). Revoke the token anytime in Contentful → Settings → CMA tokens.
72
-
73
- The bridge source code is in the [SE monorepo](https://github.com/Something-Else-Studio/se-core-product) under `packages/contentful-cms/mcpb/bridge/` if you want to inspect it.
41
+ No extension install, no personal access token, no command line.
74
42
 
75
43
  ---
76
44
 
77
45
  ## Step 3 — Try it
78
46
 
79
- **Getting started:** Ask Claude to read the **cms-edit guide** (`cms-edit://guide` resource) or use the **`cms_edit_verify`** prompt to check version and connectivity. No separate skill install is required — onboarding lives on the MCP server.
47
+ **Getting started:** Ask Claude to read the **cms-edit guide** (`cms-edit://guide` resource) or use the **`cms_edit_verify`** prompt to check version and connectivity.
80
48
 
81
49
  In a new Claude conversation:
82
50
 
@@ -86,23 +54,15 @@ or:
86
54
 
87
55
  > Open the homepage and show me the content tree.
88
56
 
89
- or:
90
-
91
- > List all pages on the site.
92
-
93
57
  If Claude returns JSON with page content or a snapshot with `@c0`, `@c1` refs, you are connected.
94
58
 
95
- **Homepage slug:** On SE Studio sites, Contentful stores the homepage as slug `index` (public URL `/`). Use `open --page-slug /` or `open --page-slug /index` — both work. `sitemap` may show `/index`; that is the same page. Site-specific exceptions are in `cms-edit://customer/routing`.
59
+ **Homepage slug:** On SE Studio sites, Contentful stores the homepage as slug `index` (public URL `/`). Use `open --page-slug /` or `open --page-slug /index` — both work. Site-specific exceptions are in `cms-edit://customer/routing`.
96
60
 
97
- **Typical edit workflow:** `open --page-slug /` → `snapshot` → `read @c1` → `set @c1 heading "New title"` → `diff` → `save`. MCP automatically uses session `_mcp` so each step shares the same Redis-backed session — you do not need to pass `--session` unless you are juggling multiple pages at once.
98
-
99
- To edit copy:
100
-
101
- > Open `/pricing`, change the main heading to "Simple pricing", show me the diff, then save.
61
+ **Typical edit workflow:** `open --page-slug /` → `snapshot` → `read @c1` → `set @c1 heading "New title"` → `diff` → `save`.
102
62
 
103
63
  Remember: **save creates drafts only**. You or a colleague must **publish in Contentful** for changes to go live.
104
64
 
105
- **Do not pass `--space`** when using the hosted extension. The deployment is already configured for your site. The `--space` flag is only for local multi-space setups.
65
+ **Do not pass `--space`** when using the hosted integration. The deployment is already configured for your site.
106
66
 
107
67
  ---
108
68
 
@@ -110,35 +70,28 @@ Remember: **save creates drafts only**. You or a colleague must **publish in Con
110
70
 
111
71
  | Problem | What to do |
112
72
  |---------|------------|
113
- | **401 / invalid token** | Generate a new CMA token in Contentful. In Claude Desktop → Settings → Extensions, open the cms-edit extension and update your token. |
114
- | **No cms_edit tool in Claude** | Quit Claude fully and reopen. Confirm the extension is installed and enabled under Settings → Extensions. |
115
- | **No active session** (after `open` worked) | Do not pass `--space`. MCP uses session `_mcp` automatically. Run `["diagnose"]` to inspect store, userId, and active session key. On Vercel, ensure `LOG_CMS_SESSION=1` is set and check runtime logs for `[cms-edit:session]` lines. Fallback: `["read", "<entry-id>", "--id"]`. |
116
- | **Wrong space** | Your token must belong to the space this deployment is configured for. Ask SE if unsure. Do not use `--space` with the hosted extension. |
117
- | **Lost laptop** | Revoke your token in Contentful → Settings → CMA tokens. |
118
- | **Check cms-edit version** | Ask Claude to use the `cms_edit_version` tool, or run `curl -s "https://YOUR-DEPLOYMENT.vercel.app/api/health" | jq .cmsEdit`. Version comes from the hosted server — no `.mcpb` reinstall needed. |
73
+ | **Connection stopped working** | Open Settings → Integrations and click **Connect** again to refresh your Contentful sign-in. |
74
+ | **No cms_edit tool in Claude** | Confirm the integration is connected under Settings → Integrations. |
75
+ | **No active session** (after `open` worked) | Do not pass `--space`. MCP uses session `_mcp` automatically. Run `["diagnose"]` to inspect state. |
76
+ | **Wrong space** | Your Contentful account must have access to this site's space. Ask SE if unsure. |
77
+ | **Check cms-edit version** | Ask Claude to use the `cms_edit_version` tool, or run `curl -s "https://YOUR-DEPLOYMENT.vercel.app/api/health" \| jq .cmsEdit`. |
119
78
 
120
79
  ### Health check
121
80
 
122
- Ask SE to run (or run yourself if you have curl):
123
-
124
81
  ```bash
125
- curl -s -H "Authorization: Bearer YOUR_TOKEN" \
126
- "https://YOUR-DEPLOYMENT.vercel.app/api/health"
82
+ curl -s "https://YOUR-DEPLOYMENT.vercel.app/api/health"
127
83
  ```
128
84
 
129
- All checks should show `"ok": true`. The response includes a `cmsEdit` object with the deployed cms-edit version. If `redis` is not ok, sessions cannot persist between MCP calls — contact SE to fix the deployment.
85
+ All checks should show `"ok": true`. If `redis` or `oauth` is not ok, contact SE to fix the deployment.
130
86
 
131
87
  ---
132
88
 
133
- ## Security notes
89
+ ## Legacy: `.mcpb` extension (deprecated)
134
90
 
135
- - Your token is stored in Claude Desktop on your machine — same sensitivity as the local setup wizard.
136
- - The hosted server **does not store** your token; it is sent on each request over HTTPS.
137
- - Use a token with the **AI Editor** role only — not an admin token.
138
- - The local extension is a network proxy only; it does not access your filesystem. See [About the install warning](#about-the-install-warning) above.
91
+ Older deployments used a Claude Desktop **extension** (`.mcpb`) with a manual Contentful personal access token. New setups use **Integrations + OAuth** instead. If your extension stopped working, remove it (Settings → Extensions) and reconnect via your site's `/cms-edit` page.
139
92
 
140
93
  ---
141
94
 
142
95
  ## Local setup (developers)
143
96
 
144
- Developers can still use the local MCP wizard: see [INSTALL.md](./INSTALL.md).
97
+ Developers can still use the local MCP wizard: see [INSTALL.md](./INSTALL.md).
package/INSTALL.md CHANGED
@@ -6,14 +6,14 @@ There are two setup paths:
6
6
 
7
7
  | Path | Who | Requirements |
8
8
  |------|-----|--------------|
9
- | **Hosted** | Content editors on a client site | Claude Desktop + `.mcpb` extension from SE — **no Node.js** |
9
+ | **Hosted** | Content editors on a client site | Claude Desktop Integrations + onboarding URL from SE — **no Node.js** |
10
10
  | **Local** | Developers / multi-space workflows | Node.js + setup wizard |
11
11
 
12
12
  ---
13
13
 
14
14
  ## Hosted setup (content editors)
15
15
 
16
- If SE sent you a **`.mcpb` file**, follow [HOSTED.md](./HOSTED.md). You install the extension in Claude Desktop and enter your Contentful personal access token — no terminal or Node.js required.
16
+ If SE sent you an **onboarding link** (e.g. `https://your-site.content.se.studio/cms-edit`), follow [HOSTED.md](./HOSTED.md). Connect via Claude Integrations and sign in with Contentful — no terminal, Node.js, or personal access token required.
17
17
 
18
18
  ---
19
19
 
package/README.md CHANGED
@@ -31,7 +31,7 @@ npx @se-studio/contentful-cms@latest setup
31
31
 
32
32
  It discovers your Contentful spaces and environments automatically from your management token, writes `~/.contentful-cms.json`, and updates the Claude Desktop config. See [INSTALL.md](./INSTALL.md) for a full walkthrough.
33
33
 
34
- **Hosted mode (no Node.js for editors):** deploy [apps/cms-edit-host](../../apps/cms-edit-host) to Vercel, build a per-client `.mcpb` extension (`pnpm mcpb:pack -- --customer <key>` — see [mcpb/README.md](./mcpb/README.md)), and share the `.mcpb` file plus [HOSTED.md](./HOSTED.md) with your content team.
34
+ **Hosted mode (no Node.js for editors):** deploy a thin Next.js host to Vercel (`cms-edit host scaffold`), configure OAuth env vars, and send editors your `/cms-edit` onboarding URL plus [HOSTED.md](./HOSTED.md). Shared route logic lives in `@se-studio/contentful-cms/hosted/next`.
35
35
 
36
36
  **Manual config** — if you'd prefer to configure by hand, add this to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows):
37
37
 
@@ -19,10 +19,10 @@ import { registerEntrySearchCommand } from '../commands/entry-search.js';
19
19
  import { registerGuideCommand } from '../commands/guide.js';
20
20
  import { registerHealthCommand } from '../commands/health.js';
21
21
  import { registerHelpCommand } from '../commands/help.js';
22
+ import { registerHostCommand } from '../commands/host.js';
22
23
  import { registerIndexCommand } from '../commands/index.js';
23
24
  import { registerLinksCommand } from '../commands/links.js';
24
25
  import { registerListCommand } from '../commands/list.js';
25
- import { registerMcpbPackCommand } from '../commands/mcpb-pack.js';
26
26
  import { registerMoveCommand } from '../commands/move.js';
27
27
  import { registerNavCommand } from '../commands/nav.js';
28
28
  import { registerOpenCommand } from '../commands/open.js';
@@ -154,7 +154,7 @@ export function createCmsEditProgram(hooks = {}) {
154
154
  registerSkillCommand(program);
155
155
  registerProjectCommand(program);
156
156
  registerEditorPackCommand(program);
157
- registerMcpbPackCommand(program);
157
+ registerHostCommand(program);
158
158
  registerHelpCommand(program);
159
159
  program
160
160
  .command('setup')
@@ -1 +1 @@
1
- {"version":3,"file":"program.js","sourceRoot":"","sources":["../../src/cli/program.ts"],"names":[],"mappings":"AAAA,uFAAuF;AAEvF,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAAE,8BAA8B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AC;IACvB,CAAC,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,SAAS,cAAc,CACrB,QAA+B,EAC/B,OAA+B;IAE/B,OAAO,KAAK,EAAE,GAAG,IAAuC,EAAE,EAAE;QAC1D,IAAI,CAAC;YACH,OAAO,MAAM,QAAQ,CAAC,GAAG,IAAI,CAAC,CAAC;QACjC,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,CAAC,GAAG,CAAC,CAAC;YACb,MAAM,GAAG,CAAC;QACZ,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,4 @@
1
+ /** biome-ignore-all lint/suspicious/noConsole: Console output is intentional in CLI */
2
+ import type { Command } from 'commander';
3
+ export declare function registerHostScaffoldCommand(hostCmd: Command): void;
4
+ //# sourceMappingURL=host-scaffold.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host-scaffold.d.ts","sourceRoot":"","sources":["../../src/commands/host-scaffold.ts"],"names":[],"mappings":"AAAA,uFAAuF;AAIvF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA+CzC,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA0BlE"}
@@ -0,0 +1,73 @@
1
+ /** biome-ignore-all lint/suspicious/noConsole: Console output is intentional in CLI */
2
+ import { existsSync, mkdirSync, writeFileSync } from 'node:fs';
3
+ import { dirname, join, resolve } from 'node:path';
4
+ import { isJsonMode } from '../output/mode.js';
5
+ const SCAFFOLD_FILES = {
6
+ 'src/app/layout.tsx': `export default function RootLayout({ children }: { children: React.ReactNode }) {
7
+ return (
8
+ <html lang="en">
9
+ <body>{children}</body>
10
+ </html>
11
+ );
12
+ }
13
+ `,
14
+ 'src/app/page.tsx': `export { default } from '@se-studio/contentful-cms/hosted/next/pages/HomePage';
15
+ `,
16
+ 'src/app/cms-edit/page.tsx': `export { default } from '@se-studio/contentful-cms/hosted/next/pages/CmsEditPage';
17
+ `,
18
+ 'src/app/connect/route.ts': `export { GET } from '@se-studio/contentful-cms/hosted/next/routes/connect';
19
+ `,
20
+ 'src/app/oauth/contentful-callback/page.tsx': `export { default } from '@se-studio/contentful-cms/hosted/next/pages/ContentfulCallbackPage';
21
+ `,
22
+ 'src/app/oauth/authorize/route.ts': `export { GET } from '@se-studio/contentful-cms/hosted/next/routes/oauth-authorize';
23
+ `,
24
+ 'src/app/oauth/token/route.ts': `export { POST } from '@se-studio/contentful-cms/hosted/next/routes/oauth-token';
25
+ `,
26
+ 'src/app/oauth/register/route.ts': `export { POST } from '@se-studio/contentful-cms/hosted/next/routes/oauth-register';
27
+ `,
28
+ 'src/app/api/mcp/route.ts': `export { GET, POST, DELETE } from '@se-studio/contentful-cms/hosted/next/routes/mcp';
29
+ `,
30
+ 'src/app/api/health/route.ts': `export { GET } from '@se-studio/contentful-cms/hosted/next/routes/health';
31
+ `,
32
+ 'src/app/api/oauth/link-contentful/route.ts': `export { POST } from '@se-studio/contentful-cms/hosted/next/routes/link-contentful';
33
+ `,
34
+ 'src/app/.well-known/oauth-authorization-server/route.ts': `export { GET } from '@se-studio/contentful-cms/hosted/next/routes/oauth-authorization-server';
35
+ `,
36
+ 'src/app/.well-known/oauth-protected-resource/route.ts': `export { GET } from '@se-studio/contentful-cms/hosted/next/routes/oauth-protected-resource';
37
+ `,
38
+ 'scripts/stage-site.mjs': `#!/usr/bin/env node
39
+ import { spawnSync } from 'node:child_process';
40
+
41
+ const result = spawnSync('cms-edit', ['host', 'stage', '--host-dir', process.cwd()], {
42
+ stdio: 'inherit',
43
+ env: process.env,
44
+ });
45
+ process.exit(result.status ?? 1);
46
+ `,
47
+ };
48
+ export function registerHostScaffoldCommand(hostCmd) {
49
+ hostCmd
50
+ .command('scaffold')
51
+ .description('Write thin Next.js route re-exports for cms-edit/host (OAuth-only)')
52
+ .option('--host-dir <path>', 'Path to cms-edit/host (default: cwd)')
53
+ .option('--force', 'Overwrite existing scaffold files')
54
+ .action((opts) => {
55
+ const hostDir = resolve(opts.hostDir ?? process.cwd());
56
+ const written = [];
57
+ for (const [relativePath, content] of Object.entries(SCAFFOLD_FILES)) {
58
+ const filePath = join(hostDir, relativePath);
59
+ if (existsSync(filePath) && !opts.force) {
60
+ continue;
61
+ }
62
+ mkdirSync(dirname(filePath), { recursive: true });
63
+ writeFileSync(filePath, content);
64
+ written.push(relativePath);
65
+ }
66
+ if (isJsonMode()) {
67
+ console.log(JSON.stringify({ ok: true, hostDir, written }));
68
+ return;
69
+ }
70
+ console.log(`Scaffolded ${written.length} files in ${hostDir}`);
71
+ });
72
+ }
73
+ //# sourceMappingURL=host-scaffold.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host-scaffold.js","sourceRoot":"","sources":["../../src/commands/host-scaffold.ts"],"names":[],"mappings":"AAAA,uFAAuF;AAEvF,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEnD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,MAAM,cAAc,GAA2B;IAC7C,oBAAoB,EAAE;;;;;;;CAOvB;IACC,kBAAkB,EAAE;CACrB;IACC,2BAA2B,EAAE;CAC9B;IACC,0BAA0B,EAAE;CAC7B;IACC,4CAA4C,EAAE;CAC/C;IACC,kCAAkC,EAAE;CACrC;IACC,8BAA8B,EAAE;CACjC;IACC,iCAAiC,EAAE;CACpC;IACC,0BAA0B,EAAE;CAC7B;IACC,6BAA6B,EAAE;CAChC;IACC,4CAA4C,EAAE;CAC/C;IACC,yDAAyD,EAAE;CAC5D;IACC,uDAAuD,EAAE;CAC1D;IACC,wBAAwB,EAAE;;;;;;;;CAQ3B;CACA,CAAC;AAEF,MAAM,UAAU,2BAA2B,CAAC,OAAgB;IAC1D,OAAO;SACJ,OAAO,CAAC,UAAU,CAAC;SACnB,WAAW,CAAC,oEAAoE,CAAC;SACjF,MAAM,CAAC,mBAAmB,EAAE,sCAAsC,CAAC;SACnE,MAAM,CAAC,SAAS,EAAE,mCAAmC,CAAC;SACtD,MAAM,CAAC,CAAC,IAA2C,EAAE,EAAE;QACtD,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QACvD,MAAM,OAAO,GAAa,EAAE,CAAC;QAE7B,KAAK,MAAM,CAAC,YAAY,EAAE,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,CAAC;YACrE,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;YAC7C,IAAI,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;gBACxC,SAAS;YACX,CAAC;YACD,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YAClD,aAAa,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;YACjC,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAC7B,CAAC;QAED,IAAI,UAAU,EAAE,EAAE,CAAC;YACjB,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;YAC5D,OAAO;QACT,CAAC;QACD,OAAO,CAAC,GAAG,CAAC,cAAc,OAAO,CAAC,MAAM,aAAa,OAAO,EAAE,CAAC,CAAC;IAClE,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -1,4 +1,4 @@
1
1
  /** biome-ignore-all lint/suspicious/noConsole: Console output is intentional in CLI */
2
2
  import type { Command } from 'commander';
3
- export declare function registerMcpbPackCommand(program: Command): Command;
4
- //# sourceMappingURL=mcpb-pack.d.ts.map
3
+ export declare function registerHostStageCommand(hostCmd: Command): void;
4
+ //# sourceMappingURL=host-stage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host-stage.d.ts","sourceRoot":"","sources":["../../src/commands/host-stage.ts"],"names":[],"mappings":"AAAA,uFAAuF;AAIvF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAoCzC,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA+B/D"}
@@ -0,0 +1,60 @@
1
+ /** biome-ignore-all lint/suspicious/noConsole: Console output is intentional in CLI */
2
+ import { existsSync, readFileSync } from 'node:fs';
3
+ import { join, resolve } from 'node:path';
4
+ import { stageEditorPack } from '../hosted/next/stage-site.js';
5
+ import { isJsonMode } from '../output/mode.js';
6
+ function loadEnvLocal(hostDir) {
7
+ const envPath = join(hostDir, '.env.local');
8
+ if (!existsSync(envPath)) {
9
+ return;
10
+ }
11
+ for (const line of readFileSync(envPath, 'utf8').split('\n')) {
12
+ const trimmed = line.trim();
13
+ if (!trimmed || trimmed.startsWith('#')) {
14
+ continue;
15
+ }
16
+ const eq = trimmed.indexOf('=');
17
+ if (eq === -1) {
18
+ continue;
19
+ }
20
+ const key = trimmed.slice(0, eq).trim();
21
+ let value = trimmed.slice(eq + 1).trim();
22
+ if ((value.startsWith('"') && value.endsWith('"')) ||
23
+ (value.startsWith("'") && value.endsWith("'"))) {
24
+ value = value.slice(1, -1);
25
+ }
26
+ if (!(key in process.env)) {
27
+ process.env[key] = value;
28
+ }
29
+ }
30
+ }
31
+ export function registerHostStageCommand(hostCmd) {
32
+ hostCmd
33
+ .command('stage')
34
+ .description('Copy committed editor-pack/ into cms-edit/host before dev or Vercel build')
35
+ .option('--host-dir <path>', 'Path to cms-edit/host (default: cwd)')
36
+ .option('--repo-root <path>', 'Monorepo/site repo root (default: two levels above host)')
37
+ .action((opts) => {
38
+ const hostDir = resolve(opts.hostDir ?? process.cwd());
39
+ loadEnvLocal(hostDir);
40
+ const result = stageEditorPack({
41
+ hostDir,
42
+ repoRoot: opts.repoRoot,
43
+ });
44
+ if (result.skipped) {
45
+ const message = 'CMS_EDIT_ROOT not set — colocated editor-pack/ already in cms-edit-host/';
46
+ if (isJsonMode()) {
47
+ console.log(JSON.stringify({ ok: true, skipped: true, message }));
48
+ return;
49
+ }
50
+ console.log(message);
51
+ return;
52
+ }
53
+ if (isJsonMode()) {
54
+ console.log(JSON.stringify({ ok: true, projectKey: result.projectKey }));
55
+ return;
56
+ }
57
+ console.log(`Staged ${result.projectKey} editor-pack into ${hostDir}/`);
58
+ });
59
+ }
60
+ //# sourceMappingURL=host-stage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host-stage.js","sourceRoot":"","sources":["../../src/commands/host-stage.ts"],"names":[],"mappings":"AAAA,uFAAuF;AAEvF,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,SAAS,YAAY,CAAC,OAAe;IACnC,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;IAC5C,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QACzB,OAAO;IACT,CAAC;IAED,KAAK,MAAM,IAAI,IAAI,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;QAC7D,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;QAC5B,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACxC,SAAS;QACX,CAAC;QAED,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,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;QAEH,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YACnB,MAAM,OAAO,GAAG,0EAA0E,CAAC;YAC3F,IAAI,UAAU,EAAE,EAAE,CAAC;gBACjB,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;gBAClE,OAAO;YACT,CAAC;YACD,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YACrB,OAAO;QACT,CAAC;QAED,IAAI,UAAU,EAAE,EAAE,CAAC;YACjB,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;YACzE,OAAO;QACT,CAAC;QACD,OAAO,CAAC,GAAG,CAAC,UAAU,MAAM,CAAC,UAAU,qBAAqB,OAAO,GAAG,CAAC,CAAC;IAC1E,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Command } from 'commander';
2
+ export declare function registerHostCommand(program: Command): Command;
3
+ //# sourceMappingURL=host.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../../src/commands/host.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIzC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAO7D"}
@@ -0,0 +1,9 @@
1
+ import { registerHostScaffoldCommand } from './host-scaffold.js';
2
+ import { registerHostStageCommand } from './host-stage.js';
3
+ export function registerHostCommand(program) {
4
+ const hostCmd = program.command('host').description('cms-edit hosted Next.js deploy helpers');
5
+ registerHostStageCommand(hostCmd);
6
+ registerHostScaffoldCommand(hostCmd);
7
+ return hostCmd;
8
+ }
9
+ //# sourceMappingURL=host.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host.js","sourceRoot":"","sources":["../../src/commands/host.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAE3D,MAAM,UAAU,mBAAmB,CAAC,OAAgB;IAClD,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,wCAAwC,CAAC,CAAC;IAE9F,wBAAwB,CAAC,OAAO,CAAC,CAAC;IAClC,2BAA2B,CAAC,OAAO,CAAC,CAAC;IAErC,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -1,2 +1,2 @@
1
- export declare const HOSTED_GUIDE_TEMPLATE = "# cms-edit MCP guide\n\nUse this guide when editing Contentful draft content through Claude Desktop (hosted `.mcpb` extension) or local stdio MCP.\n\n{{SITE_INTRO}}\n\n## Safety rules\n\ncms-edit **cannot and will not**:\n\n- Publish or unpublish entries\n- Archive or delete published entries\n- Upload new assets (use Contentful UI for assets)\n\nAll `save` operations create **drafts only**. A human must review and publish in Contentful.\n\n## MCP tools\n\n| Tool | Purpose |\n|------|---------|\n| `cms_edit` | Run any cms-edit command via an `args` array |\n| `cms_edit_version` | Check the installed cms-edit version (no session required) |\n| `cms_edit_help` | Read this guide by topic (`overview`, `workflow`, `commands`, `troubleshooting`, `hosted`) |\n\n## Customer editor pack (read first)\n\nWhen a site editor pack is deployed, these MCP resources provide **site-specific** context. Read them before creating or editing content:\n\n| Resource | Purpose |\n|----------|---------|\n| `cms-edit://customer/index` | List of all customer resources |\n| `cms-edit://customer/overview` | Site name, space, staging URL, handoff rules |\n| `cms-edit://customer/routing` | Article/tag URL rules for this site |\n| `cms-edit://customer/components-index` | Component types and when to use each |\n| `cms-edit://customer/collections-index` | Collection types |\n| `cms-edit://customer/brand` | Brand voice and terminology (if configured) |\n| `cms-edit://customer/articles` | Article/publication playbook (if configured) |\n\n**Workflow:** read `cms-edit://customer/index` \u2192 `overview` \u2192 `routing` \u2192 `components-index` \u2192 then use `cms_edit` commands.\n\n## MCP prompts\n\n| Prompt | Purpose |\n|--------|---------|\n| `cms_edit_verify` | Check version and connectivity |\n| `cms_edit_explore` | List site content and open a page |\n| `cms_edit_edit_page` | Edit a page through diff \u2192 save |\n| `cms_edit_index_sync` | Build/refresh local index (assets, media, templates, taxonomy) |\n| `cms_edit_create_page` | Create a page with template selection |\n| `cms_edit_create_from_doc` | Create a page from a freeform document (infer \u2192 confirm \u2192 dry-run) |\n| `cms_edit_taxonomy` | Import or ensure taxonomy entries |\n\nRead the full guide anytime via the `cms-edit://guide` resource or `cms_edit_help`.\n\n## Core workflow\n\nStandard editing flow: **open \u2192 snapshot \u2192 read \u2192 set/rtf \u2192 diff \u2192 save**\n\nEach step is a separate `cms_edit` call. Sessions persist in Redis between calls (hosted) or on disk (local). MCP auto-uses session `_mcp`.\n\n### 1. Open a page\n\n```\n[\"open\", \"--page-slug\", \"/\"]\n[\"open\", \"--page-slug\", \"/pricing\"]\n[\"open\", \"--id\", \"<entry-id>\"]\n```\n\n**Homepage (all SE Studio sites):** Contentful stores the marketing homepage slug as `index`. The live site URL is `/`. In cms-edit, `--page-slug /` and `--page-slug /index` are equivalent (both resolve to `index`). `sitemap` displays this page as `/index` \u2014 that is formatting, not a different slug. Read `cms-edit://customer/routing` for site-specific exceptions (e.g. Pedestal uses `home`).\n\n### 2. Snapshot \u2014 see the content tree\n\n```\n[\"snapshot\"]\n```\n\nOutput shows `@c0`, `@c1`, \u2026 refs for each component. Use these refs in `read`, `set`, and `rtf`.\n\n### 3. Read fields\n\n```\n[\"read\", \"@c1\"]\n[\"read\", \"@c1\", \"heading\"]\n```\n\n### 4. Edit fields\n\n```\n[\"set\", \"@c1\", \"heading\", \"New heading text\"]\n[\"rtf\", \"@c1\", \"body\", \"--content\", \"# Title\\n\\nParagraph text.\"]\n```\n\nFor rich text, prefer `--content` with inline markdown. Use `--base64` when special characters cause issues.\n\n### 5. Review and save\n\n```\n[\"diff\"]\n[\"save\"]\n```\n\nAlways run `diff` before `save`. To abandon changes: `[\"discard\"]`.\n\n## Common sequences\n\n### List all pages\n\n```\n[\"sitemap\"]\n```\n\n### Refresh local index (assets, media, templates, taxonomy)\n\nRun before asset filename search, media-by-filename list, or fast template/taxonomy lookup:\n\n```\n[\"index\", \"sync\"]\n[\"index\", \"status\"]\n[\"list\", \"--type\", \"template\"]\n```\n\nAsset search and media-by-filename list **require** the index. Template/taxonomy list prefers the index when built.\n\n### Explore the homepage\n\n```\n[\"open\", \"--page-slug\", \"/\"]\n[\"snapshot\"]\n[\"read\", \"@c1\"]\n```\n\n### Edit copy on a page\n\n```\n[\"open\", \"--page-slug\", \"{{EXAMPLE_SLUG}}\"]\n[\"snapshot\"]\n[\"read\", \"@c1\", \"heading\"]\n[\"set\", \"@c1\", \"heading\", \"Updated heading\"]\n[\"diff\"]\n[\"save\"]\n```\n\n## Field discovery\n\n```\n[\"schema\", \"component\"]\n[\"list\", \"--type\", \"page\"]\n[\"search\", \"pricing\"]\n```\n\n## Hosted extension rules\n\n{{HOSTED_RULES}}\n\n## Session tips\n\n- After `open`, subsequent MCP commands share session `_mcp` automatically (stored in Redis on hosted).\n- Use `--session <name>` only when juggling multiple pages \u2014 pass it **before** the subcommand on every call: `[\"--session\", \"my-work\", \"open\", \"--page-slug\", \"/\"]`.\n- Snapshot JSON includes `sessionName` and `sessionKey` for debugging.\n- If you see \"No active session\", check `/api/health` (Redis must be ok), then run `open` again. Set `LOG_CMS_SESSION=1` on Vercel and search runtime logs for `[cms-edit:session]` (`redis save ok` / `redis load hit` / `requireSession miss`).\n\n### peek vs open vs read\n\n| Goal | MCP args |\n|------|----------|\n| Edit workflow (session) | `[\"open\", \"--page-slug\", \"/\"]` then `[\"read\", \"@c0\"]` |\n| Preview tree + fields, no session | `[\"peek\", \"--page-slug\", \"/pricing\"]` or `[\"peek\", \"--id\", \"<entry-id>\"]` (JSON includes `rootFields`) |\n| Read fields by entry ID, no session | `[\"read\", \"<entry-id>\", \"--id\"]` or `[\"read\", \"<entry-id>\", \"--id\", \"heading\"]` |\n| Debug session persistence | `[\"diagnose\"]` \u2014 reports store, userId, active session key |\n\n- **`peek` is one-shot** \u2014 prints tree and **root field values** (`rootFields` in JSON). No session is created; do not chain `read @ref` afterward.\n- **Use flat lookup flags** for `open` and `peek` \u2014 same as CLI (`--page-slug`, `--id`, etc.). See `help lookup`.\n- **`read @root`** only works after `open` (uses the active session). The hint in peek output is for terminal users who already ran `open`.\n- **Do not invent flags** \u2014 there is no `--read`, `--then`, or chained peek+read syntax. One command per `cms_edit` call.\n\n## Troubleshooting\n\n| Problem | What to do |\n|---------|------------|\n| **401 / invalid token** | Regenerate CMA token in Contentful; update token in Claude Desktop \u2192 Settings \u2192 Extensions |\n| **No cms_edit tool** | Quit Claude fully and reopen; confirm extension is enabled |\n| **No active session** | Do not pass `--space` on hosted. Check `/api/health` \u2014 `redis` must be ok. MCP uses `_mcp` session automatically. Manual session: `[\"--session\", \"name\", \"open\", \"--page-slug\", \"/\"]`. Fallback: `[\"read\", \"<entry-id>\", \"--id\"]` |\n| **Wrong space** | Token must belong to this deployment's Contentful space |\n| **Check version** | Call `cms_edit_version` or `curl /api/health` and read `cmsEdit` |\n\n## Articles\n\n**Recent articles** (by publication `date`, not last-updated):\n\n```json\n[\"list\", \"--type\", \"article\", \"--sort\", \"date\", \"-n\", \"10\"]\n```\n\nAlternatives: `[\"search\", \"<keyword>\", \"--type\", \"article\"]` (also sorts by date), `[\"sitemap\", \"--include\", \"article\", \"--sort\", \"date\"]`.\n\n**Draft articles** \u2014 `peek` and `open` load drafts via CMA (not published-only). To discover drafts:\n\n```json\n[\"sitemap\", \"--include\", \"article\", \"--status\", \"draft\"]\n[\"search\", \"<title>\", \"--type\", \"article\"]\n[\"list\", \"--type\", \"article\", \"--slug\", \"<slug>\"]\n```\n\nThen open: `[\"peek\", \"--article-slug\", \"<slug>\"]` or `[\"open\", \"--id\", \"<entry-id>\"]`. Use `--article-slug`, not `--page-slug`.\n\n**Published-only** is opt-in: `list --published` and `resolve --published` use the Delivery API index and omit never-published drafts.\n\nAfter upgrading cms-edit, run `[\"index\", \"sync\"]` once so the local index includes article `date` values (schema v4).\n\n## Command reference (cms_edit args)\n\n**Discovery:** `sitemap`, `list --type <type>`, `search <query>`, `schema <contentType>`, `index sync`, `index status`\n\n**Reading:** `open --page-slug <slug>`, `open --id <id>`, `peek --page-slug <slug>`, `peek --id <id>`, `snapshot`, `read <ref>`, `read <ref> <field>`, `read <id> --id [field]`\n\n**Diagnostics:** `diagnose` \u2014 session store, userId, active session (after open/read issues)\n\n**Editing:** `set <ref> <field> <value>`, `rtf <ref> <field> --content \"<md>\"`, `diff`, `save`, `discard`\n\n**Creating:** `create page --slug \u2026 --title \u2026`, `add <type> --content-type \u2026 --parent @c0 --target content`\n\n**Other:** `health`, `version`, `guide [topic]`\n";
1
+ export declare const HOSTED_GUIDE_TEMPLATE = "# cms-edit MCP guide\n\nUse this guide when editing Contentful draft content through Claude Desktop (hosted Integrations + OAuth) or local stdio MCP.\n\n{{SITE_INTRO}}\n\n## Safety rules\n\ncms-edit **cannot and will not**:\n\n- Publish or unpublish entries\n- Archive or delete published entries\n- Upload new assets (use Contentful UI for assets)\n\nAll `save` operations create **drafts only**. A human must review and publish in Contentful.\n\n## MCP tools\n\n| Tool | Purpose |\n|------|---------|\n| `cms_edit` | Run any cms-edit command via an `args` array |\n| `cms_edit_version` | Check the installed cms-edit version (no session required) |\n| `cms_edit_help` | Read this guide by topic (`overview`, `workflow`, `commands`, `troubleshooting`, `hosted`) |\n\n## Customer editor pack (read first)\n\nWhen a site editor pack is deployed, these MCP resources provide **site-specific** context. Read them before creating or editing content:\n\n| Resource | Purpose |\n|----------|---------|\n| `cms-edit://customer/index` | List of all customer resources |\n| `cms-edit://customer/overview` | Site name, space, staging URL, handoff rules |\n| `cms-edit://customer/routing` | Article/tag URL rules for this site |\n| `cms-edit://customer/components-index` | Component types and when to use each |\n| `cms-edit://customer/collections-index` | Collection types |\n| `cms-edit://customer/brand` | Brand voice and terminology (if configured) |\n| `cms-edit://customer/articles` | Article/publication playbook (if configured) |\n\n**Workflow:** read `cms-edit://customer/index` \u2192 `overview` \u2192 `routing` \u2192 `components-index` \u2192 then use `cms_edit` commands.\n\n## MCP prompts\n\n| Prompt | Purpose |\n|--------|---------|\n| `cms_edit_verify` | Check version and connectivity |\n| `cms_edit_explore` | List site content and open a page |\n| `cms_edit_edit_page` | Edit a page through diff \u2192 save |\n| `cms_edit_index_sync` | Build/refresh local index (assets, media, templates, taxonomy) |\n| `cms_edit_create_page` | Create a page with template selection |\n| `cms_edit_create_from_doc` | Create a page from a freeform document (infer \u2192 confirm \u2192 dry-run) |\n| `cms_edit_taxonomy` | Import or ensure taxonomy entries |\n\nRead the full guide anytime via the `cms-edit://guide` resource or `cms_edit_help`.\n\n## Core workflow\n\nStandard editing flow: **open \u2192 snapshot \u2192 read \u2192 set/rtf \u2192 diff \u2192 save**\n\nEach step is a separate `cms_edit` call. Sessions persist in Redis between calls (hosted) or on disk (local). MCP auto-uses session `_mcp`.\n\n### 1. Open a page\n\n```\n[\"open\", \"--page-slug\", \"/\"]\n[\"open\", \"--page-slug\", \"/pricing\"]\n[\"open\", \"--id\", \"<entry-id>\"]\n```\n\n**Homepage (all SE Studio sites):** Contentful stores the marketing homepage slug as `index`. The live site URL is `/`. In cms-edit, `--page-slug /` and `--page-slug /index` are equivalent (both resolve to `index`). `sitemap` displays this page as `/index` \u2014 that is formatting, not a different slug. Read `cms-edit://customer/routing` for site-specific exceptions (e.g. Pedestal uses `home`).\n\n### 2. Snapshot \u2014 see the content tree\n\n```\n[\"snapshot\"]\n```\n\nOutput shows `@c0`, `@c1`, \u2026 refs for each component. Use these refs in `read`, `set`, and `rtf`.\n\n### 3. Read fields\n\n```\n[\"read\", \"@c1\"]\n[\"read\", \"@c1\", \"heading\"]\n```\n\n### 4. Edit fields\n\n```\n[\"set\", \"@c1\", \"heading\", \"New heading text\"]\n[\"rtf\", \"@c1\", \"body\", \"--content\", \"# Title\\n\\nParagraph text.\"]\n```\n\nFor rich text, prefer `--content` with inline markdown. Use `--base64` when special characters cause issues.\n\n### 5. Review and save\n\n```\n[\"diff\"]\n[\"save\"]\n```\n\nAlways run `diff` before `save`. To abandon changes: `[\"discard\"]`.\n\n## Common sequences\n\n### List all pages\n\n```\n[\"sitemap\"]\n```\n\n### Refresh local index (assets, media, templates, taxonomy)\n\nRun before asset filename search, media-by-filename list, or fast template/taxonomy lookup:\n\n```\n[\"index\", \"sync\"]\n[\"index\", \"status\"]\n[\"list\", \"--type\", \"template\"]\n```\n\nAsset search and media-by-filename list **require** the index. Template/taxonomy list prefers the index when built.\n\n### Explore the homepage\n\n```\n[\"open\", \"--page-slug\", \"/\"]\n[\"snapshot\"]\n[\"read\", \"@c1\"]\n```\n\n### Edit copy on a page\n\n```\n[\"open\", \"--page-slug\", \"{{EXAMPLE_SLUG}}\"]\n[\"snapshot\"]\n[\"read\", \"@c1\", \"heading\"]\n[\"set\", \"@c1\", \"heading\", \"Updated heading\"]\n[\"diff\"]\n[\"save\"]\n```\n\n## Field discovery\n\n```\n[\"schema\", \"component\"]\n[\"list\", \"--type\", \"page\"]\n[\"search\", \"pricing\"]\n```\n\n## Hosted connector rules\n\n{{HOSTED_RULES}}\n\n## Session tips\n\n- After `open`, subsequent MCP commands share session `_mcp` automatically (stored in Redis on hosted).\n- Use `--session <name>` only when juggling multiple pages \u2014 pass it **before** the subcommand on every call: `[\"--session\", \"my-work\", \"open\", \"--page-slug\", \"/\"]`.\n- Snapshot JSON includes `sessionName` and `sessionKey` for debugging.\n- If you see \"No active session\", check `/api/health` (Redis must be ok), then run `open` again. Set `LOG_CMS_SESSION=1` on Vercel and search runtime logs for `[cms-edit:session]` (`redis save ok` / `redis load hit` / `requireSession miss`).\n\n### peek vs open vs read\n\n| Goal | MCP args |\n|------|----------|\n| Edit workflow (session) | `[\"open\", \"--page-slug\", \"/\"]` then `[\"read\", \"@c0\"]` |\n| Preview tree + fields, no session | `[\"peek\", \"--page-slug\", \"/pricing\"]` or `[\"peek\", \"--id\", \"<entry-id>\"]` (JSON includes `rootFields`) |\n| Read fields by entry ID, no session | `[\"read\", \"<entry-id>\", \"--id\"]` or `[\"read\", \"<entry-id>\", \"--id\", \"heading\"]` |\n| Debug session persistence | `[\"diagnose\"]` \u2014 reports store, userId, active session key |\n\n- **`peek` is one-shot** \u2014 prints tree and **root field values** (`rootFields` in JSON). No session is created; do not chain `read @ref` afterward.\n- **Use flat lookup flags** for `open` and `peek` \u2014 same as CLI (`--page-slug`, `--id`, etc.). See `help lookup`.\n- **`read @root`** only works after `open` (uses the active session). The hint in peek output is for terminal users who already ran `open`.\n- **Do not invent flags** \u2014 there is no `--read`, `--then`, or chained peek+read syntax. One command per `cms_edit` call.\n\n## Troubleshooting\n\n| Problem | What to do |\n|---------|------------|\n| **401 / connection failed** | Claude \u2192 Settings \u2192 Integrations \u2192 Connect again; complete Contentful sign-in |\n| **No cms_edit tool** | Confirm the integration is connected under Settings \u2192 Integrations |\n| **No active session** | Do not pass `--space` on hosted. Check `/api/health` \u2014 `redis` must be ok. MCP uses `_mcp` session automatically. Manual session: `[\"--session\", \"name\", \"open\", \"--page-slug\", \"/\"]`. Fallback: `[\"read\", \"<entry-id>\", \"--id\"]` |\n| **Wrong space** | Your Contentful account must have access to this deployment's space |\n| **Check version** | Call `cms_edit_version` or `curl /api/health` and read `cmsEdit` |\n\n## Articles\n\n**Recent articles** (by publication `date`, not last-updated):\n\n```json\n[\"list\", \"--type\", \"article\", \"--sort\", \"date\", \"-n\", \"10\"]\n```\n\nAlternatives: `[\"search\", \"<keyword>\", \"--type\", \"article\"]` (also sorts by date), `[\"sitemap\", \"--include\", \"article\", \"--sort\", \"date\"]`.\n\n**Draft articles** \u2014 `peek` and `open` load drafts via CMA (not published-only). To discover drafts:\n\n```json\n[\"sitemap\", \"--include\", \"article\", \"--status\", \"draft\"]\n[\"search\", \"<title>\", \"--type\", \"article\"]\n[\"list\", \"--type\", \"article\", \"--slug\", \"<slug>\"]\n```\n\nThen open: `[\"peek\", \"--article-slug\", \"<slug>\"]` or `[\"open\", \"--id\", \"<entry-id>\"]`. Use `--article-slug`, not `--page-slug`.\n\n**Published-only** is opt-in: `list --published` and `resolve --published` use the Delivery API index and omit never-published drafts.\n\nAfter upgrading cms-edit, run `[\"index\", \"sync\"]` once so the local index includes article `date` values (schema v4).\n\n## Command reference (cms_edit args)\n\n**Discovery:** `sitemap`, `list --type <type>`, `search <query>`, `schema <contentType>`, `index sync`, `index status`\n\n**Reading:** `open --page-slug <slug>`, `open --id <id>`, `peek --page-slug <slug>`, `peek --id <id>`, `snapshot`, `read <ref>`, `read <ref> <field>`, `read <id> --id [field]`\n\n**Diagnostics:** `diagnose` \u2014 session store, userId, active session (after open/read issues)\n\n**Editing:** `set <ref> <field> <value>`, `rtf <ref> <field> --content \"<md>\"`, `diff`, `save`, `discard`\n\n**Creating:** `create page --slug \u2026 --title \u2026`, `add <type> --content-type \u2026 --parent @c0 --target content`\n\n**Other:** `health`, `version`, `guide [topic]`\n";
2
2
  //# sourceMappingURL=hosted-guide.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hosted-guide.d.ts","sourceRoot":"","sources":["../../src/generated/hosted-guide.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,qBAAqB,i1RAAqsR,CAAC"}
1
+ {"version":3,"file":"hosted-guide.d.ts","sourceRoot":"","sources":["../../src/generated/hosted-guide.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,qBAAqB,y2RAAmtR,CAAC"}
@@ -1,3 +1,3 @@
1
1
  // Generated by scripts/generate-embedded-assets.mjs — do not edit manually.
2
- export const HOSTED_GUIDE_TEMPLATE = "# cms-edit MCP guide\n\nUse this guide when editing Contentful draft content through Claude Desktop (hosted `.mcpb` extension) or local stdio MCP.\n\n{{SITE_INTRO}}\n\n## Safety rules\n\ncms-edit **cannot and will not**:\n\n- Publish or unpublish entries\n- Archive or delete published entries\n- Upload new assets (use Contentful UI for assets)\n\nAll `save` operations create **drafts only**. A human must review and publish in Contentful.\n\n## MCP tools\n\n| Tool | Purpose |\n|------|---------|\n| `cms_edit` | Run any cms-edit command via an `args` array |\n| `cms_edit_version` | Check the installed cms-edit version (no session required) |\n| `cms_edit_help` | Read this guide by topic (`overview`, `workflow`, `commands`, `troubleshooting`, `hosted`) |\n\n## Customer editor pack (read first)\n\nWhen a site editor pack is deployed, these MCP resources provide **site-specific** context. Read them before creating or editing content:\n\n| Resource | Purpose |\n|----------|---------|\n| `cms-edit://customer/index` | List of all customer resources |\n| `cms-edit://customer/overview` | Site name, space, staging URL, handoff rules |\n| `cms-edit://customer/routing` | Article/tag URL rules for this site |\n| `cms-edit://customer/components-index` | Component types and when to use each |\n| `cms-edit://customer/collections-index` | Collection types |\n| `cms-edit://customer/brand` | Brand voice and terminology (if configured) |\n| `cms-edit://customer/articles` | Article/publication playbook (if configured) |\n\n**Workflow:** read `cms-edit://customer/index` → `overview` → `routing` → `components-index` → then use `cms_edit` commands.\n\n## MCP prompts\n\n| Prompt | Purpose |\n|--------|---------|\n| `cms_edit_verify` | Check version and connectivity |\n| `cms_edit_explore` | List site content and open a page |\n| `cms_edit_edit_page` | Edit a page through diff → save |\n| `cms_edit_index_sync` | Build/refresh local index (assets, media, templates, taxonomy) |\n| `cms_edit_create_page` | Create a page with template selection |\n| `cms_edit_create_from_doc` | Create a page from a freeform document (infer → confirm → dry-run) |\n| `cms_edit_taxonomy` | Import or ensure taxonomy entries |\n\nRead the full guide anytime via the `cms-edit://guide` resource or `cms_edit_help`.\n\n## Core workflow\n\nStandard editing flow: **open → snapshot → read → set/rtf → diff → save**\n\nEach step is a separate `cms_edit` call. Sessions persist in Redis between calls (hosted) or on disk (local). MCP auto-uses session `_mcp`.\n\n### 1. Open a page\n\n```\n[\"open\", \"--page-slug\", \"/\"]\n[\"open\", \"--page-slug\", \"/pricing\"]\n[\"open\", \"--id\", \"<entry-id>\"]\n```\n\n**Homepage (all SE Studio sites):** Contentful stores the marketing homepage slug as `index`. The live site URL is `/`. In cms-edit, `--page-slug /` and `--page-slug /index` are equivalent (both resolve to `index`). `sitemap` displays this page as `/index` — that is formatting, not a different slug. Read `cms-edit://customer/routing` for site-specific exceptions (e.g. Pedestal uses `home`).\n\n### 2. Snapshot — see the content tree\n\n```\n[\"snapshot\"]\n```\n\nOutput shows `@c0`, `@c1`, … refs for each component. Use these refs in `read`, `set`, and `rtf`.\n\n### 3. Read fields\n\n```\n[\"read\", \"@c1\"]\n[\"read\", \"@c1\", \"heading\"]\n```\n\n### 4. Edit fields\n\n```\n[\"set\", \"@c1\", \"heading\", \"New heading text\"]\n[\"rtf\", \"@c1\", \"body\", \"--content\", \"# Title\\n\\nParagraph text.\"]\n```\n\nFor rich text, prefer `--content` with inline markdown. Use `--base64` when special characters cause issues.\n\n### 5. Review and save\n\n```\n[\"diff\"]\n[\"save\"]\n```\n\nAlways run `diff` before `save`. To abandon changes: `[\"discard\"]`.\n\n## Common sequences\n\n### List all pages\n\n```\n[\"sitemap\"]\n```\n\n### Refresh local index (assets, media, templates, taxonomy)\n\nRun before asset filename search, media-by-filename list, or fast template/taxonomy lookup:\n\n```\n[\"index\", \"sync\"]\n[\"index\", \"status\"]\n[\"list\", \"--type\", \"template\"]\n```\n\nAsset search and media-by-filename list **require** the index. Template/taxonomy list prefers the index when built.\n\n### Explore the homepage\n\n```\n[\"open\", \"--page-slug\", \"/\"]\n[\"snapshot\"]\n[\"read\", \"@c1\"]\n```\n\n### Edit copy on a page\n\n```\n[\"open\", \"--page-slug\", \"{{EXAMPLE_SLUG}}\"]\n[\"snapshot\"]\n[\"read\", \"@c1\", \"heading\"]\n[\"set\", \"@c1\", \"heading\", \"Updated heading\"]\n[\"diff\"]\n[\"save\"]\n```\n\n## Field discovery\n\n```\n[\"schema\", \"component\"]\n[\"list\", \"--type\", \"page\"]\n[\"search\", \"pricing\"]\n```\n\n## Hosted extension rules\n\n{{HOSTED_RULES}}\n\n## Session tips\n\n- After `open`, subsequent MCP commands share session `_mcp` automatically (stored in Redis on hosted).\n- Use `--session <name>` only when juggling multiple pages — pass it **before** the subcommand on every call: `[\"--session\", \"my-work\", \"open\", \"--page-slug\", \"/\"]`.\n- Snapshot JSON includes `sessionName` and `sessionKey` for debugging.\n- If you see \"No active session\", check `/api/health` (Redis must be ok), then run `open` again. Set `LOG_CMS_SESSION=1` on Vercel and search runtime logs for `[cms-edit:session]` (`redis save ok` / `redis load hit` / `requireSession miss`).\n\n### peek vs open vs read\n\n| Goal | MCP args |\n|------|----------|\n| Edit workflow (session) | `[\"open\", \"--page-slug\", \"/\"]` then `[\"read\", \"@c0\"]` |\n| Preview tree + fields, no session | `[\"peek\", \"--page-slug\", \"/pricing\"]` or `[\"peek\", \"--id\", \"<entry-id>\"]` (JSON includes `rootFields`) |\n| Read fields by entry ID, no session | `[\"read\", \"<entry-id>\", \"--id\"]` or `[\"read\", \"<entry-id>\", \"--id\", \"heading\"]` |\n| Debug session persistence | `[\"diagnose\"]` — reports store, userId, active session key |\n\n- **`peek` is one-shot** — prints tree and **root field values** (`rootFields` in JSON). No session is created; do not chain `read @ref` afterward.\n- **Use flat lookup flags** for `open` and `peek` — same as CLI (`--page-slug`, `--id`, etc.). See `help lookup`.\n- **`read @root`** only works after `open` (uses the active session). The hint in peek output is for terminal users who already ran `open`.\n- **Do not invent flags** — there is no `--read`, `--then`, or chained peek+read syntax. One command per `cms_edit` call.\n\n## Troubleshooting\n\n| Problem | What to do |\n|---------|------------|\n| **401 / invalid token** | Regenerate CMA token in Contentful; update token in Claude Desktop → Settings → Extensions |\n| **No cms_edit tool** | Quit Claude fully and reopen; confirm extension is enabled |\n| **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\"]` |\n| **Wrong space** | Token must belong to this deployment's Contentful space |\n| **Check version** | Call `cms_edit_version` or `curl /api/health` and read `cmsEdit` |\n\n## Articles\n\n**Recent articles** (by publication `date`, not last-updated):\n\n```json\n[\"list\", \"--type\", \"article\", \"--sort\", \"date\", \"-n\", \"10\"]\n```\n\nAlternatives: `[\"search\", \"<keyword>\", \"--type\", \"article\"]` (also sorts by date), `[\"sitemap\", \"--include\", \"article\", \"--sort\", \"date\"]`.\n\n**Draft articles** — `peek` and `open` load drafts via CMA (not published-only). To discover drafts:\n\n```json\n[\"sitemap\", \"--include\", \"article\", \"--status\", \"draft\"]\n[\"search\", \"<title>\", \"--type\", \"article\"]\n[\"list\", \"--type\", \"article\", \"--slug\", \"<slug>\"]\n```\n\nThen open: `[\"peek\", \"--article-slug\", \"<slug>\"]` or `[\"open\", \"--id\", \"<entry-id>\"]`. Use `--article-slug`, not `--page-slug`.\n\n**Published-only** is opt-in: `list --published` and `resolve --published` use the Delivery API index and omit never-published drafts.\n\nAfter upgrading cms-edit, run `[\"index\", \"sync\"]` once so the local index includes article `date` values (schema v4).\n\n## Command reference (cms_edit args)\n\n**Discovery:** `sitemap`, `list --type <type>`, `search <query>`, `schema <contentType>`, `index sync`, `index status`\n\n**Reading:** `open --page-slug <slug>`, `open --id <id>`, `peek --page-slug <slug>`, `peek --id <id>`, `snapshot`, `read <ref>`, `read <ref> <field>`, `read <id> --id [field]`\n\n**Diagnostics:** `diagnose` — session store, userId, active session (after open/read issues)\n\n**Editing:** `set <ref> <field> <value>`, `rtf <ref> <field> --content \"<md>\"`, `diff`, `save`, `discard`\n\n**Creating:** `create page --slug … --title …`, `add <type> --content-type … --parent @c0 --target content`\n\n**Other:** `health`, `version`, `guide [topic]`\n";
2
+ export const HOSTED_GUIDE_TEMPLATE = "# cms-edit MCP guide\n\nUse this guide when editing Contentful draft content through Claude Desktop (hosted Integrations + OAuth) or local stdio MCP.\n\n{{SITE_INTRO}}\n\n## Safety rules\n\ncms-edit **cannot and will not**:\n\n- Publish or unpublish entries\n- Archive or delete published entries\n- Upload new assets (use Contentful UI for assets)\n\nAll `save` operations create **drafts only**. A human must review and publish in Contentful.\n\n## MCP tools\n\n| Tool | Purpose |\n|------|---------|\n| `cms_edit` | Run any cms-edit command via an `args` array |\n| `cms_edit_version` | Check the installed cms-edit version (no session required) |\n| `cms_edit_help` | Read this guide by topic (`overview`, `workflow`, `commands`, `troubleshooting`, `hosted`) |\n\n## Customer editor pack (read first)\n\nWhen a site editor pack is deployed, these MCP resources provide **site-specific** context. Read them before creating or editing content:\n\n| Resource | Purpose |\n|----------|---------|\n| `cms-edit://customer/index` | List of all customer resources |\n| `cms-edit://customer/overview` | Site name, space, staging URL, handoff rules |\n| `cms-edit://customer/routing` | Article/tag URL rules for this site |\n| `cms-edit://customer/components-index` | Component types and when to use each |\n| `cms-edit://customer/collections-index` | Collection types |\n| `cms-edit://customer/brand` | Brand voice and terminology (if configured) |\n| `cms-edit://customer/articles` | Article/publication playbook (if configured) |\n\n**Workflow:** read `cms-edit://customer/index` → `overview` → `routing` → `components-index` → then use `cms_edit` commands.\n\n## MCP prompts\n\n| Prompt | Purpose |\n|--------|---------|\n| `cms_edit_verify` | Check version and connectivity |\n| `cms_edit_explore` | List site content and open a page |\n| `cms_edit_edit_page` | Edit a page through diff → save |\n| `cms_edit_index_sync` | Build/refresh local index (assets, media, templates, taxonomy) |\n| `cms_edit_create_page` | Create a page with template selection |\n| `cms_edit_create_from_doc` | Create a page from a freeform document (infer → confirm → dry-run) |\n| `cms_edit_taxonomy` | Import or ensure taxonomy entries |\n\nRead the full guide anytime via the `cms-edit://guide` resource or `cms_edit_help`.\n\n## Core workflow\n\nStandard editing flow: **open → snapshot → read → set/rtf → diff → save**\n\nEach step is a separate `cms_edit` call. Sessions persist in Redis between calls (hosted) or on disk (local). MCP auto-uses session `_mcp`.\n\n### 1. Open a page\n\n```\n[\"open\", \"--page-slug\", \"/\"]\n[\"open\", \"--page-slug\", \"/pricing\"]\n[\"open\", \"--id\", \"<entry-id>\"]\n```\n\n**Homepage (all SE Studio sites):** Contentful stores the marketing homepage slug as `index`. The live site URL is `/`. In cms-edit, `--page-slug /` and `--page-slug /index` are equivalent (both resolve to `index`). `sitemap` displays this page as `/index` — that is formatting, not a different slug. Read `cms-edit://customer/routing` for site-specific exceptions (e.g. Pedestal uses `home`).\n\n### 2. Snapshot — see the content tree\n\n```\n[\"snapshot\"]\n```\n\nOutput shows `@c0`, `@c1`, … refs for each component. Use these refs in `read`, `set`, and `rtf`.\n\n### 3. Read fields\n\n```\n[\"read\", \"@c1\"]\n[\"read\", \"@c1\", \"heading\"]\n```\n\n### 4. Edit fields\n\n```\n[\"set\", \"@c1\", \"heading\", \"New heading text\"]\n[\"rtf\", \"@c1\", \"body\", \"--content\", \"# Title\\n\\nParagraph text.\"]\n```\n\nFor rich text, prefer `--content` with inline markdown. Use `--base64` when special characters cause issues.\n\n### 5. Review and save\n\n```\n[\"diff\"]\n[\"save\"]\n```\n\nAlways run `diff` before `save`. To abandon changes: `[\"discard\"]`.\n\n## Common sequences\n\n### List all pages\n\n```\n[\"sitemap\"]\n```\n\n### Refresh local index (assets, media, templates, taxonomy)\n\nRun before asset filename search, media-by-filename list, or fast template/taxonomy lookup:\n\n```\n[\"index\", \"sync\"]\n[\"index\", \"status\"]\n[\"list\", \"--type\", \"template\"]\n```\n\nAsset search and media-by-filename list **require** the index. Template/taxonomy list prefers the index when built.\n\n### Explore the homepage\n\n```\n[\"open\", \"--page-slug\", \"/\"]\n[\"snapshot\"]\n[\"read\", \"@c1\"]\n```\n\n### Edit copy on a page\n\n```\n[\"open\", \"--page-slug\", \"{{EXAMPLE_SLUG}}\"]\n[\"snapshot\"]\n[\"read\", \"@c1\", \"heading\"]\n[\"set\", \"@c1\", \"heading\", \"Updated heading\"]\n[\"diff\"]\n[\"save\"]\n```\n\n## Field discovery\n\n```\n[\"schema\", \"component\"]\n[\"list\", \"--type\", \"page\"]\n[\"search\", \"pricing\"]\n```\n\n## Hosted connector rules\n\n{{HOSTED_RULES}}\n\n## Session tips\n\n- After `open`, subsequent MCP commands share session `_mcp` automatically (stored in Redis on hosted).\n- Use `--session <name>` only when juggling multiple pages — pass it **before** the subcommand on every call: `[\"--session\", \"my-work\", \"open\", \"--page-slug\", \"/\"]`.\n- Snapshot JSON includes `sessionName` and `sessionKey` for debugging.\n- If you see \"No active session\", check `/api/health` (Redis must be ok), then run `open` again. Set `LOG_CMS_SESSION=1` on Vercel and search runtime logs for `[cms-edit:session]` (`redis save ok` / `redis load hit` / `requireSession miss`).\n\n### peek vs open vs read\n\n| Goal | MCP args |\n|------|----------|\n| Edit workflow (session) | `[\"open\", \"--page-slug\", \"/\"]` then `[\"read\", \"@c0\"]` |\n| Preview tree + fields, no session | `[\"peek\", \"--page-slug\", \"/pricing\"]` or `[\"peek\", \"--id\", \"<entry-id>\"]` (JSON includes `rootFields`) |\n| Read fields by entry ID, no session | `[\"read\", \"<entry-id>\", \"--id\"]` or `[\"read\", \"<entry-id>\", \"--id\", \"heading\"]` |\n| Debug session persistence | `[\"diagnose\"]` — reports store, userId, active session key |\n\n- **`peek` is one-shot** — prints tree and **root field values** (`rootFields` in JSON). No session is created; do not chain `read @ref` afterward.\n- **Use flat lookup flags** for `open` and `peek` — same as CLI (`--page-slug`, `--id`, etc.). See `help lookup`.\n- **`read @root`** only works after `open` (uses the active session). The hint in peek output is for terminal users who already ran `open`.\n- **Do not invent flags** — there is no `--read`, `--then`, or chained peek+read syntax. One command per `cms_edit` call.\n\n## Troubleshooting\n\n| Problem | What to do |\n|---------|------------|\n| **401 / connection failed** | Claude → Settings → Integrations → Connect again; complete Contentful sign-in |\n| **No cms_edit tool** | Confirm the integration is connected under Settings → Integrations |\n| **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\"]` |\n| **Wrong space** | Your Contentful account must have access to this deployment's space |\n| **Check version** | Call `cms_edit_version` or `curl /api/health` and read `cmsEdit` |\n\n## Articles\n\n**Recent articles** (by publication `date`, not last-updated):\n\n```json\n[\"list\", \"--type\", \"article\", \"--sort\", \"date\", \"-n\", \"10\"]\n```\n\nAlternatives: `[\"search\", \"<keyword>\", \"--type\", \"article\"]` (also sorts by date), `[\"sitemap\", \"--include\", \"article\", \"--sort\", \"date\"]`.\n\n**Draft articles** — `peek` and `open` load drafts via CMA (not published-only). To discover drafts:\n\n```json\n[\"sitemap\", \"--include\", \"article\", \"--status\", \"draft\"]\n[\"search\", \"<title>\", \"--type\", \"article\"]\n[\"list\", \"--type\", \"article\", \"--slug\", \"<slug>\"]\n```\n\nThen open: `[\"peek\", \"--article-slug\", \"<slug>\"]` or `[\"open\", \"--id\", \"<entry-id>\"]`. Use `--article-slug`, not `--page-slug`.\n\n**Published-only** is opt-in: `list --published` and `resolve --published` use the Delivery API index and omit never-published drafts.\n\nAfter upgrading cms-edit, run `[\"index\", \"sync\"]` once so the local index includes article `date` values (schema v4).\n\n## Command reference (cms_edit args)\n\n**Discovery:** `sitemap`, `list --type <type>`, `search <query>`, `schema <contentType>`, `index sync`, `index status`\n\n**Reading:** `open --page-slug <slug>`, `open --id <id>`, `peek --page-slug <slug>`, `peek --id <id>`, `snapshot`, `read <ref>`, `read <ref> <field>`, `read <id> --id [field]`\n\n**Diagnostics:** `diagnose` — session store, userId, active session (after open/read issues)\n\n**Editing:** `set <ref> <field> <value>`, `rtf <ref> <field> --content \"<md>\"`, `diff`, `save`, `discard`\n\n**Creating:** `create page --slug … --title …`, `add <type> --content-type … --parent @c0 --target content`\n\n**Other:** `health`, `version`, `guide [topic]`\n";
3
3
  //# sourceMappingURL=hosted-guide.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"hosted-guide.js","sourceRoot":"","sources":["../../src/generated/hosted-guide.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,MAAM,CAAC,MAAM,qBAAqB,GAAG,ksRAAksR,CAAC"}
1
+ {"version":3,"file":"hosted-guide.js","sourceRoot":"","sources":["../../src/generated/hosted-guide.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,MAAM,CAAC,MAAM,qBAAqB,GAAG,gtRAAgtR,CAAC"}
@@ -1,3 +1,3 @@
1
1
  export declare const CMS_EDIT_PACKAGE_NAME = "@se-studio/contentful-cms";
2
- export declare const CMS_EDIT_VERSION = "1.4.0";
2
+ export declare const CMS_EDIT_VERSION = "2.0.0";
3
3
  //# sourceMappingURL=version.d.ts.map
@@ -1,4 +1,4 @@
1
1
  // Generated by scripts/generate-embedded-assets.mjs — do not edit manually.
2
2
  export const CMS_EDIT_PACKAGE_NAME = "@se-studio/contentful-cms";
3
- export const CMS_EDIT_VERSION = "1.4.0";
3
+ export const CMS_EDIT_VERSION = "2.0.0";
4
4
  //# sourceMappingURL=version.js.map
@@ -11,4 +11,11 @@ export { defaultFileSessionStore, FileSessionStore } from '../session/file-sessi
11
11
  export { RedisSessionStore } from '../session/redis-session-store.js';
12
12
  export { buildSessionKey, type RedisClient, type SessionStore, } from '../session/session-store.js';
13
13
  export { CMS_EDIT_PACKAGE_NAME, CMS_EDIT_VERSION, type CmsEditVersionInfo, getVersionInfo, } from '../version.js';
14
+ export { isMcpUnauthorizedError, McpUnauthorizedError, resolveContentfulTokenFromRequest, unauthorizedMcpResponse, } from './oauth/auth.js';
15
+ export { completeAuthorizationCodeGrant, issueAuthorizationRedirect, } from './oauth/complete.js';
16
+ export { getContentfulAuthorizeUrl, getContentfulOAuthClientId, getContentfulOAuthRedirectUri, getMcpResourceUrl, getProtectedResourceMetadataUrl, getPublicOrigin, } from './oauth/config.js';
17
+ export { handleLinkContentfulPost, handleOAuthAuthorizationServerMetadataGet, handleOAuthAuthorizeGet, handleOAuthHealthCheck, handleOAuthProtectedResourceMetadataGet, handleOAuthRegisterPost, handleOAuthTokenPost, type OAuthHandlerContext, } from './oauth/handlers.js';
18
+ export { signMcpAccessToken, verifyMcpAccessToken } from './oauth/jwt.js';
19
+ export { generateAuthCode, verifyPkce } from './oauth/pkce.js';
20
+ export { type AuthCodeRecord, contentfulTokenKey, createOAuthStore, type OAuthClientRegistration, type OAuthStore, type PendingAuthRequest, } from './oauth/store.js';
14
21
  //# sourceMappingURL=index.d.ts.map