verso-mcp 0.1.5 → 0.1.7

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.
Files changed (2) hide show
  1. package/index.js +52 -4
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -195,7 +195,18 @@ async function handleMessage(message) {
195
195
  if (toolName === 'open_project') {
196
196
  activeProjectId = toolArgs.projectId
197
197
  registerProject()
198
- return { jsonrpc: '2.0', id, result: { content: [{ type: 'text', text: `Switched to project ${activeProjectId}` }] } }
198
+ return { jsonrpc: '2.0', id, result: { content: [{ type: 'text', text: `Switched to project ${activeProjectId}. You can now use design tools.` }] } }
199
+ }
200
+
201
+ // Guard: require open_project first
202
+ if (!activeProjectId) {
203
+ return {
204
+ jsonrpc: '2.0', id,
205
+ result: {
206
+ content: [{ type: 'text', text: 'Error: No project is open. Call open_project first with a projectId from list_projects.' }],
207
+ isError: true,
208
+ },
209
+ }
199
210
  }
200
211
 
201
212
  try {
@@ -449,7 +460,7 @@ The user can edit this prompt manually in the inspector — always respect their
449
460
  },
450
461
  {
451
462
  name: 'list_screens',
452
- description: 'List all screens in the project with their indices and active status.',
463
+ description: 'List all screens in the project with their indices and active status. Requires open_project first.',
453
464
  inputSchema: { type: 'object', properties: {} },
454
465
  },
455
466
  {
@@ -465,7 +476,7 @@ The user can edit this prompt manually in the inspector — always respect their
465
476
  },
466
477
  {
467
478
  name: 'get_design_settings',
468
- description: 'Returns the current design system state (theme, accentColor, iconLibrary, fontFamily, device, viewport) AND the designPrompt the master design brief for this project. IMPORTANT: Always call this before write_html to read the current designPrompt so you can update it properly. The user may have edited the prompt manually.',
479
+ description: 'Returns the current design system state (theme, accentColor, iconLibrary, fontFamily, device, viewport) AND the designPrompt. Requires open_project first. IMPORTANT: Always call this before write_html to read the current designPrompt so you can update it properly.',
469
480
  inputSchema: { type: 'object', properties: {} },
470
481
  },
471
482
  {
@@ -482,6 +493,43 @@ The user can edit this prompt manually in the inspector — always respect their
482
493
  },
483
494
  },
484
495
  },
496
+ {
497
+ name: 'auto_prototype',
498
+ description: `Gather all screens' layer trees and design context in a single call for auto-prototyping analysis.
499
+ Returns every screen's name, index, and element tree so you can determine which interactive elements (tab bar buttons, nav buttons, CTAs, cards, back arrows) should link to which screens.
500
+
501
+ After analyzing, call set_links with your mapping to apply data-ps-link attributes.`,
502
+ inputSchema: { type: 'object', properties: {} },
503
+ },
504
+ {
505
+ name: 'set_links',
506
+ description: `Apply navigation links between screens in batch. Each link sets a data-ps-link attribute on an element so that clicking it navigates to the target screen.
507
+
508
+ Example input:
509
+ { "links": [
510
+ { "screenIndex": 0, "nodeId": "ps-42", "targetScreen": "Cart" },
511
+ { "screenIndex": 1, "nodeId": "ps-7", "targetScreen": "Home" }
512
+ ]}`,
513
+ inputSchema: {
514
+ type: 'object',
515
+ properties: {
516
+ links: {
517
+ type: 'array',
518
+ description: 'Array of link mappings to apply',
519
+ items: {
520
+ type: 'object',
521
+ properties: {
522
+ screenIndex: { type: 'number', description: 'Index of the screen containing the element' },
523
+ nodeId: { type: 'string', description: 'The data-ps-id of the element to make clickable' },
524
+ targetScreen: { type: 'string', description: 'Name of the screen to navigate to (must match exactly)' },
525
+ },
526
+ required: ['screenIndex', 'nodeId', 'targetScreen'],
527
+ },
528
+ },
529
+ },
530
+ required: ['links'],
531
+ },
532
+ },
485
533
  {
486
534
  name: 'list_projects',
487
535
  description: 'List all your Verso projects. Returns project id, name, screen count, and last updated time.',
@@ -489,7 +537,7 @@ The user can edit this prompt manually in the inspector — always respect their
489
537
  },
490
538
  {
491
539
  name: 'open_project',
492
- description: 'Connect to a specific Verso project by its ID. Must be called before using any design tools.',
540
+ description: 'Connect to a specific Verso project by its ID. ⚠️ REQUIRED: You MUST call this before ANY other tool (except list_projects). All other tools will fail if no project is open.',
493
541
  inputSchema: {
494
542
  type: 'object',
495
543
  properties: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "verso-mcp",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "description": "MCP server for Verso — AI-powered mobile app design tool",
5
5
  "bin": {
6
6
  "verso-mcp": "./index.js"