multisite-cms-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/README.md +126 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +201 -0
- package/dist/tools/get-conversion-guide.d.ts +7 -0
- package/dist/tools/get-conversion-guide.d.ts.map +1 -0
- package/dist/tools/get-conversion-guide.js +529 -0
- package/dist/tools/get-example.d.ts +7 -0
- package/dist/tools/get-example.d.ts.map +1 -0
- package/dist/tools/get-example.js +673 -0
- package/dist/tools/get-schema.d.ts +5 -0
- package/dist/tools/get-schema.d.ts.map +1 -0
- package/dist/tools/get-schema.js +148 -0
- package/dist/tools/validate-manifest.d.ts +5 -0
- package/dist/tools/validate-manifest.d.ts.map +1 -0
- package/dist/tools/validate-manifest.js +146 -0
- package/dist/tools/validate-package.d.ts +5 -0
- package/dist/tools/validate-package.d.ts.map +1 -0
- package/dist/tools/validate-package.js +190 -0
- package/dist/tools/validate-template.d.ts +7 -0
- package/dist/tools/validate-template.d.ts.map +1 -0
- package/dist/tools/validate-template.js +234 -0
- package/package.json +49 -0
package/README.md
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# Multisite CMS MCP Server
|
|
2
|
+
|
|
3
|
+
An MCP (Model Context Protocol) server that helps AI agents convert websites into CMS-compatible packages. Provides validation, examples, and schema information.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
### Using npx (Recommended)
|
|
8
|
+
|
|
9
|
+
Add to your MCP configuration (e.g., `.cursor/mcp.json`):
|
|
10
|
+
|
|
11
|
+
```json
|
|
12
|
+
{
|
|
13
|
+
"mcpServers": {
|
|
14
|
+
"multisite-cms": {
|
|
15
|
+
"command": "npx",
|
|
16
|
+
"args": ["-y", "multisite-cms-mcp"]
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### Global Installation
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npm install -g multisite-cms-mcp
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Then configure:
|
|
29
|
+
|
|
30
|
+
```json
|
|
31
|
+
{
|
|
32
|
+
"mcpServers": {
|
|
33
|
+
"multisite-cms": {
|
|
34
|
+
"command": "multisite-cms-mcp"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Available Tools
|
|
41
|
+
|
|
42
|
+
### `get_schema`
|
|
43
|
+
Get the complete CMS schema including all built-in collections and their fields.
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
AI: What fields are available for blog posts?
|
|
47
|
+
[calls get_schema]
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### `validate_manifest`
|
|
51
|
+
Validate a manifest.json file structure.
|
|
52
|
+
|
|
53
|
+
**Parameters:**
|
|
54
|
+
- `manifest` (string): The manifest.json content
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
AI: Let me check if this manifest is valid...
|
|
58
|
+
[calls validate_manifest with JSON string]
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### `validate_template`
|
|
62
|
+
Check HTML templates for correct token usage.
|
|
63
|
+
|
|
64
|
+
**Parameters:**
|
|
65
|
+
- `html` (string): The template HTML content
|
|
66
|
+
- `templateType` (string): One of: `blog_index`, `blog_post`, `team`, `downloads`, `authors_index`, `author_detail`, `custom_index`, `custom_detail`, `static_page`
|
|
67
|
+
- `collectionSlug` (string, optional): For custom collections
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
AI: Let me validate this blog template...
|
|
71
|
+
[calls validate_template]
|
|
72
|
+
|
|
73
|
+
Response: ❌ TEMPLATE HAS ERRORS
|
|
74
|
+
- Wrong token: {{title}} → Use name (for blog posts)
|
|
75
|
+
- {{postBody}} must use triple braces {{{postBody}}}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### `validate_package`
|
|
79
|
+
Full package structure validation.
|
|
80
|
+
|
|
81
|
+
**Parameters:**
|
|
82
|
+
- `fileList` (string[]): All file paths in the package
|
|
83
|
+
- `manifestContent` (string): The manifest.json content
|
|
84
|
+
- `templateContentsJson` (string, optional): JSON object mapping template paths to contents
|
|
85
|
+
|
|
86
|
+
### `get_example`
|
|
87
|
+
Get code examples for specific patterns.
|
|
88
|
+
|
|
89
|
+
**Parameters:**
|
|
90
|
+
- `exampleType` (string): One of:
|
|
91
|
+
- `manifest_basic`, `manifest_custom_paths`
|
|
92
|
+
- `blog_index_template`, `blog_post_template`
|
|
93
|
+
- `team_template`, `downloads_template`
|
|
94
|
+
- `authors_template`, `author_detail_template`
|
|
95
|
+
- `custom_collection_template`
|
|
96
|
+
- `form_handling`, `asset_paths`, `data_edit_keys`
|
|
97
|
+
- `each_loop`, `conditional_if`, `nested_fields`, `featured_posts`
|
|
98
|
+
|
|
99
|
+
### `get_conversion_guide`
|
|
100
|
+
Get the complete conversion documentation.
|
|
101
|
+
|
|
102
|
+
**Parameters:**
|
|
103
|
+
- `section` (string, optional): One of: `full`, `analysis`, `structure`, `manifest`, `templates`, `tokens`, `forms`, `assets`, `checklist`
|
|
104
|
+
|
|
105
|
+
## Workflow Example
|
|
106
|
+
|
|
107
|
+
When converting a website, an AI agent can:
|
|
108
|
+
|
|
109
|
+
1. **Start** → Call `get_conversion_guide` for requirements
|
|
110
|
+
2. **Check fields** → Call `get_schema` to see exact token names
|
|
111
|
+
3. **Need example?** → Call `get_example` for specific pattern
|
|
112
|
+
4. **Create manifest** → Call `validate_manifest` to check it
|
|
113
|
+
5. **Create template** → Call `validate_template` to verify tokens
|
|
114
|
+
6. **Final check** → Call `validate_package` for full validation
|
|
115
|
+
|
|
116
|
+
## Key Benefits
|
|
117
|
+
|
|
118
|
+
- **Validates as you work** - Catch errors during conversion, not after
|
|
119
|
+
- **Correct field names** - No more guessing `{{title}}` vs `{{name}}`
|
|
120
|
+
- **Triple brace reminders** - Ensures rich text uses `{{{...}}}`
|
|
121
|
+
- **Structure validation** - Confirms package layout is correct
|
|
122
|
+
|
|
123
|
+
## License
|
|
124
|
+
|
|
125
|
+
MIT
|
|
126
|
+
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const index_js_1 = require("@modelcontextprotocol/sdk/server/index.js");
|
|
5
|
+
const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
|
|
6
|
+
const types_js_1 = require("@modelcontextprotocol/sdk/types.js");
|
|
7
|
+
const get_schema_1 = require("./tools/get-schema");
|
|
8
|
+
const validate_manifest_1 = require("./tools/validate-manifest");
|
|
9
|
+
const validate_template_1 = require("./tools/validate-template");
|
|
10
|
+
const validate_package_1 = require("./tools/validate-package");
|
|
11
|
+
const get_example_1 = require("./tools/get-example");
|
|
12
|
+
const get_conversion_guide_1 = require("./tools/get-conversion-guide");
|
|
13
|
+
const server = new index_js_1.Server({
|
|
14
|
+
name: 'multisite-cms',
|
|
15
|
+
version: '1.0.0',
|
|
16
|
+
}, {
|
|
17
|
+
capabilities: {
|
|
18
|
+
tools: {},
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
// Define available tools
|
|
22
|
+
const TOOLS = [
|
|
23
|
+
{
|
|
24
|
+
name: 'get_schema',
|
|
25
|
+
description: 'Get the complete CMS schema including all built-in and custom collections with their fields. Use this to understand what content types are available and what tokens to use in templates.',
|
|
26
|
+
inputSchema: {
|
|
27
|
+
type: 'object',
|
|
28
|
+
properties: {},
|
|
29
|
+
required: [],
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'validate_manifest',
|
|
34
|
+
description: 'Validate a manifest.json file for the CMS package. Returns errors if the structure is incorrect or required fields are missing.',
|
|
35
|
+
inputSchema: {
|
|
36
|
+
type: 'object',
|
|
37
|
+
properties: {
|
|
38
|
+
manifest: {
|
|
39
|
+
type: 'string',
|
|
40
|
+
description: 'The manifest.json content as a string',
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
required: ['manifest'],
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: 'validate_template',
|
|
48
|
+
description: 'Validate an HTML template for correct CMS token usage. Checks for proper {{token}} syntax, correct field names, and proper use of triple braces for rich text.',
|
|
49
|
+
inputSchema: {
|
|
50
|
+
type: 'object',
|
|
51
|
+
properties: {
|
|
52
|
+
html: {
|
|
53
|
+
type: 'string',
|
|
54
|
+
description: 'The HTML template content',
|
|
55
|
+
},
|
|
56
|
+
templateType: {
|
|
57
|
+
type: 'string',
|
|
58
|
+
enum: ['blog_index', 'blog_post', 'team', 'downloads', 'authors_index', 'author_detail', 'custom_index', 'custom_detail', 'static_page'],
|
|
59
|
+
description: 'The type of template being validated',
|
|
60
|
+
},
|
|
61
|
+
collectionSlug: {
|
|
62
|
+
type: 'string',
|
|
63
|
+
description: 'For custom collections, the collection slug',
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
required: ['html', 'templateType'],
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
name: 'validate_package',
|
|
71
|
+
description: 'Validate the complete structure of a CMS website package. Checks folder structure, manifest, all templates, and asset references.',
|
|
72
|
+
inputSchema: {
|
|
73
|
+
type: 'object',
|
|
74
|
+
properties: {
|
|
75
|
+
fileList: {
|
|
76
|
+
type: 'array',
|
|
77
|
+
items: { type: 'string' },
|
|
78
|
+
description: 'List of all file paths in the package',
|
|
79
|
+
},
|
|
80
|
+
manifestContent: {
|
|
81
|
+
type: 'string',
|
|
82
|
+
description: 'Content of manifest.json',
|
|
83
|
+
},
|
|
84
|
+
templateContentsJson: {
|
|
85
|
+
type: 'string',
|
|
86
|
+
description: 'JSON string mapping template file paths to their contents',
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
required: ['fileList', 'manifestContent'],
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
name: 'get_example',
|
|
94
|
+
description: 'Get example code for a specific pattern or use case. Use this when you need to see how something should be implemented.',
|
|
95
|
+
inputSchema: {
|
|
96
|
+
type: 'object',
|
|
97
|
+
properties: {
|
|
98
|
+
exampleType: {
|
|
99
|
+
type: 'string',
|
|
100
|
+
enum: [
|
|
101
|
+
'manifest_basic',
|
|
102
|
+
'manifest_custom_paths',
|
|
103
|
+
'blog_index_template',
|
|
104
|
+
'blog_post_template',
|
|
105
|
+
'team_template',
|
|
106
|
+
'downloads_template',
|
|
107
|
+
'authors_template',
|
|
108
|
+
'author_detail_template',
|
|
109
|
+
'custom_collection_template',
|
|
110
|
+
'form_handling',
|
|
111
|
+
'asset_paths',
|
|
112
|
+
'data_edit_keys',
|
|
113
|
+
'each_loop',
|
|
114
|
+
'conditional_if',
|
|
115
|
+
'nested_fields',
|
|
116
|
+
'featured_posts',
|
|
117
|
+
],
|
|
118
|
+
description: 'The type of example to retrieve',
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
required: ['exampleType'],
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
name: 'get_conversion_guide',
|
|
126
|
+
description: 'Get the complete website conversion guide. Use this at the start of a conversion project to understand all requirements.',
|
|
127
|
+
inputSchema: {
|
|
128
|
+
type: 'object',
|
|
129
|
+
properties: {
|
|
130
|
+
section: {
|
|
131
|
+
type: 'string',
|
|
132
|
+
enum: ['full', 'analysis', 'structure', 'manifest', 'templates', 'tokens', 'forms', 'assets', 'checklist'],
|
|
133
|
+
description: 'Specific section to retrieve, or "full" for everything',
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
required: [],
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
];
|
|
140
|
+
// Handle list tools request
|
|
141
|
+
server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => {
|
|
142
|
+
return { tools: TOOLS };
|
|
143
|
+
});
|
|
144
|
+
// Handle tool calls
|
|
145
|
+
server.setRequestHandler(types_js_1.CallToolRequestSchema, async (request) => {
|
|
146
|
+
const { name, arguments: args } = request.params;
|
|
147
|
+
const params = args;
|
|
148
|
+
try {
|
|
149
|
+
let result;
|
|
150
|
+
switch (name) {
|
|
151
|
+
case 'get_schema':
|
|
152
|
+
result = await (0, get_schema_1.getSchema)();
|
|
153
|
+
break;
|
|
154
|
+
case 'validate_manifest':
|
|
155
|
+
result = await (0, validate_manifest_1.validateManifest)(params.manifest);
|
|
156
|
+
break;
|
|
157
|
+
case 'validate_template':
|
|
158
|
+
result = await (0, validate_template_1.validateTemplate)(params.html, params.templateType, params.collectionSlug);
|
|
159
|
+
break;
|
|
160
|
+
case 'validate_package': {
|
|
161
|
+
let templateContents;
|
|
162
|
+
if (params.templateContentsJson) {
|
|
163
|
+
try {
|
|
164
|
+
templateContents = JSON.parse(params.templateContentsJson);
|
|
165
|
+
}
|
|
166
|
+
catch {
|
|
167
|
+
templateContents = undefined;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
result = await (0, validate_package_1.validatePackage)(params.fileList, params.manifestContent, templateContents);
|
|
171
|
+
break;
|
|
172
|
+
}
|
|
173
|
+
case 'get_example':
|
|
174
|
+
result = await (0, get_example_1.getExample)(params.exampleType);
|
|
175
|
+
break;
|
|
176
|
+
case 'get_conversion_guide':
|
|
177
|
+
result = await (0, get_conversion_guide_1.getConversionGuide)(params.section || 'full');
|
|
178
|
+
break;
|
|
179
|
+
default:
|
|
180
|
+
return {
|
|
181
|
+
content: [{ type: 'text', text: `Unknown tool: ${name}` }],
|
|
182
|
+
isError: true,
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
return {
|
|
186
|
+
content: [{ type: 'text', text: result }],
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
catch (error) {
|
|
190
|
+
return {
|
|
191
|
+
content: [{ type: 'text', text: `Error: ${error instanceof Error ? error.message : String(error)}` }],
|
|
192
|
+
isError: true,
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
async function main() {
|
|
197
|
+
const transport = new stdio_js_1.StdioServerTransport();
|
|
198
|
+
await server.connect(transport);
|
|
199
|
+
console.error('Multisite CMS MCP Server running on stdio');
|
|
200
|
+
}
|
|
201
|
+
main().catch(console.error);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
type Section = 'full' | 'analysis' | 'structure' | 'manifest' | 'templates' | 'tokens' | 'forms' | 'assets' | 'checklist';
|
|
2
|
+
/**
|
|
3
|
+
* Returns the conversion guide, either full or a specific section
|
|
4
|
+
*/
|
|
5
|
+
export declare function getConversionGuide(section: Section): Promise<string>;
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=get-conversion-guide.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-conversion-guide.d.ts","sourceRoot":"","sources":["../../src/tools/get-conversion-guide.ts"],"names":[],"mappings":"AAAA,KAAK,OAAO,GAAG,MAAM,GAAG,UAAU,GAAG,WAAW,GAAG,UAAU,GAAG,WAAW,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,WAAW,CAAC;AAoe1H;;GAEG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAkD1E"}
|