@se-studio/contentful-cms 1.0.81 → 1.0.83

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 (146) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/HOSTED.md +121 -0
  3. package/INSTALL.md +22 -5
  4. package/README.md +2 -0
  5. package/dist/bin/cms-edit.js +8 -143
  6. package/dist/bin/cms-edit.js.map +1 -1
  7. package/dist/cli/program.d.ts +9 -0
  8. package/dist/cli/program.d.ts.map +1 -0
  9. package/dist/cli/program.js +163 -0
  10. package/dist/cli/program.js.map +1 -0
  11. package/dist/cli/runner.d.ts +15 -0
  12. package/dist/cli/runner.d.ts.map +1 -0
  13. package/dist/cli/runner.js +94 -0
  14. package/dist/cli/runner.js.map +1 -0
  15. package/dist/commands/add.js +2 -2
  16. package/dist/commands/add.js.map +1 -1
  17. package/dist/commands/asset.js +5 -5
  18. package/dist/commands/asset.js.map +1 -1
  19. package/dist/commands/backup.js +1 -1
  20. package/dist/commands/backup.js.map +1 -1
  21. package/dist/commands/create-from-json.js +1 -1
  22. package/dist/commands/create-from-json.js.map +1 -1
  23. package/dist/commands/create.js +4 -4
  24. package/dist/commands/create.js.map +1 -1
  25. package/dist/commands/diff.js +2 -2
  26. package/dist/commands/diff.js.map +1 -1
  27. package/dist/commands/discard.js +4 -4
  28. package/dist/commands/discard.js.map +1 -1
  29. package/dist/commands/guide.d.ts +4 -0
  30. package/dist/commands/guide.d.ts.map +1 -0
  31. package/dist/commands/guide.js +18 -0
  32. package/dist/commands/guide.js.map +1 -0
  33. package/dist/commands/links.js +10 -10
  34. package/dist/commands/links.js.map +1 -1
  35. package/dist/commands/move.js +3 -3
  36. package/dist/commands/move.js.map +1 -1
  37. package/dist/commands/nav.js +3 -3
  38. package/dist/commands/nav.js.map +1 -1
  39. package/dist/commands/open.js +1 -1
  40. package/dist/commands/open.js.map +1 -1
  41. package/dist/commands/peek.d.ts.map +1 -1
  42. package/dist/commands/peek.js +8 -2
  43. package/dist/commands/peek.js.map +1 -1
  44. package/dist/commands/preview.js +1 -1
  45. package/dist/commands/preview.js.map +1 -1
  46. package/dist/commands/read.d.ts.map +1 -1
  47. package/dist/commands/read.js +97 -68
  48. package/dist/commands/read.js.map +1 -1
  49. package/dist/commands/remove.js +2 -2
  50. package/dist/commands/remove.js.map +1 -1
  51. package/dist/commands/revert.js +5 -5
  52. package/dist/commands/revert.js.map +1 -1
  53. package/dist/commands/rtf.js +11 -11
  54. package/dist/commands/rtf.js.map +1 -1
  55. package/dist/commands/run.js +8 -8
  56. package/dist/commands/run.js.map +1 -1
  57. package/dist/commands/save.js +3 -3
  58. package/dist/commands/save.js.map +1 -1
  59. package/dist/commands/screenshot.js +2 -2
  60. package/dist/commands/screenshot.js.map +1 -1
  61. package/dist/commands/set.js +7 -7
  62. package/dist/commands/set.js.map +1 -1
  63. package/dist/commands/snapshot.js +1 -1
  64. package/dist/commands/snapshot.js.map +1 -1
  65. package/dist/commands/version.d.ts +4 -0
  66. package/dist/commands/version.d.ts.map +1 -0
  67. package/dist/commands/version.js +17 -0
  68. package/dist/commands/version.js.map +1 -0
  69. package/dist/config/hosted.d.ts +28 -0
  70. package/dist/config/hosted.d.ts.map +1 -0
  71. package/dist/config/hosted.js +94 -0
  72. package/dist/config/hosted.js.map +1 -0
  73. package/dist/config/load.d.ts.map +1 -1
  74. package/dist/config/load.js +5 -0
  75. package/dist/config/load.js.map +1 -1
  76. package/dist/hosted/index.d.ts +13 -0
  77. package/dist/hosted/index.d.ts.map +1 -0
  78. package/dist/hosted/index.js +12 -0
  79. package/dist/hosted/index.js.map +1 -0
  80. package/dist/mcp/guide.d.ts +20 -0
  81. package/dist/mcp/guide.d.ts.map +1 -0
  82. package/dist/mcp/guide.js +91 -0
  83. package/dist/mcp/guide.js.map +1 -0
  84. package/dist/mcp/http-handler.d.ts +13 -0
  85. package/dist/mcp/http-handler.d.ts.map +1 -0
  86. package/dist/mcp/http-handler.js +28 -0
  87. package/dist/mcp/http-handler.js.map +1 -0
  88. package/dist/mcp/prompts/onboarding.d.ts +4 -0
  89. package/dist/mcp/prompts/onboarding.d.ts.map +1 -0
  90. package/dist/mcp/prompts/onboarding.js +77 -0
  91. package/dist/mcp/prompts/onboarding.js.map +1 -0
  92. package/dist/mcp/resources/guide.d.ts +4 -0
  93. package/dist/mcp/resources/guide.d.ts.map +1 -0
  94. package/dist/mcp/resources/guide.js +16 -0
  95. package/dist/mcp/resources/guide.js.map +1 -0
  96. package/dist/mcp/server.d.ts +13 -1
  97. package/dist/mcp/server.d.ts.map +1 -1
  98. package/dist/mcp/server.js +20 -92
  99. package/dist/mcp/server.js.map +1 -1
  100. package/dist/mcp/session-args.d.ts +5 -0
  101. package/dist/mcp/session-args.d.ts.map +1 -0
  102. package/dist/mcp/session-args.js +10 -0
  103. package/dist/mcp/session-args.js.map +1 -0
  104. package/dist/mcp/tools/cms-edit.d.ts +9 -0
  105. package/dist/mcp/tools/cms-edit.d.ts.map +1 -0
  106. package/dist/mcp/tools/cms-edit.js +62 -0
  107. package/dist/mcp/tools/cms-edit.js.map +1 -0
  108. package/dist/mcp/tools/help.d.ts +4 -0
  109. package/dist/mcp/tools/help.d.ts.map +1 -0
  110. package/dist/mcp/tools/help.js +22 -0
  111. package/dist/mcp/tools/help.js.map +1 -0
  112. package/dist/mcp/types.d.ts +2 -0
  113. package/dist/mcp/types.d.ts.map +1 -0
  114. package/dist/mcp/types.js +2 -0
  115. package/dist/mcp/types.js.map +1 -0
  116. package/dist/runtime/context.d.ts +19 -0
  117. package/dist/runtime/context.d.ts.map +1 -0
  118. package/dist/runtime/context.js +9 -0
  119. package/dist/runtime/context.js.map +1 -0
  120. package/dist/session/file-session-store.d.ts +10 -0
  121. package/dist/session/file-session-store.d.ts.map +1 -0
  122. package/dist/session/file-session-store.js +149 -0
  123. package/dist/session/file-session-store.js.map +1 -0
  124. package/dist/session/redis-session-store.d.ts +23 -0
  125. package/dist/session/redis-session-store.d.ts.map +1 -0
  126. package/dist/session/redis-session-store.js +133 -0
  127. package/dist/session/redis-session-store.js.map +1 -0
  128. package/dist/session/session-store.d.ts +19 -0
  129. package/dist/session/session-store.d.ts.map +1 -0
  130. package/dist/session/session-store.js +9 -0
  131. package/dist/session/session-store.js.map +1 -0
  132. package/dist/session/store.d.ts +5 -5
  133. package/dist/session/store.d.ts.map +1 -1
  134. package/dist/session/store.js +23 -75
  135. package/dist/session/store.js.map +1 -1
  136. package/dist/snapshot/render.d.ts.map +1 -1
  137. package/dist/snapshot/render.js +7 -0
  138. package/dist/snapshot/render.js.map +1 -1
  139. package/dist/version.d.ts +9 -0
  140. package/dist/version.d.ts.map +1 -0
  141. package/dist/version.js +19 -0
  142. package/dist/version.js.map +1 -0
  143. package/docs/FEATURE_REQUESTS_ARCHIVE.md +141 -0
  144. package/docs/FUNCTIONAL_SPEC.md +271 -0
  145. package/docs/mcp/hosted-guide.md +151 -0
  146. package/package.json +14 -6
@@ -0,0 +1,13 @@
1
+ export { CmsEditProcessExit, type RunCmsEditArgsResult, runCmsEditArgs } from '../cli/runner.js';
2
+ export { assertPatSpaceAccess, buildHostedConfig, buildHostedSpaceConfig, extractBearerToken, type HostedDeploymentConfig, loadHostedDeploymentFromEnv, type ValidatePatResult, validateContentfulPat, validatePatForDeployment, } from '../config/hosted.js';
3
+ export type { CmsEditConfig, SpaceConfig } from '../config/types.js';
4
+ export { createSafeEnvironment } from '../contentful/client.js';
5
+ export { GETTING_STARTED_INFO, GUIDE_RESOURCE_URI, type HostedMcpInfo } from '../mcp/guide.js';
6
+ export { type HostedMcpHandlerOptions, handleHostedMcpRequest } from '../mcp/http-handler.js';
7
+ export { type CreateMcpServerOptions, createMcpServer, runCmsEditInProcess, } from '../mcp/server.js';
8
+ export { type CmsEditRuntimeContext, type ContentfulUserIdentity, cmsEditContext, getRuntimeContext, runWithCmsEditContext, } from '../runtime/context.js';
9
+ export { defaultFileSessionStore, FileSessionStore } from '../session/file-session-store.js';
10
+ export { RedisSessionStore } from '../session/redis-session-store.js';
11
+ export { buildSessionKey, type RedisClient, type SessionStore, } from '../session/session-store.js';
12
+ export { CMS_EDIT_PACKAGE_NAME, CMS_EDIT_VERSION, type CmsEditVersionInfo, getVersionInfo, } from '../version.js';
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hosted/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,KAAK,oBAAoB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACjG,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,sBAAsB,EACtB,kBAAkB,EAClB,KAAK,sBAAsB,EAC3B,2BAA2B,EAC3B,KAAK,iBAAiB,EACtB,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC/F,OAAO,EAAE,KAAK,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAC9F,OAAO,EACL,KAAK,sBAAsB,EAC3B,eAAe,EACf,mBAAmB,GACpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,cAAc,EACd,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAC7F,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EACL,eAAe,EACf,KAAK,WAAW,EAChB,KAAK,YAAY,GAClB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,KAAK,kBAAkB,EACvB,cAAc,GACf,MAAM,eAAe,CAAC"}
@@ -0,0 +1,12 @@
1
+ export { CmsEditProcessExit, runCmsEditArgs } from '../cli/runner.js';
2
+ export { assertPatSpaceAccess, buildHostedConfig, buildHostedSpaceConfig, extractBearerToken, loadHostedDeploymentFromEnv, validateContentfulPat, validatePatForDeployment, } from '../config/hosted.js';
3
+ export { createSafeEnvironment } from '../contentful/client.js';
4
+ export { GETTING_STARTED_INFO, GUIDE_RESOURCE_URI } from '../mcp/guide.js';
5
+ export { handleHostedMcpRequest } from '../mcp/http-handler.js';
6
+ export { createMcpServer, runCmsEditInProcess, } from '../mcp/server.js';
7
+ export { cmsEditContext, getRuntimeContext, runWithCmsEditContext, } from '../runtime/context.js';
8
+ export { defaultFileSessionStore, FileSessionStore } from '../session/file-session-store.js';
9
+ export { RedisSessionStore } from '../session/redis-session-store.js';
10
+ export { buildSessionKey, } from '../session/session-store.js';
11
+ export { CMS_EDIT_PACKAGE_NAME, CMS_EDIT_VERSION, getVersionInfo, } from '../version.js';
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hosted/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAA6B,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACjG,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,sBAAsB,EACtB,kBAAkB,EAElB,2BAA2B,EAE3B,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAsB,MAAM,iBAAiB,CAAC;AAC/F,OAAO,EAAgC,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAC9F,OAAO,EAEL,eAAe,EACf,mBAAmB,GACpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAGL,cAAc,EACd,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAC7F,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EACL,eAAe,GAGhB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAEhB,cAAc,GACf,MAAM,eAAe,CAAC"}
@@ -0,0 +1,20 @@
1
+ export interface HostedMcpInfo {
2
+ projectKey: string;
3
+ displayName?: string;
4
+ exampleSlugs?: string[];
5
+ }
6
+ export type GuideTopic = 'overview' | 'workflow' | 'commands' | 'troubleshooting' | 'hosted';
7
+ export declare const GUIDE_TOPICS: GuideTopic[];
8
+ export declare const GUIDE_RESOURCE_URI = "cms-edit://guide";
9
+ export declare const ONBOARDING_PROMPTS: readonly ["cms_edit_verify", "cms_edit_explore", "cms_edit_edit_page"];
10
+ export declare const GETTING_STARTED_INFO: {
11
+ readonly resourceUri: "cms-edit://guide";
12
+ readonly prompts: readonly ["cms_edit_verify", "cms_edit_explore", "cms_edit_edit_page"];
13
+ readonly helpTool: "cms_edit_help";
14
+ };
15
+ export declare function loadHostedGuideTemplate(): string;
16
+ export declare function buildGuideMarkdown(hosted?: HostedMcpInfo): string;
17
+ export declare function extractGuideTopic(markdown: string, topic: GuideTopic): string;
18
+ export declare function getGuideTopicMarkdown(topic: GuideTopic, hosted?: HostedMcpInfo): string;
19
+ export declare function parseGuideTopic(value?: string): GuideTopic;
20
+ //# sourceMappingURL=guide.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guide.d.ts","sourceRoot":"","sources":["../../src/mcp/guide.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAED,MAAM,MAAM,UAAU,GAAG,UAAU,GAAG,UAAU,GAAG,UAAU,GAAG,iBAAiB,GAAG,QAAQ,CAAC;AAE7F,eAAO,MAAM,YAAY,EAAE,UAAU,EAMpC,CAAC;AAEF,eAAO,MAAM,kBAAkB,qBAAqB,CAAC;AAErD,eAAO,MAAM,kBAAkB,wEAIrB,CAAC;AAEX,eAAO,MAAM,oBAAoB;;;;CAIvB,CAAC;AAeX,wBAAgB,uBAAuB,IAAI,MAAM,CAGhD;AA+BD,wBAAgB,kBAAkB,CAAC,MAAM,CAAC,EAAE,aAAa,GAAG,MAAM,CAMjE;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,GAAG,MAAM,CAiB7E;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,aAAa,GAAG,MAAM,CAGvF;AAED,wBAAgB,eAAe,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,UAAU,CAQ1D"}
@@ -0,0 +1,91 @@
1
+ import { readFileSync } from 'node:fs';
2
+ import * as path from 'node:path';
3
+ import { fileURLToPath } from 'node:url';
4
+ export const GUIDE_TOPICS = [
5
+ 'overview',
6
+ 'workflow',
7
+ 'commands',
8
+ 'troubleshooting',
9
+ 'hosted',
10
+ ];
11
+ export const GUIDE_RESOURCE_URI = 'cms-edit://guide';
12
+ export const ONBOARDING_PROMPTS = [
13
+ 'cms_edit_verify',
14
+ 'cms_edit_explore',
15
+ 'cms_edit_edit_page',
16
+ ];
17
+ export const GETTING_STARTED_INFO = {
18
+ resourceUri: GUIDE_RESOURCE_URI,
19
+ prompts: [...ONBOARDING_PROMPTS],
20
+ helpTool: 'cms_edit_help',
21
+ };
22
+ const DEFAULT_EXAMPLE_SLUGS = ['/', '/pricing'];
23
+ const TOPIC_HEADINGS = {
24
+ workflow: '## Core workflow',
25
+ commands: '## Command reference (cms_edit args)',
26
+ troubleshooting: '## Troubleshooting',
27
+ hosted: '## Hosted extension rules',
28
+ };
29
+ function packageRoot() {
30
+ return path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..', '..');
31
+ }
32
+ export function loadHostedGuideTemplate() {
33
+ const guidePath = path.join(packageRoot(), 'docs', 'mcp', 'hosted-guide.md');
34
+ return readFileSync(guidePath, 'utf-8');
35
+ }
36
+ function buildSiteIntro(hosted) {
37
+ if (hosted) {
38
+ const siteName = hosted.displayName ?? hosted.projectKey;
39
+ return (`This deployment is configured for **${siteName}** (project key \`${hosted.projectKey}\`). ` +
40
+ 'You are using the hosted Claude Desktop extension — no local config files or `--space` flag needed.');
41
+ }
42
+ return ('You are using local stdio MCP. Multi-space setups may use `--space <name>` when multiple spaces ' +
43
+ 'are configured in `.contentful-cms.json`.');
44
+ }
45
+ function buildHostedRules(hosted) {
46
+ if (hosted) {
47
+ return ('- **Do not pass `--space`** — this deployment is already bound to one Contentful space.\n' +
48
+ '- Your Contentful personal access token is sent on each request; edits appear under your name.\n' +
49
+ '- Redeploy the hosted server to pick up cms-edit updates; no `.mcpb` reinstall needed for tool changes.');
50
+ }
51
+ return ('- Use `--space <name>` only when your config defines multiple spaces.\n' +
52
+ '- Ensure `.contentful-cms.json` exists and your management token is configured.\n' +
53
+ '- For hosted editors, use the `.mcpb` extension instead of local config.');
54
+ }
55
+ export function buildGuideMarkdown(hosted) {
56
+ const exampleSlug = hosted?.exampleSlugs?.[1] ?? DEFAULT_EXAMPLE_SLUGS[1] ?? '/pricing';
57
+ return loadHostedGuideTemplate()
58
+ .replace('{{SITE_INTRO}}', buildSiteIntro(hosted))
59
+ .replace('{{HOSTED_RULES}}', buildHostedRules(hosted))
60
+ .replaceAll('{{EXAMPLE_SLUG}}', exampleSlug);
61
+ }
62
+ export function extractGuideTopic(markdown, topic) {
63
+ if (topic === 'overview') {
64
+ return markdown.trim();
65
+ }
66
+ const heading = TOPIC_HEADINGS[topic];
67
+ const start = markdown.indexOf(heading);
68
+ if (start === -1) {
69
+ return markdown.trim();
70
+ }
71
+ const afterHeading = markdown.slice(start);
72
+ const nextHeadingIndex = afterHeading.indexOf('\n## ', 1);
73
+ if (nextHeadingIndex === -1) {
74
+ return afterHeading.trim();
75
+ }
76
+ return afterHeading.slice(0, nextHeadingIndex).trim();
77
+ }
78
+ export function getGuideTopicMarkdown(topic, hosted) {
79
+ const markdown = buildGuideMarkdown(hosted);
80
+ return extractGuideTopic(markdown, topic);
81
+ }
82
+ export function parseGuideTopic(value) {
83
+ if (!value || value === 'overview') {
84
+ return 'overview';
85
+ }
86
+ if (GUIDE_TOPICS.includes(value)) {
87
+ return value;
88
+ }
89
+ throw new Error(`Unknown guide topic "${value}". Valid topics: ${GUIDE_TOPICS.join(', ')}`);
90
+ }
91
+ //# sourceMappingURL=guide.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guide.js","sourceRoot":"","sources":["../../src/mcp/guide.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAUzC,MAAM,CAAC,MAAM,YAAY,GAAiB;IACxC,UAAU;IACV,UAAU;IACV,UAAU;IACV,iBAAiB;IACjB,QAAQ;CACT,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,kBAAkB,CAAC;AAErD,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,iBAAiB;IACjB,kBAAkB;IAClB,oBAAoB;CACZ,CAAC;AAEX,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,WAAW,EAAE,kBAAkB;IAC/B,OAAO,EAAE,CAAC,GAAG,kBAAkB,CAAC;IAChC,QAAQ,EAAE,eAAe;CACjB,CAAC;AAEX,MAAM,qBAAqB,GAAG,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;AAEhD,MAAM,c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AK,YAAkC,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACxD,OAAO,KAAmB,CAAC;IAC7B,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,wBAAwB,KAAK,oBAAoB,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC9F,CAAC"}
@@ -0,0 +1,13 @@
1
+ import type { CmsEditRuntimeContext } from '../runtime/context.js';
2
+ import type { HostedMcpInfo } from './guide.js';
3
+ export interface HostedMcpHandlerOptions {
4
+ /** Builds runtime context (config, user, session store) from the incoming request. */
5
+ resolveContext: (request: Request) => Promise<CmsEditRuntimeContext>;
6
+ /** Optional deployment info for guide/prompt interpolation. */
7
+ getMcpInfo?: () => HostedMcpInfo | undefined;
8
+ }
9
+ /**
10
+ * Handles a Streamable HTTP MCP request in stateless mode (suitable for Vercel serverless).
11
+ */
12
+ export declare function handleHostedMcpRequest(request: Request, options: HostedMcpHandlerOptions): Promise<Response>;
13
+ //# sourceMappingURL=http-handler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http-handler.d.ts","sourceRoot":"","sources":["../../src/mcp/http-handler.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAEnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAGhD,MAAM,WAAW,uBAAuB;IACtC,sFAAsF;IACtF,cAAc,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,qBAAqB,CAAC,CAAC;IACrE,+DAA+D;IAC/D,UAAU,CAAC,EAAE,MAAM,aAAa,GAAG,SAAS,CAAC;CAC9C;AAOD;;GAEG;AACH,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,uBAAuB,GAC/B,OAAO,CAAC,QAAQ,CAAC,CAiBnB"}
@@ -0,0 +1,28 @@
1
+ import { WebStandardStreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/webStandardStreamableHttp.js';
2
+ import { runCmsEditArgs } from '../cli/runner.js';
3
+ import { runWithCmsEditContext } from '../runtime/context.js';
4
+ import { createMcpServer } from './server.js';
5
+ async function defaultRunCmsEdit(args) {
6
+ const { exitCode, output } = await runCmsEditArgs(args);
7
+ return exitCode !== 0 ? `${output}\n(exit code ${exitCode})` : output;
8
+ }
9
+ /**
10
+ * Handles a Streamable HTTP MCP request in stateless mode (suitable for Vercel serverless).
11
+ */
12
+ export async function handleHostedMcpRequest(request, options) {
13
+ const runCmsEdit = async (args) => {
14
+ const context = await options.resolveContext(request);
15
+ return runWithCmsEditContext(context, async () => {
16
+ process.env['CMS_EDIT_JSON'] = '1';
17
+ return defaultRunCmsEdit(args);
18
+ });
19
+ };
20
+ const server = createMcpServer({ runCmsEdit, hosted: options.getMcpInfo?.() });
21
+ const transport = new WebStandardStreamableHTTPServerTransport({
22
+ sessionIdGenerator: undefined,
23
+ enableJsonResponse: true,
24
+ });
25
+ await server.connect(transport);
26
+ return transport.handleRequest(request);
27
+ }
28
+ //# sourceMappingURL=http-handler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http-handler.js","sourceRoot":"","sources":["../../src/mcp/http-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wCAAwC,EAAE,MAAM,+DAA+D,CAAC;AACzH,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAS9C,KAAK,UAAU,iBAAiB,CAAC,IAAc;IAC7C,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,cAAc,CAAC,IAAI,CAAC,CAAC;IACxD,OAAO,QAAQ,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,gBAAgB,QAAQ,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC;AACxE,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,OAAgB,EAChB,OAAgC;IAEhC,MAAM,UAAU,GAAG,KAAK,EAAE,IAAc,EAAE,EAAE;QAC1C,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QACtD,OAAO,qBAAqB,CAAC,OAAO,EAAE,KAAK,IAAI,EAAE;YAC/C,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,GAAG,GAAG,CAAC;YACnC,OAAO,iBAAiB,CAAC,IAAI,CAAC,CAAC;QACjC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,MAAM,MAAM,GAAG,eAAe,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,UAAU,EAAE,EAAE,EAAE,CAAC,CAAC;IAC/E,MAAM,SAAS,GAAG,IAAI,wCAAwC,CAAC;QAC7D,kBAAkB,EAAE,SAAS;QAC7B,kBAAkB,EAAE,IAAI;KACzB,CAAC,CAAC;IAEH,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,SAAS,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;AAC1C,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import type { HostedMcpInfo } from '../guide.js';
3
+ export declare function registerOnboardingPrompts(server: McpServer, hosted?: HostedMcpInfo): void;
4
+ //# sourceMappingURL=onboarding.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"onboarding.d.ts","sourceRoot":"","sources":["../../../src/mcp/prompts/onboarding.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAajD,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,aAAa,GAAG,IAAI,CAsFzF"}
@@ -0,0 +1,77 @@
1
+ import { z } from 'zod';
2
+ function hostedNote(hosted) {
3
+ if (!hosted) {
4
+ return 'Local MCP: use --space when multiple spaces are configured.';
5
+ }
6
+ const siteName = hosted.displayName ?? hosted.projectKey;
7
+ return (`Hosted deployment for ${siteName}. Do NOT pass --space in cms_edit args — ` +
8
+ 'this extension is already bound to one Contentful space.');
9
+ }
10
+ export function registerOnboardingPrompts(server, hosted) {
11
+ const note = hostedNote(hosted);
12
+ server.prompt('cms_edit_verify', 'Verify cms-edit connectivity: check version and run health checks.', async () => ({
13
+ messages: [
14
+ {
15
+ role: 'user',
16
+ content: {
17
+ type: 'text',
18
+ text: `${note}\n\n` +
19
+ 'Verify cms-edit is working:\n' +
20
+ '1. Call cms_edit_version\n' +
21
+ '2. Call cms_edit with args ["health"]\n' +
22
+ '3. Summarize version and health status for the user',
23
+ },
24
+ },
25
+ ],
26
+ }));
27
+ server.prompt('cms_edit_explore', 'Explore site content: sitemap, open a page, and show the content tree.', {
28
+ slug: z.string().optional().describe('Page slug to open (default: / for homepage)'),
29
+ }, async ({ slug }) => {
30
+ const targetSlug = slug ?? '/';
31
+ return {
32
+ messages: [
33
+ {
34
+ role: 'user',
35
+ content: {
36
+ type: 'text',
37
+ text: `${note}\n\n` +
38
+ 'Explore this Contentful site:\n' +
39
+ '1. cms_edit ["sitemap"] — list pages\n' +
40
+ `2. cms_edit ["open", "${targetSlug}"] — load the page\n` +
41
+ '3. cms_edit ["snapshot"] — show @ref tree\n' +
42
+ '4. Summarize what you found',
43
+ },
44
+ },
45
+ ],
46
+ };
47
+ });
48
+ server.prompt('cms_edit_edit_page', 'Edit a page: open, inspect, change fields, diff, then save as draft.', {
49
+ slug: z.string().describe('Page slug to edit, e.g. /pricing'),
50
+ instructions: z.string().optional().describe('Optional edit instructions from the user'),
51
+ }, async ({ slug, instructions }) => {
52
+ const editLine = instructions
53
+ ? `User wants: ${instructions}\n`
54
+ : 'Ask the user what to change if not specified.\n';
55
+ return {
56
+ messages: [
57
+ {
58
+ role: 'user',
59
+ content: {
60
+ type: 'text',
61
+ text: `${note}\n\n` +
62
+ `${editLine}` +
63
+ `Edit page "${slug}":\n` +
64
+ `1. cms_edit ["open", "${slug}"]\n` +
65
+ '2. cms_edit ["snapshot"] — find @refs\n' +
66
+ '3. cms_edit ["read", "@cN", "field"] — inspect fields\n' +
67
+ '4. cms_edit ["set", ...] or ["rtf", ..., "--content", "..."] — make changes\n' +
68
+ '5. cms_edit ["diff"] — review ALL changes\n' +
69
+ '6. cms_edit ["save"] — write drafts (does NOT publish)\n' +
70
+ 'Always show diff before saving.',
71
+ },
72
+ },
73
+ ],
74
+ };
75
+ });
76
+ }
77
+ //# sourceMappingURL=onboarding.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"onboarding.js","sourceRoot":"","sources":["../../../src/mcp/prompts/onboarding.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,SAAS,UAAU,CAAC,MAAsB;IACxC,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,6DAA6D,CAAC;IACvE,CAAC;IACD,MAAM,QAAQ,GAAG,MAAM,CAAC,WAAW,IAAI,MAAM,CAAC,UAAU,CAAC;IACzD,OAAO,CACL,yBAAyB,QAAQ,2CAA2C;QAC5E,0DAA0D,CAC3D,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,yBAAyB,CAAC,MAAiB,EAAE,MAAsB;IACjF,MAAM,IAAI,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;IAEhC,MAAM,CAAC,MAAM,CACX,iBAAiB,EACjB,oEAAoE,EACpE,KAAK,IAAI,EAAE,CAAC,CAAC;QACX,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,MAAe;gBACrB,OAAO,EAAE;oBACP,IAAI,EAAE,MAAe;oBACrB,IAAI,EACF,GAAG,IAAI,MAAM;wBACb,+BAA+B;wB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AM;4BACnC,yCAAyC;4BACzC,yDAAyD;4BACzD,+EAA+E;4BAC/E,6CAA6C;4BAC7C,0DAA0D;4BAC1D,iCAAiC;qBACpC;iBACF;aACF;SACF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import { type HostedMcpInfo } from '../guide.js';
3
+ export declare function registerGuideResource(server: McpServer, hosted?: HostedMcpInfo): void;
4
+ //# sourceMappingURL=guide.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guide.d.ts","sourceRoot":"","sources":["../../../src/mcp/resources/guide.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,EAA0C,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAEzF,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,aAAa,GAAG,IAAI,CAkBrF"}
@@ -0,0 +1,16 @@
1
+ import { buildGuideMarkdown, GUIDE_RESOURCE_URI } from '../guide.js';
2
+ export function registerGuideResource(server, hosted) {
3
+ server.resource('cms-edit-guide', GUIDE_RESOURCE_URI, {
4
+ description: 'Read before editing Contentful content with cms_edit.',
5
+ mimeType: 'text/markdown',
6
+ }, async () => ({
7
+ contents: [
8
+ {
9
+ uri: GUIDE_RESOURCE_URI,
10
+ mimeType: 'text/markdown',
11
+ text: buildGuideMarkdown(hosted),
12
+ },
13
+ ],
14
+ }));
15
+ }
16
+ //# sourceMappingURL=guide.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guide.js","sourceRoot":"","sources":["../../../src/mcp/resources/guide.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAsB,MAAM,aAAa,CAAC;AAEzF,MAAM,UAAU,qBAAqB,CAAC,MAAiB,EAAE,MAAsB;IAC7E,MAAM,CAAC,QAAQ,CACb,gBAAgB,EAChB,kBAAkB,EAClB;QACE,WAAW,EAAE,uDAAuD;QACpE,QAAQ,EAAE,eAAe;KAC1B,EACD,KAAK,IAAI,EAAE,CAAC,CAAC;QACX,QAAQ,EAAE;YACR;gBACE,GAAG,EAAE,kBAAkB;gBACvB,QAAQ,EAAE,eAAe;gBACzB,IAAI,EAAE,kBAAkB,CAAC,MAAM,CAAC;aACjC;SACF;KACF,CAAC,CACH,CAAC;AACJ,CAAC"}
@@ -1,3 +1,15 @@
1
1
  import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
- export declare function createMcpServer(): McpServer;
2
+ import type { HostedMcpInfo } from './guide.js';
3
+ import type { RunCmsEditFn } from './types.js';
4
+ export type { HostedMcpInfo } from './guide.js';
5
+ export type { RunCmsEditFn } from './types.js';
6
+ export interface CreateMcpServerOptions {
7
+ /** Custom runner (in-process for hosted). Defaults to child-process spawn for stdio MCP. */
8
+ runCmsEdit?: RunCmsEditFn;
9
+ /** When set, guide and prompts include hosted-specific notes (site name, no --space). */
10
+ hosted?: HostedMcpInfo;
11
+ }
12
+ export declare function createMcpServer(options?: CreateMcpServerOptions): McpServer;
13
+ /** In-process runner used by hosted MCP and tests. */
14
+ export declare function runCmsEditInProcess(args: string[]): Promise<string>;
3
15
  //# sourceMappingURL=server.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAmFpE,wBAAgB,eAAe,IAAI,SAAS,CAoB3C"}
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAKhD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAK/C,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,MAAM,WAAW,sBAAsB;IACrC,4FAA4F;IAC5F,UAAU,CAAC,EAAE,YAAY,CAAC;IAC1B,yFAAyF;IACzF,MAAM,CAAC,EAAE,aAAa,CAAC;CACxB;AAED,wBAAgB,eAAe,CAAC,OAAO,GAAE,sBAA2B,GAAG,SAAS,CAW/E;AA8BD,sDAAsD;AACtD,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAIzE"}
@@ -3,103 +3,26 @@ import * as child_process from 'node:child_process';
3
3
  import * as path from 'node:path';
4
4
  import { fileURLToPath } from 'node:url';
5
5
  import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
6
- import { z } from 'zod';
6
+ import { runCmsEditArgs } from '../cli/runner.js';
7
+ import { registerOnboardingPrompts } from './prompts/onboarding.js';
8
+ import { registerGuideResource } from './resources/guide.js';
9
+ import { getMcpServerInfo, registerCmsEditTools } from './tools/cms-edit.js';
10
+ import { registerHelpTool } from './tools/help.js';
7
11
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
8
- // dist/mcp/server.js → dist/bin/cms-edit.js
9
12
  const CMS_EDIT_BIN = path.resolve(__dirname, '..', 'bin', 'cms-edit.js');
10
- const TOOL_DESCRIPTION = `Run any cms-edit command. cms-edit edits Contentful draft content (no publishing).
11
-
12
- Workflow: open → snapshot → read/set/rtf/add/remove → diff → save
13
- All saves create drafts only — a human must publish in Contentful.
14
-
15
- Common command sequences:
16
- ["open", "/pricing"] — load a page by slug
17
- ["open", "<entry-id>", "--id"] — load by Contentful entry ID
18
- ["snapshot"] — print content tree with @refs
19
- ["read", "@c0"] — read all fields of a component
20
- ["read", "@c0", "heading"] — read a specific field
21
- ["set", "@c0", "heading", "New heading"] — set a scalar field
22
- ["rtf", "@c0", "body", "--content", "# H1\\n\\nBody."] — set rich text (preferred for AI)
23
- ["rtf", "@c0", "body", "--base64", "<encoded>"] — set rich text via base64 (no filesystem)
24
- ["diff"] — show pending changes
25
- ["save"] — write drafts to Contentful
26
- ["discard"] — discard unsaved changes
27
- ["health"] — verify config and connectivity
28
- ["--docs"] — print README path for reference
29
-
30
- Entry creation:
31
- create = new top-level entries (page, article, template)
32
- add = new child entries linked into an existing entry's content array
33
- ["create", "article", "--slug", "/blog/x", "--title", "X", "--article-type-id", "<id>"]
34
- ["list", "--type", "articleType"] — find valid article type IDs
35
- ["add", "<type>", "--content-type", "<ct>", "--parent", "@c0", "--target", "content"]
36
-
37
- Field discovery:
38
- ["schema", "<content-type>"] — show field definitions, descriptions, and SEO hints
39
- ["list", "--type", "<contentType>"] — list entries by type (prefer over search for type-specific queries)
40
-
41
- Command reference by category:
42
-
43
- DISCOVERY
44
- list --type <page|article|component|…> List entries by content type
45
- search <query> Full-text search across entries
46
- types <contentType> List type-discriminator enum values
47
- schema <contentType> Show fields, descriptions, and SEO hints
48
- sitemap All pages/articles with slugs and status
49
-
50
- READING
51
- open <slug> Load a page or article by slug
52
- open <id> --id Load by Contentful entry ID
53
- snapshot Show content tree with @refs
54
- read <ref> Read all fields on an entry
55
- read <ref> <field> Read a specific field
56
- peek <id> Quick field preview without opening a session
57
-
58
- EDITING
59
- set <ref> <field> <value> Set a text/boolean/number/date field
60
- asset set <ref> <field> <asset-id> Set an asset/image field (not plain set)
61
- rtf <ref> <field> --content "<markdown>" Set a rich text field
62
- links add/remove/move Manage CTA/link arrays
63
-
64
- CREATING CONTENT
65
- create article --slug … --title … --article-type-id …
66
- create page --slug … --title …
67
- add <type> --content-type <ct> --target content --parent <ref> Add a child component
68
- remove <ref> Remove a child entry
69
- move <ref> --after <ref> Reorder entries
70
-
71
- NAVIGATION & ASSETS
72
- nav open/add Manage navigation entries
73
- asset search/info/set Find and set assets
74
- resolve <id> Resolve entry ID to ref in current session
75
-
76
- Use --session <name> to isolate concurrent workflows.
77
- Use --space <name> to target a specific Contentful space.
78
- Output is always JSON (CMS_EDIT_JSON=1 is forced by the MCP server).
79
-
80
- Rich text tips:
81
- --content "<markdown>" preferred named flag for inline content (any length)
82
- --base64 "<encoded>" fully environment-agnostic, no filesystem needed
83
- --file "<abs-path>" platform-native absolute path required (C:\\\\Users\\\\... on Windows)
84
- stdin ("-") not supported via MCP`;
85
- export function createMcpServer() {
86
- const server = new McpServer({ name: 'cms-edit', version: '1.0.0' });
87
- server.tool('cms_edit', TOOL_DESCRIPTION, {
88
- args: z
89
- .array(z.string())
90
- .describe('CLI arguments to pass to cms-edit, e.g. ["open", "/pricing"] or ["--space", "om1", "snapshot"]'),
91
- }, async ({ args }) => {
92
- const text = await runCmsEdit(args);
93
- return { content: [{ type: 'text', text }] };
94
- });
13
+ export function createMcpServer(options = {}) {
14
+ const serverInfo = getMcpServerInfo();
15
+ const server = new McpServer({ name: serverInfo.name, version: serverInfo.version });
16
+ const runCmsEdit = options.runCmsEdit ?? spawnRunCmsEdit;
17
+ registerCmsEditTools(server, runCmsEdit);
18
+ registerHelpTool(server, options.hosted);
19
+ registerGuideResource(server, options.hosted);
20
+ registerOnboardingPrompts(server, options.hosted);
95
21
  return server;
96
22
  }
97
- async function runCmsEdit(args) {
23
+ async function spawnRunCmsEdit(args) {
98
24
  return new Promise((resolve) => {
99
- // Inherit all env vars (CMS_EDIT_TOKEN, CMS_EDIT_SPACE, etc.) and force JSON mode
100
25
  const env = { ...process.env, CMS_EDIT_JSON: '1' };
101
- // Use process.execPath (node binary) + absolute path to cms-edit.js to avoid
102
- // PATH resolution issues when launched by Claude Desktop / Claude Code
103
26
  const proc = child_process.spawn(process.execPath, [CMS_EDIT_BIN, ...args], {
104
27
  cwd: process.cwd(),
105
28
  env,
@@ -113,7 +36,6 @@ async function runCmsEdit(args) {
113
36
  const out = Buffer.concat(stdout).toString('utf-8').trim();
114
37
  const err = Buffer.concat(stderr).toString('utf-8').trim();
115
38
  const combined = [out, err].filter(Boolean).join('\n');
116
- // Append exit code on failure so Claude knows the command failed
117
39
  resolve(code !== 0 ? `${combined}\n(exit code ${code})` : combined);
118
40
  });
119
41
  proc.on('error', (err) => {
@@ -121,4 +43,10 @@ async function runCmsEdit(args) {
121
43
  });
122
44
  });
123
45
  }
46
+ /** In-process runner used by hosted MCP and tests. */
47
+ export async function runCmsEditInProcess(args) {
48
+ process.env['CMS_EDIT_JSON'] = '1';
49
+ const { exitCode, output } = await runCmsEditArgs(args);
50
+ return exitCode !== 0 ? `${output}\n(exit code ${exitCode})` : output;
51
+ }
124
52
  //# sourceMappingURL=server.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAC/D,4CAA4C;AAC5C,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,aAAa,CAAC,CAAC;AAEzE,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iDA0EwB,CAAC;AAElD,MAAM,UAAU,eAAe;IAC7B,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;IAErE,MAAM,CAAC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AC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAED,sDAAsD;AACtD,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,IAAc;IACtD,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,GAAG,GAAG,CAAC;IACnC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,cAAc,CAAC,IAAI,CAAC,CAAC;IACxD,OAAO,QAAQ,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,gBAAgB,QAAQ,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC;AACxE,CAAC"}
@@ -0,0 +1,5 @@
1
+ /** Default session name injected for all MCP tool calls unless --session is explicit. */
2
+ export declare const MCP_DEFAULT_SESSION = "_mcp";
3
+ /** Prepends --session <name> when the args array does not already include --session. */
4
+ export declare function withMcpSession(args: string[]): string[];
5
+ //# sourceMappingURL=session-args.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-args.d.ts","sourceRoot":"","sources":["../../src/mcp/session-args.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,eAAO,MAAM,mBAAmB,SAAS,CAAC;AAE1C,wFAAwF;AACxF,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAKvD"}
@@ -0,0 +1,10 @@
1
+ /** Default session name injected for all MCP tool calls unless --session is explicit. */
2
+ export const MCP_DEFAULT_SESSION = '_mcp';
3
+ /** Prepends --session <name> when the args array does not already include --session. */
4
+ export function withMcpSession(args) {
5
+ if (args.includes('--session')) {
6
+ return args;
7
+ }
8
+ return ['--session', MCP_DEFAULT_SESSION, ...args];
9
+ }
10
+ //# sourceMappingURL=session-args.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-args.js","sourceRoot":"","sources":["../../src/mcp/session-args.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC;AAE1C,wFAAwF;AACxF,MAAM,UAAU,cAAc,CAAC,IAAc;IAC3C,IAAI,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;QAC/B,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,CAAC,WAAW,EAAE,mBAAmB,EAAE,GAAG,IAAI,CAAC,CAAC;AACrD,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
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";
4
+ export declare function registerCmsEditTools(server: McpServer, runCmsEdit: RunCmsEditFn): void;
5
+ export declare function getMcpServerInfo(): {
6
+ name: string;
7
+ version: string;
8
+ };
9
+ //# sourceMappingURL=cms-edit.d.ts.map
@@ -0,0 +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;AAIzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,eAAO,MAAM,gBAAgB,s/FAsCoB,CAAC;AAElD,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,GAAG,IAAI,CA4BtF;AAED,wBAAgB,gBAAgB,IAAI;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAEpE"}