@se-studio/contentful-cms 1.0.84 → 1.0.85
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/HOSTED.md +1 -1
- package/dist/commands/peek.d.ts.map +1 -1
- package/dist/commands/peek.js +2 -1
- package/dist/commands/peek.js.map +1 -1
- package/dist/mcp/tools/cms-edit.d.ts +1 -1
- package/dist/mcp/tools/cms-edit.d.ts.map +1 -1
- package/dist/mcp/tools/cms-edit.js +7 -3
- package/dist/mcp/tools/cms-edit.js.map +1 -1
- package/docs/FUNCTIONAL_SPEC.md +4 -2
- package/docs/help/index.md +6 -3
- package/docs/mcp/hosted-guide.md +15 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @se-studio/contentful-cms Changelog
|
|
2
2
|
|
|
3
|
+
## 1.0.85
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Clarify `peek` vs `open` vs `read` in MCP tool description and docs (entry IDs require `--id`; peek is one-shot with no chainable read)
|
|
8
|
+
- Document session logging env var (`LOG_CMS_SESSION=1`) in hosted troubleshooting
|
|
9
|
+
|
|
3
10
|
## 1.0.82
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
package/HOSTED.md
CHANGED
|
@@ -90,7 +90,7 @@ Remember: **save creates drafts only**. You or a colleague must **publish in Con
|
|
|
90
90
|
|---------|------------|
|
|
91
91
|
| **401 / invalid token** | Generate a new CMA token in Contentful. In Claude Desktop → Settings → Extensions, open the cms-edit extension and update your token. |
|
|
92
92
|
| **No cms_edit tool in Claude** | Quit Claude fully and reopen. Confirm the extension is installed and enabled under Settings → Extensions. |
|
|
93
|
-
| **No active session** (after `open` worked) | Do not pass `--space`. MCP uses session `_mcp` automatically.
|
|
93
|
+
| **No active session** (after `open` worked) | Do not pass `--space`. MCP uses session `_mcp` automatically. On Vercel, ensure `LOG_CMS_SESSION=1` is set and check runtime logs for `[cms-edit:session]` lines (`redis save ok` then `redis load hit`). Ensure `--session` is **before** the subcommand if passed manually: `["--session", "name", "open", "/"]`. Fallback: `["read", "<entry-id>", "--id"]`. |
|
|
94
94
|
| **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. |
|
|
95
95
|
| **Lost laptop** | Revoke your token in Contentful → Settings → CMA tokens. |
|
|
96
96
|
| **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. |
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"peek.d.ts","sourceRoot":"","sources":["../../src/commands/peek.ts"],"names":[],"mappings":"AAAA,uFAAuF;AAEvF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAYzC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"peek.d.ts","sourceRoot":"","sources":["../../src/commands/peek.ts"],"names":[],"mappings":"AAAA,uFAAuF;AAEvF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAYzC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA6F1D"}
|
package/dist/commands/peek.js
CHANGED
|
@@ -14,7 +14,8 @@ export function registerPeekCommand(program) {
|
|
|
14
14
|
.command('peek <slug-or-id>')
|
|
15
15
|
.description('Fetch and display an entry tree without affecting your active session.\n' +
|
|
16
16
|
"Useful for inspecting a page's structure, refs, and field values before opening it.\n" +
|
|
17
|
-
'Use --id
|
|
17
|
+
'Use --id when the argument is a Contentful entry ID (bare IDs are not auto-detected as IDs).\n' +
|
|
18
|
+
'Does not create a session — you cannot run read @ref in a follow-up call.\n' +
|
|
18
19
|
'Example: cms-edit peek /pricing (your active session is unchanged)')
|
|
19
20
|
.option('--id', 'Treat the argument as a Contentful entry ID instead of a slug')
|
|
20
21
|
.action(async (slugOrId, opts, cmd) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"peek.js","sourceRoot":"","sources":["../../src/commands/peek.ts"],"names":[],"mappings":"AAAA,uFAAuF;AAGvF,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACzF,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,+BAA+B,EAAqB,MAAM,qBAAqB,CAAC;AACzF,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,MAAM,UAAU,mBAAmB,CAAC,OAAgB;IAClD,OAAO;SACJ,OAAO,CAAC,mBAAmB,CAAC;SAC5B,WAAW,CACV,0EAA0E;QACxE,uFAAuF;QACvF,
|
|
1
|
+
{"version":3,"file":"peek.js","sourceRoot":"","sources":["../../src/commands/peek.ts"],"names":[],"mappings":"AAAA,uFAAuF;AAGvF,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACzF,OAAO,EAAE,UA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,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
2
|
import type { RunCmsEditFn } from '../types.js';
|
|
3
|
-
export declare const TOOL_DESCRIPTION = "Run any cms-edit command. cms-edit edits Contentful draft content (no publishing).\n\nUse cms_edit_version (no args) to check the installed version.\nUse cms_edit_help to read the getting-started guide by topic.\nRead the cms-edit://guide resource for the full guide.\n\nWorkflow: open \u2192 snapshot \u2192 read/set/rtf/add/remove \u2192 diff \u2192 save\nAll saves create drafts only \u2014 a human must publish in Contentful.\n\nCommon command sequences:\n [\"open\", \"/pricing\"] \u2014 load a page by slug\n [\"open\", \"<entry-id>\", \"--id\"] \u2014 load by Contentful entry ID\n [\"snapshot\"] \u2014 print content tree with @refs\n [\"read\", \"@c0\"] \u2014 read all fields of a component\n [\"read\", \"@c0\", \"heading\"] \u2014 read a specific field\n [\"read\", \"<entry-id>\", \"--id\"] \u2014 read entry by ID (no session)\n [\"read\", \"<entry-id>\", \"--id\", \"heading\"] \u2014 read one field by entry ID\n [\"set\", \"@c0\", \"heading\", \"New heading\"] \u2014 set a scalar field\n [\"rtf\", \"@c0\", \"body\", \"--content\", \"# H1\\n\\nBody.\"] \u2014 set rich text (preferred for AI)\n [\"rtf\", \"@c0\", \"body\", \"--base64\", \"<encoded>\"] \u2014 set rich text via base64 (no filesystem)\n [\"diff\"] \u2014 show pending changes\n [\"save\"] \u2014 write drafts to Contentful\n [\"discard\"] \u2014 discard unsaved changes\n [\"health\"] \u2014 verify config and connectivity\n [\"version\"] \u2014 print installed cms-edit version\n [\"guide\"] \u2014 print getting-started guide\n [\"guide\", \"workflow\"] \u2014 print a guide section\n\nSessions persist between MCP calls (Redis on hosted, disk locally). MCP auto-uses session \"_mcp\" unless you pass --session.\nUse --session <name> before the subcommand to isolate concurrent workflows, e.g. [\"--session\", \"my-work\", \"open\", \"/\"].\nUse --space <name> to target a specific Contentful space (local MCP only \u2014 omit for hosted .mcpb extensions).\nStateless read (no open required): [\"read\", \"<entry-id>\", \"--id\"] or [\"read\", \"<entry-id>\", \"--id\", \"heading\"].\nOutput is always JSON (CMS_EDIT_JSON=1 is forced by the MCP server).\n\nRich text tips:\n --content \"<markdown>\" preferred named flag for inline content (any length)\n --base64 \"<encoded>\" fully environment-agnostic, no filesystem needed\n --file \"<abs-path>\" platform-native absolute path required (C:\\\\Users\\\\... on Windows)\n stdin (\"-\") not supported via MCP";
|
|
3
|
+
export declare const TOOL_DESCRIPTION = "Run any cms-edit command. cms-edit edits Contentful draft content (no publishing).\n\nUse cms_edit_version (no args) to check the installed version.\nUse cms_edit_help to read the getting-started guide by topic.\nRead the cms-edit://guide resource for the full guide.\n\nWorkflow: open \u2192 snapshot \u2192 read/set/rtf/add/remove \u2192 diff \u2192 save\nAll saves create drafts only \u2014 a human must publish in Contentful.\n\nCommon command sequences:\n [\"open\", \"/pricing\"] \u2014 load a page by slug\n [\"open\", \"<entry-id>\", \"--id\"] \u2014 load by Contentful entry ID\n [\"snapshot\"] \u2014 print content tree with @refs\n [\"read\", \"@c0\"] \u2014 read all fields of a component (requires open session)\n [\"read\", \"@c0\", \"heading\"] \u2014 read a specific field (requires open session)\n [\"read\", \"@root\"] \u2014 read root entry fields (requires open session)\n [\"read\", \"<entry-id>\", \"--id\"] \u2014 read entry by ID (no session)\n [\"read\", \"<entry-id>\", \"--id\", \"heading\"] \u2014 read one field by entry ID (no session)\n [\"peek\", \"/pricing\"] \u2014 preview tree without opening a session\n [\"peek\", \"<entry-id>\", \"--id\"] \u2014 preview by entry ID (no session; cannot chain read)\n [\"set\", \"@c0\", \"heading\", \"New heading\"] \u2014 set a scalar field\n [\"rtf\", \"@c0\", \"body\", \"--content\", \"# H1\\n\\nBody.\"] \u2014 set rich text (preferred for AI)\n [\"rtf\", \"@c0\", \"body\", \"--base64\", \"<encoded>\"] \u2014 set rich text via base64 (no filesystem)\n [\"diff\"] \u2014 show pending changes\n [\"save\"] \u2014 write drafts to Contentful\n [\"discard\"] \u2014 discard unsaved changes\n [\"health\"] \u2014 verify config and connectivity\n [\"version\"] \u2014 print installed cms-edit version\n [\"guide\"] \u2014 print getting-started guide\n [\"guide\", \"workflow\"] \u2014 print a guide section\n\nSessions persist between MCP calls (Redis on hosted, disk locally). MCP auto-uses session \"_mcp\" unless you pass --session.\nUse --session <name> before the subcommand to isolate concurrent workflows, e.g. [\"--session\", \"my-work\", \"open\", \"/\"].\nUse --space <name> to target a specific Contentful space (local MCP only \u2014 omit for hosted .mcpb extensions).\nStateless read (no open required): [\"read\", \"<entry-id>\", \"--id\"] or [\"read\", \"<entry-id>\", \"--id\", \"heading\"].\npeek is one-shot (no session): use [\"peek\", \"<slug>\"] or [\"peek\", \"<entry-id>\", \"--id\"]. Do not chain read after peek; no --read flag.\nOutput is always JSON (CMS_EDIT_JSON=1 is forced by the MCP server).\n\nRich text tips:\n --content \"<markdown>\" preferred named flag for inline content (any length)\n --base64 \"<encoded>\" fully environment-agnostic, no filesystem needed\n --file \"<abs-path>\" platform-native absolute path required (C:\\\\Users\\\\... on Windows)\n stdin (\"-\") not supported via MCP";
|
|
4
4
|
export declare function registerCmsEditTools(server: McpServer, runCmsEdit: RunCmsEditFn): void;
|
|
5
5
|
export declare function getMcpServerInfo(): {
|
|
6
6
|
name: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cms-edit.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/cms-edit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAKzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"cms-edit.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/cms-edit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAKzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,eAAO,MAAM,gBAAgB,siHA0CoB,CAAC;AAElD,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,GAAG,IAAI,CA8BtF;AAED,wBAAgB,gBAAgB,IAAI;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAEpE"}
|
|
@@ -15,10 +15,13 @@ Common command sequences:
|
|
|
15
15
|
["open", "/pricing"] — load a page by slug
|
|
16
16
|
["open", "<entry-id>", "--id"] — load by Contentful entry ID
|
|
17
17
|
["snapshot"] — print content tree with @refs
|
|
18
|
-
["read", "@c0"] — read all fields of a component
|
|
19
|
-
["read", "@c0", "heading"] — read a specific field
|
|
18
|
+
["read", "@c0"] — read all fields of a component (requires open session)
|
|
19
|
+
["read", "@c0", "heading"] — read a specific field (requires open session)
|
|
20
|
+
["read", "@root"] — read root entry fields (requires open session)
|
|
20
21
|
["read", "<entry-id>", "--id"] — read entry by ID (no session)
|
|
21
|
-
["read", "<entry-id>", "--id", "heading"] — read one field by entry ID
|
|
22
|
+
["read", "<entry-id>", "--id", "heading"] — read one field by entry ID (no session)
|
|
23
|
+
["peek", "/pricing"] — preview tree without opening a session
|
|
24
|
+
["peek", "<entry-id>", "--id"] — preview by entry ID (no session; cannot chain read)
|
|
22
25
|
["set", "@c0", "heading", "New heading"] — set a scalar field
|
|
23
26
|
["rtf", "@c0", "body", "--content", "# H1\\n\\nBody."] — set rich text (preferred for AI)
|
|
24
27
|
["rtf", "@c0", "body", "--base64", "<encoded>"] — set rich text via base64 (no filesystem)
|
|
@@ -34,6 +37,7 @@ Sessions persist between MCP calls (Redis on hosted, disk locally). MCP auto-use
|
|
|
34
37
|
Use --session <name> before the subcommand to isolate concurrent workflows, e.g. ["--session", "my-work", "open", "/"].
|
|
35
38
|
Use --space <name> to target a specific Contentful space (local MCP only — omit for hosted .mcpb extensions).
|
|
36
39
|
Stateless read (no open required): ["read", "<entry-id>", "--id"] or ["read", "<entry-id>", "--id", "heading"].
|
|
40
|
+
peek is one-shot (no session): use ["peek", "<slug>"] or ["peek", "<entry-id>", "--id"]. Do not chain read after peek; no --read flag.
|
|
37
41
|
Output is always JSON (CMS_EDIT_JSON=1 is forced by the MCP server).
|
|
38
42
|
|
|
39
43
|
Rich text tips:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cms-edit.js","sourceRoot":"","sources":["../../../src/mcp/tools/cms-edit.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGpD,MAAM,CAAC,MAAM,gBAAgB,GAAG
|
|
1
|
+
{"version":3,"file":"cms-edit.js","sourceRoot":"","sources":["../../../src/mcp/tools/cms-edit.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGpD,MAAM,CAAC,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iDA0CiB,CAAC;AAElD,MAAM,UAAU,oBAAoB,CAAC,MAAiB,EAAE,UAAwB;IAC9E,MAAM,CAAC,IAAI,CACT,kBAAkB,EAClB,+FAA+F,EAC/F,EAAE,EACF,KAAK,IAAI,EAAE;QACT,MAAM,IAAI,GAAG,cAAc,EAAE,CAAC;QAC9B,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,CAAC,EAAE,CAAC;SAClF,CAAC;IACJ,CAAC,CACF,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,UAAU,EACV,gBAAgB,EAChB;QACE,IAAI,EAAE,CAAC;aACJ,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;aACjB,QAAQ,CACP,2JAA2J,CAC5J;KACJ,EACD,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;QACjB,MAAM,cAAc,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC;QAC5C,iBAAiB,CAAC,oBAAoB,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC,CAAC;QAC3E,MAAM,IAAI,GAAG,MAAM,UAAU,CAAC,cAAc,CAAC,CAAC;QAC9C,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;IACxD,CAAC,CACF,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,gBAAgB;IAC9B,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,gBAAgB,EAAE,CAAC;AACzD,CAAC"}
|
package/docs/FUNCTIONAL_SPEC.md
CHANGED
|
@@ -91,10 +91,12 @@ Each resolved entry is assigned a stable `@ref` label (`@c0` = the root, `@c1`,
|
|
|
91
91
|
|---|---|
|
|
92
92
|
| `open <slug>` | Load page/article/tag by slug into a session. Resolution order: page → article → articleType → tag. |
|
|
93
93
|
| `open <id> --id` | Load by Contentful entry ID |
|
|
94
|
-
| `peek <slug>` | Fetch and display content tree without creating a session |
|
|
94
|
+
| `peek <slug>` | Fetch and display content tree without creating a session (active session unchanged) |
|
|
95
|
+
| `peek <id> --id` | Same as peek, but look up by Contentful entry ID |
|
|
95
96
|
| `snapshot` | Print the current session's entry tree with @refs, entry types, field labels, and publish status |
|
|
96
|
-
| `read <ref>` | Print all fields of an entry |
|
|
97
|
+
| `read <ref>` | Print all fields of an entry in the active session |
|
|
97
98
|
| `read <ref> <field>` | Print a specific field (rich text rendered as Markdown) |
|
|
99
|
+
| `read <id> --id [field]` | Print entry fields by ID without an open session |
|
|
98
100
|
| `search <query>` | Full-text search across entries; returns matching entries |
|
|
99
101
|
| `list --type <type>` | List all entries of a given content type |
|
|
100
102
|
| `sitemap` | List all pages with their slugs and publish status |
|
package/docs/help/index.md
CHANGED
|
@@ -58,10 +58,13 @@ cms-edit run --file patch.json
|
|
|
58
58
|
### Navigation & Discovery
|
|
59
59
|
| Command | Description |
|
|
60
60
|
|---|---|
|
|
61
|
-
| `open <slug
|
|
62
|
-
| `
|
|
61
|
+
| `open <slug>` | Load a page/article into the session by slug |
|
|
62
|
+
| `open <id> --id` | Load by Contentful entry ID |
|
|
63
|
+
| `peek <slug>` | Print a content tree without creating a session (active session unchanged) |
|
|
64
|
+
| `peek <id> --id` | Same as peek, but look up by entry ID (required for 12-char IDs) |
|
|
63
65
|
| `snapshot` | Re-print the current session's content tree with @refs |
|
|
64
|
-
| `read [@ref] [field]` | Read
|
|
66
|
+
| `read [@ref] [field]` | Read fields from the active session (@refs from snapshot) |
|
|
67
|
+
| `read <id> --id [field]` | Read entry fields by ID without an open session |
|
|
65
68
|
| `sitemap` | List all pages with their slugs |
|
|
66
69
|
| `list --type <ct>` | List all entries of a content type |
|
|
67
70
|
| `search <query>` | Full-text search across entries |
|
package/docs/mcp/hosted-guide.md
CHANGED
|
@@ -125,8 +125,20 @@ Always run `diff` before `save`. To abandon changes: `["discard"]`.
|
|
|
125
125
|
- After `open`, subsequent MCP commands share session `_mcp` automatically (stored in Redis on hosted).
|
|
126
126
|
- Use `--session <name>` only when juggling multiple pages — pass it **before** the subcommand on every call: `["--session", "my-work", "open", "/"]`.
|
|
127
127
|
- Snapshot JSON includes `sessionName` and `sessionKey` for debugging.
|
|
128
|
-
-
|
|
129
|
-
|
|
128
|
+
- 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`).
|
|
129
|
+
|
|
130
|
+
### peek vs open vs read
|
|
131
|
+
|
|
132
|
+
| Goal | MCP args |
|
|
133
|
+
|------|----------|
|
|
134
|
+
| Edit workflow (session) | `["open", "/"]` then `["read", "@c0"]` |
|
|
135
|
+
| Preview tree, no session | `["peek", "/pricing"]` or `["peek", "<entry-id>", "--id"]` |
|
|
136
|
+
| Read fields by entry ID, no session | `["read", "<entry-id>", "--id"]` or `["read", "<entry-id>", "--id", "heading"]` |
|
|
137
|
+
|
|
138
|
+
- **`peek` is one-shot** — it prints a snapshot and discards it. You cannot run `read @ref` in a follow-up call; there is no peek session.
|
|
139
|
+
- **Entry IDs need `--id`** for both `open` and `peek` (bare IDs are treated as slugs).
|
|
140
|
+
- **`read @root`** only works after `open` (uses the active session). The hint in peek output is for terminal users who already ran `open`.
|
|
141
|
+
- **Do not invent flags** — there is no `--read`, `--then`, or chained peek+read syntax. One command per `cms_edit` call.
|
|
130
142
|
|
|
131
143
|
## Troubleshooting
|
|
132
144
|
|
|
@@ -142,7 +154,7 @@ Always run `diff` before `save`. To abandon changes: `["discard"]`.
|
|
|
142
154
|
|
|
143
155
|
**Discovery:** `sitemap`, `list --type <type>`, `search <query>`, `schema <contentType>`
|
|
144
156
|
|
|
145
|
-
**Reading:** `open <slug>`, `open <id> --id`, `snapshot`, `read <ref>`, `read <id> --id`, `peek <slug
|
|
157
|
+
**Reading:** `open <slug>`, `open <id> --id`, `snapshot`, `read <ref>`, `read <ref> <field>`, `read <id> --id [field]`, `peek <slug>`, `peek <id> --id`
|
|
146
158
|
|
|
147
159
|
**Editing:** `set <ref> <field> <value>`, `rtf <ref> <field> --content "<md>"`, `diff`, `save`, `discard`
|
|
148
160
|
|