@upassist/neos-mcp 2.2.0 → 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 +20 -0
- package/README.md +26 -0
- package/dist/index.js +147 -38
- package/package.json +2 -2
- package/src/dimensions.ts +60 -0
- package/src/server.ts +4 -0
- package/src/tools/createContentNode.ts +5 -2
- package/src/tools/createDocumentNode.ts +5 -2
- package/src/tools/createNodeVariant.ts +39 -0
- package/src/tools/deleteNode.ts +8 -3
- package/src/tools/entityCrud.ts +1 -1
- package/src/tools/getDocumentProperties.ts +5 -3
- package/src/tools/getPageContent.ts +5 -3
- package/src/tools/getPreviewUrl.ts +5 -3
- package/src/tools/getSiteContext.ts +9 -4
- package/src/tools/listAssets.ts +1 -1
- package/src/tools/listNodeTypes.ts +1 -1
- package/src/tools/listPages.ts +6 -3
- package/src/tools/listPendingChanges.ts +6 -3
- package/src/tools/listSites.ts +15 -0
- package/src/tools/moveNode.ts +5 -2
- package/src/tools/publishChanges.ts +23 -4
- package/src/tools/updateNodeProperty.ts +5 -2
- package/src/tools/uploadAsset.ts +1 -1
- package/test/dimensions.test.ts +210 -0
- package/test/multiSite.test.ts +116 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,26 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [2.4.0](https://github.com/UpAssist/neos-mcp-client/compare/2.3.0...2.4.0) (2026-11-02)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* content dimensions for the node tools and neos_create_node_variant ([#10](https://github.com/UpAssist/neos-mcp-client/issues/10)) ([46f0553](https://github.com/UpAssist/neos-mcp-client/commit/46f0553142faa9579e041517905277901eff617a))
|
|
11
|
+
* dimensions for preview, pending changes and publishing; fix typecheck ([#10](https://github.com/UpAssist/neos-mcp-client/issues/10)) ([d591f17](https://github.com/UpAssist/neos-mcp-client/commit/d591f17ac8d4859661ca70b97159e931b3100009))
|
|
12
|
+
|
|
13
|
+
## [2.3.0](https://github.com/UpAssist/neos-mcp-client/compare/2.2.0...2.3.0) (2026-10-13)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Features
|
|
17
|
+
|
|
18
|
+
* add multi-site support to the tools ([#5](https://github.com/UpAssist/neos-mcp-client/issues/5)) ([dbffad3](https://github.com/UpAssist/neos-mcp-client/commit/dbffad3106b39f1f4ba21603e7adc078ca99892e))
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Bug Fixes
|
|
22
|
+
|
|
23
|
+
* refuse site-scoped publish when the bridge has no multi-site support ([0076e8d](https://github.com/UpAssist/neos-mcp-client/commit/0076e8deed841fe912c7aa22c97869378b8de8cb))
|
|
24
|
+
|
|
5
25
|
## [2.2.0](https://github.com/UpAssist/neos-mcp-client/compare/2.1.0...2.2.0) (2026-10-12)
|
|
6
26
|
|
|
7
27
|
|
package/README.md
CHANGED
|
@@ -13,6 +13,10 @@ This is the client-side component. It runs locally on your machine and translate
|
|
|
13
13
|
|
|
14
14
|
> **v2 auto-detects** the bridge API version. A single MCP server v2 works with both Neos 8 and Neos 9 bridges.
|
|
15
15
|
|
|
16
|
+
> **Multi-site** (`neos_list_sites` and the `site` parameter) needs a bridge with multi-site support (see the [bridge README](https://github.com/UpAssist/neos-mcp#multi-site): upassist/neos-mcp **2.3+** for Neos 9, **1.2+** for Neos 8). Older bridges ignore `site` and always work on the default site; `neos_list_sites` fails with a 404 there. To avoid publishing every site by accident, `neos_publish_changes` with `site` first checks that the bridge supports multi-site and refuses to publish otherwise.
|
|
17
|
+
|
|
18
|
+
> **Content dimensions** (the `dimensions` parameter and `neos_create_node_variant`) need a bridge with dimension support: upassist/neos-mcp **2.4+** for Neos 9, **1.3+** for Neos 8. With `dimensions` the client first checks that the bridge reports its dimensions and refuses otherwise, because an older bridge would silently use the default dimensions (and write there).
|
|
19
|
+
|
|
16
20
|
> **`neos_upload_asset`** (client 2.1+) needs a bridge with the `uploadAsset` endpoint: upassist/neos-mcp **2.1+** (Neos 9) or **1.1+** (Neos 8). Against an older bridge the other tools keep working and the upload call fails with a 404.
|
|
17
21
|
|
|
18
22
|
## Requirements
|
|
@@ -127,6 +131,7 @@ Once connected, your AI assistant can use these tools:
|
|
|
127
131
|
|
|
128
132
|
| Tool | Description |
|
|
129
133
|
| --- | --- |
|
|
134
|
+
| `neos_list_sites` | List all sites of the Neos instance and which one is the default |
|
|
130
135
|
| `neos_get_site_context` | Get site structure, node types, and page tree. **Call this first.** |
|
|
131
136
|
| `neos_list_pages` | List all pages in a workspace |
|
|
132
137
|
| `neos_get_page_content` | Get all content nodes on a specific page |
|
|
@@ -143,6 +148,7 @@ Once connected, your AI assistant can use these tools:
|
|
|
143
148
|
| `neos_create_document_node` | Create a new page |
|
|
144
149
|
| `neos_move_node` | Move or reorder a node |
|
|
145
150
|
| `neos_delete_node` | Remove a node |
|
|
151
|
+
| `neos_create_node_variant` | Create a variant of a node in another content dimension (e.g. a translation, when the dimension is a language), as a copy or empty |
|
|
146
152
|
|
|
147
153
|
Property values are passed to the bridge unchanged and resolved there against the NodeType's property type:
|
|
148
154
|
|
|
@@ -183,6 +189,26 @@ Optional: `filename` (overrides the name taken from the path or URL), `title`, `
|
|
|
183
189
|
| `neos_list_pending_changes` | See what has been changed |
|
|
184
190
|
| `neos_publish_changes` | Publish all changes to live |
|
|
185
191
|
|
|
192
|
+
### Multi-site
|
|
193
|
+
|
|
194
|
+
A Neos instance can host several sites. Without further input the tools work on the instance's default site. `neos_list_sites` shows all sites; pass a site node name as `site` to:
|
|
195
|
+
|
|
196
|
+
- `neos_get_site_context` and `neos_list_pages`: context and page tree of that site,
|
|
197
|
+
- `neos_list_pending_changes`: only the changes of that site (without `site`, each change shows its site),
|
|
198
|
+
- `neos_publish_changes`: publish only that site's changes. **Without `site`, the changes of all sites go live.**
|
|
199
|
+
|
|
200
|
+
Tools that work by node id (page content, create, update, move, delete) reach nodes of every site; preview links use the domain of the page's own site. One token covers all sites of an instance.
|
|
201
|
+
|
|
202
|
+
### Content dimensions
|
|
203
|
+
|
|
204
|
+
A site can have content dimensions, such as a language or a country; several dimensions can be combined. `neos_get_site_context` lists them under `dimensions`, with the default value and the fallback chain of each value (for example `en_UK` shows `en_US`). Without further input the tools work in the default dimensions. Pass `dimensions`, for example `{"language": "nl"}`, to `neos_list_pages`, `neos_get_page_content`, `neos_get_document_properties` and to all writing tools to work in another dimension. Dimensions you leave out keep their default.
|
|
205
|
+
|
|
206
|
+
- Nodes in the results show the `dimensions` they are stored in and `fallback: true` when they are only visible here through a dimension fallback.
|
|
207
|
+
- A node that only exists in another dimension (shown through a fallback) cannot be changed or moved in the requested dimension: the bridge answers with a 409. Create a variant first with `neos_create_node_variant` (`mode: "copy"` starts from the source content, `mode: "empty"` without properties and content). The parent has to exist in the target dimension, so create variants top-down.
|
|
208
|
+
- `neos_delete_node` with `dimensions` removes only the variant in those dimensions. On Neos 8 a node that is only shown through a fallback is refused; on Neos 9 it is removed from the requested dimension (and its specializations) and stays in the dimension it is stored in.
|
|
209
|
+
- `neos_get_preview_url` with `dimensions` returns a link to the page in those dimensions, including the URL prefix the site uses for them.
|
|
210
|
+
- `neos_list_pending_changes` shows the `dimensions` of each change and can be limited to some. `neos_publish_changes` without `dimensions` publishes the changes of all dimensions; with `dimensions` only the changes made in those. Neos 9 publishes whole nodes, so a node that also changed in another dimension is skipped and reported under `skippedNodes`; Neos 8 publishes the variants of the requested dimensions separately, so a new variant can go live before its counterpart in another dimension.
|
|
211
|
+
|
|
186
212
|
### Entity management
|
|
187
213
|
|
|
188
214
|
If the Neos installation exposes custom Doctrine entities (see [bridge documentation](https://github.com/UpAssist/neos-mcp#entity-crud-advanced)), these tools are also available:
|
package/dist/index.js
CHANGED
|
@@ -21066,10 +21066,12 @@ async function callBridge(action, method, params = {}) {
|
|
|
21066
21066
|
function registerGetSiteContext(server) {
|
|
21067
21067
|
server.tool(
|
|
21068
21068
|
"neos_get_site_context",
|
|
21069
|
-
|
|
21070
|
-
{
|
|
21071
|
-
|
|
21072
|
-
|
|
21069
|
+
'Get the site context: site name, available content NodeTypes with their properties, current page tree, and editorial workflow instructions. Always call this first at the start of any Neos content editing session. On a multi-site instance "sites" lists all sites; pass "site" to get the context of another site than the default one. The "dimensions" in the result list the content dimensions (for example language or country) with their default and fallback chains; pass "dimensions" to the other tools to work in one of them.',
|
|
21070
|
+
{
|
|
21071
|
+
site: external_exports.string().optional().describe("Site node name (see neos_list_sites). Defaults to the default site of the instance.")
|
|
21072
|
+
},
|
|
21073
|
+
async ({ site }) => {
|
|
21074
|
+
const data = await callBridge("getSiteContext", "GET", { site });
|
|
21073
21075
|
if (data && typeof data === "object" && "apiVersion" in data && data.apiVersion === 2) {
|
|
21074
21076
|
setApiVersion(2);
|
|
21075
21077
|
} else {
|
|
@@ -21080,6 +21082,19 @@ function registerGetSiteContext(server) {
|
|
|
21080
21082
|
);
|
|
21081
21083
|
}
|
|
21082
21084
|
|
|
21085
|
+
// src/tools/listSites.ts
|
|
21086
|
+
function registerListSites(server) {
|
|
21087
|
+
server.tool(
|
|
21088
|
+
"neos_list_sites",
|
|
21089
|
+
'List all sites of the Neos instance: name, node name, online state, domains and which one is the default site. Pass a site node name as "site" to neos_get_site_context, neos_list_pages, neos_list_pending_changes and neos_publish_changes to work on a site other than the default one.',
|
|
21090
|
+
{},
|
|
21091
|
+
async () => {
|
|
21092
|
+
const data = await callBridge("listSites", "GET");
|
|
21093
|
+
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|
|
21094
|
+
}
|
|
21095
|
+
);
|
|
21096
|
+
}
|
|
21097
|
+
|
|
21083
21098
|
// src/tools/setupWorkspace.ts
|
|
21084
21099
|
function registerSetupWorkspace(server) {
|
|
21085
21100
|
server.tool(
|
|
@@ -21093,16 +21108,48 @@ function registerSetupWorkspace(server) {
|
|
|
21093
21108
|
);
|
|
21094
21109
|
}
|
|
21095
21110
|
|
|
21111
|
+
// src/dimensions.ts
|
|
21112
|
+
var DIMENSIONS_HINT = 'Content dimensions as an object, e.g. {"language":"nl"} or {"language":"nl","country":"be"} (see "dimensions" in neos_get_site_context for the available values). Dimensions you leave out keep their default value; without this argument the default dimensions are used.';
|
|
21113
|
+
function dimensionsSchema(extra = "") {
|
|
21114
|
+
return external_exports.record(external_exports.string()).optional().describe(DIMENSIONS_HINT + (extra ? " " + extra : ""));
|
|
21115
|
+
}
|
|
21116
|
+
var dimensionSupportConfirmed = false;
|
|
21117
|
+
async function assertDimensionSupport() {
|
|
21118
|
+
if (dimensionSupportConfirmed) return;
|
|
21119
|
+
let context;
|
|
21120
|
+
try {
|
|
21121
|
+
context = await callBridge("getSiteContext", "GET");
|
|
21122
|
+
} catch (error2) {
|
|
21123
|
+
const reason = error2 instanceof Error ? error2.message : String(error2);
|
|
21124
|
+
throw new Error(
|
|
21125
|
+
`Not executed: could not confirm that the bridge supports content dimensions (${reason}).`
|
|
21126
|
+
);
|
|
21127
|
+
}
|
|
21128
|
+
if (!context || typeof context !== "object" || !Array.isArray(context.dimensions)) {
|
|
21129
|
+
throw new Error(
|
|
21130
|
+
'Not executed: this bridge does not support content dimensions and would use the default dimensions instead. Update the bridge (upassist/neos-mcp 2.4+ for Neos 9, 1.3+ for Neos 8) or leave out "dimensions".'
|
|
21131
|
+
);
|
|
21132
|
+
}
|
|
21133
|
+
dimensionSupportConfirmed = true;
|
|
21134
|
+
}
|
|
21135
|
+
async function dimensionsParam(dimensions, key = "dimensions") {
|
|
21136
|
+
if (!dimensions || Object.keys(dimensions).length === 0) return {};
|
|
21137
|
+
await assertDimensionSupport();
|
|
21138
|
+
return { [key]: JSON.stringify(dimensions) };
|
|
21139
|
+
}
|
|
21140
|
+
|
|
21096
21141
|
// src/tools/listPages.ts
|
|
21097
21142
|
function registerListPages(server) {
|
|
21098
21143
|
server.tool(
|
|
21099
21144
|
"neos_list_pages",
|
|
21100
21145
|
"List all document nodes (pages) in the Neos CMS site as a flat tree with paths and titles.",
|
|
21101
21146
|
{
|
|
21102
|
-
workspace: external_exports.string().default("mcp").describe('Workspace name. Use "live" for published content, "mcp" for staged changes.')
|
|
21147
|
+
workspace: external_exports.string().default("mcp").describe('Workspace name. Use "live" for published content, "mcp" for staged changes.'),
|
|
21148
|
+
site: external_exports.string().optional().describe("Site node name (see neos_list_sites). Defaults to the default site of the instance."),
|
|
21149
|
+
dimensions: dimensionsSchema('Pages that only exist in another dimension and are shown through a fallback have "fallback": true.')
|
|
21103
21150
|
},
|
|
21104
|
-
async ({ workspace }) => {
|
|
21105
|
-
const data = await callBridge("listPages", "GET", { workspace });
|
|
21151
|
+
async ({ workspace, site, dimensions }) => {
|
|
21152
|
+
const data = await callBridge("listPages", "GET", { workspace, site, ...await dimensionsParam(dimensions) });
|
|
21106
21153
|
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|
|
21107
21154
|
}
|
|
21108
21155
|
);
|
|
@@ -21115,10 +21162,11 @@ function registerGetPageContent(server) {
|
|
|
21115
21162
|
"Get all content nodes on a specific page with their properties. Call neos_get_site_context first if you have not already done so this session.",
|
|
21116
21163
|
{
|
|
21117
21164
|
node_id: external_exports.string().describe("Node identifier \u2014 use the nodeAggregateId (Neos 9) or path (Neos 8) from neos_get_site_context / neos_list_pages"),
|
|
21118
|
-
workspace: external_exports.string().default("mcp").describe("Workspace name")
|
|
21165
|
+
workspace: external_exports.string().default("mcp").describe("Workspace name"),
|
|
21166
|
+
dimensions: dimensionsSchema()
|
|
21119
21167
|
},
|
|
21120
|
-
async ({ node_id, workspace }) => {
|
|
21121
|
-
const data = await callBridge("getPageContent", "GET", { ...await nodeIdParam("nodePath", node_id), workspace });
|
|
21168
|
+
async ({ node_id, workspace, dimensions }) => {
|
|
21169
|
+
const data = await callBridge("getPageContent", "GET", { ...await nodeIdParam("nodePath", node_id), workspace, ...await dimensionsParam(dimensions) });
|
|
21122
21170
|
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|
|
21123
21171
|
}
|
|
21124
21172
|
);
|
|
@@ -21131,10 +21179,11 @@ function registerGetDocumentProperties(server) {
|
|
|
21131
21179
|
"Get all properties of a document node (page) without its content nodes. Use this for SEO fields, meta data, and other document-level properties.",
|
|
21132
21180
|
{
|
|
21133
21181
|
node_id: external_exports.string().describe("Node identifier \u2014 use the nodeAggregateId (Neos 9) or path (Neos 8) from neos_get_site_context / neos_list_pages"),
|
|
21134
|
-
workspace: external_exports.string().default("mcp").describe('Workspace name. Use "live" for published content, "mcp" for staged changes.')
|
|
21182
|
+
workspace: external_exports.string().default("mcp").describe('Workspace name. Use "live" for published content, "mcp" for staged changes.'),
|
|
21183
|
+
dimensions: dimensionsSchema()
|
|
21135
21184
|
},
|
|
21136
|
-
async ({ node_id, workspace }) => {
|
|
21137
|
-
const data = await callBridge("getDocumentProperties", "GET", { ...await nodeIdParam("nodePath", node_id), workspace });
|
|
21185
|
+
async ({ node_id, workspace, dimensions }) => {
|
|
21186
|
+
const data = await callBridge("getDocumentProperties", "GET", { ...await nodeIdParam("nodePath", node_id), workspace, ...await dimensionsParam(dimensions) });
|
|
21138
21187
|
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|
|
21139
21188
|
}
|
|
21140
21189
|
);
|
|
@@ -21163,10 +21212,12 @@ function registerListPendingChanges(server) {
|
|
|
21163
21212
|
"neos_list_pending_changes",
|
|
21164
21213
|
"List all content changes staged in the MCP workspace that have not yet been published to live. Call this before neos_publish_changes to review what will go live.",
|
|
21165
21214
|
{
|
|
21166
|
-
workspace: external_exports.string().default("mcp").describe("Workspace name to check for pending changes")
|
|
21215
|
+
workspace: external_exports.string().default("mcp").describe("Workspace name to check for pending changes"),
|
|
21216
|
+
site: external_exports.string().optional().describe('Only list changes of this site (site node name, see neos_list_sites). Without it, changes of all sites are listed, each with its "site".'),
|
|
21217
|
+
dimensions: dimensionsSchema('Only list the changes made in these dimensions. Without it, the changes of all dimensions are listed, each with its "dimensions".')
|
|
21167
21218
|
},
|
|
21168
|
-
async ({ workspace }) => {
|
|
21169
|
-
const data = await callBridge("listPendingChanges", "GET", { workspace });
|
|
21219
|
+
async ({ workspace, site, dimensions }) => {
|
|
21220
|
+
const data = await callBridge("listPendingChanges", "GET", { workspace, site, ...await dimensionsParam(dimensions) });
|
|
21170
21221
|
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|
|
21171
21222
|
}
|
|
21172
21223
|
);
|
|
@@ -21179,10 +21230,11 @@ function registerGetPreviewUrl(server) {
|
|
|
21179
21230
|
"Generate a time-limited public preview URL for a page in the MCP workspace. The URL can be opened in any browser without logging into Neos \u2014 valid for 24 hours.",
|
|
21180
21231
|
{
|
|
21181
21232
|
node_id: external_exports.string().describe("Node identifier \u2014 use the nodeAggregateId (Neos 9) or path (Neos 8) from neos_list_pages"),
|
|
21182
|
-
workspace: external_exports.string().default("mcp").describe("Workspace to preview")
|
|
21233
|
+
workspace: external_exports.string().default("mcp").describe("Workspace to preview"),
|
|
21234
|
+
dimensions: dimensionsSchema("The preview URL shows the page in these dimensions, including the URL prefix the site uses for them (e.g. /nl).")
|
|
21183
21235
|
},
|
|
21184
|
-
async ({ node_id, workspace }) => {
|
|
21185
|
-
const data = await callBridge("getPreviewUrl", "GET", { ...await nodeIdParam("nodePath", node_id), workspace });
|
|
21236
|
+
async ({ node_id, workspace, dimensions }) => {
|
|
21237
|
+
const data = await callBridge("getPreviewUrl", "GET", { ...await nodeIdParam("nodePath", node_id), workspace, ...await dimensionsParam(dimensions) });
|
|
21186
21238
|
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|
|
21187
21239
|
}
|
|
21188
21240
|
);
|
|
@@ -21203,14 +21255,16 @@ function registerCreateContentNode(server) {
|
|
|
21203
21255
|
properties: external_exports.record(external_exports.unknown()).default({}).describe(
|
|
21204
21256
|
"Property key-value pairs to set on the new node. Use neos_list_node_types to see available properties. Values are resolved like in neos_update_node_property (asset identifiers, link URIs or { href, \u2026 } objects)."
|
|
21205
21257
|
),
|
|
21206
|
-
workspace: external_exports.string().default("mcp").describe("Draft workspace name")
|
|
21258
|
+
workspace: external_exports.string().default("mcp").describe("Draft workspace name"),
|
|
21259
|
+
dimensions: dimensionsSchema("The content is created in these dimensions; the parent has to exist there.")
|
|
21207
21260
|
},
|
|
21208
|
-
async ({ parent_id, node_type, properties, workspace }) => {
|
|
21261
|
+
async ({ parent_id, node_type, properties, workspace, dimensions }) => {
|
|
21209
21262
|
const data = await callBridge("createContentNode", "POST", {
|
|
21210
21263
|
...await nodeIdParam("parentPath", parent_id),
|
|
21211
21264
|
nodeType: node_type,
|
|
21212
21265
|
properties,
|
|
21213
|
-
workspace
|
|
21266
|
+
workspace,
|
|
21267
|
+
...await dimensionsParam(dimensions)
|
|
21214
21268
|
});
|
|
21215
21269
|
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|
|
21216
21270
|
}
|
|
@@ -21230,14 +21284,16 @@ function registerUpdateNodeProperty(server) {
|
|
|
21230
21284
|
value: external_exports.unknown().describe(
|
|
21231
21285
|
'New property value (string, number, boolean, or object). Image/asset properties: the asset identifier. Link properties (type Neos\\Neos\\Domain\\Link\\Link): a URI string such as "node://<nodeAggregateId>", "asset://<id>" or "https://\u2026", or an object { href, title?, target?, rel?, download? }; an empty string clears the link. A node:// target must exist in the workspace (check with neos_list_pages), otherwise the write is rejected.'
|
|
21232
21286
|
),
|
|
21233
|
-
workspace: external_exports.string().default("mcp").describe("Workspace to write to")
|
|
21287
|
+
workspace: external_exports.string().default("mcp").describe("Workspace to write to"),
|
|
21288
|
+
dimensions: dimensionsSchema("The property is changed in exactly these dimensions; a node that only exists in another dimension is refused, create a variant first with neos_create_node_variant.")
|
|
21234
21289
|
},
|
|
21235
|
-
async ({ node_id, property, value, workspace }) => {
|
|
21290
|
+
async ({ node_id, property, value, workspace, dimensions }) => {
|
|
21236
21291
|
const data = await callBridge("updateNodeProperty", "POST", {
|
|
21237
21292
|
...await nodeIdParam("contextPath", node_id),
|
|
21238
21293
|
property,
|
|
21239
21294
|
value,
|
|
21240
|
-
workspace
|
|
21295
|
+
workspace,
|
|
21296
|
+
...await dimensionsParam(dimensions)
|
|
21241
21297
|
});
|
|
21242
21298
|
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|
|
21243
21299
|
}
|
|
@@ -21248,15 +21304,17 @@ function registerUpdateNodeProperty(server) {
|
|
|
21248
21304
|
function registerDeleteNode(server) {
|
|
21249
21305
|
server.tool(
|
|
21250
21306
|
"neos_delete_node",
|
|
21251
|
-
|
|
21307
|
+
'Mark a content node as removed in the mcp workspace. The deletion is staged and will only go live after neos_publish_changes is called. With "dimensions" only the variant in those dimensions is removed, the variants in other dimensions stay. Neos 8 refuses a node that is only shown through a fallback; Neos 9 then removes the page from the requested dimension (and its specializations) only, the page stays in the dimension it is stored in.',
|
|
21252
21308
|
{
|
|
21253
21309
|
node_id: external_exports.string().describe("Node identifier \u2014 use nodeAggregateId (Neos 9) or contextPath/path (Neos 8)"),
|
|
21254
|
-
workspace: external_exports.string().default("mcp").describe("Workspace to operate in")
|
|
21310
|
+
workspace: external_exports.string().default("mcp").describe("Workspace to operate in"),
|
|
21311
|
+
dimensions: dimensionsSchema()
|
|
21255
21312
|
},
|
|
21256
|
-
async ({ node_id, workspace }) => {
|
|
21313
|
+
async ({ node_id, workspace, dimensions }) => {
|
|
21257
21314
|
const data = await callBridge("deleteNode", "POST", {
|
|
21258
21315
|
...await nodeIdParam("contextPath", node_id),
|
|
21259
|
-
workspace
|
|
21316
|
+
workspace,
|
|
21317
|
+
...await dimensionsParam(dimensions)
|
|
21260
21318
|
});
|
|
21261
21319
|
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|
|
21262
21320
|
}
|
|
@@ -21267,12 +21325,24 @@ function registerDeleteNode(server) {
|
|
|
21267
21325
|
function registerPublishChanges(server) {
|
|
21268
21326
|
server.tool(
|
|
21269
21327
|
"neos_publish_changes",
|
|
21270
|
-
|
|
21328
|
+
'Publish all pending changes from the mcp workspace to live. This is irreversible. Always call neos_list_pending_changes first and confirm with the user before publishing. On a multi-site instance, pass "site" to publish only the changes of that site; without it, the changes of all sites go live. Without "dimensions" the changes of all content dimensions go live; with "dimensions" only the changes made in those dimensions (on Neos 9 a node that also changed in another dimension is skipped and listed in skippedNodes, because Neos publishes whole nodes).',
|
|
21271
21329
|
{
|
|
21272
|
-
workspace: external_exports.string().default("mcp").describe("Workspace to publish from")
|
|
21330
|
+
workspace: external_exports.string().default("mcp").describe("Workspace to publish from"),
|
|
21331
|
+
site: external_exports.string().optional().describe("Only publish changes of this site (site node name, see neos_list_sites). Without it, all pending changes of all sites are published."),
|
|
21332
|
+
dimensions: dimensionsSchema("Only publish the changes made in these dimensions. Without it, the changes of all dimensions go live.")
|
|
21273
21333
|
},
|
|
21274
|
-
async ({ workspace }) => {
|
|
21275
|
-
|
|
21334
|
+
async ({ workspace, site, dimensions }) => {
|
|
21335
|
+
if (site) {
|
|
21336
|
+
try {
|
|
21337
|
+
await callBridge("listSites", "GET");
|
|
21338
|
+
} catch (error2) {
|
|
21339
|
+
const reason = error2 instanceof Error ? error2.message : String(error2);
|
|
21340
|
+
throw new Error(
|
|
21341
|
+
`Not published: could not confirm that the bridge supports multi-site (${reason}). A bridge without multi-site support would publish the changes of all sites. Update the bridge (upassist/neos-mcp 2.3+ for Neos 9, 1.2+ for Neos 8) or publish without "site" if that is what you want.`
|
|
21342
|
+
);
|
|
21343
|
+
}
|
|
21344
|
+
}
|
|
21345
|
+
const data = await callBridge("publishChanges", "POST", { workspace, site, ...await dimensionsParam(dimensions) });
|
|
21276
21346
|
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|
|
21277
21347
|
}
|
|
21278
21348
|
);
|
|
@@ -21302,9 +21372,10 @@ function registerCreateDocumentNode(server) {
|
|
|
21302
21372
|
),
|
|
21303
21373
|
insert_after: external_exports.string().optional().describe(
|
|
21304
21374
|
"Sibling node identifier \u2014 insert the new page after this sibling"
|
|
21305
|
-
)
|
|
21375
|
+
),
|
|
21376
|
+
dimensions: dimensionsSchema("The page is created in these dimensions; the parent has to exist there.")
|
|
21306
21377
|
},
|
|
21307
|
-
async ({ parent_id, node_type, properties, workspace, node_name, insert_before, insert_after }) => {
|
|
21378
|
+
async ({ parent_id, node_type, properties, workspace, node_name, insert_before, insert_after, dimensions }) => {
|
|
21308
21379
|
const data = await callBridge("createDocumentNode", "POST", {
|
|
21309
21380
|
...await nodeIdParam("parentPath", parent_id),
|
|
21310
21381
|
nodeType: node_type,
|
|
@@ -21312,7 +21383,8 @@ function registerCreateDocumentNode(server) {
|
|
|
21312
21383
|
workspace,
|
|
21313
21384
|
nodeName: node_name ?? "",
|
|
21314
21385
|
insertBefore: insert_before ?? "",
|
|
21315
|
-
insertAfter: insert_after ?? ""
|
|
21386
|
+
insertAfter: insert_after ?? "",
|
|
21387
|
+
...await dimensionsParam(dimensions)
|
|
21316
21388
|
});
|
|
21317
21389
|
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|
|
21318
21390
|
}
|
|
@@ -21337,14 +21409,49 @@ function registerMoveNode(server) {
|
|
|
21337
21409
|
new_parent_id: external_exports.string().optional().describe(
|
|
21338
21410
|
"New parent node identifier \u2014 move into this parent (as last child)"
|
|
21339
21411
|
),
|
|
21340
|
-
workspace: external_exports.string().default("mcp").describe("Draft workspace name")
|
|
21412
|
+
workspace: external_exports.string().default("mcp").describe("Draft workspace name"),
|
|
21413
|
+
dimensions: dimensionsSchema()
|
|
21341
21414
|
},
|
|
21342
|
-
async ({ node_id, insert_before, insert_after, new_parent_id, workspace }) => {
|
|
21415
|
+
async ({ node_id, insert_before, insert_after, new_parent_id, workspace, dimensions }) => {
|
|
21343
21416
|
const data = await callBridge("moveNode", "POST", {
|
|
21344
21417
|
...await nodeIdParam("contextPath", node_id),
|
|
21345
21418
|
...await nodeIdParam("newParentPath", new_parent_id ?? ""),
|
|
21346
21419
|
insertBefore: insert_before ?? "",
|
|
21347
21420
|
insertAfter: insert_after ?? "",
|
|
21421
|
+
workspace,
|
|
21422
|
+
...await dimensionsParam(dimensions)
|
|
21423
|
+
});
|
|
21424
|
+
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|
|
21425
|
+
}
|
|
21426
|
+
);
|
|
21427
|
+
}
|
|
21428
|
+
|
|
21429
|
+
// src/tools/createNodeVariant.ts
|
|
21430
|
+
function registerCreateNodeVariant(server) {
|
|
21431
|
+
server.tool(
|
|
21432
|
+
"neos_create_node_variant",
|
|
21433
|
+
'Create a variant of a page or content node in another content dimension (for example a translation when the dimension is a language), starting from the node as it exists in the source dimensions. Use mode "copy" to start from the source content, or "empty" for a variant without properties and content. The parent has to exist in the target dimensions first: create variants top-down. Writes to the mcp workspace. Needed before you can change a node that is only shown in the target dimensions through a fallback.',
|
|
21434
|
+
{
|
|
21435
|
+
node_id: external_exports.string().describe(
|
|
21436
|
+
"Node identifier \u2014 use nodeAggregateId (Neos 9) or contextPath/path (Neos 8)"
|
|
21437
|
+
),
|
|
21438
|
+
dimensions: external_exports.record(external_exports.string()).describe(
|
|
21439
|
+
'Target dimensions the variant is created in, e.g. {"language":"nl"}, several dimensions can be combined (see "dimensions" in neos_get_site_context)'
|
|
21440
|
+
),
|
|
21441
|
+
source_dimensions: external_exports.record(external_exports.string()).optional().describe(
|
|
21442
|
+
"Dimensions of the node to start from. Defaults to the default dimensions."
|
|
21443
|
+
),
|
|
21444
|
+
mode: external_exports.enum(["copy", "empty"]).default("copy").describe(
|
|
21445
|
+
'"copy": copy properties and content from the source. "empty": no properties (except the URL segment) and no content.'
|
|
21446
|
+
),
|
|
21447
|
+
workspace: external_exports.string().default("mcp").describe("Draft workspace name")
|
|
21448
|
+
},
|
|
21449
|
+
async ({ node_id, dimensions, source_dimensions, mode, workspace }) => {
|
|
21450
|
+
const data = await callBridge("createNodeVariant", "POST", {
|
|
21451
|
+
...await nodeIdParam("contextPath", node_id),
|
|
21452
|
+
...await dimensionsParam(dimensions),
|
|
21453
|
+
...await dimensionsParam(source_dimensions, "sourceDimensions"),
|
|
21454
|
+
mode,
|
|
21348
21455
|
workspace
|
|
21349
21456
|
});
|
|
21350
21457
|
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|
|
@@ -21563,6 +21670,7 @@ function createServer() {
|
|
|
21563
21670
|
version: "0.1.0"
|
|
21564
21671
|
});
|
|
21565
21672
|
registerGetSiteContext(server);
|
|
21673
|
+
registerListSites(server);
|
|
21566
21674
|
registerSetupWorkspace(server);
|
|
21567
21675
|
registerListPages(server);
|
|
21568
21676
|
registerGetPageContent(server);
|
|
@@ -21576,6 +21684,7 @@ function createServer() {
|
|
|
21576
21684
|
registerPublishChanges(server);
|
|
21577
21685
|
registerCreateDocumentNode(server);
|
|
21578
21686
|
registerMoveNode(server);
|
|
21687
|
+
registerCreateNodeVariant(server);
|
|
21579
21688
|
registerRestart(server);
|
|
21580
21689
|
registerListAssets(server);
|
|
21581
21690
|
registerListAssetTags(server);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@upassist/neos-mcp",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"description": "MCP server for Neos CMS — connects AI assistants to any UpAssist.Neos.Mcp bridge",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bin": {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
27
|
-
"zod": "^3.
|
|
27
|
+
"zod": "^3.25.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@types/node": "^20.0.0",
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { z } from 'zod/v3';
|
|
2
|
+
import { callBridge } from './bridge.js';
|
|
3
|
+
|
|
4
|
+
const DIMENSIONS_HINT =
|
|
5
|
+
'Content dimensions as an object, e.g. {"language":"nl"} or {"language":"nl","country":"be"} (see "dimensions" in neos_get_site_context for the available values). ' +
|
|
6
|
+
'Dimensions you leave out keep their default value; without this argument the default dimensions are used.';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Optional "dimensions" tool argument, shared by all tools that work on node content.
|
|
10
|
+
* `extra` is appended to the description for tool specific behaviour.
|
|
11
|
+
*/
|
|
12
|
+
export function dimensionsSchema(extra = '') {
|
|
13
|
+
return z.record(z.string()).optional().describe(DIMENSIONS_HINT + (extra ? ' ' + extra : ''));
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
let dimensionSupportConfirmed = false;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* A bridge without content dimension support ignores the "dimensions" argument and would read or
|
|
20
|
+
* write the default dimensions instead. That is wrong for every call, and for writes it changes
|
|
21
|
+
* the wrong content, so only go ahead when the bridge reports the dimensions it knows.
|
|
22
|
+
*/
|
|
23
|
+
export async function assertDimensionSupport(): Promise<void> {
|
|
24
|
+
if (dimensionSupportConfirmed) return;
|
|
25
|
+
let context: unknown;
|
|
26
|
+
try {
|
|
27
|
+
context = await callBridge('getSiteContext', 'GET');
|
|
28
|
+
} catch (error) {
|
|
29
|
+
const reason = error instanceof Error ? error.message : String(error);
|
|
30
|
+
throw new Error(
|
|
31
|
+
`Not executed: could not confirm that the bridge supports content dimensions (${reason}).`
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
if (!context || typeof context !== 'object' || !Array.isArray((context as { dimensions?: unknown }).dimensions)) {
|
|
35
|
+
throw new Error(
|
|
36
|
+
'Not executed: this bridge does not support content dimensions and would use the default dimensions instead. ' +
|
|
37
|
+
'Update the bridge (upassist/neos-mcp 2.4+ for Neos 9, 1.3+ for Neos 8) or leave out "dimensions".'
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
dimensionSupportConfirmed = true;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Bridge parameters for the "dimensions" argument: nothing when not given, otherwise the
|
|
45
|
+
* dimensions as a JSON string (the bridge accepts it in GET queries and POST bodies alike).
|
|
46
|
+
* Refuses when the bridge has no dimension support.
|
|
47
|
+
*/
|
|
48
|
+
export async function dimensionsParam(
|
|
49
|
+
dimensions: Record<string, string> | undefined,
|
|
50
|
+
key = 'dimensions'
|
|
51
|
+
): Promise<Record<string, string>> {
|
|
52
|
+
if (!dimensions || Object.keys(dimensions).length === 0) return {};
|
|
53
|
+
await assertDimensionSupport();
|
|
54
|
+
return { [key]: JSON.stringify(dimensions) };
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** Test helper: forget a confirmed bridge so the next call checks again. */
|
|
58
|
+
export function resetDimensionSupport(): void {
|
|
59
|
+
dimensionSupportConfirmed = false;
|
|
60
|
+
}
|
package/src/server.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
2
|
import { registerGetSiteContext } from './tools/getSiteContext.js';
|
|
3
|
+
import { registerListSites } from './tools/listSites.js';
|
|
3
4
|
import { registerSetupWorkspace } from './tools/setupWorkspace.js';
|
|
4
5
|
import { registerListPages } from './tools/listPages.js';
|
|
5
6
|
import { registerGetPageContent } from './tools/getPageContent.js';
|
|
@@ -13,6 +14,7 @@ import { registerDeleteNode } from './tools/deleteNode.js';
|
|
|
13
14
|
import { registerPublishChanges } from './tools/publishChanges.js';
|
|
14
15
|
import { registerCreateDocumentNode } from './tools/createDocumentNode.js';
|
|
15
16
|
import { registerMoveNode } from './tools/moveNode.js';
|
|
17
|
+
import { registerCreateNodeVariant } from './tools/createNodeVariant.js';
|
|
16
18
|
import { registerRestart } from './tools/restart.js';
|
|
17
19
|
import { registerListAssets } from './tools/listAssets.js';
|
|
18
20
|
import { registerListAssetTags } from './tools/listAssetTags.js';
|
|
@@ -26,6 +28,7 @@ export function createServer(): McpServer {
|
|
|
26
28
|
});
|
|
27
29
|
|
|
28
30
|
registerGetSiteContext(server);
|
|
31
|
+
registerListSites(server);
|
|
29
32
|
registerSetupWorkspace(server);
|
|
30
33
|
registerListPages(server);
|
|
31
34
|
registerGetPageContent(server);
|
|
@@ -39,6 +42,7 @@ export function createServer(): McpServer {
|
|
|
39
42
|
registerPublishChanges(server);
|
|
40
43
|
registerCreateDocumentNode(server);
|
|
41
44
|
registerMoveNode(server);
|
|
45
|
+
registerCreateNodeVariant(server);
|
|
42
46
|
registerRestart(server);
|
|
43
47
|
registerListAssets(server);
|
|
44
48
|
registerListAssetTags(server);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
-
import { z } from 'zod';
|
|
2
|
+
import { z } from 'zod/v3';
|
|
3
3
|
import { callBridge, nodeIdParam } from '../bridge.js';
|
|
4
|
+
import { dimensionsSchema, dimensionsParam } from '../dimensions.js';
|
|
4
5
|
|
|
5
6
|
export function registerCreateContentNode(server: McpServer): void {
|
|
6
7
|
server.tool(
|
|
@@ -18,13 +19,15 @@ export function registerCreateContentNode(server: McpServer): void {
|
|
|
18
19
|
'Values are resolved like in neos_update_node_property (asset identifiers, link URIs or { href, … } objects).'
|
|
19
20
|
),
|
|
20
21
|
workspace: z.string().default('mcp').describe('Draft workspace name'),
|
|
22
|
+
dimensions: dimensionsSchema('The content is created in these dimensions; the parent has to exist there.'),
|
|
21
23
|
},
|
|
22
|
-
async ({ parent_id, node_type, properties, workspace }) => {
|
|
24
|
+
async ({ parent_id, node_type, properties, workspace, dimensions }) => {
|
|
23
25
|
const data = await callBridge('createContentNode', 'POST', {
|
|
24
26
|
...await nodeIdParam('parentPath', parent_id),
|
|
25
27
|
nodeType: node_type,
|
|
26
28
|
properties,
|
|
27
29
|
workspace,
|
|
30
|
+
...await dimensionsParam(dimensions),
|
|
28
31
|
});
|
|
29
32
|
return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
|
|
30
33
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
-
import { z } from 'zod';
|
|
2
|
+
import { z } from 'zod/v3';
|
|
3
3
|
import { callBridge, nodeIdParam } from '../bridge.js';
|
|
4
|
+
import { dimensionsSchema, dimensionsParam } from '../dimensions.js';
|
|
4
5
|
|
|
5
6
|
export function registerCreateDocumentNode(server: McpServer): void {
|
|
6
7
|
server.tool(
|
|
@@ -29,8 +30,9 @@ export function registerCreateDocumentNode(server: McpServer): void {
|
|
|
29
30
|
insert_after: z.string().optional().describe(
|
|
30
31
|
'Sibling node identifier — insert the new page after this sibling'
|
|
31
32
|
),
|
|
33
|
+
dimensions: dimensionsSchema('The page is created in these dimensions; the parent has to exist there.'),
|
|
32
34
|
},
|
|
33
|
-
async ({ parent_id, node_type, properties, workspace, node_name, insert_before, insert_after }) => {
|
|
35
|
+
async ({ parent_id, node_type, properties, workspace, node_name, insert_before, insert_after, dimensions }) => {
|
|
34
36
|
const data = await callBridge('createDocumentNode', 'POST', {
|
|
35
37
|
...await nodeIdParam('parentPath', parent_id),
|
|
36
38
|
nodeType: node_type,
|
|
@@ -39,6 +41,7 @@ export function registerCreateDocumentNode(server: McpServer): void {
|
|
|
39
41
|
nodeName: node_name ?? '',
|
|
40
42
|
insertBefore: insert_before ?? '',
|
|
41
43
|
insertAfter: insert_after ?? '',
|
|
44
|
+
...await dimensionsParam(dimensions),
|
|
42
45
|
});
|
|
43
46
|
return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
|
|
44
47
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
+
import { z } from 'zod/v3';
|
|
3
|
+
import { callBridge, nodeIdParam } from '../bridge.js';
|
|
4
|
+
import { dimensionsParam } from '../dimensions.js';
|
|
5
|
+
|
|
6
|
+
export function registerCreateNodeVariant(server: McpServer): void {
|
|
7
|
+
server.tool(
|
|
8
|
+
'neos_create_node_variant',
|
|
9
|
+
'Create a variant of a page or content node in another content dimension (for example a translation when the dimension is a language), starting from the node as it exists in the source dimensions. ' +
|
|
10
|
+
'Use mode "copy" to start from the source content, or "empty" for a variant without properties and content. ' +
|
|
11
|
+
'The parent has to exist in the target dimensions first: create variants top-down. ' +
|
|
12
|
+
'Writes to the mcp workspace. Needed before you can change a node that is only shown in the target dimensions through a fallback.',
|
|
13
|
+
{
|
|
14
|
+
node_id: z.string().describe(
|
|
15
|
+
'Node identifier — use nodeAggregateId (Neos 9) or contextPath/path (Neos 8)'
|
|
16
|
+
),
|
|
17
|
+
dimensions: z.record(z.string()).describe(
|
|
18
|
+
'Target dimensions the variant is created in, e.g. {"language":"nl"}, several dimensions can be combined (see "dimensions" in neos_get_site_context)'
|
|
19
|
+
),
|
|
20
|
+
source_dimensions: z.record(z.string()).optional().describe(
|
|
21
|
+
'Dimensions of the node to start from. Defaults to the default dimensions.'
|
|
22
|
+
),
|
|
23
|
+
mode: z.enum(['copy', 'empty']).default('copy').describe(
|
|
24
|
+
'"copy": copy properties and content from the source. "empty": no properties (except the URL segment) and no content.'
|
|
25
|
+
),
|
|
26
|
+
workspace: z.string().default('mcp').describe('Draft workspace name'),
|
|
27
|
+
},
|
|
28
|
+
async ({ node_id, dimensions, source_dimensions, mode, workspace }) => {
|
|
29
|
+
const data = await callBridge('createNodeVariant', 'POST', {
|
|
30
|
+
...await nodeIdParam('contextPath', node_id),
|
|
31
|
+
...await dimensionsParam(dimensions),
|
|
32
|
+
...await dimensionsParam(source_dimensions, 'sourceDimensions'),
|
|
33
|
+
mode,
|
|
34
|
+
workspace,
|
|
35
|
+
});
|
|
36
|
+
return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
}
|