multisite-cms-mcp 1.2.2 → 1.2.3
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/dist/index.js
CHANGED
|
@@ -192,7 +192,7 @@ const TOOLS = [
|
|
|
192
192
|
},
|
|
193
193
|
{
|
|
194
194
|
name: 'deploy_package',
|
|
195
|
-
description: 'Deploy a website package (.zip file) to Fast Mode.
|
|
195
|
+
description: 'Deploy a website package (.zip file) to Fast Mode. Will check for GitHub sync and block deployment if connected (to prevent conflicts). Use force:true to override. Opens browser for authentication if not already logged in.',
|
|
196
196
|
inputSchema: {
|
|
197
197
|
type: 'object',
|
|
198
198
|
properties: {
|
|
@@ -208,6 +208,10 @@ const TOOLS = [
|
|
|
208
208
|
type: 'string',
|
|
209
209
|
description: 'Optional: Create a new project with this name and deploy to it. Required if projectId is not provided and no projects exist.',
|
|
210
210
|
},
|
|
211
|
+
force: {
|
|
212
|
+
type: 'boolean',
|
|
213
|
+
description: 'Optional: Skip GitHub connection check and deploy anyway. Use with caution - may cause conflicts if GitHub auto-deploy is enabled.',
|
|
214
|
+
},
|
|
211
215
|
},
|
|
212
216
|
required: ['packagePath'],
|
|
213
217
|
},
|
|
@@ -345,7 +349,7 @@ server.setRequestHandler(types_js_1.CallToolRequestSchema, async (request) => {
|
|
|
345
349
|
result = await (0, create_site_1.createSite)(params.name, params.subdomain);
|
|
346
350
|
break;
|
|
347
351
|
case 'deploy_package':
|
|
348
|
-
result = await (0, deploy_package_1.deployPackage)(params.packagePath, params.projectId, params.projectName);
|
|
352
|
+
result = await (0, deploy_package_1.deployPackage)(params.packagePath, params.projectId, params.projectName, params.force);
|
|
349
353
|
break;
|
|
350
354
|
case 'get_field_types':
|
|
351
355
|
result = await (0, get_field_types_1.getFieldTypes)();
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* @param packagePath - Path to the zip file
|
|
5
5
|
* @param projectId - Optional: Deploy to existing project with this ID
|
|
6
6
|
* @param projectName - Optional: Create new project with this name
|
|
7
|
+
* @param force - Optional: Skip GitHub connection check and deploy anyway
|
|
7
8
|
*/
|
|
8
|
-
export declare function deployPackage(packagePath: string, projectId?: string, projectName?: string): Promise<string>;
|
|
9
|
+
export declare function deployPackage(packagePath: string, projectId?: string, projectName?: string, force?: boolean): Promise<string>;
|
|
9
10
|
//# sourceMappingURL=deploy-package.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy-package.d.ts","sourceRoot":"","sources":["../../src/tools/deploy-package.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"deploy-package.d.ts","sourceRoot":"","sources":["../../src/tools/deploy-package.ts"],"names":[],"mappings":"AAmRA;;;;;;;GAOG;AACH,wBAAsB,aAAa,CACjC,WAAW,EAAE,MAAM,EACnB,SAAS,CAAC,EAAE,MAAM,EAClB,WAAW,CAAC,EAAE,MAAM,EACpB,KAAK,CAAC,EAAE,OAAO,GACd,OAAO,CAAC,MAAM,CAAC,CAwJjB"}
|
|
@@ -49,6 +49,60 @@ async function listExistingProjects() {
|
|
|
49
49
|
}
|
|
50
50
|
return response.data;
|
|
51
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* Check if a project has GitHub connected
|
|
54
|
+
*/
|
|
55
|
+
async function checkGitHubConnection(tenantId) {
|
|
56
|
+
const response = await (0, api_client_1.apiRequest)('/api/github/site-connection', { tenantId });
|
|
57
|
+
if ((0, api_client_1.isApiError)(response)) {
|
|
58
|
+
// If we can't check, assume not connected (fail open for better UX)
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
return response.data;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Format the GitHub blocking message
|
|
65
|
+
*/
|
|
66
|
+
function formatGitHubBlockMessage(repo, branch, subdomain) {
|
|
67
|
+
return `# ⚠️ GitHub Sync Detected
|
|
68
|
+
|
|
69
|
+
This project has GitHub connected and will auto-deploy from:
|
|
70
|
+
- **Repository:** ${repo}
|
|
71
|
+
- **Branch:** ${branch}
|
|
72
|
+
|
|
73
|
+
## Why This Matters
|
|
74
|
+
|
|
75
|
+
Deploying via MCP while GitHub is connected can cause conflicts:
|
|
76
|
+
- Your MCP changes could be overwritten on the next GitHub push
|
|
77
|
+
- Or this deploy could overwrite changes from GitHub
|
|
78
|
+
|
|
79
|
+
## Options
|
|
80
|
+
|
|
81
|
+
### Option 1: Push to GitHub Instead (Recommended)
|
|
82
|
+
Push your changes to the connected repository and let GitHub handle the deploy:
|
|
83
|
+
\`\`\`bash
|
|
84
|
+
git push origin ${branch}
|
|
85
|
+
\`\`\`
|
|
86
|
+
|
|
87
|
+
### Option 2: Disconnect GitHub First
|
|
88
|
+
Go to **app.fastmode.ai** → Settings → GitHub and disconnect the repository.
|
|
89
|
+
|
|
90
|
+
### Option 3: Force Deploy Anyway
|
|
91
|
+
If you understand the risks and want to proceed:
|
|
92
|
+
\`\`\`
|
|
93
|
+
deploy_package(
|
|
94
|
+
packagePath: "./your-site.zip",
|
|
95
|
+
projectId: "...",
|
|
96
|
+
force: true
|
|
97
|
+
)
|
|
98
|
+
\`\`\`
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
**Dashboard:** https://app.fastmode.ai
|
|
103
|
+
**Site:** https://${subdomain}.fastmode.ai
|
|
104
|
+
`;
|
|
105
|
+
}
|
|
52
106
|
/**
|
|
53
107
|
* Create a new site/project
|
|
54
108
|
*/
|
|
@@ -176,8 +230,9 @@ deploy_package(
|
|
|
176
230
|
* @param packagePath - Path to the zip file
|
|
177
231
|
* @param projectId - Optional: Deploy to existing project with this ID
|
|
178
232
|
* @param projectName - Optional: Create new project with this name
|
|
233
|
+
* @param force - Optional: Skip GitHub connection check and deploy anyway
|
|
179
234
|
*/
|
|
180
|
-
async function deployPackage(packagePath, projectId, projectName) {
|
|
235
|
+
async function deployPackage(packagePath, projectId, projectName, force) {
|
|
181
236
|
// Check authentication
|
|
182
237
|
if (await (0, api_client_1.needsAuthentication)()) {
|
|
183
238
|
const authResult = await (0, device_flow_1.ensureAuthenticated)();
|
|
@@ -263,6 +318,14 @@ Please try again or create the project manually at app.fastmode.ai
|
|
|
263
318
|
const project = projects.find(p => p.id === targetProjectId);
|
|
264
319
|
subdomain = project?.subdomain || '';
|
|
265
320
|
}
|
|
321
|
+
// Check for GitHub connection (unless force is true or it's a new project)
|
|
322
|
+
if (!force && !projectName && targetProjectId) {
|
|
323
|
+
const githubStatus = await checkGitHubConnection(targetProjectId);
|
|
324
|
+
if (githubStatus?.connected && githubStatus.repo) {
|
|
325
|
+
// GitHub is connected - block deployment
|
|
326
|
+
return formatGitHubBlockMessage(githubStatus.repo, githubStatus.branch || 'main', subdomain);
|
|
327
|
+
}
|
|
328
|
+
}
|
|
266
329
|
// Upload the package
|
|
267
330
|
console.error(`Deploying to ${subdomain}.fastmode.ai...`);
|
|
268
331
|
const uploadResult = await uploadPackage(targetProjectId, zipBuffer);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "multisite-cms-mcp",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.3",
|
|
4
4
|
"description": "MCP server for Fast Mode CMS. Convert websites, validate packages, and deploy directly to Fast Mode. Includes authentication, project creation, schema sync, and one-click deployment.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|