@createlex/figma-swiftui-mcp 1.0.2 → 1.0.4
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.
|
@@ -24,7 +24,7 @@ function ensureApiBaseUrl(value) {
|
|
|
24
24
|
let base = normalizeWebBase(value)
|
|
25
25
|
|| normalizeWebBase(process.env.CREATELEX_API_BASE_URL)
|
|
26
26
|
|| normalizeWebBase(process.env.API_BASE_URL)
|
|
27
|
-
|| 'https://createlex.com';
|
|
27
|
+
|| 'https://api.createlex.com';
|
|
28
28
|
|
|
29
29
|
if (!base.toLowerCase().endsWith('/api')) {
|
|
30
30
|
base = `${base}/api`;
|
package/companion/login.mjs
CHANGED
|
@@ -13,13 +13,12 @@ const {
|
|
|
13
13
|
validateTokenFormat,
|
|
14
14
|
} = require('./createlex-auth.cjs');
|
|
15
15
|
|
|
16
|
-
function
|
|
17
|
-
const explicit = process.env.
|
|
16
|
+
function getLoginBaseUrl() {
|
|
17
|
+
const explicit = process.env.CREATELEX_LOGIN_BASE_URL?.trim();
|
|
18
18
|
if (explicit) {
|
|
19
19
|
return explicit.replace(/\/+$/, '');
|
|
20
20
|
}
|
|
21
|
-
|
|
22
|
-
return apiBase.replace(/\/api$/, '');
|
|
21
|
+
return ensureApiBaseUrl(process.env.CREATELEX_API_BASE_URL);
|
|
23
22
|
}
|
|
24
23
|
|
|
25
24
|
function openBrowser(url) {
|
|
@@ -77,7 +76,7 @@ Options:
|
|
|
77
76
|
const noOpen = args.has('--no-open');
|
|
78
77
|
const state = randomBytes(16).toString('hex');
|
|
79
78
|
const apiBaseUrl = ensureApiBaseUrl(process.env.CREATELEX_API_BASE_URL);
|
|
80
|
-
const
|
|
79
|
+
const loginBaseUrl = getLoginBaseUrl();
|
|
81
80
|
|
|
82
81
|
let server;
|
|
83
82
|
const completion = new Promise((resolve, reject) => {
|
|
@@ -161,7 +160,7 @@ Options:
|
|
|
161
160
|
}
|
|
162
161
|
|
|
163
162
|
const callbackUrl = `http://127.0.0.1:${address.port}/callback`;
|
|
164
|
-
const loginUrl = `${
|
|
163
|
+
const loginUrl = `${loginBaseUrl}/mcp/figma-swiftui/login?callback_url=${encodeURIComponent(callbackUrl)}&state=${encodeURIComponent(state)}`;
|
|
165
164
|
|
|
166
165
|
console.log(noOpen ? 'CreateLex login URL:' : 'Opening CreateLex login in your browser...');
|
|
167
166
|
console.log(`If the browser does not open, visit:\n${loginUrl}\n`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@createlex/figma-swiftui-mcp",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "CreateLex MCP runtime for Figma-to-SwiftUI generation and Xcode export",
|
|
5
5
|
"bin": {
|
|
6
6
|
"figma-swiftui-mcp": "bin/figma-swiftui-mcp.js"
|
|
@@ -20,7 +20,6 @@
|
|
|
20
20
|
"access": "public"
|
|
21
21
|
},
|
|
22
22
|
"scripts": {
|
|
23
|
-
"postinstall": "npm --prefix companion install",
|
|
24
23
|
"build": "tsc",
|
|
25
24
|
"login": "node bin/figma-swiftui-mcp.js login",
|
|
26
25
|
"start": "node bin/figma-swiftui-mcp.js start",
|
|
@@ -32,6 +31,13 @@
|
|
|
32
31
|
"engines": {
|
|
33
32
|
"node": ">=18.0.0"
|
|
34
33
|
},
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"@modelcontextprotocol/sdk": "^1.28.0",
|
|
36
|
+
"cors": "^2.8.5",
|
|
37
|
+
"express": "^4.18.0",
|
|
38
|
+
"ws": "^8.20.0",
|
|
39
|
+
"zod": "^4.3.6"
|
|
40
|
+
},
|
|
35
41
|
"devDependencies": {
|
|
36
42
|
"@figma/plugin-typings": "*",
|
|
37
43
|
"typescript": "^5.4.0"
|