@stellisoft/stellify-mcp 0.1.25 → 0.1.26

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
@@ -127,11 +127,15 @@ This creates an EMPTY file shell - no methods, statements, or template yet. The
127
127
 
128
128
  COMPLETE WORKFLOW:
129
129
  1. create_file → creates empty shell, returns file UUID
130
- 2. create_statement + add_statement_code → add variables/imports (returns statement UUIDs)
131
- 3. create_method + add_method_body → add functions (returns method UUIDs)
130
+ 2. create_statement_with_code → add variables/imports in ONE call (returns statement UUIDs)
131
+ 3. create_method with body param → add functions in ONE call (returns method UUIDs)
132
132
  4. html_to_elements → create template elements (returns element UUIDs)
133
133
  5. save_file → FINALIZE by wiring template/data arrays with all collected UUIDs
134
134
 
135
+ LEGACY (still supported but prefer combined tools above):
136
+ - create_statement + add_statement_code (2 calls instead of 1)
137
+ - create_method + add_method_body + save_method for is_async (3 calls instead of 1)
138
+
135
139
  For PHP: Use type='class', 'model', 'controller', or 'middleware'.
136
140
  For Vue: Use type='js' and extension='vue'. Place in the 'js' directory.
137
141
 
@@ -180,11 +184,13 @@ The system resolves these to UUIDs automatically, creating missing dependencies
180
184
  },
181
185
  {
182
186
  name: 'create_method',
183
- description: `Create a method signature in a file. This only creates the method declaration, not the body. Use add_method_body to add implementation.
187
+ description: `Create a method in a file. Can optionally include the body and async flag in a single call.
188
+
189
+ **NEW: Combined creation** - You can now pass 'body' and 'is_async' to create the complete method in ONE call instead of three (create_method → add_method_body → save_method).
184
190
 
185
191
  Parameters are automatically created as clauses. The response includes the clause UUIDs for each parameter.
186
192
 
187
- Example request:
193
+ Example request (simple - signature only):
188
194
  {
189
195
  "file": "file-uuid",
190
196
  "name": "verify",
@@ -196,14 +202,22 @@ Example request:
196
202
  ]
197
203
  }
198
204
 
205
+ Example request (combined - with body and async):
206
+ {
207
+ "file": "file-uuid",
208
+ "name": "fetchData",
209
+ "body": "const response = await Http.get('/api/data');\\nreturn response.data;",
210
+ "is_async": true
211
+ }
212
+
199
213
  Example response includes:
200
214
  {
201
215
  "uuid": "method-uuid",
202
- "name": "verify",
203
- "returnType": "object",
204
- "nullable": true,
216
+ "name": "fetchData",
217
+ "is_async": true,
205
218
  "parameters": ["clause-uuid-for-credentials"],
206
- ...
219
+ "statements": {...}, // Only if body was provided
220
+ "clauses": {...} // Only if body was provided
207
221
  }`,
208
222
  inputSchema: {
209
223
  type: 'object',
@@ -225,6 +239,10 @@ Example response includes:
225
239
  type: 'boolean',
226
240
  description: 'Whether the method is static (PHP only)',
227
241
  },
242
+ is_async: {
243
+ type: 'boolean',
244
+ description: 'Whether the method is async (JavaScript/Vue only). Set to true for methods that use await.',
245
+ },
228
246
  returnType: {
229
247
  type: 'string',
230
248
  description: 'Return type (e.g., "int", "string", "void", "object")',
@@ -259,6 +277,10 @@ Example response includes:
259
277
  required: ['name'],
260
278
  },
261
279
  },
280
+ body: {
281
+ type: 'string',
282
+ description: 'Method body code (optional). If provided, automatically parses and adds the code. Example: "const response = await Http.get(\\"/api/data\\");\\nreturn response.data;"',
283
+ },
262
284
  },
263
285
  required: ['file', 'name'],
264
286
  },
@@ -799,6 +821,8 @@ Prefer SVG icons over emoji (encoding issues).`,
799
821
  name: 'create_statement',
800
822
  description: `Create an empty statement in a file. This is step 1 of 2 - you MUST call add_statement_code next to add the actual code.
801
823
 
824
+ **ALTERNATIVE:** Use create_statement_with_code for a single-call approach that combines both steps.
825
+
802
826
  IMPORTANT: This is a TWO-STEP process:
803
827
  1. create_statement → returns statement UUID
804
828
  2. add_statement_code → adds the actual code to that statement
@@ -822,10 +846,42 @@ For Vue components, include the returned statement UUID in save_file's 'statemen
822
846
  },
823
847
  },
824
848
  },
849
+ {
850
+ name: 'create_statement_with_code',
851
+ description: `Create a statement with code in a SINGLE call. This combines create_statement and add_statement_code.
852
+
853
+ **PREFERRED:** Use this instead of the two-step create_statement → add_statement_code process.
854
+
855
+ Examples:
856
+ - PHP: "use Illuminate\\Http\\Request;" or "private $items = [];"
857
+ - JS/Vue: "const count = ref(0);" or "import { ref } from 'vue';"
858
+
859
+ For Vue components, include the returned statement UUID in save_file's 'statements' array (NOT 'data' - that's for methods).`,
860
+ inputSchema: {
861
+ type: 'object',
862
+ properties: {
863
+ file: {
864
+ type: 'string',
865
+ description: 'UUID of the file to add the statement to',
866
+ },
867
+ code: {
868
+ type: 'string',
869
+ description: 'The code for the statement (e.g., "const count = ref(0);")',
870
+ },
871
+ method: {
872
+ type: 'string',
873
+ description: 'UUID of the method to add the statement to (optional, for method body statements)',
874
+ },
875
+ },
876
+ required: ['file', 'code'],
877
+ },
878
+ },
825
879
  {
826
880
  name: 'add_statement_code',
827
881
  description: `Add code to an existing statement. This is step 2 of 2 - call this AFTER create_statement.
828
882
 
883
+ **ALTERNATIVE:** Use create_statement_with_code for a single-call approach.
884
+
829
885
  The statement must already exist (created via create_statement). This parses and stores the code.
830
886
 
831
887
  Examples:
@@ -1404,7 +1460,7 @@ The response includes actionable suggestions like:
1404
1460
  },
1405
1461
  ];
1406
1462
  // Server instructions for tool discovery (used by MCP Tool Search)
1407
- const SERVER_INSTRUCTIONS = `Stellify is a coding platform where you code alongside AI on a codebase maintained and curated by AI. Build Laravel/PHP and Vue.js applications.
1463
+ const SERVER_INSTRUCTIONS = `Stellify is a coding platform where you code alongside AI on a codebase maintained and curated by AI. Build Laravel, stellify-framework, and Vue.js applications.
1408
1464
 
1409
1465
  Use Stellify tools when:
1410
1466
  - Building PHP controllers, models, middleware, or classes
@@ -1434,18 +1490,21 @@ Key concepts:
1434
1490
  - create_route with name like "notes-template" or "component-name-template"
1435
1491
  - This route is NOT where the component displays - it's only for accessing the template in the Stellify visual editor
1436
1492
  - The actual display route (e.g., "/notes") will have just \`<div id="app"></div>\` where Vue mounts
1437
- 4. Create statements for imports:
1438
- - "import { ref, onMounted } from 'vue';" (REQUIRED for ref() and lifecycle hooks)
1439
- - "import { Http } from 'stellify-framework';" (for API calls)
1493
+ 4. Create statements for imports using **create_statement_with_code** (ONE call each):
1494
+ - create_statement_with_code(file, "import { ref, onMounted } from 'vue';")
1495
+ - create_statement_with_code(file, "import { Http } from 'stellify-framework';")
1440
1496
  NOTE: The npm package is "stellify-framework" (NOT @stellify/core)
1441
- 5. Create statements for reactive data: "const notes = ref([]);"
1442
- 6. create_method + add_method_body for functions. Example fetchNotes body:
1497
+ 5. Create statements for reactive data: create_statement_with_code(file, "const notes = ref([]);")
1498
+ 6. **create_method with body and is_async** (ONE call instead of three). Example:
1443
1499
  \`\`\`
1444
- const response = await Http.get('/api/notes');
1445
- notes.value = response.data || [];
1500
+ create_method({
1501
+ file: fileUuid,
1502
+ name: "fetchNotes",
1503
+ body: "const response = await Http.get('/api/notes');\\nnotes.value = response.data || [];",
1504
+ is_async: true
1505
+ })
1446
1506
  \`\`\`
1447
- **THEN call save_method with is_async: true** (required for methods using await)
1448
- 7. Create statement for onMounted: "onMounted(fetchNotes);" (direct method reference, no arrow wrapper)
1507
+ 7. Create statement for onMounted: create_statement_with_code(file, "onMounted(fetchNotes);")
1449
1508
  8. html_to_elements → template **with page=templateRouteUuid** (attach to the template route for editor access)
1450
1509
  9. update_element → wire click handlers to method UUIDs
1451
1510
  10. save_file with: extension='vue', template=[elementUuid], data=[methodUuids], statements=[importUuids, refUuids, onMountedUuid]
@@ -1497,7 +1556,7 @@ notes.value = response.data.data || []; // BUG: response.data.data is undefined
1497
1556
  - add_method_body APPENDS, doesn't replace - create new method to replace
1498
1557
  - 'data' array = method UUIDs, 'statements' array = import/variable UUIDs
1499
1558
  - For buttons in forms, set inputType: "button" to prevent auto-submit
1500
- - **Async methods:** Methods using await MUST be marked async via save_method with is_async: true
1559
+ - **Async methods:** Methods using await MUST be marked async. Use is_async: true in create_method (preferred) or save_method
1501
1560
  - **onMounted:** Use direct method reference: "onMounted(fetchNotes);"
1502
1561
  The assembler automatically outputs lifecycle hooks after method definitions.
1503
1562
 
@@ -1536,32 +1595,11 @@ When using a nullable ref (e.g., \`const editingNote = ref(null)\`) with v-model
1536
1595
  4. Start editing: \`editingItem.value = { ...item };\`
1537
1596
  5. Cancel/save: \`editingItem.value = null;\`
1538
1597
 
1539
- ## Framework Capabilities (Libraries/Packages)
1540
-
1541
- **CRITICAL: You write BUSINESS LOGIC only. Capabilities are installed packages/libraries (Sanctum, Stripe, AWS SDK, etc.) that Stellify provides. You CANNOT create these by writing code.**
1542
-
1543
- Examples of capabilities (packages you cannot write):
1544
- - Authentication: laravel/sanctum, laravel/socialite
1545
- - Payments: stripe/stripe-php
1546
- - Storage: aws/aws-sdk-php, league/flysystem-aws-s3-v3
1547
- - Email: mailgun/mailgun-php, aws/aws-sdk-php (SES)
1548
- - Search: meilisearch/meilisearch-php, algolia/algoliasearch-client-php
1549
- - WebSocket: laravel/reverb
1550
-
1551
- **WORKFLOW:**
1598
+ ## Stack and Business Logic
1552
1599
 
1553
- 1. When a user requests functionality that might need a package/library, check the capabilities list from get_project FIRST.
1600
+ **Default stack:** Laravel (PHP), stellify-framework (JS), and Vue.js. Available capabilities (optional packages/libraries) are returned by \`get_project\`. Use \`get_stellify_framework_api\` for the stellify-framework API reference.
1554
1601
 
1555
- 2. If status is "available" package is installed, proceed with business logic.
1556
-
1557
- 3. If status is "needs_config" → package installed but needs API keys. INFORM THE USER to configure it in Project Settings.
1558
-
1559
- 4. If status is "not_available" or doesn't exist:
1560
- - STOP IMMEDIATELY
1561
- - Call request_capability() to log it
1562
- - INFORM THE USER: "This feature requires the [X] package which isn't installed in Stellify yet. I've logged a request. This cannot be built until the package is added."
1563
-
1564
- **NEVER write code that belongs in a package.** If you find yourself writing OAuth flows, payment processing, S3 clients, email transport, search indexing, or similar infrastructure - STOP. That's a capability request, not business logic.
1602
+ **All business logic** (controllers, models, middleware, etc.) goes in the tenant DB via MCP tools. If a required capability is not available, use \`request_capability\` to log it.
1565
1603
 
1566
1604
  ## Project Modules (Code Organization)
1567
1605
 
@@ -1621,7 +1659,7 @@ Example app.js structure:
1621
1659
  // Create MCP server
1622
1660
  const server = new Server({
1623
1661
  name: 'stellify-mcp',
1624
- version: '0.1.25',
1662
+ version: '0.1.26',
1625
1663
  }, {
1626
1664
  capabilities: {
1627
1665
  tools: {},
@@ -1700,15 +1738,26 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
1700
1738
  case 'create_method': {
1701
1739
  const result = await stellify.createMethod(args);
1702
1740
  const methodData = result.data || result;
1741
+ const hasBody = !!args.body;
1742
+ const response = {
1743
+ success: true,
1744
+ message: hasBody
1745
+ ? `Created method "${args.name}" with body (UUID: ${methodData.uuid})`
1746
+ : `Created method "${args.name}" (UUID: ${methodData.uuid})`,
1747
+ method: methodData,
1748
+ };
1749
+ // Include statements and clauses if body was provided
1750
+ if (result.statements) {
1751
+ response.statements = result.statements;
1752
+ }
1753
+ if (result.clauses) {
1754
+ response.clauses = result.clauses;
1755
+ }
1703
1756
  return {
1704
1757
  content: [
1705
1758
  {
1706
1759
  type: 'text',
1707
- text: JSON.stringify({
1708
- success: true,
1709
- message: `Created method "${args.name}" (UUID: ${methodData.uuid})`,
1710
- method: methodData,
1711
- }, null, 2),
1760
+ text: JSON.stringify(response, null, 2),
1712
1761
  },
1713
1762
  ],
1714
1763
  };
@@ -2030,6 +2079,24 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
2030
2079
  ],
2031
2080
  };
2032
2081
  }
2082
+ case 'create_statement_with_code': {
2083
+ const result = await stellify.createStatementWithCode(args);
2084
+ const statementData = result.data || result;
2085
+ return {
2086
+ content: [
2087
+ {
2088
+ type: 'text',
2089
+ text: JSON.stringify({
2090
+ success: true,
2091
+ message: `Created statement with code (UUID: ${statementData.uuid})`,
2092
+ statement: statementData.statement || statementData,
2093
+ statements: statementData.statements,
2094
+ clauses: statementData.clauses,
2095
+ }, null, 2),
2096
+ },
2097
+ ],
2098
+ };
2099
+ }
2033
2100
  case 'add_statement_code': {
2034
2101
  const result = await stellify.addStatementCode(args);
2035
2102
  return {
@@ -17,11 +17,16 @@ export interface CreateMethodParams {
17
17
  name: string;
18
18
  visibility?: 'public' | 'protected' | 'private';
19
19
  is_static?: boolean;
20
+ is_async?: boolean;
20
21
  returnType?: string;
22
+ nullable?: boolean;
21
23
  parameters?: Array<{
22
24
  name: string;
23
- type: string;
25
+ type?: string;
26
+ datatype?: string;
27
+ value?: string;
24
28
  }>;
29
+ body?: string;
25
30
  }
26
31
  export interface AddMethodBodyParams {
27
32
  file: string;
@@ -84,6 +89,11 @@ export declare class StellifyClient {
84
89
  file?: string;
85
90
  method?: string;
86
91
  }): Promise<any>;
92
+ createStatementWithCode(params: {
93
+ file: string;
94
+ code: string;
95
+ method?: string;
96
+ }): Promise<any>;
87
97
  getStatement(statement: string): Promise<any>;
88
98
  deleteStatement(file: string, method: string, statement: string): Promise<any>;
89
99
  saveStatement(statement: string, data: any): Promise<any>;
@@ -63,6 +63,11 @@ export class StellifyClient {
63
63
  const response = await this.client.post('/statement', params);
64
64
  return response.data;
65
65
  }
66
+ // NEW: Combined create statement with code in a single call
67
+ async createStatementWithCode(params) {
68
+ const response = await this.client.post('/statement/with-code', params);
69
+ return response.data;
70
+ }
66
71
  async getStatement(statement) {
67
72
  const response = await this.client.get(`/statement/${statement}`);
68
73
  return response.data;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stellisoft/stellify-mcp",
3
- "version": "0.1.25",
3
+ "version": "0.1.26",
4
4
  "mcpName": "io.github.MattStellisoft/stellify-mcp",
5
5
  "description": "MCP server for Stellify - AI-native code generation platform",
6
6
  "main": "dist/index.js",
package/server.json CHANGED
@@ -6,12 +6,12 @@
6
6
  "url": "https://github.com/Stellify-Software-Ltd/stellify-mcp",
7
7
  "source": "github"
8
8
  },
9
- "version": "0.1.25",
9
+ "version": "0.1.26",
10
10
  "packages": [
11
11
  {
12
12
  "registryType": "npm",
13
13
  "identifier": "@stellisoft/stellify-mcp",
14
- "version": "0.1.25",
14
+ "version": "0.1.26",
15
15
  "transport": {
16
16
  "type": "stdio"
17
17
  },