frameworc-mcp 0.6.1 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +245 -242
  2. package/dist/index.js +4 -4
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,243 +1,246 @@
1
- # @yourorg/frameworc-mcp
2
-
3
- A [Model Context Protocol](https://modelcontextprotocol.io) server that lets Claude / Cursor / opencode / other AI chat clients create and edit pages built with the **FrameworC** OctoberCMS plugin. One MCP process serves any number of OctCMS installs — you tell the chat which site to work on by calling `use_site`.
4
-
5
- ## What it does
6
-
7
- - Composes 15 prebuilt FrameworC blocks (`Header`, `Section`, `Tiles`, `Slider`, `Tabs`, `Accordion`, `Form`, `Gallery`, `Downloads`, `Columns`, `Prefill`, `BlogList`, `MenuBlock`, `ImageStrip`, `InstaFeed`) into pages
8
- - Lists existing pages and their full builder JSON
9
- - Creates pages, adds / updates / removes / reorders individual blocks — on pages and on Prefill entries
10
- - Full CRUD for `Form` entries (incl. their field rows), `Menu` entries (incl. the navigation tree) and `Prefill` entries (incl. their builder blocks)
11
- - Extracts a repeated page section into a Prefill entry and replaces it with a reference (`extract_block_to_prefill`) — the intended FrameworC de-duplication workflow
12
- - Reads and writes the per-site singles (Meta & SEO, Navigation, Footer) and the FrameworC settings (global navbar options and SCSS, per-site SCSS; integration secrets are not accessible by design)
13
- - Multisite-aware: every content tool takes/pins a `site_id`; page and prefill translations are linked for the language switcher
14
- - Publishes the block catalogue as an MCP resource (`frameworc://blocks`) so the chat agent knows each block's fields, defaults, and when-to-use notes
15
- - Draft by default — created pages have `is_enabled = false`; the human flips the switch in the OctCMS backend after assigning images
16
-
17
- The chat-side flow (text → blocks) is **LLM-native**: you paste a markdown page (or upload `.docx` / `.pdf` and instruct Claude to convert it to markdown), Claude reads the `frameworc://blocks` resource once, segments the content into blocks, calls `list_forms` / `list_menus` / `list_prefills` as needed, then calls `create_page` with the assembled JSON. The MCP simply forwards authenticated HTTPS calls to the OctCMS install.
18
-
19
- ## Architecture
20
-
21
- ```
22
- chat client (Claude Desktop / opencode / Cursor / Cline / Continue / ...)
23
- │ stdio JSON-RPC
24
- ▼
25
- node dist/index.js (local, spawned by the chat client)
26
- reads ~/.config/frameworc/sites.json (auto-created on first run; hot-reloaded)
27
- │ HTTPS + Authorization: Bearer <token resolved by URL>
28
- ▼
29
- any OctCMS install /api/mcp/v1/* (provided by the crscompany/frameworcmcp plugin v1.1.0+)
30
- ```
31
-
32
- No Docker, no ToolHive, no remote gateway, no second auth layer. Each OctCMS install has its own bearer token stored in its backend under `Settings → FrameworC → MCP API`, and your laptop keeps the URL → token map in one local file.
33
-
34
- ## Install
35
-
36
- ```bash
37
- git clone <your-gitlab-url>/frameworc-mcp.git
38
- cd frameworc-mcp
39
- npm install
40
- npm run build
41
- ```
42
-
43
- (Optional) publish to your GitLab group's npm registry so colleagues can `npx` it without a clone — see [Publishing](#publishing) below.
44
-
45
- ## Claude Desktop config
46
-
47
- Edit `claude_desktop_config.json` (macOS: `~/Library/Application Support/Claude/`; Linux: `~/.config/Claude/`):
48
-
49
- ```json
50
- {
51
- "mcpServers": {
52
- "frameworc": {
53
- "command": "npx",
54
- "args": ["-y", "@yourorg/frameworc-mcp"]
55
- }
56
- }
57
- }
58
- ```
59
-
60
- If you cloned instead of `npx`-installed, point `args` to your local `dist/index.js`:
61
-
62
- ```json
63
- {
64
- "mcpServers": {
65
- "frameworc": {
66
- "command": "node",
67
- "args": ["/absolute/path/to/frameworc-mcp/dist/index.js"]
68
- }
69
- }
70
- }
71
- ```
72
-
73
- No env vars. Restart Claude → the `frameworc` tools appear. On first start the MCP creates `~/.config/frameworc/sites.json` with a template; edit it with your real sites (see below).
74
-
75
- ## Per-site token file — `~/.config/frameworc/sites.json`
76
-
77
- The MCP stores one bearer token per OctCMS install in this file on your laptop. It's the only credential store. Format:
78
-
79
- ```json
80
- {
81
- "sites": [
82
- { "label": "Client A prod", "url": "https://clienta.test", "token": "AAA..." },
83
- { "label": "Client A staging", "url": "https://staging.clienta.test", "token": "BBB..." },
84
- { "label": "Myco", "url": "https://myco.example", "token": "CCC..." }
85
- ]
86
- }
87
- ```
88
-
89
- - `label` is optional, shown by the `list_sites` tool so the chat can pick a site by name when you say "use the myco site".
90
- - `url` is matched after normalising trailing slashes — `https://x.test/` and `https://x.test` are the same.
91
- - `token` is sent as `Authorization: Bearer <token>` on every HTTP call to that site. Never committed to git.
92
-
93
- The file is created automatically on first MCP startup (with a template and `0600` perms). Edits are picked up via stat-on-every-tool-call hot-reload — no MCP or chat-client restart needed.
94
-
95
- If the file is missing or empty, `use_site` errors with a pointer to where to add it. The `list_sites` tool enumerates configured sites without exposing tokens.
96
-
97
- ### Adding a new OctCMS site
98
-
99
- 1. Spin up the new OctCMS install with the FrameworC suite incl. the `crscompany/frameworcmcp` plugin (v1.3.0 or newer; media assignment needs v1.2.0, per-site settings need v1.3.0 with FrameworC v1.10.0).
100
- 2. Backend → Settings → FrameworC → **MCP API** → paste a freshly generated random string (e.g. `openssl rand -hex 32`) → Save.
101
- 3. Edit `~/.config/frameworc/sites.json` on your laptop, add one entry: `{ "label": "New Client", "url": "https://newsite.test", "token": "<that string>" }`.
102
- 4. In your next chat (no Claude Desktop restart needed): *"Use `https://newsite.test`."* → MCP hot-reloads the file, finds the token, sends it. Done.
103
-
104
- No env var, no chat-client config edit, no ToolHive touch, no repo push. The whole token map lives in one file on your machine.
105
-
106
- ### Security
107
-
108
- - The file should be `0600` (auto-set on first creation). If you `chmod` it looser, the MCP prints a stderr warning on startup.
109
- - A leak of the file compromises every site listed in it. Treat it like an SSH private key — back it up, rotate tokens periodically, never commit it to git.
110
- - One-off override: `use_site("https://X", "token-string")` lets you pass a token inline (without storing it) for the duration of the chat session. Useful for testing a token before saving it.
111
-
112
- ## Tools (0.5.0)
113
-
114
- | Tool | Description |
115
- |---|---|
116
- | `use_site(url, site_token?)` | Pin the target OctCMS site for the session. Token resolved from `~/.config/frameworc/sites.json` by URL, or supplied via the optional `site_token` arg. |
117
- | `list_sites` | List configured sites (label + URL only, no tokens) from `sites.json`. |
118
- | `list_cms_sites` | List the multisite sites (languages) inside the pinned install. |
119
- | `use_cms_site(site_id)` | Pin the multisite site for subsequent calls (null = primary). |
120
- | `list_pages` | List all pages on the pinned site. |
121
- | `get_page(id)` | Full page JSON (page meta + builder blocks + nested repeaters). |
122
- | `create_page(payload)` | Create a draft page. `payload = { page: {...}, builder: [...] }`. |
123
- | `update_page(id, payload)` | Edit page meta, or full-rebuild the builder array (prefer the per-block tools). |
124
- | `delete_page(id)` | Soft-delete a page. |
125
- | `create_translation(id, target_site_id, prefill?)` | Linked sibling of a page (or Prefill with `prefill:true`) on another multisite site. |
126
- | `add_block(page_id \| prefill_id, block, position?)` | Append (or insert at `position`) a block. |
127
- | `update_block(page_id \| prefill_id, block_id, block)` | Replace one block by row id (new id returned). A media field you omit is inherited; one you send is written verbatim, so `""` clears it. |
128
- | `remove_block(page_id \| prefill_id, block_id)` | Remove one block by row id. |
129
- | `reorder_blocks(page_id \| prefill_id, order)` | Reorder blocks (order = array of all row ids in new order). |
130
- | `extract_block_to_prefill(page_id, block_id, title)` | Move a page block into a new Prefill entry (lossless from plugin v1.2.0) and reference it in place. |
131
- | `list_forms` / `get_form(id)` | Form entries; `get_form` includes the `fwcFields` rows. |
132
- | `get_form_schema` | Live field-group catalogue for authoring forms. |
133
- | `create_form` / `update_form` / `delete_form` | Form CRUD. `fwcFields` rows: `{group, label, name, required, width, ...}`; delete guarded unless `force:true`. |
134
- | `list_menus` / `get_menu(id)` | Menu entries; `get_menu` includes the navigation tree. |
135
- | `create_menu` / `update_menu` / `delete_menu` | Menu CRUD. Tree items `{title, url \| {page_id}, anchor, blank, children}`, max 2 levels; delete guarded. |
136
- | `list_prefills` / `get_prefill(id)` | Prefill entries; `get_prefill` includes the builder blocks. |
137
- | `create_prefill` / `update_prefill` / `delete_prefill` | Prefill CRUD — same block shape as pages; delete guarded. |
138
- | `get_page_meta(handle)` / `update_page_meta(handle, fields)` | Per-site singles: `Meta` (SEO), `Navigation` (navbar incl. `nav` menu link + buttons), `Footer` (incl. `socials` rows + `nav`). |
139
- | `get_settings` / `update_settings(fields)` | Global FrameworC settings: navbar options + global custom SCSS (`styles_globalScss`). Integration secrets are not exposed. |
140
- | `get_site_settings` / `update_site_settings(fields)` | Per-site FrameworC settings: custom SCSS for one site (`siteScss`), compiled after the global SCSS. |
141
- | `get_block_schema(name)` | Field schema + usage notes for one block (live from the CMS). |
142
- | `list_media(folder?, type?, sort?, limit?, offset?)` | Browse the media library. Returns files with their `path` — write that into a mediafinder field. |
143
- | `search_media(q, folder?, type?, ...)` | Find library files by name across all folders. Every whitespace-separated word must appear in the path. |
144
-
145
- Form and Menu entries have no translation linking — create them per site by passing `site_id`.
146
-
147
- ## Resource
148
-
149
- - `frameworc://blocks` — reference for all 15 block types (fields, defaults, enums, conditional visibility, nested repeaters, reference fields). The chat reads this once per session; you don't invoke it manually.
150
-
151
- ## Page-content JSON shape
152
-
153
- `create_page` / `update_page` `payload`:
154
-
155
- ```json
156
- {
157
- "page": {
158
- "title": "Contact",
159
- "slug": "contact",
160
- "fullslug": "contact",
161
- "is_enabled": false,
162
- "metaTitle": "",
163
- "metaDescription": "",
164
- "menuStyle": "solid",
165
- "menuHide": "no"
166
- },
167
- "builder": [
168
- {
169
- "content_group": "Header",
170
- "base": {
171
- "blockId": "kontakt",
172
- "headline": "<h1>Contact us</h1>",
173
- "elevated": false,
174
- "containerWidth": "default",
175
- "backgroundColor": "default",
176
- "customCssClass": [],
177
- "responsiveHide": []
178
- },
179
- "content": {
180
- "image": "",
181
- "imageMobile": "",
182
- "isVideoBg": false,
183
- "buttonLabel1": "",
184
- "buttonLink1": "",
185
- "buttonBlank1": false,
186
- "fullHeight": true,
187
- "contrast": false,
188
- "overlay": false
189
- }
190
- },
191
- {
192
- "content_group": "Form",
193
- "base": { "blockId": "formular", "headline": "<h2>Write us</h2>" },
194
- "form": 7,
195
- "content": { "variant": "default" }
196
- }
197
- ]
198
- }
199
- ```
200
-
201
- ### Storage encoding (what the MCP understands)
202
-
203
- - Media fields hold **media library paths**, root-relative with a leading slash (`/images/hero.jpg`). Assignment only: the API cannot upload, and a path that is not in the library is a 422. Single-item fields (`maxItems: 1`) are strings and read as `""` when unset; multi fields are arrays and read as `[]`. Find paths with `search_media` / `list_media`.
204
- - `switch` fields accept booleans; the API normalises to `"1"` / `"0"` for storage.
205
- - `customCssClass` + `responsiveHide` are arrays of strings.
206
- - Multi-`mediafinder` fields are arrays of path strings: `Gallery.images` and `ImageStrip.images`, where **every** item renders, plus `Section.content.image` and the `Footer` single's `logo`, which are arrays in storage but of which the theme renders **only the first item**.
207
- - `entries` links are integers (or `{id: n}`): `form` (block level for `Form`), `content.menu` (for `MenuBlock`), `content.block` (for `Prefill`). Reads return them as `{id, title}`.
208
- - `Slider` accepts an optional `content.breakpoints = { tablet: number, mobile: number }`.
209
- - `Columns` blocks have `content.columns = [{ blockId, builder: [...blocks] }]` — recursive: each column's `builder` follows the exact same shape as the top-level `builder`.
210
-
211
- ### Working with media
212
-
213
- `mode: image` on a blueprint field is only a hint for the backend widget; October never enforces it, and real FrameworC content relies on the slack. The API therefore accepts any image, SVG or video extension in a `mode: image` field and rejects the rest (a `.pdf` in a hero would break `resize()`), which means:
214
-
215
- - The `Navigation` logo is an SVG and `Header.image` holds an `.mp4` when `isVideoBg` is on. Both are valid.
216
- - `buttonIcon1..4` and `Downloads`' `file` declare no `mode` at all, so any file type is accepted there.
217
- - Whether SVG reports as `file_type: image` or `document` depends on the install's `media.image_extensions` config, so treat `list_media`'s `type` filter as a convenience rather than a guarantee.
218
- - Folders are not selectable, and filenames containing `+ # % !` are unreachable through the API — an October media library limitation that applies to its own backend manager too.
219
-
220
- ## Catalogue drift
221
-
222
- The hand-authored block catalogue lives in `src/catalogue.ts`. It mirrors `plugins/crscompany/frameworc/blueprints/Blocks/*.yaml` + `Mixins/Buttons.yaml` + `Mixins/Buttons2.yaml` + `BaseBlock.yaml`. If a block blueprint changes (new field, new enum value, removed field), update `src/catalogue.ts` to match and rebuild. No generator script — kept manual because blocks change rarely per the FrameworC convention.
223
-
224
- ## Publishing
225
-
226
- To publish to your GitLab group's npm registry:
227
-
228
- 1. Edit `package.json`:
229
- - Replace `@yourorg` in `name` and `publishConfig["@yourorg:registry"]` with your actual GitLab scope/group.
230
- - Replace `<YOUR-PROJECT-ID>` in `publishConfig["@yourorg:registry"]` with the numeric project id of the `frameworc-mcp` GitLab repo.
231
- 2. Create a GitLab deploy token / project access token with `api` + `write_registry` scope. Add a `.npmrc` at the registry host:
232
-
233
- ```
234
- @yourorg:registry=https://gitlab.com/api/v4/projects/<YOUR-PROJECT-ID>/packages/npm/
235
- //gitlab.com/api/v4/projects/<YOUR-PROJECT-ID>/packages/npm/:_authToken=<TOKEN>
236
- ```
237
- 3. `npm publish`.
238
-
239
- Colleagues then use `npx -y @yourorg/frameworc-mcp` in their `claude_desktop_config.json` (no clone needed).
240
-
241
- ## License
242
-
1
+ # @yourorg/frameworc-mcp
2
+
3
+ A [Model Context Protocol](https://modelcontextprotocol.io) server that lets Claude / Cursor / opencode / other AI chat clients create and edit pages built with the **FrameworC** OctoberCMS plugin. One MCP process serves any number of OctCMS installs — you tell the chat which site to work on by calling `use_site`.
4
+
5
+ ## What it does
6
+
7
+ - Composes 15 prebuilt FrameworC blocks (`Header`, `Section`, `Tiles`, `Slider`, `Tabs`, `Accordion`, `Form`, `Gallery`, `Downloads`, `Columns`, `Prefill`, `BlogList`, `MenuBlock`, `ImageStrip`, `InstaFeed`) into pages
8
+ - Lists existing pages and their full builder JSON
9
+ - Creates pages, adds / updates / removes / reorders individual blocks — on pages and on Prefill entries
10
+ - Full CRUD for `Form` entries (incl. their field rows), `Menu` entries (incl. the navigation tree) and `Prefill` entries (incl. their builder blocks)
11
+ - Extracts a repeated page section into a Prefill entry and replaces it with a reference (`extract_block_to_prefill`) — the intended FrameworC de-duplication workflow
12
+ - Reads and writes the per-site singles (Meta & SEO, Navigation, Footer) and the FrameworC settings (global navbar options and SCSS, per-site SCSS; integration secrets are not accessible by design)
13
+ - Multisite-aware: every content tool takes/pins a `site_id`; page and prefill translations are linked for the language switcher
14
+ - Publishes the block catalogue as an MCP resource (`frameworc://blocks`) so the chat agent knows each block's fields, defaults, and when-to-use notes
15
+ - Draft by default — created pages have `is_enabled = false`; the human flips the switch in the OctCMS backend after assigning images
16
+
17
+ The chat-side flow (text → blocks) is **LLM-native**: you paste a markdown page (or upload `.docx` / `.pdf` and instruct Claude to convert it to markdown), Claude reads the `frameworc://blocks` resource once, segments the content into blocks, calls `list_forms` / `list_menus` / `list_prefills` as needed, then calls `create_page` with the assembled JSON. The MCP simply forwards authenticated HTTPS calls to the OctCMS install.
18
+
19
+ ## Architecture
20
+
21
+ ```
22
+ chat client (Claude Desktop / opencode / Cursor / Cline / Continue / ...)
23
+ │ stdio JSON-RPC
24
+ ▼
25
+ node dist/index.js (local, spawned by the chat client)
26
+ reads ~/.config/frameworc/sites.json (auto-created on first run; hot-reloaded)
27
+ │ HTTPS + Authorization: Bearer <token resolved by URL>
28
+ ▼
29
+ any OctCMS install /api/mcp/v1/* (provided by the crscompany/frameworcmcp plugin v1.1.0+)
30
+ ```
31
+
32
+ No Docker, no ToolHive, no remote gateway, no second auth layer. Each OctCMS install has its own bearer token stored in its backend under `Settings → FrameworC → MCP API`, and your laptop keeps the URL → token map in one local file.
33
+
34
+ ## Install
35
+
36
+ ```bash
37
+ git clone <your-gitlab-url>/frameworc-mcp.git
38
+ cd frameworc-mcp
39
+ npm install
40
+ npm run build
41
+ ```
42
+
43
+ (Optional) publish to your GitLab group's npm registry so colleagues can `npx` it without a clone — see [Publishing](#publishing) below.
44
+
45
+ ## Claude Desktop config
46
+
47
+ Edit `claude_desktop_config.json` (macOS: `~/Library/Application Support/Claude/`; Linux: `~/.config/Claude/`):
48
+
49
+ ```json
50
+ {
51
+ "mcpServers": {
52
+ "frameworc": {
53
+ "command": "npx",
54
+ "args": ["-y", "@yourorg/frameworc-mcp"]
55
+ }
56
+ }
57
+ }
58
+ ```
59
+
60
+ If you cloned instead of `npx`-installed, point `args` to your local `dist/index.js`:
61
+
62
+ ```json
63
+ {
64
+ "mcpServers": {
65
+ "frameworc": {
66
+ "command": "node",
67
+ "args": ["/absolute/path/to/frameworc-mcp/dist/index.js"]
68
+ }
69
+ }
70
+ }
71
+ ```
72
+
73
+ No env vars. Restart Claude → the `frameworc` tools appear. On first start the MCP creates `~/.config/frameworc/sites.json` with a template; edit it with your real sites (see below).
74
+
75
+ ## Per-site token file — `~/.config/frameworc/sites.json`
76
+
77
+ The MCP stores one bearer token per OctCMS install in this file on your laptop. It's the only credential store. Format:
78
+
79
+ ```json
80
+ {
81
+ "sites": [
82
+ { "label": "Client A prod", "url": "https://clienta.test", "token": "AAA..." },
83
+ { "label": "Client A staging", "url": "https://staging.clienta.test", "token": "BBB..." },
84
+ { "label": "Myco", "url": "https://myco.example", "token": "CCC..." }
85
+ ]
86
+ }
87
+ ```
88
+
89
+ - `label` is optional, shown by the `list_sites` tool so the chat can pick a site by name when you say "use the myco site".
90
+ - `url` is matched after normalising trailing slashes — `https://x.test/` and `https://x.test` are the same.
91
+ - `token` is sent as `Authorization: Bearer <token>` on every HTTP call to that site. Never committed to git.
92
+
93
+ The file is created automatically on first MCP startup (with a template and `0600` perms). Edits are picked up via stat-on-every-tool-call hot-reload — no MCP or chat-client restart needed.
94
+
95
+ If the file is missing or empty, `use_site` errors with a pointer to where to add it. The `list_sites` tool enumerates configured sites without exposing tokens.
96
+
97
+ ### Adding a new OctCMS site
98
+
99
+ 1. Spin up the new OctCMS install with the FrameworC suite incl. the `crscompany/frameworcmcp` plugin (v1.4.0 or newer; media assignment needs v1.2.0, per-site settings need v1.3.0 with FrameworC v1.10.0, page JSON-LD fields need v1.4.0 with FrameworC v1.13.0).
100
+ 2. Backend → Settings → FrameworC → **MCP API** → paste a freshly generated random string (e.g. `openssl rand -hex 32`) → Save.
101
+ 3. Edit `~/.config/frameworc/sites.json` on your laptop, add one entry: `{ "label": "New Client", "url": "https://newsite.test", "token": "<that string>" }`.
102
+ 4. In your next chat (no Claude Desktop restart needed): *"Use `https://newsite.test`."* → MCP hot-reloads the file, finds the token, sends it. Done.
103
+
104
+ No env var, no chat-client config edit, no ToolHive touch, no repo push. The whole token map lives in one file on your machine.
105
+
106
+ ### Security
107
+
108
+ - The file should be `0600` (auto-set on first creation). If you `chmod` it looser, the MCP prints a stderr warning on startup.
109
+ - A leak of the file compromises every site listed in it. Treat it like an SSH private key — back it up, rotate tokens periodically, never commit it to git.
110
+ - One-off override: `use_site("https://X", "token-string")` lets you pass a token inline (without storing it) for the duration of the chat session. Useful for testing a token before saving it.
111
+
112
+ ## Tools (0.5.0)
113
+
114
+ | Tool | Description |
115
+ |---|---|
116
+ | `use_site(url, site_token?)` | Pin the target OctCMS site for the session. Token resolved from `~/.config/frameworc/sites.json` by URL, or supplied via the optional `site_token` arg. |
117
+ | `list_sites` | List configured sites (label + URL only, no tokens) from `sites.json`. |
118
+ | `list_cms_sites` | List the multisite sites (languages) inside the pinned install. |
119
+ | `use_cms_site(site_id)` | Pin the multisite site for subsequent calls (null = primary). |
120
+ | `list_pages` | List all pages on the pinned site. |
121
+ | `get_page(id)` | Full page JSON (page meta + builder blocks + nested repeaters). |
122
+ | `create_page(payload)` | Create a draft page. `payload = { page: {...}, builder: [...] }`. |
123
+ | `update_page(id, payload)` | Edit page meta, or full-rebuild the builder array (prefer the per-block tools). |
124
+ | `delete_page(id)` | Soft-delete a page. |
125
+ | `create_translation(id, target_site_id, prefill?)` | Linked sibling of a page (or Prefill with `prefill:true`) on another multisite site. |
126
+ | `add_block(page_id \| prefill_id, block, position?)` | Append (or insert at `position`) a block. |
127
+ | `update_block(page_id \| prefill_id, block_id, block)` | Replace one block by row id (new id returned). A media field you omit is inherited; one you send is written verbatim, so `""` clears it. |
128
+ | `remove_block(page_id \| prefill_id, block_id)` | Remove one block by row id. |
129
+ | `reorder_blocks(page_id \| prefill_id, order)` | Reorder blocks (order = array of all row ids in new order). |
130
+ | `extract_block_to_prefill(page_id, block_id, title)` | Move a page block into a new Prefill entry (lossless from plugin v1.2.0) and reference it in place. |
131
+ | `list_forms` / `get_form(id)` | Form entries; `get_form` includes the `fwcFields` rows. |
132
+ | `get_form_schema` | Live field-group catalogue for authoring forms. |
133
+ | `create_form` / `update_form` / `delete_form` | Form CRUD. `fwcFields` rows: `{group, label, name, required, width, ...}`; delete guarded unless `force:true`. |
134
+ | `list_menus` / `get_menu(id)` | Menu entries; `get_menu` includes the navigation tree. |
135
+ | `create_menu` / `update_menu` / `delete_menu` | Menu CRUD. Tree items `{title, url \| {page_id}, anchor, blank, children}`, max 2 levels; delete guarded. |
136
+ | `list_prefills` / `get_prefill(id)` | Prefill entries; `get_prefill` includes the builder blocks. |
137
+ | `create_prefill` / `update_prefill` / `delete_prefill` | Prefill CRUD — same block shape as pages; delete guarded. |
138
+ | `get_page_meta(handle)` / `update_page_meta(handle, fields)` | Per-site singles: `Meta` (SEO), `Navigation` (navbar incl. `nav` menu link + buttons), `Footer` (incl. `socials` rows + `nav`). |
139
+ | `get_settings` / `update_settings(fields)` | Global FrameworC settings: navbar options + global custom SCSS (`styles_globalScss`). Integration secrets are not exposed. |
140
+ | `get_site_settings` / `update_site_settings(fields)` | Per-site FrameworC settings: custom SCSS for one site (`siteScss`), compiled after the global SCSS. |
141
+ | `get_block_schema(name)` | Field schema + usage notes for one block (live from the CMS). |
142
+ | `list_media(folder?, type?, sort?, limit?, offset?)` | Browse the media library. Returns files with their `path` — write that into a mediafinder field. |
143
+ | `search_media(q, folder?, type?, ...)` | Find library files by name across all folders. Every whitespace-separated word must appear in the path. |
144
+
145
+ Form and Menu entries have no translation linking — create them per site by passing `site_id`.
146
+
147
+ ## Resource
148
+
149
+ - `frameworc://blocks` — reference for all 15 block types (fields, defaults, enums, conditional visibility, nested repeaters, reference fields). The chat reads this once per session; you don't invoke it manually.
150
+
151
+ ## Page-content JSON shape
152
+
153
+ `create_page` / `update_page` `payload`:
154
+
155
+ ```json
156
+ {
157
+ "page": {
158
+ "title": "Contact",
159
+ "slug": "contact",
160
+ "fullslug": "contact",
161
+ "is_enabled": false,
162
+ "metaTitle": "",
163
+ "metaDescription": "",
164
+ "menuStyle": "solid",
165
+ "menuHide": "no",
166
+ "jsonLdPageType": "ContactPage",
167
+ "jsonLdDisable": false,
168
+ "jsonLdCustom": ""
169
+ },
170
+ "builder": [
171
+ {
172
+ "content_group": "Header",
173
+ "base": {
174
+ "blockId": "kontakt",
175
+ "headline": "<h1>Contact us</h1>",
176
+ "elevated": false,
177
+ "containerWidth": "default",
178
+ "backgroundColor": "default",
179
+ "customCssClass": [],
180
+ "responsiveHide": []
181
+ },
182
+ "content": {
183
+ "image": "",
184
+ "imageMobile": "",
185
+ "isVideoBg": false,
186
+ "buttonLabel1": "",
187
+ "buttonLink1": "",
188
+ "buttonBlank1": false,
189
+ "fullHeight": true,
190
+ "contrast": false,
191
+ "overlay": false
192
+ }
193
+ },
194
+ {
195
+ "content_group": "Form",
196
+ "base": { "blockId": "formular", "headline": "<h2>Write us</h2>" },
197
+ "form": 7,
198
+ "content": { "variant": "default" }
199
+ }
200
+ ]
201
+ }
202
+ ```
203
+
204
+ ### Storage encoding (what the MCP understands)
205
+
206
+ - Media fields hold **media library paths**, root-relative with a leading slash (`/images/hero.jpg`). Assignment only: the API cannot upload, and a path that is not in the library is a 422. Single-item fields (`maxItems: 1`) are strings and read as `""` when unset; multi fields are arrays and read as `[]`. Find paths with `search_media` / `list_media`.
207
+ - `switch` fields accept booleans; the API normalises to `"1"` / `"0"` for storage.
208
+ - `customCssClass` + `responsiveHide` are arrays of strings.
209
+ - Multi-`mediafinder` fields are arrays of path strings: `Gallery.images` and `ImageStrip.images`, where **every** item renders, plus `Section.content.image` and the `Footer` single's `logo`, which are arrays in storage but of which the theme renders **only the first item**.
210
+ - `entries` links are integers (or `{id: n}`): `form` (block level for `Form`), `content.menu` (for `MenuBlock`), `content.block` (for `Prefill`). Reads return them as `{id, title}`.
211
+ - `Slider` accepts an optional `content.breakpoints = { tablet: number, mobile: number }`.
212
+ - `Columns` blocks have `content.columns = [{ blockId, builder: [...blocks] }]` — recursive: each column's `builder` follows the exact same shape as the top-level `builder`.
213
+
214
+ ### Working with media
215
+
216
+ `mode: image` on a blueprint field is only a hint for the backend widget; October never enforces it, and real FrameworC content relies on the slack. The API therefore accepts any image, SVG or video extension in a `mode: image` field and rejects the rest (a `.pdf` in a hero would break `resize()`), which means:
217
+
218
+ - The `Navigation` logo is an SVG and `Header.image` holds an `.mp4` when `isVideoBg` is on. Both are valid.
219
+ - `buttonIcon1..4` and `Downloads`' `file` declare no `mode` at all, so any file type is accepted there.
220
+ - Whether SVG reports as `file_type: image` or `document` depends on the install's `media.image_extensions` config, so treat `list_media`'s `type` filter as a convenience rather than a guarantee.
221
+ - Folders are not selectable, and filenames containing `+ # % !` are unreachable through the API — an October media library limitation that applies to its own backend manager too.
222
+
223
+ ## Catalogue drift
224
+
225
+ The hand-authored block catalogue lives in `src/catalogue.ts`. It mirrors `plugins/crscompany/frameworc/blueprints/Blocks/*.yaml` + `Mixins/Buttons.yaml` + `Mixins/Buttons2.yaml` + `BaseBlock.yaml`. If a block blueprint changes (new field, new enum value, removed field), update `src/catalogue.ts` to match and rebuild. No generator script — kept manual because blocks change rarely per the FrameworC convention.
226
+
227
+ ## Publishing
228
+
229
+ To publish to your GitLab group's npm registry:
230
+
231
+ 1. Edit `package.json`:
232
+ - Replace `@yourorg` in `name` and `publishConfig["@yourorg:registry"]` with your actual GitLab scope/group.
233
+ - Replace `<YOUR-PROJECT-ID>` in `publishConfig["@yourorg:registry"]` with the numeric project id of the `frameworc-mcp` GitLab repo.
234
+ 2. Create a GitLab deploy token / project access token with `api` + `write_registry` scope. Add a `.npmrc` at the registry host:
235
+
236
+ ```
237
+ @yourorg:registry=https://gitlab.com/api/v4/projects/<YOUR-PROJECT-ID>/packages/npm/
238
+ //gitlab.com/api/v4/projects/<YOUR-PROJECT-ID>/packages/npm/:_authToken=<TOKEN>
239
+ ```
240
+ 3. `npm publish`.
241
+
242
+ Colleagues then use `npx -y @yourorg/frameworc-mcp` in their `claude_desktop_config.json` (no clone needed).
243
+
244
+ ## License
245
+
243
246
  MIT.
package/dist/index.js CHANGED
@@ -93,7 +93,7 @@ const tools = [
93
93
  },
94
94
  {
95
95
  name: "create_page",
96
- description: "Create a new FrameworC page. Send a `page` object (title, slug, fullslug, is_enabled, metaTitle, metaDescription, menuStyle, menuHide) and a `builder` array of block objects per the frameworc://blocks resource. Pages are created with is_enabled=false (draft) by default. Media fields take a media library path such as \"/images/hero.jpg\" — find one with search_media or list_media; the file must already exist, as this server cannot upload. Leave a media field as \"\" (single) or [] (multi) to leave it unset. After creating, surface the returned page id so the user can review and flip is_enabled to publish.",
96
+ description: "Create a new FrameworC page. Send a `page` object (title, slug, fullslug, is_enabled, metaTitle, metaDescription, menuStyle, menuHide, jsonLdPageType, jsonLdDisable, jsonLdCustom) and a `builder` array of block objects per the frameworc://blocks resource. Pages are created with is_enabled=false (draft) by default. Media fields take a media library path such as \"/images/hero.jpg\" — find one with search_media or list_media; the file must already exist, as this server cannot upload. Leave a media field as \"\" (single) or [] (multi) to leave it unset. After creating, surface the returned page id so the user can review and flip is_enabled to publish.",
97
97
  inputSchema: {
98
98
  type: "object",
99
99
  properties: {
@@ -114,7 +114,7 @@ const tools = [
114
114
  },
115
115
  {
116
116
  name: "update_page",
117
- description: "Update an existing page. Partial updates: send only `page` (meta edits) and/or `builder` (full rebuild — all existing blocks are deleted and the new array is written). A rebuild also rewrites media, so send the builder array exactly as get_page returned it, paths included, or the existing images are cleared. To add, edit or remove one block, prefer add_block / update_block / remove_block. `page.ogImage` takes a media library path.",
117
+ description: "Update an existing page. Partial updates: send only `page` (meta edits) and/or `builder` (full rebuild — all existing blocks are deleted and the new array is written). A rebuild also rewrites media, so send the builder array exactly as get_page returned it, paths included, or the existing images are cleared. To add, edit or remove one block, prefer add_block / update_block / remove_block. `page.ogImage` takes a media library path. Structured data: the site renders schema.org JSON-LD automatically; `page.jsonLdPageType` is WebPage / AboutPage / ContactPage / CollectionPage / FAQPage, `page.jsonLdDisable` turns the generated graph off, and `page.jsonLdCustom` is an extra JSON-LD document as a JSON string (no script tag; invalid JSON is rejected).",
118
118
  inputSchema: {
119
119
  type: "object",
120
120
  properties: {
@@ -526,7 +526,7 @@ const tools = [
526
526
  },
527
527
  {
528
528
  name: "get_page_meta",
529
- description: "Read a per-site single: Meta (SEO defaults, blog base path), Navigation (navbar) or Footer. Use before composing pages so titles and descriptions match the site's conventions.",
529
+ description: "Read a per-site single: Meta (SEO defaults, blog base path, organization data for JSON-LD), Navigation (navbar) or Footer. Use before composing pages so titles and descriptions match the site's conventions.",
530
530
  inputSchema: {
531
531
  type: "object",
532
532
  properties: {
@@ -539,7 +539,7 @@ const tools = [
539
539
  },
540
540
  {
541
541
  name: "update_page_meta",
542
- description: "Update a per-site single (Meta / Navigation / Footer). Send only the fields you want to change, e.g. {handle:'Meta', fields:{metaTitle:'...', description:'...'}}. Media fields take a media library path from search_media: Meta.ogImage and Navigation.logo / logoDark are single paths, while Footer.logo is an ARRAY of paths of which only the first renders. Affects every page on that site, so confirm with the user first.",
542
+ description: "Update a per-site single (Meta / Navigation / Footer). Send only the fields you want to change, e.g. {handle:'Meta', fields:{metaTitle:'...', description:'...'}}. Media fields take a media library path from search_media: Meta.ogImage and Navigation.logo / logoDark are single paths, while Footer.logo is an ARRAY of paths of which only the first renders. Meta also holds the organization data rendered as JSON-LD on every page (orgType, orgName, orgLegalName, orgIco, orgLogo, orgPhone, orgEmail, orgStreet, orgCity, orgZip, orgCountry, orgLat, orgLng, orgOpeningHours, jsonLdCustom); read get_page_meta for the exact schema. Affects every page on that site, so confirm with the user first.",
543
543
  inputSchema: {
544
544
  type: "object",
545
545
  properties: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "frameworc-mcp",
3
- "version": "0.6.1",
3
+ "version": "0.7.0",
4
4
  "description": "MCP server for the FrameworC OctoberCMS plugin — programmatically create/edit FrameworC pages and blocks.",
5
5
  "license": "MIT",
6
6
  "type": "commonjs",