@stellisoft/stellify-mcp 0.1.18 → 0.1.21
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 +483 -9
- package/dist/stellify-client.d.ts +7 -0
- package/dist/stellify-client.js +20 -0
- package/package.json +1 -1
- package/server.json +2 -2
package/dist/index.js
CHANGED
|
@@ -197,6 +197,42 @@ const stellify = new StellifyClient({
|
|
|
197
197
|
// Embed: create,store,compare,nearest,search,toJSON
|
|
198
198
|
// Diff: chars,words,lines,apply,createPatch,similarity
|
|
199
199
|
//
|
|
200
|
+
// -----------------------------------------------------------------------------
|
|
201
|
+
// COMMON PITFALLS - AVOID THESE MISTAKES
|
|
202
|
+
// -----------------------------------------------------------------------------
|
|
203
|
+
// 1. v-model requires ref(), NOT Form class
|
|
204
|
+
// WRONG: const form = Form.create({title: ''}) with v-model="form.title"
|
|
205
|
+
// RIGHT: const formData = ref({title: ''}) with v-model="formData.title"
|
|
206
|
+
//
|
|
207
|
+
// 2. List.from() returns List instance, not array - use .toArray() for v-for
|
|
208
|
+
// WRONG: notes.value = List.from(response.data)
|
|
209
|
+
// RIGHT: notes.value = List.from(response.data).toArray()
|
|
210
|
+
//
|
|
211
|
+
// 3. add_method_body APPENDS, doesn't replace - create new method to replace
|
|
212
|
+
//
|
|
213
|
+
// 4. Use 'inputType' not 'type' for HTML type attribute on elements
|
|
214
|
+
//
|
|
215
|
+
// 5. Statements go in 'statements' array, methods go in 'data' array in save_file
|
|
216
|
+
//
|
|
217
|
+
// 6. Always wire click handlers to METHOD UUIDs, not file UUIDs
|
|
218
|
+
//
|
|
219
|
+
// 7. For buttons in forms, set inputType: "button" to prevent auto-submit
|
|
220
|
+
//
|
|
221
|
+
// -----------------------------------------------------------------------------
|
|
222
|
+
// ERROR HANDLING
|
|
223
|
+
// -----------------------------------------------------------------------------
|
|
224
|
+
// If a tool call fails, check:
|
|
225
|
+
// - UUID validity: Is the file/method/element UUID correct and exists?
|
|
226
|
+
// - Required fields: Did you provide all required parameters?
|
|
227
|
+
// - Order of operations: Did you create the parent before the child?
|
|
228
|
+
// - Array contents: Are you passing statement UUIDs to 'statements' (not 'data')?
|
|
229
|
+
//
|
|
230
|
+
// Common error scenarios:
|
|
231
|
+
// - "File not found" → The file UUID is invalid or was deleted
|
|
232
|
+
// - "Method not found" → The method UUID doesn't exist in that file
|
|
233
|
+
// - "Invalid element type" → Use valid types like s-wrapper, s-input, s-form
|
|
234
|
+
// - Empty response → Operation succeeded but returned no data (normal for deletes)
|
|
235
|
+
//
|
|
200
236
|
// =============================================================================
|
|
201
237
|
// Define MCP tools
|
|
202
238
|
// Stellify Framework API - full method reference for AI code generation
|
|
@@ -253,6 +289,14 @@ Use this tool when you need to:
|
|
|
253
289
|
- Verify method names before generating code
|
|
254
290
|
- Understand the full API surface
|
|
255
291
|
|
|
292
|
+
IMPORTANT - List class and Vue reactivity:
|
|
293
|
+
The List class methods return List instances, NOT plain arrays.
|
|
294
|
+
Vue's v-for directive cannot iterate over List instances directly.
|
|
295
|
+
|
|
296
|
+
When assigning to a Vue ref that will be used with v-for, call .toArray():
|
|
297
|
+
- CORRECT: notes.value = List.from(response.data).toArray();
|
|
298
|
+
- INCORRECT (v-for won't work): notes.value = List.from(response.data);
|
|
299
|
+
|
|
256
300
|
Example response:
|
|
257
301
|
{
|
|
258
302
|
"Form": ["create", "set", "get", "validate", "store", "update", "delete", ...],
|
|
@@ -434,7 +478,14 @@ Example response includes:
|
|
|
434
478
|
},
|
|
435
479
|
{
|
|
436
480
|
name: 'add_method_body',
|
|
437
|
-
description:
|
|
481
|
+
description: `Parse and add PHP code to a method body. Provide the method implementation code (without the function declaration). Stellify will parse it into structured statements.
|
|
482
|
+
|
|
483
|
+
IMPORTANT: This APPENDS to existing method statements. To REPLACE a method's code:
|
|
484
|
+
1. Create a NEW method with create_method
|
|
485
|
+
2. Add body with add_method_body
|
|
486
|
+
3. Update the file's 'data' array to include new method UUID (remove old one)
|
|
487
|
+
4. Update any element click handlers to reference the new method UUID
|
|
488
|
+
5. Optionally delete the old method with delete_method`,
|
|
438
489
|
inputSchema: {
|
|
439
490
|
type: 'object',
|
|
440
491
|
properties: {
|
|
@@ -456,15 +507,24 @@ Example response includes:
|
|
|
456
507
|
},
|
|
457
508
|
{
|
|
458
509
|
name: 'save_method',
|
|
459
|
-
description: `Update an existing method's properties (name, visibility, returnType, nullable, parameters).
|
|
510
|
+
description: `Update an existing method's properties (name, visibility, returnType, nullable, parameters, data).
|
|
460
511
|
|
|
461
512
|
Use this to modify a method after creation. For updating the method body, use add_method_body instead.
|
|
462
513
|
|
|
463
|
-
|
|
514
|
+
Parameters:
|
|
515
|
+
- data: Array of statement UUIDs that form the method body. Use this to reorder statements or remove unwanted statements from the method.
|
|
516
|
+
|
|
517
|
+
Example - Update return type:
|
|
464
518
|
{
|
|
465
519
|
"uuid": "method-uuid",
|
|
466
520
|
"returnType": "object",
|
|
467
521
|
"nullable": true
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
Example - Remove duplicate/unwanted statements:
|
|
525
|
+
{
|
|
526
|
+
"uuid": "method-uuid",
|
|
527
|
+
"data": ["statement-uuid-1", "statement-uuid-2"] // Only keep these statements
|
|
468
528
|
}`,
|
|
469
529
|
inputSchema: {
|
|
470
530
|
type: 'object',
|
|
@@ -499,6 +559,11 @@ Example:
|
|
|
499
559
|
description: 'Array of parameter clause UUIDs',
|
|
500
560
|
items: { type: 'string' },
|
|
501
561
|
},
|
|
562
|
+
data: {
|
|
563
|
+
type: 'array',
|
|
564
|
+
description: 'Array of statement UUIDs that form the method body. Use to reorder or remove statements.',
|
|
565
|
+
items: { type: 'string' },
|
|
566
|
+
},
|
|
502
567
|
},
|
|
503
568
|
required: ['uuid'],
|
|
504
569
|
},
|
|
@@ -520,6 +585,34 @@ Example:
|
|
|
520
585
|
},
|
|
521
586
|
},
|
|
522
587
|
},
|
|
588
|
+
{
|
|
589
|
+
name: 'delete_method',
|
|
590
|
+
description: 'Delete a method from a file by UUID. This permanently removes the method and all its code.',
|
|
591
|
+
inputSchema: {
|
|
592
|
+
type: 'object',
|
|
593
|
+
properties: {
|
|
594
|
+
uuid: {
|
|
595
|
+
type: 'string',
|
|
596
|
+
description: 'UUID of the method to delete',
|
|
597
|
+
},
|
|
598
|
+
},
|
|
599
|
+
required: ['uuid'],
|
|
600
|
+
},
|
|
601
|
+
},
|
|
602
|
+
{
|
|
603
|
+
name: 'get_method',
|
|
604
|
+
description: 'Get a method by UUID. Returns the method data including its parameters and body.',
|
|
605
|
+
inputSchema: {
|
|
606
|
+
type: 'object',
|
|
607
|
+
properties: {
|
|
608
|
+
uuid: {
|
|
609
|
+
type: 'string',
|
|
610
|
+
description: 'UUID of the method to retrieve',
|
|
611
|
+
},
|
|
612
|
+
},
|
|
613
|
+
required: ['uuid'],
|
|
614
|
+
},
|
|
615
|
+
},
|
|
523
616
|
{
|
|
524
617
|
name: 'search_files',
|
|
525
618
|
description: 'Search for files in the project by name or type',
|
|
@@ -539,7 +632,39 @@ Example:
|
|
|
539
632
|
},
|
|
540
633
|
{
|
|
541
634
|
name: 'create_route',
|
|
542
|
-
description:
|
|
635
|
+
description: `Create a new route/page in a Stellify project.
|
|
636
|
+
|
|
637
|
+
IMPORTANT - WIRING ROUTES TO CONTROLLERS:
|
|
638
|
+
For API routes to execute code, you MUST connect them to a controller and method:
|
|
639
|
+
- controller: UUID of the controller file (e.g., NoteController)
|
|
640
|
+
- controller_method: UUID of the method to execute (e.g., index, store, update, destroy)
|
|
641
|
+
|
|
642
|
+
Without these fields, the route exists but won't execute any code!
|
|
643
|
+
|
|
644
|
+
EXAMPLE - Create an API route wired to a controller:
|
|
645
|
+
{
|
|
646
|
+
"project_id": "project-uuid",
|
|
647
|
+
"name": "notes.index",
|
|
648
|
+
"path": "/api/notes",
|
|
649
|
+
"method": "GET",
|
|
650
|
+
"type": "api",
|
|
651
|
+
"controller": "controller-file-uuid",
|
|
652
|
+
"controller_method": "index-method-uuid"
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
WORKFLOW for API endpoints:
|
|
656
|
+
1. Create controller with create_file (type: "controller") or create_resources
|
|
657
|
+
2. Create methods with create_method + add_method_body
|
|
658
|
+
3. Create route with create_route, passing controller and controller_method UUIDs
|
|
659
|
+
|
|
660
|
+
ROUTE PARAMETERS:
|
|
661
|
+
Route parameters like {id} in "/api/notes/{id}" are automatically injected into controller method parameters when the parameter name matches.
|
|
662
|
+
|
|
663
|
+
Example: Route "/api/notes/{id}" (DELETE) with controller method destroy($id)
|
|
664
|
+
The $id parameter receives the value from the URL automatically.
|
|
665
|
+
|
|
666
|
+
When creating methods with create_method, include the parameter:
|
|
667
|
+
{ "name": "destroy", "parameters": [{ "name": "id", "datatype": "int" }] }`,
|
|
543
668
|
inputSchema: {
|
|
544
669
|
type: 'object',
|
|
545
670
|
properties: {
|
|
@@ -549,11 +674,11 @@ Example:
|
|
|
549
674
|
},
|
|
550
675
|
name: {
|
|
551
676
|
type: 'string',
|
|
552
|
-
description: 'Route/page name (e.g., "Home", "Counter", "
|
|
677
|
+
description: 'Route/page name (e.g., "Home", "Counter", "notes.index")',
|
|
553
678
|
},
|
|
554
679
|
path: {
|
|
555
680
|
type: 'string',
|
|
556
|
-
description: 'URL path (e.g., "/", "/counter", "/
|
|
681
|
+
description: 'URL path (e.g., "/", "/counter", "/api/notes")',
|
|
557
682
|
},
|
|
558
683
|
method: {
|
|
559
684
|
type: 'string',
|
|
@@ -567,6 +692,14 @@ Example:
|
|
|
567
692
|
description: 'Route type: "web" for pages, "api" for API endpoints',
|
|
568
693
|
default: 'web',
|
|
569
694
|
},
|
|
695
|
+
controller: {
|
|
696
|
+
type: 'string',
|
|
697
|
+
description: 'UUID of the controller file to handle this route. Required for API routes to execute code.',
|
|
698
|
+
},
|
|
699
|
+
controller_method: {
|
|
700
|
+
type: 'string',
|
|
701
|
+
description: 'UUID of the method within the controller to execute. Required for API routes to execute code.',
|
|
702
|
+
},
|
|
570
703
|
data: {
|
|
571
704
|
type: 'object',
|
|
572
705
|
description: 'Additional route data (title, description, element UUIDs)',
|
|
@@ -595,6 +728,90 @@ Use this to look up a route you created or to find existing routes in the projec
|
|
|
595
728
|
required: ['uuid'],
|
|
596
729
|
},
|
|
597
730
|
},
|
|
731
|
+
{
|
|
732
|
+
name: 'save_route',
|
|
733
|
+
description: `Update an existing route/page. Use this to wire a route to a controller method.
|
|
734
|
+
|
|
735
|
+
IMPORTANT: This is how you connect API routes to controller methods!
|
|
736
|
+
|
|
737
|
+
Example - Wire an API route to a controller method:
|
|
738
|
+
{
|
|
739
|
+
"uuid": "route-uuid",
|
|
740
|
+
"controller": "controller-file-uuid",
|
|
741
|
+
"controller_method": "method-uuid"
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
Available fields:
|
|
745
|
+
- controller: UUID of the controller file
|
|
746
|
+
- controller_method: UUID of the method to execute
|
|
747
|
+
- path: URL path
|
|
748
|
+
- name: Route name
|
|
749
|
+
- type: "web" or "api"
|
|
750
|
+
- method: HTTP method (GET, POST, PUT, DELETE, PATCH)
|
|
751
|
+
- middleware: Array of middleware names
|
|
752
|
+
- public: Whether the route is public (no auth required)`,
|
|
753
|
+
inputSchema: {
|
|
754
|
+
type: 'object',
|
|
755
|
+
properties: {
|
|
756
|
+
uuid: {
|
|
757
|
+
type: 'string',
|
|
758
|
+
description: 'UUID of the route to update',
|
|
759
|
+
},
|
|
760
|
+
controller: {
|
|
761
|
+
type: 'string',
|
|
762
|
+
description: 'UUID of the controller file to handle this route',
|
|
763
|
+
},
|
|
764
|
+
controller_method: {
|
|
765
|
+
type: 'string',
|
|
766
|
+
description: 'UUID of the method within the controller to execute',
|
|
767
|
+
},
|
|
768
|
+
path: {
|
|
769
|
+
type: 'string',
|
|
770
|
+
description: 'URL path (e.g., "/api/notes")',
|
|
771
|
+
},
|
|
772
|
+
name: {
|
|
773
|
+
type: 'string',
|
|
774
|
+
description: 'Route name',
|
|
775
|
+
},
|
|
776
|
+
type: {
|
|
777
|
+
type: 'string',
|
|
778
|
+
enum: ['web', 'api'],
|
|
779
|
+
description: 'Route type',
|
|
780
|
+
},
|
|
781
|
+
method: {
|
|
782
|
+
type: 'string',
|
|
783
|
+
enum: ['GET', 'POST', 'PUT', 'DELETE', 'PATCH'],
|
|
784
|
+
description: 'HTTP method',
|
|
785
|
+
},
|
|
786
|
+
middleware: {
|
|
787
|
+
type: 'array',
|
|
788
|
+
items: { type: 'string' },
|
|
789
|
+
description: 'Array of middleware names',
|
|
790
|
+
},
|
|
791
|
+
public: {
|
|
792
|
+
type: 'boolean',
|
|
793
|
+
description: 'Whether the route is public (no auth required)',
|
|
794
|
+
},
|
|
795
|
+
},
|
|
796
|
+
required: ['uuid'],
|
|
797
|
+
},
|
|
798
|
+
},
|
|
799
|
+
{
|
|
800
|
+
name: 'delete_route',
|
|
801
|
+
description: `Delete a route/page from the project by UUID. This permanently removes the route.
|
|
802
|
+
|
|
803
|
+
WARNING: This is destructive and cannot be undone. Any elements attached to this route will become orphaned.`,
|
|
804
|
+
inputSchema: {
|
|
805
|
+
type: 'object',
|
|
806
|
+
properties: {
|
|
807
|
+
uuid: {
|
|
808
|
+
type: 'string',
|
|
809
|
+
description: 'UUID of the route to delete',
|
|
810
|
+
},
|
|
811
|
+
},
|
|
812
|
+
required: ['uuid'],
|
|
813
|
+
},
|
|
814
|
+
},
|
|
598
815
|
{
|
|
599
816
|
name: 'search_routes',
|
|
600
817
|
description: `Search for routes/pages in the project by name. Use this to find existing routes before creating new ones.
|
|
@@ -628,7 +845,17 @@ Valid element types:
|
|
|
628
845
|
- HTML5: s-wrapper, s-input, s-form, s-svg, s-shape, s-media, s-iframe
|
|
629
846
|
- Components: s-loop, s-transition, s-freestyle, s-motion
|
|
630
847
|
- Blade: s-directive
|
|
631
|
-
- Shadcn/ui: s-chart, s-table, s-combobox, s-accordion, s-calendar, s-contiguous
|
|
848
|
+
- Shadcn/ui: s-chart, s-table, s-combobox, s-accordion, s-calendar, s-contiguous
|
|
849
|
+
|
|
850
|
+
s-loop ELEMENT TYPE:
|
|
851
|
+
Use s-loop for elements that should render with v-for directive.
|
|
852
|
+
Required attributes (set via update_element after creation):
|
|
853
|
+
- loop: The v-for expression (e.g., "note in notes", "item in items")
|
|
854
|
+
- key: The :key binding (e.g., "note.id", "item.id")
|
|
855
|
+
|
|
856
|
+
Example: After creating s-loop, update it with:
|
|
857
|
+
{ "tag": "div", "loop": "note in notes", "key": "note.id", "classes": ["card", "p-4"] }
|
|
858
|
+
Generates: <div class="card p-4" v-for="note in notes" :key="note.id">`,
|
|
632
859
|
inputSchema: {
|
|
633
860
|
type: 'object',
|
|
634
861
|
properties: {
|
|
@@ -668,6 +895,19 @@ Special Stellify fields:
|
|
|
668
895
|
- classes: CSS classes array ["class1", "class2"]
|
|
669
896
|
- text: Element text content
|
|
670
897
|
|
|
898
|
+
V-MODEL BINDING (for s-input elements):
|
|
899
|
+
- variable: Set this to bind v-model to a reactive variable
|
|
900
|
+
- Example: { "variable": "formData.title" } renders as <input v-model="formData.title" />
|
|
901
|
+
- IMPORTANT: The variable must reference a Vue ref() object, NOT a Form class instance
|
|
902
|
+
- CORRECT: const formData = ref({ title: '', content: '' }) → v-model="formData.title"
|
|
903
|
+
- WRONG: const form = Form.create({ title: '' }) → Form class is not reactive for v-model
|
|
904
|
+
|
|
905
|
+
INPUT TYPE ATTRIBUTE:
|
|
906
|
+
- Use 'inputType' (not 'type') to set the HTML type attribute on buttons/inputs
|
|
907
|
+
- Example: { "inputType": "button" } renders as type="button"
|
|
908
|
+
- Example: { "inputType": "textarea" } renders as <textarea> instead of <input>
|
|
909
|
+
- For buttons inside <form> elements, always set inputType: "button" to prevent form submission on click
|
|
910
|
+
|
|
671
911
|
EVENT HANDLERS (set value to method UUID):
|
|
672
912
|
- click: @click - buttons, links, any clickable element
|
|
673
913
|
- submit: @submit - form submission
|
|
@@ -680,6 +920,11 @@ EVENT HANDLERS (set value to method UUID):
|
|
|
680
920
|
- mouseenter: @mouseenter - mouse enters element
|
|
681
921
|
- mouseleave: @mouseleave - mouse leaves element
|
|
682
922
|
|
|
923
|
+
EVENT HANDLER ARGUMENTS:
|
|
924
|
+
When wiring click handlers that need arguments (e.g., from v-for loops), use clickArgs:
|
|
925
|
+
- { "click": "delete-method-uuid", "clickArgs": "item.id" } → @click="deleteItem(item.id)"
|
|
926
|
+
- { "click": "edit-method-uuid", "clickArgs": "item" } → @click="editItem(item)"
|
|
927
|
+
|
|
683
928
|
Example wiring a button click to a method:
|
|
684
929
|
{
|
|
685
930
|
"uuid": "button-element-uuid",
|
|
@@ -799,6 +1044,12 @@ Text like {{ count }} is automatically detected and:
|
|
|
799
1044
|
For Vue components: Omit 'page' - elements are created standalone for the component template.
|
|
800
1045
|
For page content: Provide 'page' (route UUID) to attach elements directly.
|
|
801
1046
|
|
|
1047
|
+
ICONS - Best practices:
|
|
1048
|
+
- Prefer SVG icons or icon fonts (Heroicons, Font Awesome) over emoji
|
|
1049
|
+
- Use HTML entities where available (e.g., × for ×)
|
|
1050
|
+
- Avoid raw emoji characters as they may have encoding issues
|
|
1051
|
+
- Example: <button><svg>...</svg></button> instead of <button>🗑️</button>
|
|
1052
|
+
|
|
802
1053
|
IMPORTANT: Use the returned root element UUID in save_file's template array.`,
|
|
803
1054
|
inputSchema: {
|
|
804
1055
|
type: 'object',
|
|
@@ -852,7 +1103,7 @@ Use cases:
|
|
|
852
1103
|
- PHP: Class properties, use statements, constants
|
|
853
1104
|
- JS/Vue: Variable declarations, imports, reactive refs
|
|
854
1105
|
|
|
855
|
-
For Vue components, include the returned statement UUID in save_file's 'data'
|
|
1106
|
+
For Vue components, include the returned statement UUID in save_file's 'statements' array (NOT 'data' - that's for methods).`,
|
|
856
1107
|
inputSchema: {
|
|
857
1108
|
type: 'object',
|
|
858
1109
|
properties: {
|
|
@@ -895,6 +1146,38 @@ Examples:
|
|
|
895
1146
|
required: ['file', 'statement', 'code'],
|
|
896
1147
|
},
|
|
897
1148
|
},
|
|
1149
|
+
{
|
|
1150
|
+
name: 'delete_statement',
|
|
1151
|
+
description: 'Delete a statement from a file by UUID. This permanently removes the statement (import, variable, ref, etc.).',
|
|
1152
|
+
inputSchema: {
|
|
1153
|
+
type: 'object',
|
|
1154
|
+
properties: {
|
|
1155
|
+
uuid: {
|
|
1156
|
+
type: 'string',
|
|
1157
|
+
description: 'UUID of the statement to delete',
|
|
1158
|
+
},
|
|
1159
|
+
},
|
|
1160
|
+
required: ['uuid'],
|
|
1161
|
+
},
|
|
1162
|
+
},
|
|
1163
|
+
{
|
|
1164
|
+
name: 'save_statement',
|
|
1165
|
+
description: 'Update an existing statement. Use this to modify statement properties after creation.',
|
|
1166
|
+
inputSchema: {
|
|
1167
|
+
type: 'object',
|
|
1168
|
+
properties: {
|
|
1169
|
+
uuid: {
|
|
1170
|
+
type: 'string',
|
|
1171
|
+
description: 'UUID of the statement to update',
|
|
1172
|
+
},
|
|
1173
|
+
data: {
|
|
1174
|
+
type: 'object',
|
|
1175
|
+
description: 'Statement data to update',
|
|
1176
|
+
},
|
|
1177
|
+
},
|
|
1178
|
+
required: ['uuid'],
|
|
1179
|
+
},
|
|
1180
|
+
},
|
|
898
1181
|
{
|
|
899
1182
|
name: 'save_file',
|
|
900
1183
|
description: `Save/update a file with its full configuration. This FINALIZES the file after create_file.
|
|
@@ -964,6 +1247,11 @@ For <script setup> content, the order in statements array determines output orde
|
|
|
964
1247
|
items: { type: 'string' },
|
|
965
1248
|
description: 'Array of file UUIDs to import',
|
|
966
1249
|
},
|
|
1250
|
+
models: {
|
|
1251
|
+
type: 'array',
|
|
1252
|
+
items: { type: 'string' },
|
|
1253
|
+
description: 'Array of model file UUIDs that this controller uses (required for model class loading)',
|
|
1254
|
+
},
|
|
967
1255
|
},
|
|
968
1256
|
required: ['uuid', 'name', 'type'],
|
|
969
1257
|
},
|
|
@@ -982,6 +1270,22 @@ For <script setup> content, the order in statements array determines output orde
|
|
|
982
1270
|
required: ['uuid'],
|
|
983
1271
|
},
|
|
984
1272
|
},
|
|
1273
|
+
{
|
|
1274
|
+
name: 'delete_file',
|
|
1275
|
+
description: `Delete a file from the project by UUID. This permanently removes the file and all its methods/statements.
|
|
1276
|
+
|
|
1277
|
+
WARNING: This is destructive and cannot be undone. Make sure the file is not referenced elsewhere before deleting.`,
|
|
1278
|
+
inputSchema: {
|
|
1279
|
+
type: 'object',
|
|
1280
|
+
properties: {
|
|
1281
|
+
uuid: {
|
|
1282
|
+
type: 'string',
|
|
1283
|
+
description: 'UUID of the file to delete',
|
|
1284
|
+
},
|
|
1285
|
+
},
|
|
1286
|
+
required: ['uuid'],
|
|
1287
|
+
},
|
|
1288
|
+
},
|
|
985
1289
|
{
|
|
986
1290
|
name: 'get_directory',
|
|
987
1291
|
description: `Get a directory by UUID to see its contents.
|
|
@@ -1020,6 +1324,24 @@ IMPORTANT: Check existing directories first using get_project and get_directory
|
|
|
1020
1324
|
required: ['name'],
|
|
1021
1325
|
},
|
|
1022
1326
|
},
|
|
1327
|
+
{
|
|
1328
|
+
name: 'save_directory',
|
|
1329
|
+
description: 'Update an existing directory. Use this to rename or modify directory properties.',
|
|
1330
|
+
inputSchema: {
|
|
1331
|
+
type: 'object',
|
|
1332
|
+
properties: {
|
|
1333
|
+
uuid: {
|
|
1334
|
+
type: 'string',
|
|
1335
|
+
description: 'UUID of the directory to update',
|
|
1336
|
+
},
|
|
1337
|
+
name: {
|
|
1338
|
+
type: 'string',
|
|
1339
|
+
description: 'New directory name',
|
|
1340
|
+
},
|
|
1341
|
+
},
|
|
1342
|
+
required: ['uuid'],
|
|
1343
|
+
},
|
|
1344
|
+
},
|
|
1023
1345
|
{
|
|
1024
1346
|
name: 'broadcast_element_command',
|
|
1025
1347
|
description: `Broadcast a real-time command to update UI elements via WebSocket.
|
|
@@ -1134,6 +1456,30 @@ RELATIONSHIP TYPES:
|
|
|
1134
1456
|
- belongsTo: Inverse of hasOne/hasMany (Post belongsTo User)
|
|
1135
1457
|
- belongsToMany: Many-to-many (User belongsToMany Roles)
|
|
1136
1458
|
|
|
1459
|
+
IMPORTANT - WIRING ROUTES TO CONTROLLERS:
|
|
1460
|
+
This tool creates controller methods but does NOT automatically wire routes to them.
|
|
1461
|
+
After calling create_resources, you must MANUALLY wire routes using create_route:
|
|
1462
|
+
|
|
1463
|
+
1. Note the returned controller UUID and method UUIDs from the response
|
|
1464
|
+
2. For each API route, call create_route with:
|
|
1465
|
+
- controller: the controller file UUID
|
|
1466
|
+
- controller_method: the specific method UUID (index, store, update, destroy)
|
|
1467
|
+
|
|
1468
|
+
Example response structure:
|
|
1469
|
+
{
|
|
1470
|
+
"controller": {
|
|
1471
|
+
"uuid": "controller-uuid",
|
|
1472
|
+
"methods": [
|
|
1473
|
+
{ "uuid": "index-method-uuid", "name": "index" },
|
|
1474
|
+
{ "uuid": "store-method-uuid", "name": "store" },
|
|
1475
|
+
...
|
|
1476
|
+
]
|
|
1477
|
+
}
|
|
1478
|
+
}
|
|
1479
|
+
|
|
1480
|
+
Then create routes:
|
|
1481
|
+
create_route({ path: "/api/notes", method: "GET", controller: "controller-uuid", controller_method: "index-method-uuid" })
|
|
1482
|
+
|
|
1137
1483
|
Returns UUIDs for all created files so you can customize them further if needed.`,
|
|
1138
1484
|
inputSchema: {
|
|
1139
1485
|
type: 'object',
|
|
@@ -1482,7 +1828,7 @@ Example module names: "user-auth", "blog-posts", "product-catalog", "order-manag
|
|
|
1482
1828
|
// Create MCP server
|
|
1483
1829
|
const server = new Server({
|
|
1484
1830
|
name: 'stellify-mcp',
|
|
1485
|
-
version: '0.1.
|
|
1831
|
+
version: '0.1.21',
|
|
1486
1832
|
}, {
|
|
1487
1833
|
capabilities: {
|
|
1488
1834
|
tools: {},
|
|
@@ -1619,6 +1965,37 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
1619
1965
|
],
|
|
1620
1966
|
};
|
|
1621
1967
|
}
|
|
1968
|
+
case 'delete_method': {
|
|
1969
|
+
const { uuid } = args;
|
|
1970
|
+
const result = await stellify.deleteMethod(uuid);
|
|
1971
|
+
return {
|
|
1972
|
+
content: [
|
|
1973
|
+
{
|
|
1974
|
+
type: 'text',
|
|
1975
|
+
text: JSON.stringify({
|
|
1976
|
+
success: true,
|
|
1977
|
+
message: `Deleted method ${uuid}`,
|
|
1978
|
+
data: result,
|
|
1979
|
+
}, null, 2),
|
|
1980
|
+
},
|
|
1981
|
+
],
|
|
1982
|
+
};
|
|
1983
|
+
}
|
|
1984
|
+
case 'get_method': {
|
|
1985
|
+
const { uuid } = args;
|
|
1986
|
+
const result = await stellify.getMethod(uuid);
|
|
1987
|
+
return {
|
|
1988
|
+
content: [
|
|
1989
|
+
{
|
|
1990
|
+
type: 'text',
|
|
1991
|
+
text: JSON.stringify({
|
|
1992
|
+
success: true,
|
|
1993
|
+
method: result,
|
|
1994
|
+
}, null, 2),
|
|
1995
|
+
},
|
|
1996
|
+
],
|
|
1997
|
+
};
|
|
1998
|
+
}
|
|
1622
1999
|
case 'search_files': {
|
|
1623
2000
|
const result = await stellify.searchFiles(args);
|
|
1624
2001
|
return {
|
|
@@ -1665,6 +2042,39 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
1665
2042
|
],
|
|
1666
2043
|
};
|
|
1667
2044
|
}
|
|
2045
|
+
case 'save_route': {
|
|
2046
|
+
const { uuid, ...updateData } = args;
|
|
2047
|
+
const result = await stellify.saveRoute(uuid, updateData);
|
|
2048
|
+
const routeData = result.data || result;
|
|
2049
|
+
return {
|
|
2050
|
+
content: [
|
|
2051
|
+
{
|
|
2052
|
+
type: 'text',
|
|
2053
|
+
text: JSON.stringify({
|
|
2054
|
+
success: true,
|
|
2055
|
+
message: `Updated route "${uuid}"${updateData.controller ? ' with controller wiring' : ''}`,
|
|
2056
|
+
route: routeData,
|
|
2057
|
+
}, null, 2),
|
|
2058
|
+
},
|
|
2059
|
+
],
|
|
2060
|
+
};
|
|
2061
|
+
}
|
|
2062
|
+
case 'delete_route': {
|
|
2063
|
+
const { uuid } = args;
|
|
2064
|
+
const result = await stellify.deleteRoute(uuid);
|
|
2065
|
+
return {
|
|
2066
|
+
content: [
|
|
2067
|
+
{
|
|
2068
|
+
type: 'text',
|
|
2069
|
+
text: JSON.stringify({
|
|
2070
|
+
success: true,
|
|
2071
|
+
message: `Deleted route ${uuid}`,
|
|
2072
|
+
data: result,
|
|
2073
|
+
}, null, 2),
|
|
2074
|
+
},
|
|
2075
|
+
],
|
|
2076
|
+
};
|
|
2077
|
+
}
|
|
1668
2078
|
case 'search_routes': {
|
|
1669
2079
|
const result = await stellify.searchRoutes(args);
|
|
1670
2080
|
const routes = result.data || result;
|
|
@@ -1842,6 +2252,38 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
1842
2252
|
],
|
|
1843
2253
|
};
|
|
1844
2254
|
}
|
|
2255
|
+
case 'delete_statement': {
|
|
2256
|
+
const { uuid } = args;
|
|
2257
|
+
const result = await stellify.deleteStatement(uuid);
|
|
2258
|
+
return {
|
|
2259
|
+
content: [
|
|
2260
|
+
{
|
|
2261
|
+
type: 'text',
|
|
2262
|
+
text: JSON.stringify({
|
|
2263
|
+
success: true,
|
|
2264
|
+
message: `Deleted statement ${uuid}`,
|
|
2265
|
+
data: result,
|
|
2266
|
+
}, null, 2),
|
|
2267
|
+
},
|
|
2268
|
+
],
|
|
2269
|
+
};
|
|
2270
|
+
}
|
|
2271
|
+
case 'save_statement': {
|
|
2272
|
+
const { uuid, ...data } = args;
|
|
2273
|
+
const result = await stellify.saveStatement(uuid, data);
|
|
2274
|
+
return {
|
|
2275
|
+
content: [
|
|
2276
|
+
{
|
|
2277
|
+
type: 'text',
|
|
2278
|
+
text: JSON.stringify({
|
|
2279
|
+
success: true,
|
|
2280
|
+
message: `Saved statement ${uuid}`,
|
|
2281
|
+
statement: result,
|
|
2282
|
+
}, null, 2),
|
|
2283
|
+
},
|
|
2284
|
+
],
|
|
2285
|
+
};
|
|
2286
|
+
}
|
|
1845
2287
|
case 'save_file': {
|
|
1846
2288
|
const { uuid, ...data } = args;
|
|
1847
2289
|
const result = await stellify.saveFile(uuid, { uuid, ...data });
|
|
@@ -1873,6 +2315,22 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
1873
2315
|
],
|
|
1874
2316
|
};
|
|
1875
2317
|
}
|
|
2318
|
+
case 'delete_file': {
|
|
2319
|
+
const { uuid } = args;
|
|
2320
|
+
const result = await stellify.deleteFile(uuid);
|
|
2321
|
+
return {
|
|
2322
|
+
content: [
|
|
2323
|
+
{
|
|
2324
|
+
type: 'text',
|
|
2325
|
+
text: JSON.stringify({
|
|
2326
|
+
success: true,
|
|
2327
|
+
message: `Deleted file ${uuid}`,
|
|
2328
|
+
data: result,
|
|
2329
|
+
}, null, 2),
|
|
2330
|
+
},
|
|
2331
|
+
],
|
|
2332
|
+
};
|
|
2333
|
+
}
|
|
1876
2334
|
case 'get_directory': {
|
|
1877
2335
|
const result = await stellify.getDirectory(args.uuid);
|
|
1878
2336
|
const dirData = result.data || result;
|
|
@@ -1907,6 +2365,22 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
1907
2365
|
],
|
|
1908
2366
|
};
|
|
1909
2367
|
}
|
|
2368
|
+
case 'save_directory': {
|
|
2369
|
+
const { uuid, ...data } = args;
|
|
2370
|
+
const result = await stellify.saveDirectory(uuid, data);
|
|
2371
|
+
return {
|
|
2372
|
+
content: [
|
|
2373
|
+
{
|
|
2374
|
+
type: 'text',
|
|
2375
|
+
text: JSON.stringify({
|
|
2376
|
+
success: true,
|
|
2377
|
+
message: `Saved directory ${uuid}`,
|
|
2378
|
+
directory: result,
|
|
2379
|
+
}, null, 2),
|
|
2380
|
+
},
|
|
2381
|
+
],
|
|
2382
|
+
};
|
|
2383
|
+
}
|
|
1910
2384
|
case 'broadcast_element_command': {
|
|
1911
2385
|
const result = await stellify.broadcastElementCommand(args);
|
|
1912
2386
|
return {
|
|
@@ -52,6 +52,8 @@ export interface CreateRouteParams {
|
|
|
52
52
|
path: string;
|
|
53
53
|
method: string;
|
|
54
54
|
type?: string;
|
|
55
|
+
controller?: string;
|
|
56
|
+
controller_method?: string;
|
|
55
57
|
data?: any;
|
|
56
58
|
}
|
|
57
59
|
export interface CreateElementParams {
|
|
@@ -74,16 +76,21 @@ export declare class StellifyClient {
|
|
|
74
76
|
searchFiles(params: SearchFilesParams): Promise<any>;
|
|
75
77
|
getFile(file: string): Promise<any>;
|
|
76
78
|
saveFile(file: string, data: any): Promise<any>;
|
|
79
|
+
deleteFile(file: string): Promise<any>;
|
|
77
80
|
getMethod(method: string): Promise<any>;
|
|
78
81
|
saveMethod(method: string, data: any): Promise<any>;
|
|
82
|
+
deleteMethod(method: string): Promise<any>;
|
|
79
83
|
createStatement(params: {
|
|
80
84
|
file?: string;
|
|
81
85
|
method?: string;
|
|
82
86
|
}): Promise<any>;
|
|
83
87
|
getStatement(statement: string): Promise<any>;
|
|
88
|
+
deleteStatement(statement: string): Promise<any>;
|
|
84
89
|
saveStatement(statement: string, data: any): Promise<any>;
|
|
85
90
|
createRoute(params: CreateRouteParams): Promise<any>;
|
|
86
91
|
getRoute(route: string): Promise<any>;
|
|
92
|
+
saveRoute(route: string, data: any): Promise<any>;
|
|
93
|
+
deleteRoute(route: string): Promise<any>;
|
|
87
94
|
searchRoutes(params: {
|
|
88
95
|
search?: string;
|
|
89
96
|
type?: string;
|
package/dist/stellify-client.js
CHANGED
|
@@ -43,6 +43,10 @@ export class StellifyClient {
|
|
|
43
43
|
const response = await this.client.put(`/file/${file}`, data);
|
|
44
44
|
return response.data;
|
|
45
45
|
}
|
|
46
|
+
async deleteFile(file) {
|
|
47
|
+
const response = await this.client.delete(`/file/${file}`);
|
|
48
|
+
return response.data;
|
|
49
|
+
}
|
|
46
50
|
async getMethod(method) {
|
|
47
51
|
const response = await this.client.get(`/method/${method}`);
|
|
48
52
|
return response.data;
|
|
@@ -51,6 +55,10 @@ export class StellifyClient {
|
|
|
51
55
|
const response = await this.client.put(`/method/${method}`, data);
|
|
52
56
|
return response.data;
|
|
53
57
|
}
|
|
58
|
+
async deleteMethod(method) {
|
|
59
|
+
const response = await this.client.delete(`/method/${method}`);
|
|
60
|
+
return response.data;
|
|
61
|
+
}
|
|
54
62
|
async createStatement(params) {
|
|
55
63
|
const response = await this.client.post('/statement', params);
|
|
56
64
|
return response.data;
|
|
@@ -59,6 +67,10 @@ export class StellifyClient {
|
|
|
59
67
|
const response = await this.client.get(`/statement/${statement}`);
|
|
60
68
|
return response.data;
|
|
61
69
|
}
|
|
70
|
+
async deleteStatement(statement) {
|
|
71
|
+
const response = await this.client.delete(`/statement/${statement}`);
|
|
72
|
+
return response.data;
|
|
73
|
+
}
|
|
62
74
|
async saveStatement(statement, data) {
|
|
63
75
|
const response = await this.client.put(`/statement/${statement}`, data);
|
|
64
76
|
return response.data;
|
|
@@ -71,6 +83,14 @@ export class StellifyClient {
|
|
|
71
83
|
const response = await this.client.get(`/route/${route}`);
|
|
72
84
|
return response.data;
|
|
73
85
|
}
|
|
86
|
+
async saveRoute(route, data) {
|
|
87
|
+
const response = await this.client.put(`/route/${route}`, { uuid: route, ...data });
|
|
88
|
+
return response.data;
|
|
89
|
+
}
|
|
90
|
+
async deleteRoute(route) {
|
|
91
|
+
const response = await this.client.delete(`/route/${route}`);
|
|
92
|
+
return response.data;
|
|
93
|
+
}
|
|
74
94
|
async searchRoutes(params) {
|
|
75
95
|
const response = await this.client.get('/route/search', { params });
|
|
76
96
|
return response.data;
|
package/package.json
CHANGED
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.
|
|
9
|
+
"version": "0.1.21",
|
|
10
10
|
"packages": [
|
|
11
11
|
{
|
|
12
12
|
"registryType": "npm",
|
|
13
13
|
"identifier": "@stellisoft/stellify-mcp",
|
|
14
|
-
"version": "0.1.
|
|
14
|
+
"version": "0.1.21",
|
|
15
15
|
"transport": {
|
|
16
16
|
"type": "stdio"
|
|
17
17
|
},
|