verso-mcp 0.1.7 → 0.2.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/index.js +42 -4
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -15,7 +15,6 @@ const log = (...args) => process.stderr.write(`[verso-mcp] ${args.join(' ')}\n`)
|
|
|
15
15
|
const args = process.argv.slice(2)
|
|
16
16
|
let API_TOKEN = ''
|
|
17
17
|
let SERVER_URL = 'https://useverso.app' // default production
|
|
18
|
-
|
|
19
18
|
for (let i = 0; i < args.length; i++) {
|
|
20
19
|
if (args[i] === '--token' && args[i + 1]) { API_TOKEN = args[++i]; continue }
|
|
21
20
|
if (args[i].startsWith('--token=')) { API_TOKEN = args[i].split('=')[1]; continue }
|
|
@@ -192,6 +191,18 @@ async function handleMessage(message) {
|
|
|
192
191
|
}
|
|
193
192
|
}
|
|
194
193
|
|
|
194
|
+
if (toolName === 'generate_image') {
|
|
195
|
+
try {
|
|
196
|
+
const result = await apiRequest('POST', '/api/generate-image', { prompt: toolArgs.prompt, size: toolArgs.size })
|
|
197
|
+
if (result.url) {
|
|
198
|
+
return { jsonrpc: '2.0', id, result: { content: [{ type: 'text', text: result.url }] } }
|
|
199
|
+
}
|
|
200
|
+
return { jsonrpc: '2.0', id, result: { content: [{ type: 'text', text: `Error: ${result.error || 'No image returned'}` }], isError: true } }
|
|
201
|
+
} catch (err) {
|
|
202
|
+
return { jsonrpc: '2.0', id, result: { content: [{ type: 'text', text: `Error generating image: ${err.message}` }], isError: true } }
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
195
206
|
if (toolName === 'open_project') {
|
|
196
207
|
activeProjectId = toolArgs.projectId
|
|
197
208
|
registerProject()
|
|
@@ -344,10 +355,10 @@ IMPORTANT: The renderer is an iframe sized to the phone frame (393x852). Use w-f
|
|
|
344
355
|
</div>
|
|
345
356
|
|
|
346
357
|
=== IMAGES ===
|
|
347
|
-
NEVER use emoji as image placeholders. Use real
|
|
358
|
+
NEVER use emoji as image placeholders. Use real images:
|
|
348
359
|
- Avatars: https://i.pravatar.cc/SIZE?u=UNIQUE_NAME
|
|
349
|
-
-
|
|
350
|
-
-
|
|
360
|
+
- Contextual images (hero, illustrations, products, food, backgrounds): use the generate_image tool to create AI images that match the app's theme. Call generate_image BEFORE write_html, then use the returned URL in your <img> tags.
|
|
361
|
+
- Fallback only: https://picsum.photos/W/H?random=N (if generate_image is unavailable)
|
|
351
362
|
All images: object-cover, proper border-radius, aspect ratios.
|
|
352
363
|
|
|
353
364
|
=== QUALITY RULES ===
|
|
@@ -530,6 +541,33 @@ Example input:
|
|
|
530
541
|
required: ['links'],
|
|
531
542
|
},
|
|
532
543
|
},
|
|
544
|
+
{
|
|
545
|
+
name: 'generate_image',
|
|
546
|
+
description: `Generate a custom AI image using Flux Schnell. Returns a URL you can use in <img src="...">.
|
|
547
|
+
Use this instead of picsum.photos/unsplash for contextual images like:
|
|
548
|
+
- App illustrations, hero images, onboarding graphics
|
|
549
|
+
- Food photos, product images, lifestyle shots
|
|
550
|
+
- Backgrounds, patterns, mascots, characters
|
|
551
|
+
- Any image that should match the app's specific theme/context
|
|
552
|
+
|
|
553
|
+
Do NOT use for: maps, screenshots, icons, UI elements, text-heavy graphics.
|
|
554
|
+
Write detailed prompts: "flat illustration of a cozy coffee shop interior, warm tones, minimal style" not "coffee shop".`,
|
|
555
|
+
inputSchema: {
|
|
556
|
+
type: 'object',
|
|
557
|
+
properties: {
|
|
558
|
+
prompt: {
|
|
559
|
+
type: 'string',
|
|
560
|
+
description: 'Detailed image description. Include style (flat illustration, photo, 3D render), subject, mood, colors.',
|
|
561
|
+
},
|
|
562
|
+
size: {
|
|
563
|
+
type: 'string',
|
|
564
|
+
enum: ['square', 'landscape', 'portrait'],
|
|
565
|
+
description: 'Image aspect ratio. square=512x512, landscape=768x512, portrait=512x768. Default: square.',
|
|
566
|
+
},
|
|
567
|
+
},
|
|
568
|
+
required: ['prompt'],
|
|
569
|
+
},
|
|
570
|
+
},
|
|
533
571
|
{
|
|
534
572
|
name: 'list_projects',
|
|
535
573
|
description: 'List all your Verso projects. Returns project id, name, screen count, and last updated time.',
|