@stellisoft/stellify-mcp 0.1.18 → 0.1.19

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
@@ -539,7 +539,30 @@ Example:
539
539
  },
540
540
  {
541
541
  name: 'create_route',
542
- description: 'Create a new route/page in a Stellify project',
542
+ description: `Create a new route/page in a Stellify project.
543
+
544
+ IMPORTANT - WIRING ROUTES TO CONTROLLERS:
545
+ For API routes to execute code, you MUST connect them to a controller and method:
546
+ - controller: UUID of the controller file (e.g., NoteController)
547
+ - controller_method: UUID of the method to execute (e.g., index, store, update, destroy)
548
+
549
+ Without these fields, the route exists but won't execute any code!
550
+
551
+ EXAMPLE - Create an API route wired to a controller:
552
+ {
553
+ "project_id": "project-uuid",
554
+ "name": "notes.index",
555
+ "path": "/api/notes",
556
+ "method": "GET",
557
+ "type": "api",
558
+ "controller": "controller-file-uuid",
559
+ "controller_method": "index-method-uuid"
560
+ }
561
+
562
+ WORKFLOW for API endpoints:
563
+ 1. Create controller with create_file (type: "controller") or create_resources
564
+ 2. Create methods with create_method + add_method_body
565
+ 3. Create route with create_route, passing controller and controller_method UUIDs`,
543
566
  inputSchema: {
544
567
  type: 'object',
545
568
  properties: {
@@ -549,11 +572,11 @@ Example:
549
572
  },
550
573
  name: {
551
574
  type: 'string',
552
- description: 'Route/page name (e.g., "Home", "Counter", "About")',
575
+ description: 'Route/page name (e.g., "Home", "Counter", "notes.index")',
553
576
  },
554
577
  path: {
555
578
  type: 'string',
556
- description: 'URL path (e.g., "/", "/counter", "/about")',
579
+ description: 'URL path (e.g., "/", "/counter", "/api/notes")',
557
580
  },
558
581
  method: {
559
582
  type: 'string',
@@ -567,6 +590,14 @@ Example:
567
590
  description: 'Route type: "web" for pages, "api" for API endpoints',
568
591
  default: 'web',
569
592
  },
593
+ controller: {
594
+ type: 'string',
595
+ description: 'UUID of the controller file to handle this route. Required for API routes to execute code.',
596
+ },
597
+ controller_method: {
598
+ type: 'string',
599
+ description: 'UUID of the method within the controller to execute. Required for API routes to execute code.',
600
+ },
570
601
  data: {
571
602
  type: 'object',
572
603
  description: 'Additional route data (title, description, element UUIDs)',
@@ -595,6 +626,74 @@ Use this to look up a route you created or to find existing routes in the projec
595
626
  required: ['uuid'],
596
627
  },
597
628
  },
629
+ {
630
+ name: 'save_route',
631
+ description: `Update an existing route/page. Use this to wire a route to a controller method.
632
+
633
+ IMPORTANT: This is how you connect API routes to controller methods!
634
+
635
+ Example - Wire an API route to a controller method:
636
+ {
637
+ "uuid": "route-uuid",
638
+ "controller": "controller-file-uuid",
639
+ "controller_method": "method-uuid"
640
+ }
641
+
642
+ Available fields:
643
+ - controller: UUID of the controller file
644
+ - controller_method: UUID of the method to execute
645
+ - path: URL path
646
+ - name: Route name
647
+ - type: "web" or "api"
648
+ - method: HTTP method (GET, POST, PUT, DELETE, PATCH)
649
+ - middleware: Array of middleware names
650
+ - public: Whether the route is public (no auth required)`,
651
+ inputSchema: {
652
+ type: 'object',
653
+ properties: {
654
+ uuid: {
655
+ type: 'string',
656
+ description: 'UUID of the route to update',
657
+ },
658
+ controller: {
659
+ type: 'string',
660
+ description: 'UUID of the controller file to handle this route',
661
+ },
662
+ controller_method: {
663
+ type: 'string',
664
+ description: 'UUID of the method within the controller to execute',
665
+ },
666
+ path: {
667
+ type: 'string',
668
+ description: 'URL path (e.g., "/api/notes")',
669
+ },
670
+ name: {
671
+ type: 'string',
672
+ description: 'Route name',
673
+ },
674
+ type: {
675
+ type: 'string',
676
+ enum: ['web', 'api'],
677
+ description: 'Route type',
678
+ },
679
+ method: {
680
+ type: 'string',
681
+ enum: ['GET', 'POST', 'PUT', 'DELETE', 'PATCH'],
682
+ description: 'HTTP method',
683
+ },
684
+ middleware: {
685
+ type: 'array',
686
+ items: { type: 'string' },
687
+ description: 'Array of middleware names',
688
+ },
689
+ public: {
690
+ type: 'boolean',
691
+ description: 'Whether the route is public (no auth required)',
692
+ },
693
+ },
694
+ required: ['uuid'],
695
+ },
696
+ },
598
697
  {
599
698
  name: 'search_routes',
600
699
  description: `Search for routes/pages in the project by name. Use this to find existing routes before creating new ones.
@@ -1134,6 +1233,30 @@ RELATIONSHIP TYPES:
1134
1233
  - belongsTo: Inverse of hasOne/hasMany (Post belongsTo User)
1135
1234
  - belongsToMany: Many-to-many (User belongsToMany Roles)
1136
1235
 
1236
+ IMPORTANT - WIRING ROUTES TO CONTROLLERS:
1237
+ This tool creates controller methods but does NOT automatically wire routes to them.
1238
+ After calling create_resources, you must MANUALLY wire routes using create_route:
1239
+
1240
+ 1. Note the returned controller UUID and method UUIDs from the response
1241
+ 2. For each API route, call create_route with:
1242
+ - controller: the controller file UUID
1243
+ - controller_method: the specific method UUID (index, store, update, destroy)
1244
+
1245
+ Example response structure:
1246
+ {
1247
+ "controller": {
1248
+ "uuid": "controller-uuid",
1249
+ "methods": [
1250
+ { "uuid": "index-method-uuid", "name": "index" },
1251
+ { "uuid": "store-method-uuid", "name": "store" },
1252
+ ...
1253
+ ]
1254
+ }
1255
+ }
1256
+
1257
+ Then create routes:
1258
+ create_route({ path: "/api/notes", method: "GET", controller: "controller-uuid", controller_method: "index-method-uuid" })
1259
+
1137
1260
  Returns UUIDs for all created files so you can customize them further if needed.`,
1138
1261
  inputSchema: {
1139
1262
  type: 'object',
@@ -1665,6 +1788,23 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
1665
1788
  ],
1666
1789
  };
1667
1790
  }
1791
+ case 'save_route': {
1792
+ const { uuid, ...updateData } = args;
1793
+ const result = await stellify.saveRoute(uuid, updateData);
1794
+ const routeData = result.data || result;
1795
+ return {
1796
+ content: [
1797
+ {
1798
+ type: 'text',
1799
+ text: JSON.stringify({
1800
+ success: true,
1801
+ message: `Updated route "${uuid}"${updateData.controller ? ' with controller wiring' : ''}`,
1802
+ route: routeData,
1803
+ }, null, 2),
1804
+ },
1805
+ ],
1806
+ };
1807
+ }
1668
1808
  case 'search_routes': {
1669
1809
  const result = await stellify.searchRoutes(args);
1670
1810
  const routes = result.data || result;
@@ -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 {
@@ -84,6 +86,7 @@ export declare class StellifyClient {
84
86
  saveStatement(statement: string, data: any): Promise<any>;
85
87
  createRoute(params: CreateRouteParams): Promise<any>;
86
88
  getRoute(route: string): Promise<any>;
89
+ saveRoute(route: string, data: any): Promise<any>;
87
90
  searchRoutes(params: {
88
91
  search?: string;
89
92
  type?: string;
@@ -71,6 +71,10 @@ export class StellifyClient {
71
71
  const response = await this.client.get(`/route/${route}`);
72
72
  return response.data;
73
73
  }
74
+ async saveRoute(route, data) {
75
+ const response = await this.client.put(`/route/${route}`, { uuid: route, ...data });
76
+ return response.data;
77
+ }
74
78
  async searchRoutes(params) {
75
79
  const response = await this.client.get('/route/search', { params });
76
80
  return response.data;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stellisoft/stellify-mcp",
3
- "version": "0.1.18",
3
+ "version": "0.1.19",
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.17",
9
+ "version": "0.1.18",
10
10
  "packages": [
11
11
  {
12
12
  "registryType": "npm",
13
13
  "identifier": "@stellisoft/stellify-mcp",
14
- "version": "0.1.17",
14
+ "version": "0.1.18",
15
15
  "transport": {
16
16
  "type": "stdio"
17
17
  },