@stellisoft/stellify-mcp 0.1.15 → 0.1.16

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
@@ -1243,6 +1243,45 @@ The response includes actionable recommendations like:
1243
1243
  },
1244
1244
  },
1245
1245
  },
1246
+ {
1247
+ name: 'analyze_quality',
1248
+ description: `Analyze Laravel code structure for quality issues. Detects missing relationships, fillables, casts, and route problems.
1249
+
1250
+ Use this tool PROACTIVELY to:
1251
+ - Review code quality after creating models or controllers
1252
+ - Detect missing Eloquent relationships (belongsTo, hasMany)
1253
+ - Find migration fields not in $fillable
1254
+ - Suggest type casts for columns (json → array, datetime → datetime)
1255
+ - Identify broken route bindings (orphaned methods, missing controllers)
1256
+
1257
+ ANALYSIS TYPES:
1258
+ - full: Comprehensive analysis of all categories with recommendations
1259
+ - relationships: Missing belongsTo/hasMany based on foreign keys
1260
+ - fillables: Migration fields not in Model $fillable array
1261
+ - casts: Columns that should have type casts
1262
+ - routes: Orphaned controller methods, routes pointing to missing methods
1263
+
1264
+ EXAMPLE - Full analysis:
1265
+ { "type": "full" }
1266
+
1267
+ EXAMPLE - Check relationships only:
1268
+ { "type": "relationships" }
1269
+
1270
+ The response includes actionable suggestions like:
1271
+ - "Add belongsTo relationship: public function user() { return $this->belongsTo(User::class); }"
1272
+ - "Add 'published_at' to $fillable array"
1273
+ - "Add cast: 'metadata' => 'array'"`,
1274
+ inputSchema: {
1275
+ type: 'object',
1276
+ properties: {
1277
+ type: {
1278
+ type: 'string',
1279
+ enum: ['full', 'relationships', 'fillables', 'casts', 'routes'],
1280
+ description: 'Type of analysis to run (default: full)',
1281
+ },
1282
+ },
1283
+ },
1284
+ },
1246
1285
  ];
1247
1286
  // Server instructions for tool discovery (used by MCP Tool Search)
1248
1287
  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.
@@ -1868,6 +1907,40 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
1868
1907
  ],
1869
1908
  };
1870
1909
  }
1910
+ case 'analyze_quality': {
1911
+ const result = await stellify.analyzeQuality(args);
1912
+ const data = result.data || result;
1913
+ const analysisType = args.type || 'full';
1914
+ // Build message based on analysis type
1915
+ let message = '';
1916
+ const issues = data.issues || [];
1917
+ if (analysisType === 'full') {
1918
+ const summary = data.summary || {};
1919
+ message = `Analyzed ${summary.models_analyzed || 0} models, ${summary.controllers_analyzed || 0} controllers`;
1920
+ if (summary.total_issues > 0) {
1921
+ message += ` - Found ${summary.total_issues} issue(s): ${summary.high_severity || 0} high, ${summary.medium_severity || 0} medium, ${summary.low_severity || 0} low`;
1922
+ }
1923
+ else {
1924
+ message += ' - No issues found';
1925
+ }
1926
+ }
1927
+ else {
1928
+ message = `Found ${issues.length} ${analysisType} issue(s)`;
1929
+ }
1930
+ return {
1931
+ content: [
1932
+ {
1933
+ type: 'text',
1934
+ text: JSON.stringify({
1935
+ success: true,
1936
+ message,
1937
+ analysis_type: analysisType,
1938
+ data,
1939
+ }, null, 2),
1940
+ },
1941
+ ],
1942
+ };
1943
+ }
1871
1944
  default:
1872
1945
  throw new Error(`Unknown tool: ${name}`);
1873
1946
  }
@@ -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.16",
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",