@prenta/mcp-server 2.3.9 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -0
- package/README.md +4 -1
- package/dist/client.d.ts +10 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +7 -3
- package/dist/client.js.map +1 -1
- package/dist/content-model.d.ts +51 -0
- package/dist/content-model.d.ts.map +1 -0
- package/dist/content-model.js +135 -0
- package/dist/content-model.js.map +1 -0
- package/dist/instructions.d.ts +4 -2
- package/dist/instructions.d.ts.map +1 -1
- package/dist/instructions.js +29 -23
- package/dist/instructions.js.map +1 -1
- package/dist/resources.d.ts +8 -2
- package/dist/resources.d.ts.map +1 -1
- package/dist/resources.js +82 -3
- package/dist/resources.js.map +1 -1
- package/dist/tools.d.ts +7 -7
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +106 -42
- package/dist/tools.js.map +1 -1
- package/package.json +2 -2
package/dist/instructions.d.ts
CHANGED
|
@@ -7,7 +7,9 @@
|
|
|
7
7
|
* Keep it short and high-signal: the canonical workflow, the page-content
|
|
8
8
|
* contract, and the safety rails. Per-tool detail lives in each tool's
|
|
9
9
|
* `description`; live content-model detail lives in the MCP resources
|
|
10
|
-
* (`prenta://
|
|
10
|
+
* (`prenta://content-model`, `prenta://collections`, `prenta://section-types`,
|
|
11
|
+
* `prenta://design-system`). Long workflows that only some tasks need (SEO)
|
|
12
|
+
* live in their own resource (`prenta://seo-guide`) with a pointer here.
|
|
11
13
|
*/
|
|
12
|
-
export declare const SERVER_INSTRUCTIONS = "You are connected to an Prenta CMS instance over MCP. You can author and manage real site content (pages, posts, media, forms, navigation, SEO) by calling the tools below. Everything you write goes through the CMS's audited, access-controlled API \u2014 treat it as production data.\n\n## The visual stack (the page model)\nA page is a **visual stack**: an ordered list of small, single-purpose sections (`data.sections`), one section per visual band of the design (hero, logos, stats, features, pricing, testimonials, FAQ, CTA, \u2026). Build it section by section, top to bottom \u2014 the canvas outline should read as the design's band list. Never author a whole page as one section, and never overload one type's fields to cover several bands: pick the narrowest registered type whose `description` matches what that band looks like. If none fits, skip the band and name it in the band list. Leave color and type to the site theme. Read `prenta://design-system` before choosing colors.\n\n## How to build a page (the only path)\nThis is the only page-build sequence. There is no tree generator. Read `prenta://how-to-build-a-page` for the same checklist.\n\n1. `health_check` once, then `list_collections`. Never assume a collection exists.\n2. `create_document` / `update_document` on `pages` (or the site's page collection) with title + slug. Defaults to DRAFT.\n3. `list_section_types` (optionally scoped `page`/`post`, and `template` or `collection`+`documentId` for a page family) \u2192 `get_section_schema` if you need the field schema. Skip types with `addable: false` or omitted from a template filter (do not add). Do not hide types with `hideable: false`. Do not work around a 400 via `update_document`.\n4. `add_page_section` / `update_page_section` / `reorder_page_sections` \u2014 one `add_page_section` per design band, in visual order. The server seeds registry defaults; you shallow-merge `content`/`settings`.\n5. Every image: `upload_media` \u2192 `generate_media_alt({ mediaId })` \u2192 `update_media({ id, alt })`. Never put `/public/` or `/images/` paths in `imageUrl`.\n6. `validate_section_content` before you call the page done.\n7. Humans review with **View site** (public origin, `?preview=` for drafts). Share a draft via the admin Share control or `POST /preview/token`.\n8. End with the band list below. The page is not done until that list is in your reply.\n\n## Band list (required when building from a design)\nFinish with one line per band, top to bottom:\n- Band \u2014 a few words for what the reference shows\n- Section \u2014 the registered type id you added, or Skipped\n\nSkip a band when no registered type fits. Name it. Do not invent a section type and do not write HTML for it.\nA Figma export, or any other design image, is the layout reference only. Upload each photo from its own file with `upload_media`. Do not crop photos out of the reference image.\n\nLeftover `_layout` trees still compile on write, `migrate:sections`, and `GET /resolve`. Do not invent a BlockNode tree.\n\n## Start here (discovery)\nRead `prenta://collections` and `prenta://section-types` for the live content model. Per-tool detail lives in each tool's description.\n- `list_documents` `search` matches the title and body, case-insensitive, at least 2 characters. Pass `locale` to keep one language.\n- Translations: `list_document_translations` \u2192 `create_translation` (a draft copy) \u2192 edit that draft. `localize_translation` fills a draft from the source with AI and will not overwrite a published, in-review, or approved translation.\n\n## Authoring lifecycle\n- Documents have a status: `DRAFT`, `PUBLISHED`, `SCHEDULED`, `ARCHIVED`. `create_document` may set `PUBLISHED` for EDITOR/ADMIN (first publish). Existing page/post drafts cannot skip review: `update_document({ status: 'PUBLISHED' })` fails. Use `transition_workflow` (`DRAFT` \u2192 `IN_REVIEW` \u2192 `PUBLISHED`) or `schedule_publish` from `IN_REVIEW`.\n- **Every image must go through the media library.** Use `upload_media` first \u2014 never reference `/public/`, `/images/`, or other static paths, and do not hotlink an image on another host. `validate_section_content` warns on those. Publishing still succeeds unless `media.enforceLibrary` is `block`. The CMS optimizes, tracks usage, and stores alt text on media records.\n- After uploading an image, call `generate_media_alt({ mediaId })` then `update_media({ id, alt })` to set WCAG-aligned alt text. That tool is governed by Settings \u2192 AI \u2192 Auto alt-text for media and needs an AI provider connection (or a provider API key env var); pick a vision-capable model or the result is a low-confidence text heuristic.\n- Prefer `upload_media({ filePath })` or `upload_media({ sourceUrl })` for real photos. Inline `dataBase64` is only practical for small assets.\n- For library-wide metadata backfills, prefer `bulk_update_media({ items })` (max 50 per call, per-id results) over looping `update_media`. Use `bulk_delete_media({ ids, confirm: true })` for cleanup batches.\n- `upload_media` is content-hash idempotent: re-uploading the same final bytes returns the existing row with `deduplicated: true` / `duplicateOf`. Pass `forceUpload: true` only when you intentionally want a second copy.\n- Use `resolve_url` to verify a published page renders at its public path.\n\n## Images & performance (build fast pages)\nThe renderer (`@prenta/sections-react`) does the Core Web Vitals heavy lifting for you \u2014 your job is to give it the right inputs:\n- **Pick a hero image for the LCP.** For a page's main banner, set the `hero` section's `imageUrl` (+ required `imageAlt`). The renderer marks **exactly one** image per page as the priority/eager LCP element and lazy-loads the rest. Don't expect to \"prioritise\" several above-the-fold images \u2014 only one wins, so put it on the hero (or the post's `featuredImage`).\n- **Always set alt text.** It's an accessibility requirement (a hero image without alt is rejected) and feeds SEO. Workflow: `generate_media_alt` \u2192 review \u2192 `update_media({ alt })`, or set `imageAlt` inline when inserting into a section.\n- **Don't hand-optimise content images.** `upload_media` compresses to **high-quality WebP** (quality 82, 86 for transparent PNGs), downscales beyond 4096px, and **keeps the original when a lossy WebP would be larger**. For a screenshot or UI capture, pass `lossless: true` and a descriptive filename such as `billing-invoice-list.png` \u2014 the stored file is a lossless `.webp` even when it is larger. Do not use names like `screenshot` or `IMG_`. Photos omit `lossless`. Only pass `skipOptimize: true` for brand logos/favicons. The public site also serves AVIF/WebP via `next/image` with responsive `sizes`.\n\n## Exact find and replace\n`replace_site_text` finds a literal, case-sensitive string across live documents (except Settings), media copy, and redirect notes. It does not guess and it does not use the document search box. Omit `apply` to preview. Writing requires `apply: true` and `confirm: true`. Ids, slugs, public paths, and file URLs are never changed. URL fields change only when `includeLinks: true`. Form submissions and trash are not scanned. The scan covered the whole live site only when `complete` is true, `failureCount` is 0, `scope.documents` is `*`, `scope.media` is true, and `scope.redirects` is `write`. Otherwise tell the user exactly what was included and what was left unchanged.\n\n## Safety rails\n- Deletes are marked destructive. ChatGPT shows an approval card and waits for the person before the call runs. Do not set `confirm: true` until they approve. Tools that refuse without it: `delete_document`, `delete_media`, `bulk_delete_media`, `delete_form`, `delete_form_entry` (prefer archiving where available), `export_form_entries` (bulk PII egress), `replace_site_text` (writes site copy \u2014 preview first), `seo_scan_run` (expensive site-wide scan), `apply_seo_issue_fix` (writes SEO metadata + resolves an issue), `apply_seo_internal_link` (writes an approved in-content link insert), `batch_generate_seo_content_briefs` (batch AI content briefs), `generate_seo_proposals` (batch AI fix proposals \u2014 spends tokens), `bulk_apply_seo_proposals` (writes several SEO fixes at once), and `update_seo_autopilot_settings`, `run_seo_autopilot`, `revert_seo_autopilot_change` (SEO Autopilot \u2014 unattended writes).\n- Your API key carries scopes. A `Forbidden` error means the key lacks a permission, not that the tool is broken \u2014 surface that to the user rather than retrying blindly.\n- Tool inputs are schema-validated; read each tool's `description` for the exact shape and the response envelope (most list tools return `{ docs, total, page, pageSize }`).\n\n## SEO audit fix workflow (via MCP)\n1. `run_seo_audit` or `list_seo_issues` \u2192 triage open issues.\n2. **Metadata fixes** (meta title/desc, canonical, schema): `suggest_seo_issue_fix` \u2192 review `suggestion.changes` \u2192 `apply_seo_issue_fix` with `fingerprint` + `confirm: true`.\n3. **Orphan / inbound links:** `seo_links_snapshot` \u2192 `seo_link_suggest` \u2192 review `wrappable` rows \u2192 `apply_seo_internal_link` with `fingerprint` + `confirm: true`, or `suggest_seo_issue_fix` / `apply_seo_issue_fix` on `orphan-page` issues. Non-wrappable rows stay editor work. Briefs remain suggestions only.\n4. **Content fixes** (thin content, headings, alt text): `research_and_brief_seo_issue` (thin content + optional competitor URLs) or `generate_seo_issue_content_brief`. Briefs are suggestions only \u2014 implement in page content yourself (`add_page_section`, `update_document`, etc.).\n5. `batch_generate_seo_content_briefs` with `confirm: true` to pre-warm briefs, then `export_seo_fix_brief` to pull the full markdown handoff into your workspace.\n6. `set_seo_issue_status` to resolve/ignore when done; re-run `run_seo_audit` to verify.\n7. **Proposals inbox (batch path):** `list_seo_proposals` \u2192 review each row's `changes` and staleness \u2192 `bulk_apply_seo_proposals` (with each `fingerprint` + `confirm: true`) or `dismiss_seo_proposal`; `generate_seo_proposals` (`confirm: true`) fills the inbox for issues with no live proposal. FAQ rows (`fixStrategy: 'add-section'`) carry `section`, `grounding` (verbatim page quotes), and `signals`; approving inserts a visible FAQ section on the page \u2014 read the answers before you confirm.\n8. **SEO Autopilot (unattended path):** `get_seo_autopilot_settings` shows what the CMS will apply on its own and why it may be paused; `list_seo_autopilot_applied` is the ledger of what it did (with outcome). Only change policy, run a tick, or revert with `confirm: true` after the user agrees. Proposals the gate refuses stay in the inbox for a human \u2014 do not bulk-apply them to \"help\" the autopilot.\n9. **AI visibility (read-only):** `get_seo_ai_visibility` shows whether AI engines are crawling and citing the site (crawl trend by bot with a robots.txt cross-check, referral visits by engine, top cited pages) \u2014 use it before recommending robots.txt AI-policy changes via `update_seo_robots`. `enabled: false` means measurement is off in SEO settings.\n\n## SEO links & technical settings (via MCP)\n- `seo_links_snapshot` / `seo_link_health` \u2014 site-wide link graph and broken-link scan (Links tab parity).\n- `run_seo_link_ai_index` with `confirm: true`, then `seo_link_suggest` \u2014 AI contextual internal link suggestions.\n- `get_seo_crawl_settings` / `update_seo_crawl_settings`, `get_seo_robots` / `update_seo_robots`, `get_seo_sitemap_status` / `regenerate_seo_sitemap` \u2014 technical SEO controls.\n- `list_seo_content` / `get_seo_content` / `update_seo_content` \u2014 bulk content SEO records without opening the admin UI.\n- Redirect advanced: `flatten_redirect_chain`, `list_redirect_suggestions`, recovery settings, `import_redirects_csv` (confirm), `export_redirects_csv`.\n- AI assistant: `ai_seo_generate_field` drafts one field and does not save it \u2014 save the chosen text with `update_seo_content`. `ai_seo_explain_issue`, `ai_seo_generate_schema`, `ai_seo_summarize_audit` \u2014 need an AI provider in Settings \u2192 AI (or a provider API key env var); return `{ unavailable: true }` otherwise.";
|
|
14
|
+
export declare const SERVER_INSTRUCTIONS = "You are connected to an Prenta CMS instance over MCP. You can author and manage real site content (pages, posts, media, forms, navigation, SEO) by calling the tools below. Everything you write goes through the CMS's audited, access-controlled API \u2014 treat it as production data.\n\n## The visual stack (the page model)\nA page is a **visual stack**: an ordered list of small, single-purpose sections (`data.sections`), one section per visual band of the design. Built-in type ids: `hero`, `badges` (logo strip), `stats`, `feature` (one image beside text, not a grid), `text`, `faq`, `cta`, `form`, `gallery`, `embed`. There is no built-in pricing or testimonials type; a site may register its own, so check `list_section_types`. Build it section by section, top to bottom \u2014 the canvas outline should read as the design's band list. Never author a whole page as one section, and never overload one type's fields to cover several bands: pick the narrowest registered type whose `description` matches what that band looks like. If none fits, skip the band and name it in the band list. Leave color and type to the site theme. Read `prenta://design-system` before choosing colors.\n\n## Content model (which editor, which tools)\nCall `describe_content_model` (or read `prenta://content-model`) before writing. Each collection has an `authoring` value:\n- `sections`: a page collection. Create the document, then build `data.sections` with `add_page_section`. Admin editor `/pages/:id/edit`.\n- `post`: a post type. Same section tools, with the post type as `collection`. Admin editor `/posts/:type/:id/edit`.\n- `fields`: a plain collection. Set fields with `create_document` / `update_document`.\n- `managed`: a plugin owns it (for example `forms`). Use the tools it lists, never `create_document`.\n\n## How to build a page (the only path)\nThis is the only page-build sequence. There is no tree generator. Read `prenta://how-to-build-a-page` for the same checklist.\n\n1. `health_check` once, then `describe_content_model`. Never assume a collection exists.\n2. `create_document` / `update_document` on `pages` (or the site's page collection) with title + slug. Defaults to DRAFT.\n3. `list_section_types` (optionally scoped `page`/`post`, and `template` or `collection`+`documentId` for a page family) \u2192 `get_section_schema` if you need the field schema. Skip types with `addable: false` or omitted from a template filter (do not add). Do not hide types with `hideable: false`. Do not work around a 400 via `update_document`.\n4. `add_page_section` / `update_page_section` / `reorder_page_sections` \u2014 one `add_page_section` per design band, in visual order. The server seeds registry defaults; you shallow-merge `content`/`settings`.\n5. Every image: `upload_media` \u2192 `generate_media_alt({ mediaId })` \u2192 `update_media({ id, alt })`. Never put `/public/` or `/images/` paths in `imageUrl`.\n6. `validate_section_content` before you call the page done.\n7. Humans review with **View site** (public origin, `?preview=` for drafts). Share a draft via the admin Share control or `POST /preview/token`.\n8. End with the band list below. The page is not done until that list is in your reply.\n\n## Band list (required when building from a design)\nFinish with one line per band, top to bottom:\n- Band \u2014 a few words for what the reference shows\n- Section \u2014 the registered type id you added, or Skipped\n\nSkip a band when no registered type fits. Name it. Do not invent a section type and do not write HTML for it.\nA Figma export, or any other design image, is the layout reference only. Upload each photo from its own file with `upload_media`. Do not crop photos out of the reference image.\n\nEach `data.sections` entry is `{ sectionType, content, settings? }`. Writing malformed or unknown entries through `create_document` / `update_document` returns 400 with an `issues` list, so use the section tools. The `layout` parameter is legacy: do not send it, and do not invent a BlockNode tree.\n\n## How to build a post\nRead `prenta://how-to-build-a-post` for the checklist.\n1. Pick a collection with `authoring: post` (`describe_content_model`).\n2. `get_post_template({ postType })`: new posts start from this template's header and sections (usually `article-body`). Change it only when asked to restyle every post, with `save_post_template`.\n3. `create_document` on the post type with title, slug, and fields such as `excerpt` and `featuredImage`.\n4. `list_page_sections({ collection: <postType>, id })`, then `update_page_section` / `add_page_section` with post-scoped types (`list_section_types({ scope: 'post' })`). The section tools work on posts.\n5. `create_blog_post` drafts field data with AI, not sections.\n\n## Forms\n1. `create_form({ name, fields, status: 'active' })`. New forms are `draft` by default, and a draft form does not render on the public site.\n2. `add_page_section` with `sectionType: 'form'` and `content: { formSlug }`. A missing or inactive form comes back as a warning.\n3. Never `create_document` on the `forms` collection. Edit fields with `save_form_schema` (versioned) and metadata with `update_form`.\n\n## Start here (discovery)\nRead `prenta://content-model` (or `prenta://collections` and `prenta://section-types`) for the live content model. Per-tool detail lives in each tool's description.\n- `list_documents` `search` matches the title and body, case-insensitive, at least 2 characters. Pass `locale` to keep one language.\n- Translations: `list_document_translations` \u2192 `create_translation` (a draft copy) \u2192 edit that draft. `localize_translation` fills a draft from the source with AI and will not overwrite a published, in-review, or approved translation.\n\n## Authoring lifecycle\n- Documents have a status: `DRAFT`, `PUBLISHED`, `SCHEDULED`, `ARCHIVED`. `create_document` may set `PUBLISHED` for EDITOR/ADMIN (first publish). Existing page/post drafts cannot skip review: `update_document({ status: 'PUBLISHED' })` fails. Use `transition_workflow` (`DRAFT` \u2192 `IN_REVIEW` \u2192 `PUBLISHED`) or `schedule_publish` from `IN_REVIEW`.\n- **Every image must go through the media library.** Use `upload_media` first \u2014 never reference `/public/`, `/images/`, or other static paths, and do not hotlink an image on another host. `validate_section_content` warns on those. Publishing still succeeds unless `media.enforceLibrary` is `block`. The CMS optimizes, tracks usage, and stores alt text on media records.\n- After uploading an image, call `generate_media_alt({ mediaId })` then `update_media({ id, alt })` to set WCAG-aligned alt text. That tool is governed by Settings \u2192 AI \u2192 Auto alt-text for media and needs an AI provider connection (or a provider API key env var); pick a vision-capable model or the result is a low-confidence text heuristic.\n- Prefer `upload_media({ filePath })` or `upload_media({ sourceUrl })` for real photos. Inline `dataBase64` is only practical for small assets.\n- For library-wide metadata backfills, prefer `bulk_update_media({ items })` (max 50 per call, per-id results) over looping `update_media`. Use `bulk_delete_media({ ids, confirm: true })` for cleanup batches.\n- `upload_media` is content-hash idempotent: re-uploading the same final bytes returns the existing row with `deduplicated: true` / `duplicateOf`. Pass `forceUpload: true` only when you intentionally want a second copy.\n- Use `resolve_url` to verify a published page renders at its public path.\n\n## Images & performance (build fast pages)\nThe renderer (`@prenta/sections-react`) does the Core Web Vitals heavy lifting for you \u2014 your job is to give it the right inputs:\n- **Pick a hero image for the LCP.** For a page's main banner, set the `hero` section's `imageUrl` (+ required `imageAlt`). The renderer marks **exactly one** image per page as the priority/eager LCP element and lazy-loads the rest. Don't expect to \"prioritise\" several above-the-fold images \u2014 only one wins, so put it on the hero (or the post's `featuredImage`).\n- **Always set alt text.** It's an accessibility requirement (a hero image without alt is rejected) and feeds SEO. Workflow: `generate_media_alt` \u2192 review \u2192 `update_media({ alt })`, or set `imageAlt` inline when inserting into a section.\n- **Don't hand-optimise content images.** `upload_media` compresses to **high-quality WebP** (quality 82, 86 for transparent PNGs), downscales beyond 4096px, and **keeps the original when a lossy WebP would be larger**. For a screenshot or UI capture, pass `lossless: true` and a descriptive filename such as `billing-invoice-list.png` \u2014 the stored file is a lossless `.webp` even when it is larger. Do not use names like `screenshot` or `IMG_`. Photos omit `lossless`. Only pass `skipOptimize: true` for brand logos/favicons. The public site also serves AVIF/WebP via `next/image` with responsive `sizes`.\n\n## Exact find and replace\n`replace_site_text` finds a literal, case-sensitive string across live documents (except Settings), media copy, and redirect notes. It does not guess and it does not use the document search box. Omit `apply` to preview. Writing requires `apply: true` and `confirm: true`. Ids, slugs, public paths, and file URLs are never changed. URL fields change only when `includeLinks: true`. Form submissions and trash are not scanned. The scan covered the whole live site only when `complete` is true, `failureCount` is 0, `scope.documents` is `*`, `scope.media` is true, and `scope.redirects` is `write`. Otherwise tell the user exactly what was included and what was left unchanged.\n\n## Safety rails\n- Deletes are marked destructive. ChatGPT shows an approval card and waits for the person before the call runs. Do not set `confirm: true` until they approve. Tools that refuse without it: `delete_document`, `delete_media`, `bulk_delete_media`, `delete_form`, `delete_form_entry` (prefer archiving where available), `export_form_entries` (bulk PII egress), `replace_site_text` (writes site copy \u2014 preview first), `seo_scan_run` (expensive site-wide scan), `apply_seo_issue_fix` (writes SEO metadata + resolves an issue), `apply_seo_internal_link` (writes an approved in-content link insert), `batch_generate_seo_content_briefs` (batch AI content briefs), `generate_seo_proposals` (batch AI fix proposals \u2014 spends tokens), `bulk_apply_seo_proposals` (writes several SEO fixes at once), and `update_seo_autopilot_settings`, `run_seo_autopilot`, `revert_seo_autopilot_change` (SEO Autopilot \u2014 unattended writes).\n- Your API key carries scopes. A `Forbidden` error means the key lacks a permission, not that the tool is broken \u2014 surface that to the user rather than retrying blindly.\n- Tool inputs are schema-validated; read each tool's `description` for the exact shape and the response envelope (most list tools return `{ docs, total, page, pageSize }`).\n\n## SEO\nFor SEO audits, fixes, internal links, redirects and technical settings, read `prenta://seo-guide` first.";
|
|
13
15
|
//# sourceMappingURL=instructions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instructions.d.ts","sourceRoot":"","sources":["../src/instructions.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"instructions.d.ts","sourceRoot":"","sources":["../src/instructions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,mBAAmB,gzVA4E4E,CAAA"}
|
package/dist/instructions.js
CHANGED
|
@@ -7,17 +7,26 @@
|
|
|
7
7
|
* Keep it short and high-signal: the canonical workflow, the page-content
|
|
8
8
|
* contract, and the safety rails. Per-tool detail lives in each tool's
|
|
9
9
|
* `description`; live content-model detail lives in the MCP resources
|
|
10
|
-
* (`prenta://
|
|
10
|
+
* (`prenta://content-model`, `prenta://collections`, `prenta://section-types`,
|
|
11
|
+
* `prenta://design-system`). Long workflows that only some tasks need (SEO)
|
|
12
|
+
* live in their own resource (`prenta://seo-guide`) with a pointer here.
|
|
11
13
|
*/
|
|
12
14
|
export const SERVER_INSTRUCTIONS = `You are connected to an Prenta CMS instance over MCP. You can author and manage real site content (pages, posts, media, forms, navigation, SEO) by calling the tools below. Everything you write goes through the CMS's audited, access-controlled API — treat it as production data.
|
|
13
15
|
|
|
14
16
|
## The visual stack (the page model)
|
|
15
|
-
A page is a **visual stack**: an ordered list of small, single-purpose sections (\`data.sections\`), one section per visual band of the design
|
|
17
|
+
A page is a **visual stack**: an ordered list of small, single-purpose sections (\`data.sections\`), one section per visual band of the design. Built-in type ids: \`hero\`, \`badges\` (logo strip), \`stats\`, \`feature\` (one image beside text, not a grid), \`text\`, \`faq\`, \`cta\`, \`form\`, \`gallery\`, \`embed\`. There is no built-in pricing or testimonials type; a site may register its own, so check \`list_section_types\`. Build it section by section, top to bottom — the canvas outline should read as the design's band list. Never author a whole page as one section, and never overload one type's fields to cover several bands: pick the narrowest registered type whose \`description\` matches what that band looks like. If none fits, skip the band and name it in the band list. Leave color and type to the site theme. Read \`prenta://design-system\` before choosing colors.
|
|
18
|
+
|
|
19
|
+
## Content model (which editor, which tools)
|
|
20
|
+
Call \`describe_content_model\` (or read \`prenta://content-model\`) before writing. Each collection has an \`authoring\` value:
|
|
21
|
+
- \`sections\`: a page collection. Create the document, then build \`data.sections\` with \`add_page_section\`. Admin editor \`/pages/:id/edit\`.
|
|
22
|
+
- \`post\`: a post type. Same section tools, with the post type as \`collection\`. Admin editor \`/posts/:type/:id/edit\`.
|
|
23
|
+
- \`fields\`: a plain collection. Set fields with \`create_document\` / \`update_document\`.
|
|
24
|
+
- \`managed\`: a plugin owns it (for example \`forms\`). Use the tools it lists, never \`create_document\`.
|
|
16
25
|
|
|
17
26
|
## How to build a page (the only path)
|
|
18
27
|
This is the only page-build sequence. There is no tree generator. Read \`prenta://how-to-build-a-page\` for the same checklist.
|
|
19
28
|
|
|
20
|
-
1. \`health_check\` once, then \`
|
|
29
|
+
1. \`health_check\` once, then \`describe_content_model\`. Never assume a collection exists.
|
|
21
30
|
2. \`create_document\` / \`update_document\` on \`pages\` (or the site's page collection) with title + slug. Defaults to DRAFT.
|
|
22
31
|
3. \`list_section_types\` (optionally scoped \`page\`/\`post\`, and \`template\` or \`collection\`+\`documentId\` for a page family) → \`get_section_schema\` if you need the field schema. Skip types with \`addable: false\` or omitted from a template filter (do not add). Do not hide types with \`hideable: false\`. Do not work around a 400 via \`update_document\`.
|
|
23
32
|
4. \`add_page_section\` / \`update_page_section\` / \`reorder_page_sections\` — one \`add_page_section\` per design band, in visual order. The server seeds registry defaults; you shallow-merge \`content\`/\`settings\`.
|
|
@@ -34,10 +43,23 @@ Finish with one line per band, top to bottom:
|
|
|
34
43
|
Skip a band when no registered type fits. Name it. Do not invent a section type and do not write HTML for it.
|
|
35
44
|
A Figma export, or any other design image, is the layout reference only. Upload each photo from its own file with \`upload_media\`. Do not crop photos out of the reference image.
|
|
36
45
|
|
|
37
|
-
|
|
46
|
+
Each \`data.sections\` entry is \`{ sectionType, content, settings? }\`. Writing malformed or unknown entries through \`create_document\` / \`update_document\` returns 400 with an \`issues\` list, so use the section tools. The \`layout\` parameter is legacy: do not send it, and do not invent a BlockNode tree.
|
|
47
|
+
|
|
48
|
+
## How to build a post
|
|
49
|
+
Read \`prenta://how-to-build-a-post\` for the checklist.
|
|
50
|
+
1. Pick a collection with \`authoring: post\` (\`describe_content_model\`).
|
|
51
|
+
2. \`get_post_template({ postType })\`: new posts start from this template's header and sections (usually \`article-body\`). Change it only when asked to restyle every post, with \`save_post_template\`.
|
|
52
|
+
3. \`create_document\` on the post type with title, slug, and fields such as \`excerpt\` and \`featuredImage\`.
|
|
53
|
+
4. \`list_page_sections({ collection: <postType>, id })\`, then \`update_page_section\` / \`add_page_section\` with post-scoped types (\`list_section_types({ scope: 'post' })\`). The section tools work on posts.
|
|
54
|
+
5. \`create_blog_post\` drafts field data with AI, not sections.
|
|
55
|
+
|
|
56
|
+
## Forms
|
|
57
|
+
1. \`create_form({ name, fields, status: 'active' })\`. New forms are \`draft\` by default, and a draft form does not render on the public site.
|
|
58
|
+
2. \`add_page_section\` with \`sectionType: 'form'\` and \`content: { formSlug }\`. A missing or inactive form comes back as a warning.
|
|
59
|
+
3. Never \`create_document\` on the \`forms\` collection. Edit fields with \`save_form_schema\` (versioned) and metadata with \`update_form\`.
|
|
38
60
|
|
|
39
61
|
## Start here (discovery)
|
|
40
|
-
Read \`prenta://collections\` and \`prenta://section-types\` for the live content model. Per-tool detail lives in each tool's description.
|
|
62
|
+
Read \`prenta://content-model\` (or \`prenta://collections\` and \`prenta://section-types\`) for the live content model. Per-tool detail lives in each tool's description.
|
|
41
63
|
- \`list_documents\` \`search\` matches the title and body, case-insensitive, at least 2 characters. Pass \`locale\` to keep one language.
|
|
42
64
|
- Translations: \`list_document_translations\` → \`create_translation\` (a draft copy) → edit that draft. \`localize_translation\` fills a draft from the source with AI and will not overwrite a published, in-review, or approved translation.
|
|
43
65
|
|
|
@@ -64,22 +86,6 @@ The renderer (\`@prenta/sections-react\`) does the Core Web Vitals heavy lifting
|
|
|
64
86
|
- Your API key carries scopes. A \`Forbidden\` error means the key lacks a permission, not that the tool is broken — surface that to the user rather than retrying blindly.
|
|
65
87
|
- Tool inputs are schema-validated; read each tool's \`description\` for the exact shape and the response envelope (most list tools return \`{ docs, total, page, pageSize }\`).
|
|
66
88
|
|
|
67
|
-
## SEO
|
|
68
|
-
|
|
69
|
-
2. **Metadata fixes** (meta title/desc, canonical, schema): \`suggest_seo_issue_fix\` → review \`suggestion.changes\` → \`apply_seo_issue_fix\` with \`fingerprint\` + \`confirm: true\`.
|
|
70
|
-
3. **Orphan / inbound links:** \`seo_links_snapshot\` → \`seo_link_suggest\` → review \`wrappable\` rows → \`apply_seo_internal_link\` with \`fingerprint\` + \`confirm: true\`, or \`suggest_seo_issue_fix\` / \`apply_seo_issue_fix\` on \`orphan-page\` issues. Non-wrappable rows stay editor work. Briefs remain suggestions only.
|
|
71
|
-
4. **Content fixes** (thin content, headings, alt text): \`research_and_brief_seo_issue\` (thin content + optional competitor URLs) or \`generate_seo_issue_content_brief\`. Briefs are suggestions only — implement in page content yourself (\`add_page_section\`, \`update_document\`, etc.).
|
|
72
|
-
5. \`batch_generate_seo_content_briefs\` with \`confirm: true\` to pre-warm briefs, then \`export_seo_fix_brief\` to pull the full markdown handoff into your workspace.
|
|
73
|
-
6. \`set_seo_issue_status\` to resolve/ignore when done; re-run \`run_seo_audit\` to verify.
|
|
74
|
-
7. **Proposals inbox (batch path):** \`list_seo_proposals\` → review each row's \`changes\` and staleness → \`bulk_apply_seo_proposals\` (with each \`fingerprint\` + \`confirm: true\`) or \`dismiss_seo_proposal\`; \`generate_seo_proposals\` (\`confirm: true\`) fills the inbox for issues with no live proposal. FAQ rows (\`fixStrategy: 'add-section'\`) carry \`section\`, \`grounding\` (verbatim page quotes), and \`signals\`; approving inserts a visible FAQ section on the page — read the answers before you confirm.
|
|
75
|
-
8. **SEO Autopilot (unattended path):** \`get_seo_autopilot_settings\` shows what the CMS will apply on its own and why it may be paused; \`list_seo_autopilot_applied\` is the ledger of what it did (with outcome). Only change policy, run a tick, or revert with \`confirm: true\` after the user agrees. Proposals the gate refuses stay in the inbox for a human — do not bulk-apply them to "help" the autopilot.
|
|
76
|
-
9. **AI visibility (read-only):** \`get_seo_ai_visibility\` shows whether AI engines are crawling and citing the site (crawl trend by bot with a robots.txt cross-check, referral visits by engine, top cited pages) — use it before recommending robots.txt AI-policy changes via \`update_seo_robots\`. \`enabled: false\` means measurement is off in SEO settings.
|
|
77
|
-
|
|
78
|
-
## SEO links & technical settings (via MCP)
|
|
79
|
-
- \`seo_links_snapshot\` / \`seo_link_health\` — site-wide link graph and broken-link scan (Links tab parity).
|
|
80
|
-
- \`run_seo_link_ai_index\` with \`confirm: true\`, then \`seo_link_suggest\` — AI contextual internal link suggestions.
|
|
81
|
-
- \`get_seo_crawl_settings\` / \`update_seo_crawl_settings\`, \`get_seo_robots\` / \`update_seo_robots\`, \`get_seo_sitemap_status\` / \`regenerate_seo_sitemap\` — technical SEO controls.
|
|
82
|
-
- \`list_seo_content\` / \`get_seo_content\` / \`update_seo_content\` — bulk content SEO records without opening the admin UI.
|
|
83
|
-
- Redirect advanced: \`flatten_redirect_chain\`, \`list_redirect_suggestions\`, recovery settings, \`import_redirects_csv\` (confirm), \`export_redirects_csv\`.
|
|
84
|
-
- AI assistant: \`ai_seo_generate_field\` drafts one field and does not save it — save the chosen text with \`update_seo_content\`. \`ai_seo_explain_issue\`, \`ai_seo_generate_schema\`, \`ai_seo_summarize_audit\` — need an AI provider in Settings → AI (or a provider API key env var); return \`{ unavailable: true }\` otherwise.`;
|
|
89
|
+
## SEO
|
|
90
|
+
For SEO audits, fixes, internal links, redirects and technical settings, read \`prenta://seo-guide\` first.`;
|
|
85
91
|
//# sourceMappingURL=instructions.js.map
|
package/dist/instructions.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instructions.js","sourceRoot":"","sources":["../src/instructions.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"instructions.js","sourceRoot":"","sources":["../src/instructions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4GA4EyE,CAAA"}
|
package/dist/resources.d.ts
CHANGED
|
@@ -23,7 +23,13 @@ export interface McpResource {
|
|
|
23
23
|
* server `instructions` but is available as a pullable resource for clients
|
|
24
24
|
* that surface resources but not instructions.
|
|
25
25
|
*/
|
|
26
|
-
export declare const HOW_TO_BUILD_A_PAGE = "# How to build a page\n\nThis is the only page-build path. There is no tree generator and no second page model.\n\nA page is a **visual stack**: an ordered list of small, single-purpose sections, one per visual band of the design (hero, stats, pricing, CTA, \u2026), added top to bottom. Never author a whole page as one section, and never stretch one type's fields across several bands. Leave color and type to the site theme (`prenta://design-system`).\n\n1. `health_check` \u2192 `
|
|
27
|
-
export declare const
|
|
26
|
+
export declare const HOW_TO_BUILD_A_PAGE = "# How to build a page\n\nThis is the only page-build path. There is no tree generator and no second page model.\n\nA page is a **visual stack**: an ordered list of small, single-purpose sections, one per visual band of the design (hero, stats, pricing, CTA, \u2026), added top to bottom. Never author a whole page as one section, and never stretch one type's fields across several bands. Leave color and type to the site theme (`prenta://design-system`).\n\n1. `health_check` \u2192 `describe_content_model`. Pick a collection with `authoring: sections` (usually `pages`).\n2. `create_document` / `update_document` with title + slug. Status defaults to DRAFT.\n3. `list_section_types` (pass `template` or `collection`+`documentId` for a page family) \u2192 `get_section_schema` for the field schema you need. Do not add types with `addable: false` or omitted from a template filter. Do not hide types with `hideable: false`. Do not work around a 400 via `update_document`.\n4. `add_page_section` / `update_page_section` / `reorder_page_sections` \u2014 one `add_page_section` per design band, in visual order.\n5. Every image: `upload_media` \u2192 `generate_media_alt({ mediaId })` \u2192 `update_media({ id, alt })`. Never use static `/public/` or `/images/` paths.\n6. `validate_section_content` until it is clean.\n7. Humans open **View site** on the public origin (`?preview=` for drafts). Share a draft with the admin Share control or `POST /preview/token`.\n8. End your reply with a band list, one line per band, top to bottom: what the reference shows, then the registered type id you added, or Skipped. Skip a band when no type fits. Do not invent a section type and do not write HTML for it.\n\nA Figma export, or any other design image, is the layout reference only. Upload each photo from its own file. Do not crop photos out of the reference image.\n\nThe public renderer (`@prenta/sections-react`) reads `data.sections` only. Each entry is `{ sectionType, content, settings? }`; `create_document` / `update_document` reject malformed or unknown entries with 400, so use the section tools. The `layout` parameter is legacy. For a contact form, see Forms in `prenta://how-to-build-a-post`.\n";
|
|
27
|
+
export declare const HOW_TO_BUILD_A_POST = "# How to build a post\n\nA post is a document in a post-type collection (`authoring: post` in `describe_content_model`). Like a page, its body is `data.sections`, edited in the admin at `/posts/:type/:id/edit`. Every post type has a template: a header layout plus the default sections each new post starts with (usually `article-body`).\n\n1. `describe_content_model` \u2192 pick the post type (for example `blog`). Its `sectionTypes` are the post-scoped types you may add.\n2. `get_post_template({ postType })` to see what a new post starts with. Use `save_post_template` only when asked to change every future post of that type.\n3. `create_document({ collection: postType, title, slug, data: { excerpt, featuredImage } })`. Status defaults to DRAFT.\n4. `list_page_sections({ collection: postType, id })` \u2192 fill the seeded sections with `update_page_section` (for example the `article-body` text), or `add_page_section({ collection: postType, id, sectionType })` for a gallery, quote or embed. The section tools work on posts as well as pages.\n5. Images: `upload_media` \u2192 `generate_media_alt` \u2192 `update_media({ alt })`. The post's LCP image is `featuredImage`.\n6. `validate_section_content`, then submit with `transition_workflow`.\n\n`create_blog_post` drafts field data (title, excerpt, body fields) with AI. It does not write sections.\n\n## Forms on a page or post\n1. `create_form({ name, fields, status: 'active' })`. A form is `draft` by default and a draft form does not render publicly.\n2. `add_page_section({ collection, id, sectionType: 'form', content: { formSlug } })`. The result warns when the slug is missing or the form is not active.\n3. Never write the `forms` collection with `create_document`: it is managed by the Forms plugin. Change fields with `save_form_schema` and status with `update_form`.\n";
|
|
28
|
+
export declare const AUTHORING_GUIDE = "# Prenta CMS \u2014 agent authoring guide\n\n## How to build a page (the only path)\nSee also `prenta://how-to-build-a-page`.\n\n1. `create_document` / `update_document` (title + slug).\n2. `list_section_types` \u2192 `add_page_section` / `update_page_section`. Skip types with `addable: false` or omitted from a template filter.\n3. `upload_media` \u2192 `generate_media_alt` \u2192 `update_media({ alt })` for every image.\n4. `validate_section_content`.\n5. Humans review with View site / a share token.\n6. End with a band list: each reference band, the section type you used, and any band you skipped. A design image is the reference only. Upload photos from their own files.\n\n## Discovery\n- `health_check` \u2014 confirm the instance is healthy before writing.\n- `describe_content_model` \u2014 each collection's `authoring` (`sections`, `post`, `fields`, `managed`), admin editor route, tools, and allowed section types.\n- `list_collections` \u2014 the content types you can author (slugs, labels, fields).\n- Resource `prenta://section-types` \u2014 the section building blocks for pages and posts.\n- Posts: `prenta://how-to-build-a-post`. Forms: create with `create_form` (`status: active`), embed with a `form` section.\n- SEO: `prenta://seo-guide`.\n\n## Canonical `sections[]` model\nThe public renderer (`@prenta/sections-react`) renders this `sections` array. There is no BlockNode tree to generate. A page is a **visual stack** \u2014 one small, single-purpose section per visual band of the design, in order. Never one fat section holding the whole page.\n\n## Lifecycle\n- Status: DRAFT \u2192 PUBLISHED (or SCHEDULED / ARCHIVED). `create_document` is draft by default.\n- `upload_media` before referencing assets; `schedule_publish` to go live; `resolve_url` to verify.\n\n## Images & performance (Core Web Vitals)\nThe public renderer (`@prenta/sections-react`) optimises images for you \u2014 give it the right inputs:\n- **One LCP image per page.** Put a page's main banner on the `hero` section's `imageUrl` (+ required `imageAlt`); for posts use `featuredImage`. The renderer marks exactly one image as the eager/priority LCP element and lazy-loads the rest \u2014 only one image can \"win\" priority.\n- **Always set alt text** (`imageAlt`, or `update_media({ alt })`). A hero image without alt is rejected.\n- **No manual optimisation needed.** `upload_media` recompresses to WebP; pass `lossless: true` and a descriptive filename for a screenshot. The site serves AVIF/WebP via `next/image`, backfills intrinsic width/height (prevents layout shift / CLS), and emits responsive `sizes`. Upload a large source, reference its URL, done.\n\n## Safety\n- `delete_*` tools require `confirm: true`. Prefer archiving. Confirm destructive actions with the user.\n- API-key scopes apply; `Forbidden` means a missing permission.\n";
|
|
29
|
+
/**
|
|
30
|
+
* SEO workflow detail. Kept out of `SERVER_INSTRUCTIONS` (which only points
|
|
31
|
+
* here) so page and post work is not buried under SEO text.
|
|
32
|
+
*/
|
|
33
|
+
export declare const SEO_GUIDE = "# SEO with Prenta over MCP\n\n## Audit fix workflow\n1. `run_seo_audit` or `list_seo_issues` \u2192 triage open issues.\n2. **Metadata fixes** (meta title/desc, canonical, schema): `suggest_seo_issue_fix` \u2192 review `suggestion.changes` \u2192 `apply_seo_issue_fix` with `fingerprint` + `confirm: true`.\n3. **Orphan / inbound links:** `seo_links_snapshot` \u2192 `seo_link_suggest` \u2192 review `wrappable` rows \u2192 `apply_seo_internal_link` with `fingerprint` + `confirm: true`, or `suggest_seo_issue_fix` / `apply_seo_issue_fix` on `orphan-page` issues. Non-wrappable rows stay editor work. Briefs remain suggestions only.\n4. **Content fixes** (thin content, headings, alt text): `research_and_brief_seo_issue` (thin content + optional competitor URLs) or `generate_seo_issue_content_brief`. Briefs are suggestions only \u2014 implement in page content yourself (`add_page_section`, `update_document`, etc.).\n5. `batch_generate_seo_content_briefs` with `confirm: true` to pre-warm briefs, then `export_seo_fix_brief` to pull the full markdown handoff into your workspace.\n6. `set_seo_issue_status` to resolve/ignore when done; re-run `run_seo_audit` to verify.\n7. **Proposals inbox (batch path):** `list_seo_proposals` \u2192 review each row's `changes` and staleness \u2192 `bulk_apply_seo_proposals` (with each `fingerprint` + `confirm: true`) or `dismiss_seo_proposal`; `generate_seo_proposals` (`confirm: true`) fills the inbox for issues with no live proposal. FAQ rows (`fixStrategy: 'add-section'`) carry `section`, `grounding` (verbatim page quotes), and `signals`; approving inserts a visible FAQ section on the page \u2014 read the answers before you confirm.\n8. **SEO Autopilot (unattended path):** `get_seo_autopilot_settings` shows what the CMS will apply on its own and why it may be paused; `list_seo_autopilot_applied` is the ledger of what it did (with outcome). Only change policy, run a tick, or revert with `confirm: true` after the user agrees. Proposals the gate refuses stay in the inbox for a human \u2014 do not bulk-apply them to \"help\" the autopilot.\n9. **AI visibility (read-only):** `get_seo_ai_visibility` shows whether AI engines are crawling and citing the site (crawl trend by bot with a robots.txt cross-check, referral visits by engine, top cited pages) \u2014 use it before recommending robots.txt AI-policy changes via `update_seo_robots`. `enabled: false` means measurement is off in SEO settings.\n\n## Links and technical settings\n- `seo_links_snapshot` / `seo_link_health` \u2014 site-wide link graph and broken-link scan (Links tab parity).\n- `run_seo_link_ai_index` with `confirm: true`, then `seo_link_suggest` \u2014 AI contextual internal link suggestions.\n- `get_seo_crawl_settings` / `update_seo_crawl_settings`, `get_seo_robots` / `update_seo_robots`, `get_seo_sitemap_status` / `regenerate_seo_sitemap` \u2014 technical SEO controls.\n- `list_seo_content` / `get_seo_content` / `update_seo_content` \u2014 bulk content SEO records without opening the admin UI.\n- Redirect advanced: `flatten_redirect_chain`, `list_redirect_suggestions`, recovery settings, `import_redirects_csv` (confirm), `export_redirects_csv`.\n- AI assistant: `ai_seo_generate_field` drafts one field and does not save it \u2014 save the chosen text with `update_seo_content`. `ai_seo_explain_issue`, `ai_seo_generate_schema`, `ai_seo_summarize_audit` \u2014 need an AI provider in Settings \u2192 AI (or a provider API key env var); return `{ unavailable: true }` otherwise.\n";
|
|
28
34
|
export declare function buildResources(client: PrentaClient): McpResource[];
|
|
29
35
|
//# sourceMappingURL=resources.d.ts.map
|
package/dist/resources.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["../src/resources.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["../src/resources.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAG/C,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,8FAA8F;IAC9F,IAAI,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAA;CAC5B;AAED;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,gqEAkB/B,CAAA;AAED,eAAO,MAAM,mBAAmB,szDAiB/B,CAAA;AAED,eAAO,MAAM,eAAe,wyFAoC3B,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,SAAS,q8GAoBrB,CAAA;AAMD,wBAAgB,cAAc,CAAC,MAAM,EAAE,YAAY,GAAG,WAAW,EAAE,CA8GlE"}
|
package/dist/resources.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { buildContentModel } from './content-model.js';
|
|
1
2
|
/**
|
|
2
3
|
* Static, high-signal guide to the canonical authoring workflow. Mirrors the
|
|
3
4
|
* server `instructions` but is available as a pullable resource for clients
|
|
@@ -9,7 +10,7 @@ This is the only page-build path. There is no tree generator and no second page
|
|
|
9
10
|
|
|
10
11
|
A page is a **visual stack**: an ordered list of small, single-purpose sections, one per visual band of the design (hero, stats, pricing, CTA, …), added top to bottom. Never author a whole page as one section, and never stretch one type's fields across several bands. Leave color and type to the site theme (\`prenta://design-system\`).
|
|
11
12
|
|
|
12
|
-
1. \`health_check\` → \`
|
|
13
|
+
1. \`health_check\` → \`describe_content_model\`. Pick a collection with \`authoring: sections\` (usually \`pages\`).
|
|
13
14
|
2. \`create_document\` / \`update_document\` with title + slug. Status defaults to DRAFT.
|
|
14
15
|
3. \`list_section_types\` (pass \`template\` or \`collection\`+\`documentId\` for a page family) → \`get_section_schema\` for the field schema you need. Do not add types with \`addable: false\` or omitted from a template filter. Do not hide types with \`hideable: false\`. Do not work around a 400 via \`update_document\`.
|
|
15
16
|
4. \`add_page_section\` / \`update_page_section\` / \`reorder_page_sections\` — one \`add_page_section\` per design band, in visual order.
|
|
@@ -20,7 +21,25 @@ A page is a **visual stack**: an ordered list of small, single-purpose sections,
|
|
|
20
21
|
|
|
21
22
|
A Figma export, or any other design image, is the layout reference only. Upload each photo from its own file. Do not crop photos out of the reference image.
|
|
22
23
|
|
|
23
|
-
The public renderer (\`@prenta/sections-react\`) reads \`data.sections\` only.
|
|
24
|
+
The public renderer (\`@prenta/sections-react\`) reads \`data.sections\` only. Each entry is \`{ sectionType, content, settings? }\`; \`create_document\` / \`update_document\` reject malformed or unknown entries with 400, so use the section tools. The \`layout\` parameter is legacy. For a contact form, see Forms in \`prenta://how-to-build-a-post\`.
|
|
25
|
+
`;
|
|
26
|
+
export const HOW_TO_BUILD_A_POST = `# How to build a post
|
|
27
|
+
|
|
28
|
+
A post is a document in a post-type collection (\`authoring: post\` in \`describe_content_model\`). Like a page, its body is \`data.sections\`, edited in the admin at \`/posts/:type/:id/edit\`. Every post type has a template: a header layout plus the default sections each new post starts with (usually \`article-body\`).
|
|
29
|
+
|
|
30
|
+
1. \`describe_content_model\` → pick the post type (for example \`blog\`). Its \`sectionTypes\` are the post-scoped types you may add.
|
|
31
|
+
2. \`get_post_template({ postType })\` to see what a new post starts with. Use \`save_post_template\` only when asked to change every future post of that type.
|
|
32
|
+
3. \`create_document({ collection: postType, title, slug, data: { excerpt, featuredImage } })\`. Status defaults to DRAFT.
|
|
33
|
+
4. \`list_page_sections({ collection: postType, id })\` → fill the seeded sections with \`update_page_section\` (for example the \`article-body\` text), or \`add_page_section({ collection: postType, id, sectionType })\` for a gallery, quote or embed. The section tools work on posts as well as pages.
|
|
34
|
+
5. Images: \`upload_media\` → \`generate_media_alt\` → \`update_media({ alt })\`. The post's LCP image is \`featuredImage\`.
|
|
35
|
+
6. \`validate_section_content\`, then submit with \`transition_workflow\`.
|
|
36
|
+
|
|
37
|
+
\`create_blog_post\` drafts field data (title, excerpt, body fields) with AI. It does not write sections.
|
|
38
|
+
|
|
39
|
+
## Forms on a page or post
|
|
40
|
+
1. \`create_form({ name, fields, status: 'active' })\`. A form is \`draft\` by default and a draft form does not render publicly.
|
|
41
|
+
2. \`add_page_section({ collection, id, sectionType: 'form', content: { formSlug } })\`. The result warns when the slug is missing or the form is not active.
|
|
42
|
+
3. Never write the \`forms\` collection with \`create_document\`: it is managed by the Forms plugin. Change fields with \`save_form_schema\` and status with \`update_form\`.
|
|
24
43
|
`;
|
|
25
44
|
export const AUTHORING_GUIDE = `# Prenta CMS — agent authoring guide
|
|
26
45
|
|
|
@@ -36,8 +55,11 @@ See also \`prenta://how-to-build-a-page\`.
|
|
|
36
55
|
|
|
37
56
|
## Discovery
|
|
38
57
|
- \`health_check\` — confirm the instance is healthy before writing.
|
|
58
|
+
- \`describe_content_model\` — each collection's \`authoring\` (\`sections\`, \`post\`, \`fields\`, \`managed\`), admin editor route, tools, and allowed section types.
|
|
39
59
|
- \`list_collections\` — the content types you can author (slugs, labels, fields).
|
|
40
|
-
- Resource \`prenta://section-types\` — the section building blocks for pages.
|
|
60
|
+
- Resource \`prenta://section-types\` — the section building blocks for pages and posts.
|
|
61
|
+
- Posts: \`prenta://how-to-build-a-post\`. Forms: create with \`create_form\` (\`status: active\`), embed with a \`form\` section.
|
|
62
|
+
- SEO: \`prenta://seo-guide\`.
|
|
41
63
|
|
|
42
64
|
## Canonical \`sections[]\` model
|
|
43
65
|
The public renderer (\`@prenta/sections-react\`) renders this \`sections\` array. There is no BlockNode tree to generate. A page is a **visual stack** — one small, single-purpose section per visual band of the design, in order. Never one fat section holding the whole page.
|
|
@@ -56,6 +78,31 @@ The public renderer (\`@prenta/sections-react\`) optimises images for you — gi
|
|
|
56
78
|
- \`delete_*\` tools require \`confirm: true\`. Prefer archiving. Confirm destructive actions with the user.
|
|
57
79
|
- API-key scopes apply; \`Forbidden\` means a missing permission.
|
|
58
80
|
`;
|
|
81
|
+
/**
|
|
82
|
+
* SEO workflow detail. Kept out of `SERVER_INSTRUCTIONS` (which only points
|
|
83
|
+
* here) so page and post work is not buried under SEO text.
|
|
84
|
+
*/
|
|
85
|
+
export const SEO_GUIDE = `# SEO with Prenta over MCP
|
|
86
|
+
|
|
87
|
+
## Audit fix workflow
|
|
88
|
+
1. \`run_seo_audit\` or \`list_seo_issues\` → triage open issues.
|
|
89
|
+
2. **Metadata fixes** (meta title/desc, canonical, schema): \`suggest_seo_issue_fix\` → review \`suggestion.changes\` → \`apply_seo_issue_fix\` with \`fingerprint\` + \`confirm: true\`.
|
|
90
|
+
3. **Orphan / inbound links:** \`seo_links_snapshot\` → \`seo_link_suggest\` → review \`wrappable\` rows → \`apply_seo_internal_link\` with \`fingerprint\` + \`confirm: true\`, or \`suggest_seo_issue_fix\` / \`apply_seo_issue_fix\` on \`orphan-page\` issues. Non-wrappable rows stay editor work. Briefs remain suggestions only.
|
|
91
|
+
4. **Content fixes** (thin content, headings, alt text): \`research_and_brief_seo_issue\` (thin content + optional competitor URLs) or \`generate_seo_issue_content_brief\`. Briefs are suggestions only — implement in page content yourself (\`add_page_section\`, \`update_document\`, etc.).
|
|
92
|
+
5. \`batch_generate_seo_content_briefs\` with \`confirm: true\` to pre-warm briefs, then \`export_seo_fix_brief\` to pull the full markdown handoff into your workspace.
|
|
93
|
+
6. \`set_seo_issue_status\` to resolve/ignore when done; re-run \`run_seo_audit\` to verify.
|
|
94
|
+
7. **Proposals inbox (batch path):** \`list_seo_proposals\` → review each row's \`changes\` and staleness → \`bulk_apply_seo_proposals\` (with each \`fingerprint\` + \`confirm: true\`) or \`dismiss_seo_proposal\`; \`generate_seo_proposals\` (\`confirm: true\`) fills the inbox for issues with no live proposal. FAQ rows (\`fixStrategy: 'add-section'\`) carry \`section\`, \`grounding\` (verbatim page quotes), and \`signals\`; approving inserts a visible FAQ section on the page — read the answers before you confirm.
|
|
95
|
+
8. **SEO Autopilot (unattended path):** \`get_seo_autopilot_settings\` shows what the CMS will apply on its own and why it may be paused; \`list_seo_autopilot_applied\` is the ledger of what it did (with outcome). Only change policy, run a tick, or revert with \`confirm: true\` after the user agrees. Proposals the gate refuses stay in the inbox for a human — do not bulk-apply them to "help" the autopilot.
|
|
96
|
+
9. **AI visibility (read-only):** \`get_seo_ai_visibility\` shows whether AI engines are crawling and citing the site (crawl trend by bot with a robots.txt cross-check, referral visits by engine, top cited pages) — use it before recommending robots.txt AI-policy changes via \`update_seo_robots\`. \`enabled: false\` means measurement is off in SEO settings.
|
|
97
|
+
|
|
98
|
+
## Links and technical settings
|
|
99
|
+
- \`seo_links_snapshot\` / \`seo_link_health\` — site-wide link graph and broken-link scan (Links tab parity).
|
|
100
|
+
- \`run_seo_link_ai_index\` with \`confirm: true\`, then \`seo_link_suggest\` — AI contextual internal link suggestions.
|
|
101
|
+
- \`get_seo_crawl_settings\` / \`update_seo_crawl_settings\`, \`get_seo_robots\` / \`update_seo_robots\`, \`get_seo_sitemap_status\` / \`regenerate_seo_sitemap\` — technical SEO controls.
|
|
102
|
+
- \`list_seo_content\` / \`get_seo_content\` / \`update_seo_content\` — bulk content SEO records without opening the admin UI.
|
|
103
|
+
- Redirect advanced: \`flatten_redirect_chain\`, \`list_redirect_suggestions\`, recovery settings, \`import_redirects_csv\` (confirm), \`export_redirects_csv\`.
|
|
104
|
+
- AI assistant: \`ai_seo_generate_field\` drafts one field and does not save it — save the chosen text with \`update_seo_content\`. \`ai_seo_explain_issue\`, \`ai_seo_generate_schema\`, \`ai_seo_summarize_audit\` — need an AI provider in Settings → AI (or a provider API key env var); return \`{ unavailable: true }\` otherwise.
|
|
105
|
+
`;
|
|
59
106
|
function safeJson(value) {
|
|
60
107
|
return JSON.stringify(value, null, 2);
|
|
61
108
|
}
|
|
@@ -68,6 +115,13 @@ export function buildResources(client) {
|
|
|
68
115
|
mimeType: 'text/markdown',
|
|
69
116
|
read: async () => HOW_TO_BUILD_A_PAGE,
|
|
70
117
|
},
|
|
118
|
+
{
|
|
119
|
+
uri: 'prenta://how-to-build-a-post',
|
|
120
|
+
name: 'How to build a post',
|
|
121
|
+
description: 'Posts use data.sections plus a post-type template. The checklist, and how to embed a form with create_form and a form section.',
|
|
122
|
+
mimeType: 'text/markdown',
|
|
123
|
+
read: async () => HOW_TO_BUILD_A_POST,
|
|
124
|
+
},
|
|
71
125
|
{
|
|
72
126
|
uri: 'prenta://guide',
|
|
73
127
|
name: 'Prenta authoring guide',
|
|
@@ -75,6 +129,24 @@ export function buildResources(client) {
|
|
|
75
129
|
mimeType: 'text/markdown',
|
|
76
130
|
read: async () => AUTHORING_GUIDE,
|
|
77
131
|
},
|
|
132
|
+
{
|
|
133
|
+
uri: 'prenta://content-model',
|
|
134
|
+
name: 'Content model (live)',
|
|
135
|
+
description: 'For each collection: authoring (sections | post | fields | managed), admin editor route, tools to use, and the section types it accepts. Read before writing content.',
|
|
136
|
+
mimeType: 'application/json',
|
|
137
|
+
read: async () => {
|
|
138
|
+
try {
|
|
139
|
+
return safeJson(await buildContentModel(client));
|
|
140
|
+
}
|
|
141
|
+
catch (err) {
|
|
142
|
+
return safeJson({
|
|
143
|
+
error: 'Could not load the content model from this CMS instance.',
|
|
144
|
+
detail: err instanceof Error ? err.message : String(err),
|
|
145
|
+
hint: 'Call the describe_content_model tool, or confirm the server is reachable.',
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
},
|
|
78
150
|
{
|
|
79
151
|
uri: 'prenta://collections',
|
|
80
152
|
name: 'Collections (live content model)',
|
|
@@ -132,6 +204,13 @@ export function buildResources(client) {
|
|
|
132
204
|
}
|
|
133
205
|
},
|
|
134
206
|
},
|
|
207
|
+
{
|
|
208
|
+
uri: 'prenta://seo-guide',
|
|
209
|
+
name: 'SEO guide',
|
|
210
|
+
description: 'SEO audit fixes, proposals, Autopilot, internal links, redirects and technical settings over MCP.',
|
|
211
|
+
mimeType: 'text/markdown',
|
|
212
|
+
read: async () => SEO_GUIDE,
|
|
213
|
+
},
|
|
135
214
|
];
|
|
136
215
|
}
|
|
137
216
|
//# sourceMappingURL=resources.js.map
|
package/dist/resources.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resources.js","sourceRoot":"","sources":["../src/resources.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resources.js","sourceRoot":"","sources":["../src/resources.ts"],"names":[],"mappings":"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"}
|
package/dist/tools.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* MCP tool definitions for Prenta CMS.
|
|
3
3
|
*
|
|
4
|
-
* Each tool is a thin wrapper around
|
|
5
|
-
*
|
|
6
|
-
* -
|
|
7
|
-
* -
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* -
|
|
4
|
+
* Each tool is a thin wrapper around a PrentaClient call, grouped by area:
|
|
5
|
+
* - discovery: collections, the content model, section types
|
|
6
|
+
* - documents: list / get / create / update / delete, translations, workflow
|
|
7
|
+
* - page and post content: `data.sections`, built one section at a time
|
|
8
|
+
* with the section tools (there is no layout-tree or one-shot page
|
|
9
|
+
* generator), plus post templates
|
|
10
|
+
* - media, forms, navigation, globals (site settings), SEO and redirects
|
|
11
11
|
*
|
|
12
12
|
* We deliberately do not expose admin-only endpoints (user management,
|
|
13
13
|
* api-key CRUD, audit log) — the agent already has limited scope via its key.
|
package/dist/tools.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAqB,KAAK,YAAY,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAqB,KAAK,YAAY,EAAE,MAAM,aAAa,CAAA;AAelE;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB;IACjC,YAAY,EAAE,OAAO,CAAA;IACrB,eAAe,EAAE,OAAO,CAAA;IACxB,cAAc,EAAE,OAAO,CAAA;IACvB,aAAa,EAAE,OAAO,CAAA;CACvB;AAED,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACpC,WAAW,EAAE,kBAAkB,CAAA;IAC/B,OAAO,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;CAC7C;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,kBAAkB,CAmBnE;AAMD,wBAAgB,eAAe,CAAC,MAAM,EAAE,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAajF;AA0KD,wBAAgB,UAAU,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,EAAE,CAuoG1D"}
|