fastmode-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 +561 -0
- package/bin/run.js +50 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +802 -0
- package/dist/lib/api-client.d.ts +81 -0
- package/dist/lib/api-client.d.ts.map +1 -0
- package/dist/lib/api-client.js +237 -0
- package/dist/lib/auth-state.d.ts +13 -0
- package/dist/lib/auth-state.d.ts.map +1 -0
- package/dist/lib/auth-state.js +24 -0
- package/dist/lib/context-fetcher.d.ts +67 -0
- package/dist/lib/context-fetcher.d.ts.map +1 -0
- package/dist/lib/context-fetcher.js +190 -0
- package/dist/lib/credentials.d.ts +52 -0
- package/dist/lib/credentials.d.ts.map +1 -0
- package/dist/lib/credentials.js +196 -0
- package/dist/lib/device-flow.d.ts +14 -0
- package/dist/lib/device-flow.d.ts.map +1 -0
- package/dist/lib/device-flow.js +244 -0
- package/dist/tools/cms-items.d.ts +56 -0
- package/dist/tools/cms-items.d.ts.map +1 -0
- package/dist/tools/cms-items.js +376 -0
- package/dist/tools/create-site.d.ts +9 -0
- package/dist/tools/create-site.d.ts.map +1 -0
- package/dist/tools/create-site.js +202 -0
- package/dist/tools/deploy-package.d.ts +9 -0
- package/dist/tools/deploy-package.d.ts.map +1 -0
- package/dist/tools/deploy-package.js +434 -0
- package/dist/tools/generate-samples.d.ts +19 -0
- package/dist/tools/generate-samples.d.ts.map +1 -0
- package/dist/tools/generate-samples.js +272 -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 +1323 -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 +1568 -0
- package/dist/tools/get-field-types.d.ts +30 -0
- package/dist/tools/get-field-types.d.ts.map +1 -0
- package/dist/tools/get-field-types.js +154 -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 +320 -0
- package/dist/tools/get-started.d.ts +21 -0
- package/dist/tools/get-started.d.ts.map +1 -0
- package/dist/tools/get-started.js +624 -0
- package/dist/tools/get-tenant-schema.d.ts +18 -0
- package/dist/tools/get-tenant-schema.d.ts.map +1 -0
- package/dist/tools/get-tenant-schema.js +158 -0
- package/dist/tools/list-projects.d.ts +5 -0
- package/dist/tools/list-projects.d.ts.map +1 -0
- package/dist/tools/list-projects.js +101 -0
- package/dist/tools/sync-schema.d.ts +41 -0
- package/dist/tools/sync-schema.d.ts.map +1 -0
- package/dist/tools/sync-schema.js +483 -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 +311 -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 +337 -0
- package/dist/tools/validate-template.d.ts +12 -0
- package/dist/tools/validate-template.d.ts.map +1 -0
- package/dist/tools/validate-template.js +790 -0
- package/package.json +54 -0
- package/scripts/postinstall.js +129 -0
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "fastmode-mcp",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "MCP server for FastMode CMS. Convert websites, validate packages, and deploy directly to FastMode. Includes authentication, project creation, schema sync, and one-click deployment.",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"fastmode-mcp": "./bin/run.js"
|
|
8
|
+
},
|
|
9
|
+
"type": "commonjs",
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "NODE_OPTIONS='--max-old-space-size=4096' tsc --skipLibCheck && chmod +x dist/index.js",
|
|
12
|
+
"dev": "ts-node src/index.ts",
|
|
13
|
+
"start": "node dist/index.js",
|
|
14
|
+
"postinstall": "node scripts/postinstall.js"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"mcp",
|
|
18
|
+
"model-context-protocol",
|
|
19
|
+
"fastmode",
|
|
20
|
+
"cms",
|
|
21
|
+
"website-conversion",
|
|
22
|
+
"ai-tools",
|
|
23
|
+
"claude",
|
|
24
|
+
"cursor",
|
|
25
|
+
"validation"
|
|
26
|
+
],
|
|
27
|
+
"author": "Arih Goldstein",
|
|
28
|
+
"license": "MIT",
|
|
29
|
+
"repository": {
|
|
30
|
+
"type": "git",
|
|
31
|
+
"url": "https://github.com/arihgoldstein/fastmode-mcp.git"
|
|
32
|
+
},
|
|
33
|
+
"homepage": "https://fastmode.ai",
|
|
34
|
+
"files": [
|
|
35
|
+
"dist",
|
|
36
|
+
"bin",
|
|
37
|
+
"scripts",
|
|
38
|
+
"README.md"
|
|
39
|
+
],
|
|
40
|
+
"engines": {
|
|
41
|
+
"node": ">=18.0.0"
|
|
42
|
+
},
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
45
|
+
"adm-zip": "^0.5.16",
|
|
46
|
+
"zod": "^3.23.8"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@types/adm-zip": "^0.5.7",
|
|
50
|
+
"@types/node": "^20.11.0",
|
|
51
|
+
"ts-node": "^10.9.2",
|
|
52
|
+
"typescript": "^5.3.3"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Postinstall script that downloads the correct prebuilt binary for the current platform.
|
|
4
|
+
* This allows the MCP server to run without Node.js in the PATH.
|
|
5
|
+
*/
|
|
6
|
+
const https = require('https');
|
|
7
|
+
const fs = require('fs');
|
|
8
|
+
const path = require('path');
|
|
9
|
+
|
|
10
|
+
const PACKAGE_NAME = 'fastmode-mcp';
|
|
11
|
+
const BINARY_NAME = 'fastmode-mcp';
|
|
12
|
+
|
|
13
|
+
// Get package version from package.json
|
|
14
|
+
const packageJson = require('../package.json');
|
|
15
|
+
const VERSION = packageJson.version;
|
|
16
|
+
|
|
17
|
+
// Platform/arch mapping
|
|
18
|
+
const PLATFORM_MAP = {
|
|
19
|
+
'darwin-arm64': 'macos-arm64',
|
|
20
|
+
'darwin-x64': 'macos-x64',
|
|
21
|
+
'linux-arm64': 'linux-arm64',
|
|
22
|
+
'linux-x64': 'linux-x64',
|
|
23
|
+
'win32-x64': 'win-x64',
|
|
24
|
+
'win32-arm64': 'win-arm64',
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
function getPlatformKey() {
|
|
28
|
+
const platform = process.platform;
|
|
29
|
+
const arch = process.arch;
|
|
30
|
+
return `${platform}-${arch}`;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function getBinaryUrl(version, platformKey) {
|
|
34
|
+
const platformSuffix = PLATFORM_MAP[platformKey];
|
|
35
|
+
if (!platformSuffix) {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const ext = process.platform === 'win32' ? '.exe' : '';
|
|
40
|
+
const filename = `${BINARY_NAME}-${platformSuffix}${ext}`;
|
|
41
|
+
|
|
42
|
+
// Download from GitHub Releases (public repo for binaries)
|
|
43
|
+
return `https://github.com/arihgoldstein/fastmode-mcp/releases/download/v${version}/${filename}`;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function downloadFile(url, destPath) {
|
|
47
|
+
return new Promise((resolve, reject) => {
|
|
48
|
+
const file = fs.createWriteStream(destPath);
|
|
49
|
+
|
|
50
|
+
const request = (url) => {
|
|
51
|
+
https.get(url, (response) => {
|
|
52
|
+
// Handle redirects
|
|
53
|
+
if (response.statusCode === 301 || response.statusCode === 302) {
|
|
54
|
+
request(response.headers.location);
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (response.statusCode === 404) {
|
|
59
|
+
file.close();
|
|
60
|
+
fs.unlinkSync(destPath);
|
|
61
|
+
reject(new Error(`Binary not found at ${url}`));
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (response.statusCode !== 200) {
|
|
66
|
+
file.close();
|
|
67
|
+
fs.unlinkSync(destPath);
|
|
68
|
+
reject(new Error(`Failed to download: ${response.statusCode}`));
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
response.pipe(file);
|
|
73
|
+
file.on('finish', () => {
|
|
74
|
+
file.close();
|
|
75
|
+
resolve();
|
|
76
|
+
});
|
|
77
|
+
}).on('error', (err) => {
|
|
78
|
+
file.close();
|
|
79
|
+
fs.unlinkSync(destPath);
|
|
80
|
+
reject(err);
|
|
81
|
+
});
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
request(url);
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
async function main() {
|
|
89
|
+
const platformKey = getPlatformKey();
|
|
90
|
+
const binaryUrl = getBinaryUrl(VERSION, platformKey);
|
|
91
|
+
|
|
92
|
+
if (!binaryUrl) {
|
|
93
|
+
console.log(`No prebuilt binary available for ${platformKey}`);
|
|
94
|
+
console.log('Falling back to Node.js execution');
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const binDir = path.join(__dirname, '..', 'bin');
|
|
99
|
+
const ext = process.platform === 'win32' ? '.exe' : '';
|
|
100
|
+
const binaryPath = path.join(binDir, `${BINARY_NAME}${ext}`);
|
|
101
|
+
|
|
102
|
+
// Create bin directory if it doesn't exist
|
|
103
|
+
if (!fs.existsSync(binDir)) {
|
|
104
|
+
fs.mkdirSync(binDir, { recursive: true });
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
console.log(`Downloading ${PACKAGE_NAME} binary for ${platformKey}...`);
|
|
108
|
+
|
|
109
|
+
try {
|
|
110
|
+
await downloadFile(binaryUrl, binaryPath);
|
|
111
|
+
|
|
112
|
+
// Make executable on Unix
|
|
113
|
+
if (process.platform !== 'win32') {
|
|
114
|
+
fs.chmodSync(binaryPath, 0o755);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
console.log(`Successfully installed ${BINARY_NAME} binary`);
|
|
118
|
+
} catch (error) {
|
|
119
|
+
// Binary download failed - this is OK, we'll fall back to Node.js
|
|
120
|
+
console.log(`Binary download failed: ${error.message}`);
|
|
121
|
+
console.log('Falling back to Node.js execution');
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
main().catch((error) => {
|
|
126
|
+
// Don't fail the install if binary download fails
|
|
127
|
+
console.error('Postinstall warning:', error.message);
|
|
128
|
+
process.exit(0);
|
|
129
|
+
});
|