@stellisoft/stellify-mcp 0.1.15 → 0.1.17

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
@@ -1134,25 +1134,6 @@ SECURITY: Code runs in a sandboxed environment with limited permissions.`,
1134
1134
  required: ['file', 'method'],
1135
1135
  },
1136
1136
  },
1137
- {
1138
- name: 'get_capabilities',
1139
- description: `List available system-level capabilities in the Stellify framework.
1140
-
1141
- Returns what's currently available for:
1142
- - Authentication (Sanctum, session, etc.)
1143
- - File storage (local, S3, etc.)
1144
- - Email/notifications
1145
- - Queues/jobs
1146
- - Caching
1147
- - Other installed packages and services
1148
-
1149
- Use this BEFORE attempting to build features that might require system capabilities.
1150
- If a capability you need is not listed, use request_capability to log it.`,
1151
- inputSchema: {
1152
- type: 'object',
1153
- properties: {},
1154
- },
1155
- },
1156
1137
  {
1157
1138
  name: 'request_capability',
1158
1139
  description: `Log a missing system-level capability request.
@@ -1243,6 +1224,45 @@ The response includes actionable recommendations like:
1243
1224
  },
1244
1225
  },
1245
1226
  },
1227
+ {
1228
+ name: 'analyze_quality',
1229
+ description: `Analyze Laravel code structure for quality issues. Detects missing relationships, fillables, casts, and route problems.
1230
+
1231
+ Use this tool PROACTIVELY to:
1232
+ - Review code quality after creating models or controllers
1233
+ - Detect missing Eloquent relationships (belongsTo, hasMany)
1234
+ - Find migration fields not in $fillable
1235
+ - Suggest type casts for columns (json → array, datetime → datetime)
1236
+ - Identify broken route bindings (orphaned methods, missing controllers)
1237
+
1238
+ ANALYSIS TYPES:
1239
+ - full: Comprehensive analysis of all categories with recommendations
1240
+ - relationships: Missing belongsTo/hasMany based on foreign keys
1241
+ - fillables: Migration fields not in Model $fillable array
1242
+ - casts: Columns that should have type casts
1243
+ - routes: Orphaned controller methods, routes pointing to missing methods
1244
+
1245
+ EXAMPLE - Full analysis:
1246
+ { "type": "full" }
1247
+
1248
+ EXAMPLE - Check relationships only:
1249
+ { "type": "relationships" }
1250
+
1251
+ The response includes actionable suggestions like:
1252
+ - "Add belongsTo relationship: public function user() { return $this->belongsTo(User::class); }"
1253
+ - "Add 'published_at' to $fillable array"
1254
+ - "Add cast: 'metadata' => 'array'"`,
1255
+ inputSchema: {
1256
+ type: 'object',
1257
+ properties: {
1258
+ type: {
1259
+ type: 'string',
1260
+ enum: ['full', 'relationships', 'fillables', 'casts', 'routes'],
1261
+ description: 'Type of analysis to run (default: full)',
1262
+ },
1263
+ },
1264
+ },
1265
+ },
1246
1266
  ];
1247
1267
  // Server instructions for tool discovery (used by MCP Tool Search)
1248
1268
  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.
@@ -1273,7 +1293,7 @@ Examples of capabilities (packages you cannot write):
1273
1293
 
1274
1294
  **WORKFLOW:**
1275
1295
 
1276
- 1. When a user requests functionality that might need a package/library, call get_capabilities() FIRST.
1296
+ 1. When a user requests functionality that might need a package/library, check the capabilities list from get_project FIRST.
1277
1297
 
1278
1298
  2. If status is "available" → package is installed, proceed with business logic.
1279
1299
 
@@ -1322,14 +1342,16 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
1322
1342
  switch (name) {
1323
1343
  case 'get_project': {
1324
1344
  const result = await stellify.getProject();
1345
+ const projectData = result.data || result;
1346
+ const projectMeta = projectData.project || {};
1325
1347
  return {
1326
1348
  content: [
1327
1349
  {
1328
1350
  type: 'text',
1329
1351
  text: JSON.stringify({
1330
1352
  success: true,
1331
- message: `Active project: "${result.data?.name || result.name}" (${result.data?.uuid || result.uuid})`,
1332
- project: result.data || result,
1353
+ message: `Active project: "${projectMeta.name || 'unknown'}" (${projectMeta.uuid || 'unknown'})`,
1354
+ project: projectData,
1333
1355
  }, null, 2),
1334
1356
  },
1335
1357
  ],
@@ -1791,21 +1813,6 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
1791
1813
  ],
1792
1814
  };
1793
1815
  }
1794
- case 'get_capabilities': {
1795
- const result = await stellify.getCapabilities();
1796
- return {
1797
- content: [
1798
- {
1799
- type: 'text',
1800
- text: JSON.stringify({
1801
- success: true,
1802
- message: 'Available framework capabilities',
1803
- capabilities: result.data || result,
1804
- }, null, 2),
1805
- },
1806
- ],
1807
- };
1808
- }
1809
1816
  case 'request_capability': {
1810
1817
  const result = await stellify.requestCapability(args);
1811
1818
  return {
@@ -1868,6 +1875,40 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
1868
1875
  ],
1869
1876
  };
1870
1877
  }
1878
+ case 'analyze_quality': {
1879
+ const result = await stellify.analyzeQuality(args);
1880
+ const data = result.data || result;
1881
+ const analysisType = args.type || 'full';
1882
+ // Build message based on analysis type
1883
+ let message = '';
1884
+ const issues = data.issues || [];
1885
+ if (analysisType === 'full') {
1886
+ const summary = data.summary || {};
1887
+ message = `Analyzed ${summary.models_analyzed || 0} models, ${summary.controllers_analyzed || 0} controllers`;
1888
+ if (summary.total_issues > 0) {
1889
+ message += ` - Found ${summary.total_issues} issue(s): ${summary.high_severity || 0} high, ${summary.medium_severity || 0} medium, ${summary.low_severity || 0} low`;
1890
+ }
1891
+ else {
1892
+ message += ' - No issues found';
1893
+ }
1894
+ }
1895
+ else {
1896
+ message = `Found ${issues.length} ${analysisType} issue(s)`;
1897
+ }
1898
+ return {
1899
+ content: [
1900
+ {
1901
+ type: 'text',
1902
+ text: JSON.stringify({
1903
+ success: true,
1904
+ message,
1905
+ analysis_type: analysisType,
1906
+ data,
1907
+ }, null, 2),
1908
+ },
1909
+ ],
1910
+ };
1911
+ }
1871
1912
  default:
1872
1913
  throw new Error(`Unknown tool: ${name}`);
1873
1914
  }
@@ -163,4 +163,7 @@ export declare class StellifyClient {
163
163
  days?: number;
164
164
  limit?: number;
165
165
  }): Promise<any>;
166
+ analyzeQuality(params: {
167
+ type?: 'full' | 'relationships' | 'fillables' | 'casts' | 'routes';
168
+ }): Promise<any>;
166
169
  }
@@ -169,4 +169,17 @@ export class StellifyClient {
169
169
  const response = await this.client.get(endpoint, { params: queryParams });
170
170
  return response.data;
171
171
  }
172
+ // Code quality analysis - analyze Laravel structure for issues
173
+ async analyzeQuality(params) {
174
+ const type = params.type || 'full';
175
+ // Map type to endpoint
176
+ const endpoint = type === 'full' ? '/quality/analyze' :
177
+ type === 'relationships' ? '/quality/relationships' :
178
+ type === 'fillables' ? '/quality/fillables' :
179
+ type === 'casts' ? '/quality/casts' :
180
+ type === 'routes' ? '/quality/routes' :
181
+ '/quality/analyze';
182
+ const response = await this.client.get(endpoint);
183
+ return response.data;
184
+ }
172
185
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stellisoft/stellify-mcp",
3
- "version": "0.1.15",
3
+ "version": "0.1.17",
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",