@upassist/neos-mcp 1.0.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/package.json ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "@upassist/neos-mcp",
3
+ "version": "1.0.0",
4
+ "description": "MCP server for Neos CMS — connects AI assistants to any UpAssist.Neos.Mcp bridge",
5
+ "license": "MIT",
6
+ "bin": {
7
+ "neos-mcp": "dist/index.js"
8
+ },
9
+ "scripts": {
10
+ "build": "esbuild src/index.ts --bundle --platform=node --target=node20 --outfile=dist/index.js",
11
+ "typecheck": "tsc --noEmit",
12
+ "start": "node dist/index.js",
13
+ "dev": "node --import=tsx src/index.ts",
14
+ "release:prerelease": "npx standard-version -t '' -r patch --prerelease && git push --follow-tags",
15
+ "release:patch": "npx standard-version -t '' -r patch && git push --follow-tags",
16
+ "release:minor": "npx standard-version -t '' -r minor && git push --follow-tags",
17
+ "release:major": "npx standard-version -t '' -r major && git push --follow-tags",
18
+ "release": "yarn release:patch"
19
+ },
20
+ "engines": {
21
+ "node": ">=18.0.0"
22
+ },
23
+ "dependencies": {
24
+ "@modelcontextprotocol/sdk": "^1.0.0",
25
+ "zod": "^3.22.0"
26
+ },
27
+ "devDependencies": {
28
+ "@types/node": "^20.0.0",
29
+ "esbuild": "^0.27.4",
30
+ "ts-node": "^10.9.0",
31
+ "typescript": "^5.3.0"
32
+ }
33
+ }
package/src/bridge.ts ADDED
@@ -0,0 +1,58 @@
1
+ /**
2
+ * HTTP client to the UpAssist.Neos.Mcp bridge endpoint.
3
+ *
4
+ * Environment variables:
5
+ * NEOS_MCP_URL — Base URL, e.g. http://localhost:8081 or https://mysite.nl
6
+ * NEOS_MCP_TOKEN — Bearer token matching NEOS_MCP_BRIDGE_TOKEN on the server
7
+ */
8
+
9
+ const BASE_URL = (process.env.NEOS_MCP_URL ?? 'http://localhost:8081').replace(/\/$/, '');
10
+ const TOKEN = process.env.NEOS_MCP_TOKEN ?? '';
11
+
12
+ function getHeaders(): Record<string, string> {
13
+ return {
14
+ 'Authorization': `Bearer ${TOKEN}`,
15
+ 'Content-Type': 'application/json',
16
+ 'Accept': 'application/json',
17
+ };
18
+ }
19
+
20
+ export async function callBridge(
21
+ action: string,
22
+ method: 'GET' | 'POST',
23
+ params: Record<string, unknown> = {}
24
+ ): Promise<unknown> {
25
+ let url = `${BASE_URL}/neos/mcp/${action}`;
26
+ let body: string | undefined;
27
+
28
+ if (method === 'GET') {
29
+ const qs = Object.entries(params)
30
+ .filter(([, v]) => v !== undefined && v !== null)
31
+ .map(([k, v]) => `${encodeURIComponent(k)}=${encodeURIComponent(String(v))}`)
32
+ .join('&');
33
+ if (qs) url += `?${qs}`;
34
+ } else {
35
+ body = JSON.stringify(params);
36
+ }
37
+
38
+ const response = await fetch(url, {
39
+ method,
40
+ headers: getHeaders(),
41
+ body,
42
+ });
43
+
44
+ const text = await response.text();
45
+ let data: unknown;
46
+ try {
47
+ data = JSON.parse(text);
48
+ } catch {
49
+ throw new Error(`Bridge returned non-JSON response (${response.status}): ${text.slice(0, 200)}`);
50
+ }
51
+
52
+ if (!response.ok) {
53
+ const err = data as { error?: string };
54
+ throw new Error(`Bridge error ${response.status}: ${err?.error ?? text.slice(0, 200)}`);
55
+ }
56
+
57
+ return data;
58
+ }
package/src/index.ts ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env node
2
+ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
3
+ import { createServer } from './server.js';
4
+
5
+ async function main(): Promise<void> {
6
+ const server = createServer();
7
+ const transport = new StdioServerTransport();
8
+ await server.connect(transport);
9
+ }
10
+
11
+ main().catch((error: Error) => {
12
+ process.stderr.write(`Fatal: ${error.message}\n`);
13
+ process.exit(1);
14
+ });
package/src/server.ts ADDED
@@ -0,0 +1,47 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import { registerGetSiteContext } from './tools/getSiteContext.js';
3
+ import { registerSetupWorkspace } from './tools/setupWorkspace.js';
4
+ import { registerListPages } from './tools/listPages.js';
5
+ import { registerGetPageContent } from './tools/getPageContent.js';
6
+ import { registerGetDocumentProperties } from './tools/getDocumentProperties.js';
7
+ import { registerListNodeTypes } from './tools/listNodeTypes.js';
8
+ import { registerListPendingChanges } from './tools/listPendingChanges.js';
9
+ import { registerGetPreviewUrl } from './tools/getPreviewUrl.js';
10
+ import { registerCreateContentNode } from './tools/createContentNode.js';
11
+ import { registerUpdateNodeProperty } from './tools/updateNodeProperty.js';
12
+ import { registerDeleteNode } from './tools/deleteNode.js';
13
+ import { registerPublishChanges } from './tools/publishChanges.js';
14
+ import { registerCreateDocumentNode } from './tools/createDocumentNode.js';
15
+ import { registerMoveNode } from './tools/moveNode.js';
16
+ import { registerRestart } from './tools/restart.js';
17
+ import { registerListAssets } from './tools/listAssets.js';
18
+ import { registerListAssetTags } from './tools/listAssetTags.js';
19
+ import { registerEntityCrudTools } from './tools/entityCrud.js';
20
+
21
+ export function createServer(): McpServer {
22
+ const server = new McpServer({
23
+ name: 'neos-mcp',
24
+ version: '0.1.0',
25
+ });
26
+
27
+ registerGetSiteContext(server);
28
+ registerSetupWorkspace(server);
29
+ registerListPages(server);
30
+ registerGetPageContent(server);
31
+ registerGetDocumentProperties(server);
32
+ registerListNodeTypes(server);
33
+ registerListPendingChanges(server);
34
+ registerGetPreviewUrl(server);
35
+ registerCreateContentNode(server);
36
+ registerUpdateNodeProperty(server);
37
+ registerDeleteNode(server);
38
+ registerPublishChanges(server);
39
+ registerCreateDocumentNode(server);
40
+ registerMoveNode(server);
41
+ registerRestart(server);
42
+ registerListAssets(server);
43
+ registerListAssetTags(server);
44
+ registerEntityCrudTools(server);
45
+
46
+ return server;
47
+ }
@@ -0,0 +1,31 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import { z } from 'zod';
3
+ import { callBridge } from '../bridge.js';
4
+
5
+ export function registerCreateContentNode(server: McpServer): void {
6
+ server.tool(
7
+ 'neos_create_content_node',
8
+ 'Create a new content element inside a page\'s content collection. Call neos_get_site_context first if you have not already done so this session. Always writes to the mcp workspace.',
9
+ {
10
+ parent_path: z.string().describe(
11
+ 'Absolute path to the content collection node, e.g. /sites/ewijksolartechniek/over-ons/main'
12
+ ),
13
+ node_type: z.string().describe(
14
+ 'Node type name, e.g. UpAssist.EwijkSolarTechniek:Content.Headline'
15
+ ),
16
+ properties: z.record(z.unknown()).default({}).describe(
17
+ 'Property key-value pairs to set on the new node. Use neos_list_node_types to see available properties.'
18
+ ),
19
+ workspace: z.string().default('mcp').describe('Draft workspace name'),
20
+ },
21
+ async ({ parent_path, node_type, properties, workspace }) => {
22
+ const data = await callBridge('createContentNode', 'POST', {
23
+ parentPath: parent_path,
24
+ nodeType: node_type,
25
+ properties,
26
+ workspace,
27
+ });
28
+ return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
29
+ }
30
+ );
31
+ }
@@ -0,0 +1,45 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import { z } from 'zod';
3
+ import { callBridge } from '../bridge.js';
4
+
5
+ export function registerCreateDocumentNode(server: McpServer): void {
6
+ server.tool(
7
+ 'neos_create_document_node',
8
+ 'Create a new page (document node) as a child of a parent page. ' +
9
+ 'Call neos_get_site_context first to see available document NodeTypes and the page tree. ' +
10
+ 'Always writes to the mcp workspace.',
11
+ {
12
+ parent_path: z.string().describe(
13
+ 'Absolute path to the parent document node, e.g. /sites/ewijksolartechniek'
14
+ ),
15
+ node_type: z.string().describe(
16
+ 'Document node type name, e.g. UpAssist.EwijkSolarTechniek:Document.Page'
17
+ ),
18
+ properties: z.record(z.unknown()).default({}).describe(
19
+ 'Property key-value pairs, e.g. { title: "About us", uriPathSegment: "about-us" }'
20
+ ),
21
+ workspace: z.string().default('mcp').describe('Draft workspace name'),
22
+ node_name: z.string().optional().describe(
23
+ 'URL slug used as the node name (auto-generated from nodeType if omitted)'
24
+ ),
25
+ insert_before: z.string().optional().describe(
26
+ 'contextPath of a sibling node to insert the new page before'
27
+ ),
28
+ insert_after: z.string().optional().describe(
29
+ 'contextPath of a sibling node to insert the new page after'
30
+ ),
31
+ },
32
+ async ({ parent_path, node_type, properties, workspace, node_name, insert_before, insert_after }) => {
33
+ const data = await callBridge('createDocumentNode', 'POST', {
34
+ parentPath: parent_path,
35
+ nodeType: node_type,
36
+ properties,
37
+ workspace,
38
+ nodeName: node_name ?? '',
39
+ insertBefore: insert_before ?? '',
40
+ insertAfter: insert_after ?? '',
41
+ });
42
+ return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
43
+ }
44
+ );
45
+ }
@@ -0,0 +1,21 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import { z } from 'zod';
3
+ import { callBridge } from '../bridge.js';
4
+
5
+ export function registerDeleteNode(server: McpServer): void {
6
+ server.tool(
7
+ 'neos_delete_node',
8
+ '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.',
9
+ {
10
+ context_path: z.string().describe('Context path or node path of the node to delete'),
11
+ workspace: z.string().default('mcp').describe('Workspace to operate in'),
12
+ },
13
+ async ({ context_path, workspace }) => {
14
+ const data = await callBridge('deleteNode', 'POST', {
15
+ contextPath: context_path,
16
+ workspace,
17
+ });
18
+ return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
19
+ }
20
+ );
21
+ }
@@ -0,0 +1,105 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import { z } from 'zod';
3
+ import { callBridge } from '../bridge.js';
4
+
5
+ export function registerEntityCrudTools(server: McpServer): void {
6
+ server.tool(
7
+ 'neos_entity_discover',
8
+ 'Discover all Doctrine entities exposed via MCP. Returns entity schemas with fields, filters, and available actions. Call this first before using other entity tools.',
9
+ {},
10
+ async () => {
11
+ const data = await callBridge('entity/listEntities', 'GET');
12
+ return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
13
+ }
14
+ );
15
+
16
+ server.tool(
17
+ 'neos_entity_list',
18
+ 'List entities from a custom Doctrine table. Use neos_entity_discover first to see available entities and their filters.',
19
+ {
20
+ entity: z.string().describe('Entity key from neos_entity_discover, e.g. "notifications"'),
21
+ filter: z.string().default('').describe('Named filter from the entity schema, e.g. "active" or "byFilter"'),
22
+ filter_params: z.string().default('{}').describe('JSON object of filter parameters, e.g. {"filter":"draft","limit":10}'),
23
+ limit: z.number().default(50).describe('Max items to return'),
24
+ offset: z.number().default(0).describe('Pagination offset'),
25
+ },
26
+ async ({ entity, filter, filter_params, limit, offset }) => {
27
+ const data = await callBridge('entity/list', 'POST', {
28
+ entity,
29
+ filter,
30
+ filterParams: filter_params,
31
+ limit,
32
+ offset,
33
+ });
34
+ return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
35
+ }
36
+ );
37
+
38
+ server.tool(
39
+ 'neos_entity_show',
40
+ 'Get a single entity by its UUID identifier.',
41
+ {
42
+ entity: z.string().describe('Entity key, e.g. "notifications"'),
43
+ identifier: z.string().describe('UUID of the entity'),
44
+ },
45
+ async ({ entity, identifier }) => {
46
+ const data = await callBridge('entity/show', 'POST', { entity, identifier });
47
+ return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
48
+ }
49
+ );
50
+
51
+ server.tool(
52
+ 'neos_entity_create',
53
+ 'Create a new entity. Use neos_entity_discover to see required fields and their types. For markdown fields, pass raw markdown text.',
54
+ {
55
+ entity: z.string().describe('Entity key, e.g. "notifications"'),
56
+ properties: z.string().describe('JSON object of field values, e.g. {"title":"New notification","contentMarkdown":"**Hello** world"}'),
57
+ },
58
+ async ({ entity, properties }) => {
59
+ const data = await callBridge('entity/create', 'POST', { entity, properties });
60
+ return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
61
+ }
62
+ );
63
+
64
+ server.tool(
65
+ 'neos_entity_update',
66
+ 'Update an existing entity. Only pass the fields you want to change.',
67
+ {
68
+ entity: z.string().describe('Entity key, e.g. "notifications"'),
69
+ identifier: z.string().describe('UUID of the entity to update'),
70
+ properties: z.string().describe('JSON object of fields to update, e.g. {"title":"Updated title"}'),
71
+ },
72
+ async ({ entity, identifier, properties }) => {
73
+ const data = await callBridge('entity/update', 'POST', { entity, identifier, properties });
74
+ return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
75
+ }
76
+ );
77
+
78
+ server.tool(
79
+ 'neos_entity_delete',
80
+ 'Delete an entity by its UUID.',
81
+ {
82
+ entity: z.string().describe('Entity key, e.g. "notifications"'),
83
+ identifier: z.string().describe('UUID of the entity to delete'),
84
+ },
85
+ async ({ entity, identifier }) => {
86
+ const data = await callBridge('entity/delete', 'POST', { entity, identifier });
87
+ return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
88
+ }
89
+ );
90
+
91
+ server.tool(
92
+ 'neos_entity_action',
93
+ 'Execute a named action on an entity (e.g. publish, archive, unpublish). Use neos_entity_discover to see available actions.',
94
+ {
95
+ entity: z.string().describe('Entity key, e.g. "notifications"'),
96
+ action: z.string().describe('Action name from entity schema, e.g. "publish"'),
97
+ identifier: z.string().default('').describe('UUID of the entity (required if the action operates on a specific entity)'),
98
+ params: z.string().default('{}').describe('JSON object of additional action parameters'),
99
+ },
100
+ async ({ entity, action, identifier, params }) => {
101
+ const data = await callBridge('entity/execute', 'POST', { entity, action, identifier, params });
102
+ return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
103
+ }
104
+ );
105
+ }
@@ -0,0 +1,18 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import { z } from 'zod';
3
+ import { callBridge } from '../bridge.js';
4
+
5
+ export function registerGetDocumentProperties(server: McpServer): void {
6
+ server.tool(
7
+ 'neos_get_document_properties',
8
+ 'Get all properties of a document node (page) without its content nodes. Use this for SEO fields, meta data, and other document-level properties.',
9
+ {
10
+ node_path: z.string().describe('Absolute node path of the document, e.g. /sites/ewijksolartechniek/over-ons'),
11
+ workspace: z.string().default('mcp').describe('Workspace name. Use "live" for published content, "mcp" for staged changes.'),
12
+ },
13
+ async ({ node_path, workspace }) => {
14
+ const data = await callBridge('getDocumentProperties', 'GET', { nodePath: node_path, workspace });
15
+ return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
16
+ }
17
+ );
18
+ }
@@ -0,0 +1,18 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import { z } from 'zod';
3
+ import { callBridge } from '../bridge.js';
4
+
5
+ export function registerGetPageContent(server: McpServer): void {
6
+ server.tool(
7
+ 'neos_get_page_content',
8
+ '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.',
9
+ {
10
+ node_path: z.string().describe('Absolute node path of the document, e.g. /sites/ewijksolartechniek/over-ons'),
11
+ workspace: z.string().default('mcp').describe('Workspace name'),
12
+ },
13
+ async ({ node_path, workspace }) => {
14
+ const data = await callBridge('getPageContent', 'GET', { nodePath: node_path, workspace });
15
+ return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
16
+ }
17
+ );
18
+ }
@@ -0,0 +1,18 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import { z } from 'zod';
3
+ import { callBridge } from '../bridge.js';
4
+
5
+ export function registerGetPreviewUrl(server: McpServer): void {
6
+ server.tool(
7
+ 'neos_get_preview_url',
8
+ '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 — valid for 24 hours.',
9
+ {
10
+ node_path: z.string().describe('Absolute node path of the document to preview, e.g. /sites/ewijksolartechniek/over-ons'),
11
+ workspace: z.string().default('mcp').describe('Workspace to preview'),
12
+ },
13
+ async ({ node_path, workspace }) => {
14
+ const data = await callBridge('getPreviewUrl', 'GET', { nodePath: node_path, workspace });
15
+ return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
16
+ }
17
+ );
18
+ }
@@ -0,0 +1,14 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import { callBridge } from '../bridge.js';
3
+
4
+ export function registerGetSiteContext(server: McpServer): void {
5
+ server.tool(
6
+ 'neos_get_site_context',
7
+ '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.',
8
+ {},
9
+ async () => {
10
+ const data = await callBridge('getSiteContext', 'GET');
11
+ return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
12
+ }
13
+ );
14
+ }
@@ -0,0 +1,14 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import { callBridge } from '../bridge.js';
3
+
4
+ export function registerListAssetTags(server: McpServer): void {
5
+ server.tool(
6
+ 'neos_list_asset_tags',
7
+ 'List all available tags in the Neos Media Manager. Use these tags to filter assets with neos_list_assets.',
8
+ {},
9
+ async () => {
10
+ const data = await callBridge('listAssetTags', 'GET');
11
+ return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
12
+ }
13
+ );
14
+ }
@@ -0,0 +1,20 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import { z } from 'zod';
3
+ import { callBridge } from '../bridge.js';
4
+
5
+ export function registerListAssets(server: McpServer): void {
6
+ server.tool(
7
+ 'neos_list_assets',
8
+ 'List assets (images, documents, etc.) from the Neos Media Manager. Filter by media type or tag. Returns identifier, title, filename, mediaType, fileSize, tags, and collections.',
9
+ {
10
+ mediaType: z.string().default('image').describe('Media type prefix to filter on, e.g. "image", "video", "application". Empty string for all types.'),
11
+ tag: z.string().default('').describe('Filter by tag label (exact match). Empty string for no tag filter.'),
12
+ limit: z.number().default(50).describe('Maximum number of assets to return (default 50).'),
13
+ offset: z.number().default(0).describe('Offset for pagination (default 0).'),
14
+ },
15
+ async ({ mediaType, tag, limit, offset }) => {
16
+ const data = await callBridge('listAssets', 'GET', { mediaType, tag, limit, offset });
17
+ return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
18
+ }
19
+ );
20
+ }
@@ -0,0 +1,19 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import { z } from 'zod';
3
+ import { callBridge } from '../bridge.js';
4
+
5
+ export function registerListNodeTypes(server: McpServer): void {
6
+ server.tool(
7
+ 'neos_list_node_types',
8
+ 'List available content node types with their property schemas. Useful to know which types and properties are available before creating or updating nodes.',
9
+ {
10
+ filter: z.enum(['content', 'document', 'all']).default('content').describe(
11
+ '"content" for content elements, "document" for page types, "all" for everything'
12
+ ),
13
+ },
14
+ async ({ filter }) => {
15
+ const data = await callBridge('listNodeTypes', 'GET', { filter });
16
+ return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
17
+ }
18
+ );
19
+ }
@@ -0,0 +1,17 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import { z } from 'zod';
3
+ import { callBridge } from '../bridge.js';
4
+
5
+ export function registerListPages(server: McpServer): void {
6
+ server.tool(
7
+ 'neos_list_pages',
8
+ 'List all document nodes (pages) in the Neos CMS site as a flat tree with paths and titles.',
9
+ {
10
+ workspace: z.string().default('mcp').describe('Workspace name. Use "live" for published content, "mcp" for staged changes.'),
11
+ },
12
+ async ({ workspace }) => {
13
+ const data = await callBridge('listPages', 'GET', { workspace });
14
+ return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
15
+ }
16
+ );
17
+ }
@@ -0,0 +1,17 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import { z } from 'zod';
3
+ import { callBridge } from '../bridge.js';
4
+
5
+ export function registerListPendingChanges(server: McpServer): void {
6
+ server.tool(
7
+ 'neos_list_pending_changes',
8
+ '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.',
9
+ {
10
+ workspace: z.string().default('mcp').describe('Workspace name to check for pending changes'),
11
+ },
12
+ async ({ workspace }) => {
13
+ const data = await callBridge('listPendingChanges', 'GET', { workspace });
14
+ return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
15
+ }
16
+ );
17
+ }
@@ -0,0 +1,37 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import { z } from 'zod';
3
+ import { callBridge } from '../bridge.js';
4
+
5
+ export function registerMoveNode(server: McpServer): void {
6
+ server.tool(
7
+ 'neos_move_node',
8
+ 'Reorder or reparent a page or content node. ' +
9
+ 'Provide exactly one of insert_before, insert_after, or new_parent_path. ' +
10
+ 'Always writes to the mcp workspace.',
11
+ {
12
+ context_path: z.string().describe(
13
+ 'contextPath of the node to move, e.g. /sites/ewijksolartechniek/about@mcp'
14
+ ),
15
+ insert_before: z.string().optional().describe(
16
+ 'contextPath of a sibling node — move the node to appear before this sibling'
17
+ ),
18
+ insert_after: z.string().optional().describe(
19
+ 'contextPath of a sibling node — move the node to appear after this sibling'
20
+ ),
21
+ new_parent_path: z.string().optional().describe(
22
+ 'Absolute path of a new parent node — move the node into this parent (as last child)'
23
+ ),
24
+ workspace: z.string().default('mcp').describe('Draft workspace name'),
25
+ },
26
+ async ({ context_path, insert_before, insert_after, new_parent_path, workspace }) => {
27
+ const data = await callBridge('moveNode', 'POST', {
28
+ contextPath: context_path,
29
+ insertBefore: insert_before ?? '',
30
+ insertAfter: insert_after ?? '',
31
+ newParentPath: new_parent_path ?? '',
32
+ workspace,
33
+ });
34
+ return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
35
+ }
36
+ );
37
+ }
@@ -0,0 +1,17 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import { z } from 'zod';
3
+ import { callBridge } from '../bridge.js';
4
+
5
+ export function registerPublishChanges(server: McpServer): void {
6
+ server.tool(
7
+ 'neos_publish_changes',
8
+ '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.',
9
+ {
10
+ workspace: z.string().default('mcp').describe('Workspace to publish from'),
11
+ },
12
+ async ({ workspace }) => {
13
+ const data = await callBridge('publishChanges', 'POST', { workspace });
14
+ return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
15
+ }
16
+ );
17
+ }
@@ -0,0 +1,13 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+
3
+ export function registerRestart(server: McpServer): void {
4
+ server.tool(
5
+ 'neos_restart',
6
+ 'Restart this Neos MCP server. Use after the MCP bridge code or MCP client has been rebuilt to pick up changes.',
7
+ {},
8
+ async () => {
9
+ setTimeout(() => process.exit(0), 100);
10
+ return { content: [{ type: 'text', text: 'MCP server is restarting...' }] };
11
+ }
12
+ );
13
+ }
@@ -0,0 +1,14 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import { callBridge } from '../bridge.js';
3
+
4
+ export function registerSetupWorkspace(server: McpServer): void {
5
+ server.tool(
6
+ 'neos_setup_workspace',
7
+ 'Idempotently create the shared MCP review workspace. Call this once before making any content changes if the workspace does not exist yet.',
8
+ {},
9
+ async () => {
10
+ const data = await callBridge('setupWorkspace', 'POST');
11
+ return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
12
+ }
13
+ );
14
+ }
@@ -0,0 +1,27 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import { z } from 'zod';
3
+ import { callBridge } from '../bridge.js';
4
+
5
+ export function registerUpdateNodeProperty(server: McpServer): void {
6
+ server.tool(
7
+ 'neos_update_node_property',
8
+ 'Update a single property on an existing content node. Call neos_get_site_context first if you have not already done so this session. Always writes to the mcp workspace.',
9
+ {
10
+ context_path: z.string().describe(
11
+ 'Context path of the node, e.g. /sites/ewijksolartechniek/page/main/headline@mcp or just the node path without workspace'
12
+ ),
13
+ property: z.string().describe('Property name to update'),
14
+ value: z.unknown().describe('New property value (string, number, boolean, or object)'),
15
+ workspace: z.string().default('mcp').describe('Workspace to write to'),
16
+ },
17
+ async ({ context_path, property, value, workspace }) => {
18
+ const data = await callBridge('updateNodeProperty', 'POST', {
19
+ contextPath: context_path,
20
+ property,
21
+ value,
22
+ workspace,
23
+ });
24
+ return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
25
+ }
26
+ );
27
+ }