@stellisoft/stellify-mcp 0.1.13 → 0.1.15
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 +94 -0
- package/dist/stellify-client.d.ts +5 -0
- package/dist/stellify-client.js +19 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1195,6 +1195,54 @@ Examples of capability requests:
|
|
|
1195
1195
|
required: ['capability', 'description', 'use_case'],
|
|
1196
1196
|
},
|
|
1197
1197
|
},
|
|
1198
|
+
{
|
|
1199
|
+
name: 'analyze_performance',
|
|
1200
|
+
description: `Analyze code execution performance from logs. Identifies slow methods, N+1 query patterns, high memory usage, and failure rates.
|
|
1201
|
+
|
|
1202
|
+
Use this tool PROACTIVELY to:
|
|
1203
|
+
- Review performance after creating new methods
|
|
1204
|
+
- Identify optimization opportunities
|
|
1205
|
+
- Detect N+1 query patterns (high query counts)
|
|
1206
|
+
- Find methods that need caching or refactoring
|
|
1207
|
+
- Check failure rates and error patterns
|
|
1208
|
+
|
|
1209
|
+
ANALYSIS TYPES:
|
|
1210
|
+
- full: Comprehensive report with all issues, recommendations, and statistics
|
|
1211
|
+
- slow_methods: Methods exceeding 500ms execution time
|
|
1212
|
+
- high_query_methods: Methods with >10 queries (potential N+1 problems)
|
|
1213
|
+
- high_memory_methods: Methods using >50MB memory
|
|
1214
|
+
- failure_rates: Methods with high error rates
|
|
1215
|
+
- trend: Performance trend over time (daily averages)
|
|
1216
|
+
|
|
1217
|
+
EXAMPLE - Full analysis:
|
|
1218
|
+
{ "type": "full", "days": 7 }
|
|
1219
|
+
|
|
1220
|
+
EXAMPLE - Check for N+1 queries:
|
|
1221
|
+
{ "type": "high_query_methods", "limit": 10 }
|
|
1222
|
+
|
|
1223
|
+
The response includes actionable recommendations like:
|
|
1224
|
+
- "Consider eager loading relationships" for N+1 patterns
|
|
1225
|
+
- "Add database indexes" for slow queries
|
|
1226
|
+
- "Use chunking" for high memory usage`,
|
|
1227
|
+
inputSchema: {
|
|
1228
|
+
type: 'object',
|
|
1229
|
+
properties: {
|
|
1230
|
+
type: {
|
|
1231
|
+
type: 'string',
|
|
1232
|
+
enum: ['full', 'slow_methods', 'high_query_methods', 'high_memory_methods', 'failure_rates', 'trend'],
|
|
1233
|
+
description: 'Type of analysis to run (default: full)',
|
|
1234
|
+
},
|
|
1235
|
+
days: {
|
|
1236
|
+
type: 'number',
|
|
1237
|
+
description: 'Number of days to analyze (default: 7)',
|
|
1238
|
+
},
|
|
1239
|
+
limit: {
|
|
1240
|
+
type: 'number',
|
|
1241
|
+
description: 'Maximum results for specific queries (default: 10)',
|
|
1242
|
+
},
|
|
1243
|
+
},
|
|
1244
|
+
},
|
|
1245
|
+
},
|
|
1198
1246
|
];
|
|
1199
1247
|
// Server instructions for tool discovery (used by MCP Tool Search)
|
|
1200
1248
|
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.
|
|
@@ -1774,6 +1822,52 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
1774
1822
|
],
|
|
1775
1823
|
};
|
|
1776
1824
|
}
|
|
1825
|
+
case 'analyze_performance': {
|
|
1826
|
+
const result = await stellify.analyzePerformance(args);
|
|
1827
|
+
const data = result.data || result;
|
|
1828
|
+
const analysisType = args.type || 'full';
|
|
1829
|
+
// Build message based on analysis type
|
|
1830
|
+
let message = '';
|
|
1831
|
+
if (analysisType === 'full') {
|
|
1832
|
+
message = data.summary || `Analyzed ${data.analyzed_executions || 0} executions`;
|
|
1833
|
+
if (data.issues?.length > 0) {
|
|
1834
|
+
message += ` - Found ${data.issues.length} potential issue(s)`;
|
|
1835
|
+
}
|
|
1836
|
+
}
|
|
1837
|
+
else if (analysisType === 'slow_methods') {
|
|
1838
|
+
const methods = data.slow_methods || data;
|
|
1839
|
+
message = `Found ${Array.isArray(methods) ? methods.length : 0} slow methods`;
|
|
1840
|
+
}
|
|
1841
|
+
else if (analysisType === 'high_query_methods') {
|
|
1842
|
+
const methods = data.high_query_methods || data;
|
|
1843
|
+
message = `Found ${Array.isArray(methods) ? methods.length : 0} methods with high query counts (potential N+1)`;
|
|
1844
|
+
}
|
|
1845
|
+
else if (analysisType === 'high_memory_methods') {
|
|
1846
|
+
const methods = data.high_memory_methods || data;
|
|
1847
|
+
message = `Found ${Array.isArray(methods) ? methods.length : 0} methods with high memory usage`;
|
|
1848
|
+
}
|
|
1849
|
+
else if (analysisType === 'failure_rates') {
|
|
1850
|
+
const methods = data.failure_rates || data;
|
|
1851
|
+
message = `Found ${Array.isArray(methods) ? methods.length : 0} methods with failures`;
|
|
1852
|
+
}
|
|
1853
|
+
else if (analysisType === 'trend') {
|
|
1854
|
+
const trend = data.trend || data;
|
|
1855
|
+
message = `Performance trend: ${Array.isArray(trend) ? trend.length : 0} days of data`;
|
|
1856
|
+
}
|
|
1857
|
+
return {
|
|
1858
|
+
content: [
|
|
1859
|
+
{
|
|
1860
|
+
type: 'text',
|
|
1861
|
+
text: JSON.stringify({
|
|
1862
|
+
success: true,
|
|
1863
|
+
message,
|
|
1864
|
+
analysis_type: analysisType,
|
|
1865
|
+
data,
|
|
1866
|
+
}, null, 2),
|
|
1867
|
+
},
|
|
1868
|
+
],
|
|
1869
|
+
};
|
|
1870
|
+
}
|
|
1777
1871
|
default:
|
|
1778
1872
|
throw new Error(`Unknown tool: ${name}`);
|
|
1779
1873
|
}
|
|
@@ -158,4 +158,9 @@ export declare class StellifyClient {
|
|
|
158
158
|
workaround?: string;
|
|
159
159
|
priority?: 'low' | 'medium' | 'high' | 'critical';
|
|
160
160
|
}): Promise<any>;
|
|
161
|
+
analyzePerformance(params: {
|
|
162
|
+
type?: 'full' | 'slow_methods' | 'high_query_methods' | 'high_memory_methods' | 'failure_rates' | 'trend';
|
|
163
|
+
days?: number;
|
|
164
|
+
limit?: number;
|
|
165
|
+
}): Promise<any>;
|
|
161
166
|
}
|
package/dist/stellify-client.js
CHANGED
|
@@ -150,4 +150,23 @@ export class StellifyClient {
|
|
|
150
150
|
const response = await this.client.post('/capabilities/request', params);
|
|
151
151
|
return response.data;
|
|
152
152
|
}
|
|
153
|
+
// Performance analysis - analyze execution logs for optimization opportunities
|
|
154
|
+
async analyzePerformance(params) {
|
|
155
|
+
const type = params.type || 'full';
|
|
156
|
+
const queryParams = {};
|
|
157
|
+
if (params.days)
|
|
158
|
+
queryParams.days = params.days;
|
|
159
|
+
if (params.limit)
|
|
160
|
+
queryParams.limit = params.limit;
|
|
161
|
+
// Map type to endpoint
|
|
162
|
+
const endpoint = type === 'full' ? '/performance/analyze' :
|
|
163
|
+
type === 'slow_methods' ? '/performance/slow-methods' :
|
|
164
|
+
type === 'high_query_methods' ? '/performance/high-query-methods' :
|
|
165
|
+
type === 'high_memory_methods' ? '/performance/high-memory-methods' :
|
|
166
|
+
type === 'failure_rates' ? '/performance/failure-rates' :
|
|
167
|
+
type === 'trend' ? '/performance/trend' :
|
|
168
|
+
'/performance/analyze';
|
|
169
|
+
const response = await this.client.get(endpoint, { params: queryParams });
|
|
170
|
+
return response.data;
|
|
171
|
+
}
|
|
153
172
|
}
|
package/package.json
CHANGED