@stellisoft/stellify-mcp 0.1.10 → 0.1.12
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 +321 -1
- package/dist/stellify-client.d.ts +31 -0
- package/dist/stellify-client.js +15 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1058,6 +1058,154 @@ For PERSISTENT changes (saved to database), use update_element or html_to_elemen
|
|
|
1058
1058
|
required: ['action'],
|
|
1059
1059
|
},
|
|
1060
1060
|
},
|
|
1061
|
+
{
|
|
1062
|
+
name: 'create_resources',
|
|
1063
|
+
description: `Scaffold a complete resource stack in ONE operation. Creates Model, Controller, Service, and Migration together.
|
|
1064
|
+
|
|
1065
|
+
This is the FASTEST way to bootstrap new features! Instead of 20+ individual API calls, create everything at once.
|
|
1066
|
+
|
|
1067
|
+
WHAT IT CREATES:
|
|
1068
|
+
- Model: With $fillable, $casts, and relationship methods
|
|
1069
|
+
- Controller: With index, store, show, update, destroy actions
|
|
1070
|
+
- Service (optional): Business logic layer with list, find, create, update, delete methods
|
|
1071
|
+
- Migration: With proper column types based on field definitions
|
|
1072
|
+
|
|
1073
|
+
EXAMPLE - Create a User resource:
|
|
1074
|
+
{
|
|
1075
|
+
"name": "User",
|
|
1076
|
+
"fields": [
|
|
1077
|
+
{ "name": "name", "type": "string" },
|
|
1078
|
+
{ "name": "email", "type": "string", "unique": true },
|
|
1079
|
+
{ "name": "password", "type": "string" },
|
|
1080
|
+
{ "name": "is_active", "type": "boolean", "default": true }
|
|
1081
|
+
],
|
|
1082
|
+
"relationships": [
|
|
1083
|
+
{ "type": "hasMany", "model": "Post" }
|
|
1084
|
+
],
|
|
1085
|
+
"controller": true,
|
|
1086
|
+
"service": true,
|
|
1087
|
+
"migration": true
|
|
1088
|
+
}
|
|
1089
|
+
|
|
1090
|
+
FIELD TYPES:
|
|
1091
|
+
- string, text, longtext (text fields)
|
|
1092
|
+
- integer, int, bigint (numbers)
|
|
1093
|
+
- boolean, bool (true/false)
|
|
1094
|
+
- float, double, decimal (decimals)
|
|
1095
|
+
- date, datetime, timestamp (dates)
|
|
1096
|
+
- json (JSON/array data)
|
|
1097
|
+
- email (string with email validation)
|
|
1098
|
+
|
|
1099
|
+
FIELD OPTIONS:
|
|
1100
|
+
- nullable: Allow NULL values
|
|
1101
|
+
- unique: Add unique constraint
|
|
1102
|
+
- required: Require in validation (default: true for store)
|
|
1103
|
+
- default: Default value
|
|
1104
|
+
- max: Maximum length/value
|
|
1105
|
+
|
|
1106
|
+
RELATIONSHIP TYPES:
|
|
1107
|
+
- hasOne: One-to-one (User hasOne Profile)
|
|
1108
|
+
- hasMany: One-to-many (User hasMany Posts)
|
|
1109
|
+
- belongsTo: Inverse of hasOne/hasMany (Post belongsTo User)
|
|
1110
|
+
- belongsToMany: Many-to-many (User belongsToMany Roles)
|
|
1111
|
+
|
|
1112
|
+
Returns UUIDs for all created files so you can customize them further if needed.`,
|
|
1113
|
+
inputSchema: {
|
|
1114
|
+
type: 'object',
|
|
1115
|
+
properties: {
|
|
1116
|
+
name: {
|
|
1117
|
+
type: 'string',
|
|
1118
|
+
description: 'Resource name in PascalCase (e.g., "User", "BlogPost", "OrderItem")',
|
|
1119
|
+
},
|
|
1120
|
+
fields: {
|
|
1121
|
+
type: 'array',
|
|
1122
|
+
description: 'Array of field definitions for the model and migration',
|
|
1123
|
+
items: {
|
|
1124
|
+
type: 'object',
|
|
1125
|
+
properties: {
|
|
1126
|
+
name: {
|
|
1127
|
+
type: 'string',
|
|
1128
|
+
description: 'Field name in snake_case (e.g., "first_name", "is_active")',
|
|
1129
|
+
},
|
|
1130
|
+
type: {
|
|
1131
|
+
type: 'string',
|
|
1132
|
+
enum: ['string', 'integer', 'int', 'bigint', 'boolean', 'bool', 'float', 'double', 'decimal', 'date', 'datetime', 'timestamp', 'text', 'longtext', 'json', 'email'],
|
|
1133
|
+
description: 'Field data type',
|
|
1134
|
+
},
|
|
1135
|
+
nullable: {
|
|
1136
|
+
type: 'boolean',
|
|
1137
|
+
description: 'Allow NULL values (default: false)',
|
|
1138
|
+
},
|
|
1139
|
+
unique: {
|
|
1140
|
+
type: 'boolean',
|
|
1141
|
+
description: 'Add unique constraint (default: false)',
|
|
1142
|
+
},
|
|
1143
|
+
required: {
|
|
1144
|
+
type: 'boolean',
|
|
1145
|
+
description: 'Require in validation for store action (default: true)',
|
|
1146
|
+
},
|
|
1147
|
+
default: {
|
|
1148
|
+
description: 'Default value for the field',
|
|
1149
|
+
},
|
|
1150
|
+
max: {
|
|
1151
|
+
type: 'integer',
|
|
1152
|
+
description: 'Maximum length/value for validation',
|
|
1153
|
+
},
|
|
1154
|
+
},
|
|
1155
|
+
required: ['name'],
|
|
1156
|
+
},
|
|
1157
|
+
},
|
|
1158
|
+
relationships: {
|
|
1159
|
+
type: 'array',
|
|
1160
|
+
description: 'Array of relationship definitions',
|
|
1161
|
+
items: {
|
|
1162
|
+
type: 'object',
|
|
1163
|
+
properties: {
|
|
1164
|
+
type: {
|
|
1165
|
+
type: 'string',
|
|
1166
|
+
enum: ['hasOne', 'hasMany', 'belongsTo', 'belongsToMany'],
|
|
1167
|
+
description: 'Relationship type',
|
|
1168
|
+
},
|
|
1169
|
+
model: {
|
|
1170
|
+
type: 'string',
|
|
1171
|
+
description: 'Related model name in PascalCase',
|
|
1172
|
+
},
|
|
1173
|
+
name: {
|
|
1174
|
+
type: 'string',
|
|
1175
|
+
description: 'Custom method name (defaults to camelCase of model)',
|
|
1176
|
+
},
|
|
1177
|
+
},
|
|
1178
|
+
required: ['type', 'model'],
|
|
1179
|
+
},
|
|
1180
|
+
},
|
|
1181
|
+
controller: {
|
|
1182
|
+
type: 'boolean',
|
|
1183
|
+
description: 'Create controller with CRUD actions (default: true)',
|
|
1184
|
+
},
|
|
1185
|
+
service: {
|
|
1186
|
+
type: 'boolean',
|
|
1187
|
+
description: 'Create service class for business logic (default: false)',
|
|
1188
|
+
},
|
|
1189
|
+
migration: {
|
|
1190
|
+
type: 'boolean',
|
|
1191
|
+
description: 'Create database migration (default: true)',
|
|
1192
|
+
},
|
|
1193
|
+
routes: {
|
|
1194
|
+
type: 'boolean',
|
|
1195
|
+
description: 'Create API routes (default: true)',
|
|
1196
|
+
},
|
|
1197
|
+
soft_deletes: {
|
|
1198
|
+
type: 'boolean',
|
|
1199
|
+
description: 'Add soft delete support to model and migration (default: false)',
|
|
1200
|
+
},
|
|
1201
|
+
api: {
|
|
1202
|
+
type: 'boolean',
|
|
1203
|
+
description: 'Generate API-style responses (default: true)',
|
|
1204
|
+
},
|
|
1205
|
+
},
|
|
1206
|
+
required: ['name'],
|
|
1207
|
+
},
|
|
1208
|
+
},
|
|
1061
1209
|
{
|
|
1062
1210
|
name: 'run_code',
|
|
1063
1211
|
description: `Execute a method in the Stellify project environment and return the output.
|
|
@@ -1122,6 +1270,67 @@ SECURITY: Code runs in a sandboxed environment with limited permissions.`,
|
|
|
1122
1270
|
required: ['file', 'method'],
|
|
1123
1271
|
},
|
|
1124
1272
|
},
|
|
1273
|
+
{
|
|
1274
|
+
name: 'get_capabilities',
|
|
1275
|
+
description: `List available system-level capabilities in the Stellify framework.
|
|
1276
|
+
|
|
1277
|
+
Returns what's currently available for:
|
|
1278
|
+
- Authentication (Sanctum, session, etc.)
|
|
1279
|
+
- File storage (local, S3, etc.)
|
|
1280
|
+
- Email/notifications
|
|
1281
|
+
- Queues/jobs
|
|
1282
|
+
- Caching
|
|
1283
|
+
- Other installed packages and services
|
|
1284
|
+
|
|
1285
|
+
Use this BEFORE attempting to build features that might require system capabilities.
|
|
1286
|
+
If a capability you need is not listed, use request_capability to log it.`,
|
|
1287
|
+
inputSchema: {
|
|
1288
|
+
type: 'object',
|
|
1289
|
+
properties: {},
|
|
1290
|
+
},
|
|
1291
|
+
},
|
|
1292
|
+
{
|
|
1293
|
+
name: 'request_capability',
|
|
1294
|
+
description: `Log a missing system-level capability request.
|
|
1295
|
+
|
|
1296
|
+
Use this when you encounter a user requirement that needs framework-level functionality
|
|
1297
|
+
that doesn't exist in Stellify. This creates a ticket in the Stellify backlog.
|
|
1298
|
+
|
|
1299
|
+
DO NOT try to build system capabilities yourself - log them here instead.
|
|
1300
|
+
|
|
1301
|
+
Examples of capability requests:
|
|
1302
|
+
- "Need WebSocket support for real-time chat"
|
|
1303
|
+
- "Need S3 file upload with signed URLs"
|
|
1304
|
+
- "Need scheduled task runner for daily reports"
|
|
1305
|
+
- "Need OAuth2 social login (Google, GitHub)"`,
|
|
1306
|
+
inputSchema: {
|
|
1307
|
+
type: 'object',
|
|
1308
|
+
properties: {
|
|
1309
|
+
capability: {
|
|
1310
|
+
type: 'string',
|
|
1311
|
+
description: 'Short name for the capability (e.g., "websocket-support", "s3-uploads", "social-oauth")',
|
|
1312
|
+
},
|
|
1313
|
+
description: {
|
|
1314
|
+
type: 'string',
|
|
1315
|
+
description: 'Detailed description of what capability is needed',
|
|
1316
|
+
},
|
|
1317
|
+
use_case: {
|
|
1318
|
+
type: 'string',
|
|
1319
|
+
description: 'The user requirement that triggered this request',
|
|
1320
|
+
},
|
|
1321
|
+
workaround: {
|
|
1322
|
+
type: 'string',
|
|
1323
|
+
description: 'Any temporary workaround, or "blocked" if none exists',
|
|
1324
|
+
},
|
|
1325
|
+
priority: {
|
|
1326
|
+
type: 'string',
|
|
1327
|
+
enum: ['low', 'medium', 'high', 'critical'],
|
|
1328
|
+
description: 'Suggested priority based on user need (default: medium)',
|
|
1329
|
+
},
|
|
1330
|
+
},
|
|
1331
|
+
required: ['capability', 'description', 'use_case'],
|
|
1332
|
+
},
|
|
1333
|
+
},
|
|
1125
1334
|
];
|
|
1126
1335
|
// Server instructions for tool discovery (used by MCP Tool Search)
|
|
1127
1336
|
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.
|
|
@@ -1136,7 +1345,34 @@ Key concepts:
|
|
|
1136
1345
|
- Code is stored as structured JSON, enabling surgical AI edits at the statement level
|
|
1137
1346
|
- Files contain methods and statements (code outside methods)
|
|
1138
1347
|
- Vue components link to UI elements via the 'template' field
|
|
1139
|
-
- Event handlers (click, submit) wire UI elements to methods by UUID
|
|
1348
|
+
- Event handlers (click, submit) wire UI elements to methods by UUID
|
|
1349
|
+
|
|
1350
|
+
## Framework Capabilities (Libraries/Packages)
|
|
1351
|
+
|
|
1352
|
+
**CRITICAL: You write BUSINESS LOGIC only. Capabilities are installed packages/libraries (Sanctum, Stripe, AWS SDK, etc.) that Stellify provides. You CANNOT create these by writing code.**
|
|
1353
|
+
|
|
1354
|
+
Examples of capabilities (packages you cannot write):
|
|
1355
|
+
- Authentication: laravel/sanctum, laravel/socialite
|
|
1356
|
+
- Payments: stripe/stripe-php
|
|
1357
|
+
- Storage: aws/aws-sdk-php, league/flysystem-aws-s3-v3
|
|
1358
|
+
- Email: mailgun/mailgun-php, aws/aws-sdk-php (SES)
|
|
1359
|
+
- Search: meilisearch/meilisearch-php, algolia/algoliasearch-client-php
|
|
1360
|
+
- WebSocket: laravel/reverb
|
|
1361
|
+
|
|
1362
|
+
**WORKFLOW:**
|
|
1363
|
+
|
|
1364
|
+
1. When a user requests functionality that might need a package/library, call get_capabilities() FIRST.
|
|
1365
|
+
|
|
1366
|
+
2. If status is "available" → package is installed, proceed with business logic.
|
|
1367
|
+
|
|
1368
|
+
3. If status is "needs_config" → package installed but needs API keys. INFORM THE USER to configure it in Project Settings.
|
|
1369
|
+
|
|
1370
|
+
4. If status is "not_available" or doesn't exist:
|
|
1371
|
+
- STOP IMMEDIATELY
|
|
1372
|
+
- Call request_capability() to log it
|
|
1373
|
+
- INFORM THE USER: "This feature requires the [X] package which isn't installed in Stellify yet. I've logged a request. This cannot be built until the package is added."
|
|
1374
|
+
|
|
1375
|
+
**NEVER write code that belongs in a package.** If you find yourself writing OAuth flows, payment processing, S3 clients, email transport, search indexing, or similar infrastructure - STOP. That's a capability request, not business logic.`;
|
|
1140
1376
|
// Create MCP server
|
|
1141
1377
|
const server = new Server({
|
|
1142
1378
|
name: 'stellify-mcp',
|
|
@@ -1691,6 +1927,59 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
1691
1927
|
],
|
|
1692
1928
|
};
|
|
1693
1929
|
}
|
|
1930
|
+
case 'create_resources': {
|
|
1931
|
+
const result = await stellify.createResources(args);
|
|
1932
|
+
const data = result.data || result;
|
|
1933
|
+
const stats = data.statistics || {};
|
|
1934
|
+
// Build summary of what was created
|
|
1935
|
+
const created = [];
|
|
1936
|
+
if (data.model)
|
|
1937
|
+
created.push(`Model (${data.model.uuid})`);
|
|
1938
|
+
if (data.controller)
|
|
1939
|
+
created.push(`Controller (${data.controller.uuid})`);
|
|
1940
|
+
if (data.service)
|
|
1941
|
+
created.push(`Service (${data.service.uuid})`);
|
|
1942
|
+
if (data.migration)
|
|
1943
|
+
created.push(`Migration (${data.migration.uuid})`);
|
|
1944
|
+
return {
|
|
1945
|
+
content: [
|
|
1946
|
+
{
|
|
1947
|
+
type: 'text',
|
|
1948
|
+
text: JSON.stringify({
|
|
1949
|
+
success: true,
|
|
1950
|
+
message: `Created ${args.name} resource: ${created.join(', ')} (${stats.files || 0} files, ${stats.methods || 0} methods)`,
|
|
1951
|
+
data: {
|
|
1952
|
+
name: data.name,
|
|
1953
|
+
model: data.model ? {
|
|
1954
|
+
uuid: data.model.uuid,
|
|
1955
|
+
name: data.model.name,
|
|
1956
|
+
namespace: data.model.namespace,
|
|
1957
|
+
methods: data.model.methods,
|
|
1958
|
+
} : null,
|
|
1959
|
+
controller: data.controller ? {
|
|
1960
|
+
uuid: data.controller.uuid,
|
|
1961
|
+
name: data.controller.name,
|
|
1962
|
+
namespace: data.controller.namespace,
|
|
1963
|
+
methods: data.controller.methods,
|
|
1964
|
+
} : null,
|
|
1965
|
+
service: data.service ? {
|
|
1966
|
+
uuid: data.service.uuid,
|
|
1967
|
+
name: data.service.name,
|
|
1968
|
+
namespace: data.service.namespace,
|
|
1969
|
+
methods: data.service.methods,
|
|
1970
|
+
} : null,
|
|
1971
|
+
migration: data.migration ? {
|
|
1972
|
+
uuid: data.migration.uuid,
|
|
1973
|
+
name: data.migration.name,
|
|
1974
|
+
table: data.migration.table,
|
|
1975
|
+
} : null,
|
|
1976
|
+
statistics: stats,
|
|
1977
|
+
},
|
|
1978
|
+
}, null, 2),
|
|
1979
|
+
},
|
|
1980
|
+
],
|
|
1981
|
+
};
|
|
1982
|
+
}
|
|
1694
1983
|
case 'run_code': {
|
|
1695
1984
|
const result = await stellify.runCode(args);
|
|
1696
1985
|
const benchmarkInfo = args.benchmark
|
|
@@ -1714,6 +2003,37 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
1714
2003
|
],
|
|
1715
2004
|
};
|
|
1716
2005
|
}
|
|
2006
|
+
case 'get_capabilities': {
|
|
2007
|
+
const result = await stellify.getCapabilities();
|
|
2008
|
+
return {
|
|
2009
|
+
content: [
|
|
2010
|
+
{
|
|
2011
|
+
type: 'text',
|
|
2012
|
+
text: JSON.stringify({
|
|
2013
|
+
success: true,
|
|
2014
|
+
message: 'Available framework capabilities',
|
|
2015
|
+
capabilities: result.data || result,
|
|
2016
|
+
}, null, 2),
|
|
2017
|
+
},
|
|
2018
|
+
],
|
|
2019
|
+
};
|
|
2020
|
+
}
|
|
2021
|
+
case 'request_capability': {
|
|
2022
|
+
const result = await stellify.requestCapability(args);
|
|
2023
|
+
return {
|
|
2024
|
+
content: [
|
|
2025
|
+
{
|
|
2026
|
+
type: 'text',
|
|
2027
|
+
text: JSON.stringify({
|
|
2028
|
+
success: true,
|
|
2029
|
+
message: `Capability request logged: "${args.capability}"`,
|
|
2030
|
+
request_id: result.data?.uuid || result.uuid,
|
|
2031
|
+
data: result.data || result,
|
|
2032
|
+
}, null, 2),
|
|
2033
|
+
},
|
|
2034
|
+
],
|
|
2035
|
+
};
|
|
2036
|
+
}
|
|
1717
2037
|
default:
|
|
1718
2038
|
throw new Error(`Unknown tool: ${name}`);
|
|
1719
2039
|
}
|
|
@@ -148,6 +148,29 @@ export declare class StellifyClient {
|
|
|
148
148
|
changes: Record<string, any>;
|
|
149
149
|
}>;
|
|
150
150
|
}): Promise<any>;
|
|
151
|
+
createResources(params: {
|
|
152
|
+
name: string;
|
|
153
|
+
fields?: Array<{
|
|
154
|
+
name: string;
|
|
155
|
+
type?: string;
|
|
156
|
+
nullable?: boolean;
|
|
157
|
+
unique?: boolean;
|
|
158
|
+
required?: boolean;
|
|
159
|
+
default?: any;
|
|
160
|
+
max?: number;
|
|
161
|
+
}>;
|
|
162
|
+
relationships?: Array<{
|
|
163
|
+
type: 'hasOne' | 'hasMany' | 'belongsTo' | 'belongsToMany';
|
|
164
|
+
model: string;
|
|
165
|
+
name?: string;
|
|
166
|
+
}>;
|
|
167
|
+
controller?: boolean;
|
|
168
|
+
service?: boolean;
|
|
169
|
+
migration?: boolean;
|
|
170
|
+
routes?: boolean;
|
|
171
|
+
soft_deletes?: boolean;
|
|
172
|
+
api?: boolean;
|
|
173
|
+
}): Promise<any>;
|
|
151
174
|
runCode(params: {
|
|
152
175
|
file: string;
|
|
153
176
|
method: string;
|
|
@@ -155,4 +178,12 @@ export declare class StellifyClient {
|
|
|
155
178
|
timeout?: number;
|
|
156
179
|
benchmark?: boolean;
|
|
157
180
|
}): Promise<any>;
|
|
181
|
+
getCapabilities(): Promise<any>;
|
|
182
|
+
requestCapability(params: {
|
|
183
|
+
capability: string;
|
|
184
|
+
description: string;
|
|
185
|
+
use_case: string;
|
|
186
|
+
workaround?: string;
|
|
187
|
+
priority?: 'low' | 'medium' | 'high' | 'critical';
|
|
188
|
+
}): Promise<any>;
|
|
158
189
|
}
|
package/dist/stellify-client.js
CHANGED
|
@@ -172,6 +172,11 @@ export class StellifyClient {
|
|
|
172
172
|
const response = await this.client.post('/elements/command', params);
|
|
173
173
|
return response.data;
|
|
174
174
|
}
|
|
175
|
+
// Resource scaffolding - create Model, Controller, Service, Migration in one call
|
|
176
|
+
async createResources(params) {
|
|
177
|
+
const response = await this.client.post('/resources', params);
|
|
178
|
+
return response.data;
|
|
179
|
+
}
|
|
175
180
|
// Code execution - runs a specific method by file and method UUID
|
|
176
181
|
async runCode(params) {
|
|
177
182
|
const { file, method, ...body } = params;
|
|
@@ -181,4 +186,14 @@ export class StellifyClient {
|
|
|
181
186
|
const response = await this.client.put(`/code/${file}/${method}`, body);
|
|
182
187
|
return response.data;
|
|
183
188
|
}
|
|
189
|
+
// Framework capabilities - list what's available
|
|
190
|
+
async getCapabilities() {
|
|
191
|
+
const response = await this.client.get('/capabilities');
|
|
192
|
+
return response.data;
|
|
193
|
+
}
|
|
194
|
+
// Request a missing capability - logs to backlog
|
|
195
|
+
async requestCapability(params) {
|
|
196
|
+
const response = await this.client.post('/capabilities/request', params);
|
|
197
|
+
return response.data;
|
|
198
|
+
}
|
|
184
199
|
}
|
package/package.json
CHANGED