@stellisoft/stellify-mcp 0.1.5 → 0.1.7
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 +105 -0
- package/dist/stellify-client.d.ts +7 -0
- package/dist/stellify-client.js +6 -0
- package/manifest.json +3 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1058,6 +1058,88 @@ For PERSISTENT changes (saved to database), use update_element or html_to_elemen
|
|
|
1058
1058
|
required: ['action'],
|
|
1059
1059
|
},
|
|
1060
1060
|
},
|
|
1061
|
+
{
|
|
1062
|
+
name: 'run_code',
|
|
1063
|
+
description: `Execute code in the Stellify project environment and return the output.
|
|
1064
|
+
|
|
1065
|
+
This tool allows you to run PHP or JavaScript code and see the results. Use this for:
|
|
1066
|
+
- Testing methods you've created
|
|
1067
|
+
- Verifying code behavior
|
|
1068
|
+
- Running artisan commands
|
|
1069
|
+
- Debugging issues
|
|
1070
|
+
- Getting real feedback on code execution
|
|
1071
|
+
|
|
1072
|
+
EXECUTION MODES:
|
|
1073
|
+
|
|
1074
|
+
1. Run a specific method by UUID:
|
|
1075
|
+
{ file: "file-uuid", method: "method-uuid", args: ["arg1", "arg2"] }
|
|
1076
|
+
|
|
1077
|
+
2. Run arbitrary PHP code:
|
|
1078
|
+
{ code: "return 1 + 1;" }
|
|
1079
|
+
|
|
1080
|
+
3. Run with benchmarking enabled:
|
|
1081
|
+
{ file: "file-uuid", method: "method-uuid", benchmark: true }
|
|
1082
|
+
|
|
1083
|
+
EXAMPLES:
|
|
1084
|
+
|
|
1085
|
+
Run a controller method:
|
|
1086
|
+
{
|
|
1087
|
+
"file": "user-controller-uuid",
|
|
1088
|
+
"method": "index-method-uuid",
|
|
1089
|
+
"args": []
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1092
|
+
Execute inline PHP:
|
|
1093
|
+
{
|
|
1094
|
+
"code": "return collect([1, 2, 3])->sum();"
|
|
1095
|
+
}
|
|
1096
|
+
|
|
1097
|
+
Test with benchmark timing:
|
|
1098
|
+
{
|
|
1099
|
+
"file": "file-uuid",
|
|
1100
|
+
"method": "method-uuid",
|
|
1101
|
+
"benchmark": true
|
|
1102
|
+
}
|
|
1103
|
+
|
|
1104
|
+
RESPONSE includes:
|
|
1105
|
+
- output: The return value or printed output
|
|
1106
|
+
- success: Whether execution succeeded
|
|
1107
|
+
- error: Error message if failed
|
|
1108
|
+
- execution_time: Time taken (if benchmark enabled)
|
|
1109
|
+
- memory_usage: Memory used (if benchmark enabled)
|
|
1110
|
+
|
|
1111
|
+
SECURITY: Code runs in a sandboxed environment with limited permissions.`,
|
|
1112
|
+
inputSchema: {
|
|
1113
|
+
type: 'object',
|
|
1114
|
+
properties: {
|
|
1115
|
+
file: {
|
|
1116
|
+
type: 'string',
|
|
1117
|
+
description: 'UUID of the file containing the method to run',
|
|
1118
|
+
},
|
|
1119
|
+
method: {
|
|
1120
|
+
type: 'string',
|
|
1121
|
+
description: 'UUID of the method to execute',
|
|
1122
|
+
},
|
|
1123
|
+
code: {
|
|
1124
|
+
type: 'string',
|
|
1125
|
+
description: 'Raw PHP/JS code to execute (alternative to file/method)',
|
|
1126
|
+
},
|
|
1127
|
+
args: {
|
|
1128
|
+
type: 'array',
|
|
1129
|
+
description: 'Arguments to pass to the method',
|
|
1130
|
+
items: {},
|
|
1131
|
+
},
|
|
1132
|
+
timeout: {
|
|
1133
|
+
type: 'number',
|
|
1134
|
+
description: 'Execution timeout in seconds (default: 30, max: 60)',
|
|
1135
|
+
},
|
|
1136
|
+
benchmark: {
|
|
1137
|
+
type: 'boolean',
|
|
1138
|
+
description: 'Enable benchmarking to measure execution time and memory usage',
|
|
1139
|
+
},
|
|
1140
|
+
},
|
|
1141
|
+
},
|
|
1142
|
+
},
|
|
1061
1143
|
];
|
|
1062
1144
|
// Server instructions for tool discovery (used by MCP Tool Search)
|
|
1063
1145
|
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.
|
|
@@ -1627,6 +1709,29 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
1627
1709
|
],
|
|
1628
1710
|
};
|
|
1629
1711
|
}
|
|
1712
|
+
case 'run_code': {
|
|
1713
|
+
const result = await stellify.runCode(args);
|
|
1714
|
+
const benchmarkInfo = args.benchmark
|
|
1715
|
+
? ` (${result.execution_time || 'N/A'}ms, ${result.memory_usage || 'N/A'})`
|
|
1716
|
+
: '';
|
|
1717
|
+
return {
|
|
1718
|
+
content: [
|
|
1719
|
+
{
|
|
1720
|
+
type: 'text',
|
|
1721
|
+
text: JSON.stringify({
|
|
1722
|
+
success: result.success !== false,
|
|
1723
|
+
message: result.success !== false
|
|
1724
|
+
? `Code executed successfully${benchmarkInfo}`
|
|
1725
|
+
: `Execution failed: ${result.error || 'Unknown error'}`,
|
|
1726
|
+
output: result.output,
|
|
1727
|
+
error: result.error,
|
|
1728
|
+
execution_time: result.execution_time,
|
|
1729
|
+
memory_usage: result.memory_usage,
|
|
1730
|
+
}, null, 2),
|
|
1731
|
+
},
|
|
1732
|
+
],
|
|
1733
|
+
};
|
|
1734
|
+
}
|
|
1630
1735
|
default:
|
|
1631
1736
|
throw new Error(`Unknown tool: ${name}`);
|
|
1632
1737
|
}
|
|
@@ -148,4 +148,11 @@ export declare class StellifyClient {
|
|
|
148
148
|
changes: Record<string, any>;
|
|
149
149
|
}>;
|
|
150
150
|
}): Promise<any>;
|
|
151
|
+
runCode(params: {
|
|
152
|
+
file: string;
|
|
153
|
+
method: string;
|
|
154
|
+
args?: any[];
|
|
155
|
+
timeout?: number;
|
|
156
|
+
benchmark?: boolean;
|
|
157
|
+
}): Promise<any>;
|
|
151
158
|
}
|
package/dist/stellify-client.js
CHANGED
|
@@ -174,4 +174,10 @@ export class StellifyClient {
|
|
|
174
174
|
const response = await this.client.post('/elements/command', params);
|
|
175
175
|
return response.data;
|
|
176
176
|
}
|
|
177
|
+
// Code execution
|
|
178
|
+
async runCode(params) {
|
|
179
|
+
const { file, method, ...body } = params;
|
|
180
|
+
const response = await this.client.put(`/code/${file}/${method}`, body);
|
|
181
|
+
return response.data;
|
|
182
|
+
}
|
|
177
183
|
}
|
package/manifest.json
CHANGED
|
@@ -63,7 +63,9 @@
|
|
|
63
63
|
{"name": "get_module", "description": "Get module with all files"},
|
|
64
64
|
{"name": "create_module", "description": "Create new module for grouping globals"},
|
|
65
65
|
{"name": "add_file_to_module", "description": "Add file to module"},
|
|
66
|
-
{"name": "install_module", "description": "Install entire module into project"}
|
|
66
|
+
{"name": "install_module", "description": "Install entire module into project"},
|
|
67
|
+
{"name": "broadcast_element_command", "description": "Broadcast real-time UI updates via WebSocket"},
|
|
68
|
+
{"name": "run_code", "description": "Execute code and return output with optional benchmarking"}
|
|
67
69
|
],
|
|
68
70
|
"tools_generated": false,
|
|
69
71
|
"compatibility": {
|
package/package.json
CHANGED