@stellisoft/stellify-mcp 0.1.17 → 0.1.19
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 +328 -3
- package/dist/stellify-client.d.ts +3 -0
- package/dist/stellify-client.js +4 -0
- package/package.json +1 -1
- package/server.json +2 -2
package/dist/index.js
CHANGED
|
@@ -91,6 +91,39 @@ const stellify = new StellifyClient({
|
|
|
91
91
|
// - includes: Array of file UUIDs to import
|
|
92
92
|
//
|
|
93
93
|
// -----------------------------------------------------------------------------
|
|
94
|
+
// VUE COMPONENT + ROUTE PATTERN (for visual editing)
|
|
95
|
+
// -----------------------------------------------------------------------------
|
|
96
|
+
// When building Vue components, use TWO routes to enable visual editing:
|
|
97
|
+
//
|
|
98
|
+
// 1. TEMPLATE ROUTE - Holds the component's UI elements for editing
|
|
99
|
+
// - create_route: name='NotesTemplate', path='/notes-template', type='web'
|
|
100
|
+
// - html_to_elements: page=templateRouteUuid, elements='<div>...</div>'
|
|
101
|
+
// - Users can visually edit these elements in the route editor
|
|
102
|
+
//
|
|
103
|
+
// 2. DISPLAY ROUTE - The actual page that renders the component
|
|
104
|
+
// - create_route: name='Notes', path='/notes', type='web'
|
|
105
|
+
// - html_to_elements: page=displayRouteUuid, elements='<NotesApp />'
|
|
106
|
+
// - This embeds the Vue component on the page
|
|
107
|
+
//
|
|
108
|
+
// 3. VUE COMPONENT FILE - Links to template route elements
|
|
109
|
+
// - create_file: type='js', extension='vue', name='NotesApp'
|
|
110
|
+
// - save_file: template=[elementUuidsFromTemplateRoute]
|
|
111
|
+
//
|
|
112
|
+
// WHY THIS PATTERN?
|
|
113
|
+
// - Template elements need a route to be viewable/editable in the UI
|
|
114
|
+
// - The display route keeps the clean component embedding pattern
|
|
115
|
+
// - Component logic (methods, state) stays in the .vue file
|
|
116
|
+
//
|
|
117
|
+
// EXAMPLE WORKFLOW:
|
|
118
|
+
// 1. Create template route: '/notes-template' (for editing)
|
|
119
|
+
// 2. Create display route: '/notes' (for viewing)
|
|
120
|
+
// 3. html_to_elements on template route (creates editable elements)
|
|
121
|
+
// 4. html_to_elements on display route with '<NotesApp />'
|
|
122
|
+
// 5. create_file for NotesApp.vue
|
|
123
|
+
// 6. Add methods, statements, wire events
|
|
124
|
+
// 7. save_file with template pointing to template route's root element
|
|
125
|
+
//
|
|
126
|
+
// -----------------------------------------------------------------------------
|
|
94
127
|
// ELEMENT EVENT HANDLERS (for frontend files)
|
|
95
128
|
// -----------------------------------------------------------------------------
|
|
96
129
|
// Elements can have these event properties (value is method UUID):
|
|
@@ -105,9 +138,137 @@ const stellify = new StellifyClient({
|
|
|
105
138
|
// - mouseenter: Fires on mouse enter (@mouseenter)
|
|
106
139
|
// - mouseleave: Fires on mouse leave (@mouseleave)
|
|
107
140
|
//
|
|
141
|
+
// -----------------------------------------------------------------------------
|
|
142
|
+
// STELLIFY FRAMEWORK (frontend library for Vue/JS files)
|
|
143
|
+
// -----------------------------------------------------------------------------
|
|
144
|
+
// Stellify Framework is an AI-friendly frontend library with constrained APIs.
|
|
145
|
+
// Use these modules in Vue components for common frontend tasks.
|
|
146
|
+
//
|
|
147
|
+
// IMPORT PATTERN:
|
|
148
|
+
// import { Form, Http, Table } from 'stellify-framework'
|
|
149
|
+
//
|
|
150
|
+
// DATA & FORMS:
|
|
151
|
+
// Form.create({name:'',email:''}).validate({...}).store('/api/users')
|
|
152
|
+
// Table.create(data).addColumn('name').sort('name').paginate(10)
|
|
153
|
+
// List.create(items).add(item).remove(id).filter(fn).map(fn)
|
|
154
|
+
// Tree.create().setRoot(data).addChild(parentId,child).traverse(fn)
|
|
155
|
+
//
|
|
156
|
+
// NETWORK:
|
|
157
|
+
// Http.create('/api').withToken(t).get('/users').post('/users',data)
|
|
158
|
+
// Socket.create('wss://...').on('message',fn).connect().send(data)
|
|
159
|
+
// Auth.create('/api').login(creds).logout().getUser().isAuthenticated()
|
|
160
|
+
// Stream.create('/api/chat').onChunk(fn).onComplete(fn).post(data)
|
|
161
|
+
//
|
|
162
|
+
// GRAPHICS:
|
|
163
|
+
// Svg.create(800,600).rect(0,0,100,50).circle(50,50,20).text('Hi',10,10)
|
|
164
|
+
// Canvas.create(800,600).rect(0,0,100,50).circle(50,50,20).toDataURL()
|
|
165
|
+
// Graph.create().addNode('a').addNode('b').addEdge('a','b').layout('force')
|
|
166
|
+
// Scale.linear().domain([0,100]).range([0,500]).value(50) // returns 250
|
|
167
|
+
// Motion.tween(0,100,{duration:500}).onUpdate(fn).start()
|
|
168
|
+
//
|
|
169
|
+
// PLATFORM:
|
|
170
|
+
// Router.create().register('/users',component).navigate('/users')
|
|
171
|
+
// Storage.local().set('key',val).get('key').remove('key')
|
|
172
|
+
// Events.create().on('event',fn).emit('event',data)
|
|
173
|
+
// Clipboard.copy('text').paste()
|
|
174
|
+
// Notify.request().send('Title',{body:'Message'})
|
|
175
|
+
// Geo.getPosition().then(pos=>...).watchPosition(fn)
|
|
176
|
+
// Media.selectFile({accept:'image/*'}).resize(800,600).toBase64()
|
|
177
|
+
// DB.create('mydb').store({name:'items'}).open().put('items',obj)
|
|
178
|
+
// Worker.fromFunction(fn).run(data).terminate()
|
|
179
|
+
//
|
|
180
|
+
// AI & LANGUAGE:
|
|
181
|
+
// Speech.create().onResult(fn).listen({continuous:true})
|
|
182
|
+
// Speech.create().speak('Hello',{voice:'...'})
|
|
183
|
+
// Chat.create().addUser('Hi').addAssistant('Hello').getMessages()
|
|
184
|
+
// Embed.create().store('id',vector,meta).nearest(queryVec,5)
|
|
185
|
+
// Diff.lines(old,new) // [{type:'equal'|'insert'|'delete',value:'...'}]
|
|
186
|
+
//
|
|
187
|
+
// UTILITIES:
|
|
188
|
+
// Time.now().format('YYYY-MM-DD').add(7,'days').relative()
|
|
189
|
+
//
|
|
190
|
+
// KEY METHODS PER MODULE (max 7 each - AI-friendly constraint):
|
|
191
|
+
// Form: create,set,get,validate,store,update,delete
|
|
192
|
+
// Table: create,setData,addColumn,sort,filter,paginate
|
|
193
|
+
// Http: create,get,post,put,delete,withToken
|
|
194
|
+
// Stream: create,post,onChunk,onComplete,abort,getBuffer
|
|
195
|
+
// Speech: create,listen,speak,stopListening,getVoices,onResult
|
|
196
|
+
// Chat: create,addMessage,getHistory,clear,fork,truncate
|
|
197
|
+
// Embed: create,store,compare,nearest,search,toJSON
|
|
198
|
+
// Diff: chars,words,lines,apply,createPatch,similarity
|
|
199
|
+
//
|
|
108
200
|
// =============================================================================
|
|
109
201
|
// Define MCP tools
|
|
202
|
+
// Stellify Framework API - full method reference for AI code generation
|
|
203
|
+
const STELLIFY_FRAMEWORK_API = {
|
|
204
|
+
// Data & Forms
|
|
205
|
+
Form: ['create', 'set', 'get', 'getData', 'validate', 'isValid', 'getErrors', 'getError', 'reset', 'store', 'update', 'delete'],
|
|
206
|
+
Table: ['create', 'setData', 'addColumn', 'removeColumn', 'sort', 'filter', 'clearFilter', 'paginate', 'page', 'getData', 'getAllData', 'getColumns', 'getColumn', 'getTotalRows', 'getTotalPages', 'getCurrentPage', 'getPageSize', 'getSortKey', 'getSortDirection'],
|
|
207
|
+
List: ['create', 'from', 'range', 'add', 'remove', 'removeWhere', 'set', 'get', 'first', 'last', 'sort', 'sortBy', 'reverse', 'filter', 'find', 'findIndex', 'map', 'reduce', 'forEach', 'includes', 'indexOf', 'every', 'some', 'slice', 'take', 'skip', 'chunk', 'unique', 'uniqueBy', 'groupBy', 'flatten', 'concat', 'isEmpty', 'isNotEmpty', 'count', 'clear', 'toArray', 'toJSON', 'clone', 'sum', 'avg', 'min', 'max'],
|
|
208
|
+
Tree: ['create', 'setRoot', 'addChild', 'removeNode', 'getNode', 'getRoot', 'getChildren', 'getParent', 'getSiblings', 'getAncestors', 'getDescendants', 'getDepth', 'getPath', 'traverse', 'find', 'findAll', 'move', 'toArray', 'size'],
|
|
209
|
+
// Network
|
|
210
|
+
Http: ['create', 'get', 'post', 'put', 'patch', 'delete', 'withHeaders', 'withToken', 'withTimeout'],
|
|
211
|
+
Socket: ['create', 'connect', 'disconnect', 'send', 'sendEvent', 'on', 'off', 'once', 'isConnected', 'getState'],
|
|
212
|
+
Auth: ['create', 'login', 'logout', 'fetchUser', 'getUser', 'getToken', 'isAuthenticated', 'setToken', 'setUser', 'refresh', 'onAuthChange', 'offAuthChange', 'getAuthHeader'],
|
|
213
|
+
Stream: ['create', 'headers', 'withToken', 'onChunk', 'onComplete', 'onError', 'get', 'post', 'abort', 'getBuffer', 'getChunks', 'isStreaming', 'clear'],
|
|
214
|
+
// Graphics & Visualization
|
|
215
|
+
Svg: ['create', 'select', 'find', 'attr', 'attrs', 'getAttr', 'addClass', 'removeClass', 'text', 'rect', 'circle', 'ellipse', 'line', 'polyline', 'polygon', 'path', 'textElement', 'group', 'clear', 'remove', 'toString', 'toElement', 'getWidth', 'getHeight'],
|
|
216
|
+
Canvas: ['create', 'fromElement', 'fromSelector', 'size', 'getWidth', 'getHeight', 'style', 'save', 'restore', 'clear', 'fill', 'rect', 'circle', 'ellipse', 'line', 'polyline', 'polygon', 'arc', 'path', 'text', 'measureText', 'drawImage', 'translate', 'rotate', 'scale', 'resetTransform', 'getPixel', 'setPixel', 'getImageData', 'putImageData', 'toDataURL', 'toBlob', 'getElement', 'getContext', 'appendTo'],
|
|
217
|
+
Graph: ['create', 'size', 'addNode', 'removeNode', 'addEdge', 'removeEdge', 'getNode', 'getNodes', 'getEdges', 'getEdgesWithPositions', 'getNeighbors', 'layout'],
|
|
218
|
+
Scale: ['linear', 'log', 'time', 'band', 'domain', 'range', 'getDomain', 'getRange', 'value', 'invert', 'ticks', 'clamp', 'padding', 'bandwidth'],
|
|
219
|
+
Axis: ['create', 'orientation', 'ticks', 'tickFormat', 'tickSize', 'getTicks', 'getOrientation', 'getTickSize', 'getRange', 'isHorizontal', 'isVertical'],
|
|
220
|
+
Motion: ['tween', 'spring', 'easing', 'onUpdate', 'onComplete', 'start', 'stop', 'isRunning', 'valueAt'],
|
|
221
|
+
// Platform APIs
|
|
222
|
+
Router: ['create', 'register', 'navigate', 'back', 'forward', 'getParams', 'getQuery', 'getCurrent', 'getState', 'onNavigate', 'offNavigate', 'start'],
|
|
223
|
+
Storage: ['local', 'session', 'set', 'get', 'remove', 'clear', 'has', 'keys', 'getAll', 'size'],
|
|
224
|
+
Events: ['create', 'on', 'off', 'once', 'emit', 'clear', 'listenerCount', 'eventNames'],
|
|
225
|
+
Clipboard: ['copy', 'paste', 'copyImage', 'copyHtml', 'isSupported', 'isWriteSupported'],
|
|
226
|
+
Notify: ['request', 'send', 'getPermission', 'isSupported', 'isGranted', 'isDenied'],
|
|
227
|
+
Geo: ['getPosition', 'watchPosition', 'stopWatching', 'stopAllWatching', 'isSupported', 'distance'],
|
|
228
|
+
Media: ['selectFile', 'selectFiles', 'capture', 'getMetadata', 'resize', 'toBase64', 'toArrayBuffer', 'toText', 'formatSize', 'isImage', 'isVideo', 'isAudio'],
|
|
229
|
+
DB: ['create', 'store', 'open', 'close', 'put', 'add', 'get', 'getAll', 'find', 'delete', 'clear', 'count', 'keys', 'update', 'batch', 'deleteDatabase', 'databases'],
|
|
230
|
+
Worker: ['create', 'fromFunction', 'fromCode', 'run', 'post', 'onMessage', 'onError', 'terminate', 'isRunning', 'getPendingCount'],
|
|
231
|
+
WorkerPool: ['create', 'fromFunction', 'run', 'map', 'terminate', 'getSize', 'getActiveCount', 'getQueueLength'],
|
|
232
|
+
// AI & Language
|
|
233
|
+
Speech: ['create', 'isSupported', 'listen', 'stopListening', 'onResult', 'onInterim', 'onEnd', 'onError', 'speak', 'stopSpeaking', 'pause', 'resume', 'getVoices', 'getVoicesByLanguage', 'isSpeaking', 'isListening'],
|
|
234
|
+
Chat: ['create', 'fromHistory', 'addMessage', 'addUser', 'addAssistant', 'addSystem', 'getMessage', 'getHistory', 'getMessages', 'getLastMessage', 'getLastUserMessage', 'getLastAssistantMessage', 'updateMessage', 'removeMessage', 'clear', 'clearAll', 'fork', 'truncate', 'count', 'countTokensEstimate', 'toJSON'],
|
|
235
|
+
Embed: ['create', 'store', 'storeMany', 'get', 'remove', 'clear', 'count', 'compare', 'nearest', 'search', 'cosineSimilarity', 'euclideanDistance', 'dotProduct', 'normalize', 'average', 'toJSON', 'fromJSON'],
|
|
236
|
+
Diff: ['chars', 'words', 'lines', 'apply', 'createPatch', 'distance', 'similarity', 'commonPrefix', 'commonSuffix'],
|
|
237
|
+
// Utilities
|
|
238
|
+
Time: ['now', 'create', 'parse', 'format', 'toISO', 'toDate', 'toTimestamp', 'toUnix', 'add', 'subtract', 'diff', 'isBefore', 'isAfter', 'isSame', 'isBetween', 'startOf', 'endOf', 'year', 'month', 'day', 'weekday', 'hour', 'minute', 'second', 'relative', 'clone'],
|
|
239
|
+
// Adapters
|
|
240
|
+
useStellify: ['(generic adapter for any module)'],
|
|
241
|
+
useForm: ['bind'],
|
|
242
|
+
useTable: ['(reactive table adapter)'],
|
|
243
|
+
};
|
|
110
244
|
const tools = [
|
|
245
|
+
{
|
|
246
|
+
name: 'get_stellify_framework_api',
|
|
247
|
+
description: `Get the complete Stellify Framework API reference for Vue/JS development.
|
|
248
|
+
|
|
249
|
+
Returns all modules and their methods for AI-friendly frontend code generation.
|
|
250
|
+
|
|
251
|
+
Use this tool when you need to:
|
|
252
|
+
- Look up available methods for a Stellify module
|
|
253
|
+
- Verify method names before generating code
|
|
254
|
+
- Understand the full API surface
|
|
255
|
+
|
|
256
|
+
Example response:
|
|
257
|
+
{
|
|
258
|
+
"Form": ["create", "set", "get", "validate", "store", "update", "delete", ...],
|
|
259
|
+
"Http": ["create", "get", "post", "put", "delete", "withToken", ...],
|
|
260
|
+
...
|
|
261
|
+
}`,
|
|
262
|
+
inputSchema: {
|
|
263
|
+
type: 'object',
|
|
264
|
+
properties: {
|
|
265
|
+
module: {
|
|
266
|
+
type: 'string',
|
|
267
|
+
description: 'Optional: specific module to get API for (e.g., "Form", "Http"). Omit to get all modules.',
|
|
268
|
+
},
|
|
269
|
+
},
|
|
270
|
+
},
|
|
271
|
+
},
|
|
111
272
|
{
|
|
112
273
|
name: 'get_project',
|
|
113
274
|
description: `Get the active Stellify project for the authenticated user.
|
|
@@ -378,7 +539,30 @@ Example:
|
|
|
378
539
|
},
|
|
379
540
|
{
|
|
380
541
|
name: 'create_route',
|
|
381
|
-
description:
|
|
542
|
+
description: `Create a new route/page in a Stellify project.
|
|
543
|
+
|
|
544
|
+
IMPORTANT - WIRING ROUTES TO CONTROLLERS:
|
|
545
|
+
For API routes to execute code, you MUST connect them to a controller and method:
|
|
546
|
+
- controller: UUID of the controller file (e.g., NoteController)
|
|
547
|
+
- controller_method: UUID of the method to execute (e.g., index, store, update, destroy)
|
|
548
|
+
|
|
549
|
+
Without these fields, the route exists but won't execute any code!
|
|
550
|
+
|
|
551
|
+
EXAMPLE - Create an API route wired to a controller:
|
|
552
|
+
{
|
|
553
|
+
"project_id": "project-uuid",
|
|
554
|
+
"name": "notes.index",
|
|
555
|
+
"path": "/api/notes",
|
|
556
|
+
"method": "GET",
|
|
557
|
+
"type": "api",
|
|
558
|
+
"controller": "controller-file-uuid",
|
|
559
|
+
"controller_method": "index-method-uuid"
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
WORKFLOW for API endpoints:
|
|
563
|
+
1. Create controller with create_file (type: "controller") or create_resources
|
|
564
|
+
2. Create methods with create_method + add_method_body
|
|
565
|
+
3. Create route with create_route, passing controller and controller_method UUIDs`,
|
|
382
566
|
inputSchema: {
|
|
383
567
|
type: 'object',
|
|
384
568
|
properties: {
|
|
@@ -388,11 +572,11 @@ Example:
|
|
|
388
572
|
},
|
|
389
573
|
name: {
|
|
390
574
|
type: 'string',
|
|
391
|
-
description: 'Route/page name (e.g., "Home", "Counter", "
|
|
575
|
+
description: 'Route/page name (e.g., "Home", "Counter", "notes.index")',
|
|
392
576
|
},
|
|
393
577
|
path: {
|
|
394
578
|
type: 'string',
|
|
395
|
-
description: 'URL path (e.g., "/", "/counter", "/
|
|
579
|
+
description: 'URL path (e.g., "/", "/counter", "/api/notes")',
|
|
396
580
|
},
|
|
397
581
|
method: {
|
|
398
582
|
type: 'string',
|
|
@@ -406,6 +590,14 @@ Example:
|
|
|
406
590
|
description: 'Route type: "web" for pages, "api" for API endpoints',
|
|
407
591
|
default: 'web',
|
|
408
592
|
},
|
|
593
|
+
controller: {
|
|
594
|
+
type: 'string',
|
|
595
|
+
description: 'UUID of the controller file to handle this route. Required for API routes to execute code.',
|
|
596
|
+
},
|
|
597
|
+
controller_method: {
|
|
598
|
+
type: 'string',
|
|
599
|
+
description: 'UUID of the method within the controller to execute. Required for API routes to execute code.',
|
|
600
|
+
},
|
|
409
601
|
data: {
|
|
410
602
|
type: 'object',
|
|
411
603
|
description: 'Additional route data (title, description, element UUIDs)',
|
|
@@ -434,6 +626,74 @@ Use this to look up a route you created or to find existing routes in the projec
|
|
|
434
626
|
required: ['uuid'],
|
|
435
627
|
},
|
|
436
628
|
},
|
|
629
|
+
{
|
|
630
|
+
name: 'save_route',
|
|
631
|
+
description: `Update an existing route/page. Use this to wire a route to a controller method.
|
|
632
|
+
|
|
633
|
+
IMPORTANT: This is how you connect API routes to controller methods!
|
|
634
|
+
|
|
635
|
+
Example - Wire an API route to a controller method:
|
|
636
|
+
{
|
|
637
|
+
"uuid": "route-uuid",
|
|
638
|
+
"controller": "controller-file-uuid",
|
|
639
|
+
"controller_method": "method-uuid"
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
Available fields:
|
|
643
|
+
- controller: UUID of the controller file
|
|
644
|
+
- controller_method: UUID of the method to execute
|
|
645
|
+
- path: URL path
|
|
646
|
+
- name: Route name
|
|
647
|
+
- type: "web" or "api"
|
|
648
|
+
- method: HTTP method (GET, POST, PUT, DELETE, PATCH)
|
|
649
|
+
- middleware: Array of middleware names
|
|
650
|
+
- public: Whether the route is public (no auth required)`,
|
|
651
|
+
inputSchema: {
|
|
652
|
+
type: 'object',
|
|
653
|
+
properties: {
|
|
654
|
+
uuid: {
|
|
655
|
+
type: 'string',
|
|
656
|
+
description: 'UUID of the route to update',
|
|
657
|
+
},
|
|
658
|
+
controller: {
|
|
659
|
+
type: 'string',
|
|
660
|
+
description: 'UUID of the controller file to handle this route',
|
|
661
|
+
},
|
|
662
|
+
controller_method: {
|
|
663
|
+
type: 'string',
|
|
664
|
+
description: 'UUID of the method within the controller to execute',
|
|
665
|
+
},
|
|
666
|
+
path: {
|
|
667
|
+
type: 'string',
|
|
668
|
+
description: 'URL path (e.g., "/api/notes")',
|
|
669
|
+
},
|
|
670
|
+
name: {
|
|
671
|
+
type: 'string',
|
|
672
|
+
description: 'Route name',
|
|
673
|
+
},
|
|
674
|
+
type: {
|
|
675
|
+
type: 'string',
|
|
676
|
+
enum: ['web', 'api'],
|
|
677
|
+
description: 'Route type',
|
|
678
|
+
},
|
|
679
|
+
method: {
|
|
680
|
+
type: 'string',
|
|
681
|
+
enum: ['GET', 'POST', 'PUT', 'DELETE', 'PATCH'],
|
|
682
|
+
description: 'HTTP method',
|
|
683
|
+
},
|
|
684
|
+
middleware: {
|
|
685
|
+
type: 'array',
|
|
686
|
+
items: { type: 'string' },
|
|
687
|
+
description: 'Array of middleware names',
|
|
688
|
+
},
|
|
689
|
+
public: {
|
|
690
|
+
type: 'boolean',
|
|
691
|
+
description: 'Whether the route is public (no auth required)',
|
|
692
|
+
},
|
|
693
|
+
},
|
|
694
|
+
required: ['uuid'],
|
|
695
|
+
},
|
|
696
|
+
},
|
|
437
697
|
{
|
|
438
698
|
name: 'search_routes',
|
|
439
699
|
description: `Search for routes/pages in the project by name. Use this to find existing routes before creating new ones.
|
|
@@ -973,6 +1233,30 @@ RELATIONSHIP TYPES:
|
|
|
973
1233
|
- belongsTo: Inverse of hasOne/hasMany (Post belongsTo User)
|
|
974
1234
|
- belongsToMany: Many-to-many (User belongsToMany Roles)
|
|
975
1235
|
|
|
1236
|
+
IMPORTANT - WIRING ROUTES TO CONTROLLERS:
|
|
1237
|
+
This tool creates controller methods but does NOT automatically wire routes to them.
|
|
1238
|
+
After calling create_resources, you must MANUALLY wire routes using create_route:
|
|
1239
|
+
|
|
1240
|
+
1. Note the returned controller UUID and method UUIDs from the response
|
|
1241
|
+
2. For each API route, call create_route with:
|
|
1242
|
+
- controller: the controller file UUID
|
|
1243
|
+
- controller_method: the specific method UUID (index, store, update, destroy)
|
|
1244
|
+
|
|
1245
|
+
Example response structure:
|
|
1246
|
+
{
|
|
1247
|
+
"controller": {
|
|
1248
|
+
"uuid": "controller-uuid",
|
|
1249
|
+
"methods": [
|
|
1250
|
+
{ "uuid": "index-method-uuid", "name": "index" },
|
|
1251
|
+
{ "uuid": "store-method-uuid", "name": "store" },
|
|
1252
|
+
...
|
|
1253
|
+
]
|
|
1254
|
+
}
|
|
1255
|
+
}
|
|
1256
|
+
|
|
1257
|
+
Then create routes:
|
|
1258
|
+
create_route({ path: "/api/notes", method: "GET", controller: "controller-uuid", controller_method: "index-method-uuid" })
|
|
1259
|
+
|
|
976
1260
|
Returns UUIDs for all created files so you can customize them further if needed.`,
|
|
977
1261
|
inputSchema: {
|
|
978
1262
|
type: 'object',
|
|
@@ -1340,6 +1624,30 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
1340
1624
|
}
|
|
1341
1625
|
try {
|
|
1342
1626
|
switch (name) {
|
|
1627
|
+
case 'get_stellify_framework_api': {
|
|
1628
|
+
const moduleName = args.module;
|
|
1629
|
+
let result;
|
|
1630
|
+
if (moduleName) {
|
|
1631
|
+
const moduleApi = STELLIFY_FRAMEWORK_API[moduleName];
|
|
1632
|
+
if (moduleApi) {
|
|
1633
|
+
result = { [moduleName]: moduleApi };
|
|
1634
|
+
}
|
|
1635
|
+
else {
|
|
1636
|
+
result = { error: `Module "${moduleName}" not found. Available: ${Object.keys(STELLIFY_FRAMEWORK_API).join(', ')}` };
|
|
1637
|
+
}
|
|
1638
|
+
}
|
|
1639
|
+
else {
|
|
1640
|
+
result = STELLIFY_FRAMEWORK_API;
|
|
1641
|
+
}
|
|
1642
|
+
return {
|
|
1643
|
+
content: [
|
|
1644
|
+
{
|
|
1645
|
+
type: 'text',
|
|
1646
|
+
text: JSON.stringify(result, null, 2),
|
|
1647
|
+
},
|
|
1648
|
+
],
|
|
1649
|
+
};
|
|
1650
|
+
}
|
|
1343
1651
|
case 'get_project': {
|
|
1344
1652
|
const result = await stellify.getProject();
|
|
1345
1653
|
const projectData = result.data || result;
|
|
@@ -1480,6 +1788,23 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
1480
1788
|
],
|
|
1481
1789
|
};
|
|
1482
1790
|
}
|
|
1791
|
+
case 'save_route': {
|
|
1792
|
+
const { uuid, ...updateData } = args;
|
|
1793
|
+
const result = await stellify.saveRoute(uuid, updateData);
|
|
1794
|
+
const routeData = result.data || result;
|
|
1795
|
+
return {
|
|
1796
|
+
content: [
|
|
1797
|
+
{
|
|
1798
|
+
type: 'text',
|
|
1799
|
+
text: JSON.stringify({
|
|
1800
|
+
success: true,
|
|
1801
|
+
message: `Updated route "${uuid}"${updateData.controller ? ' with controller wiring' : ''}`,
|
|
1802
|
+
route: routeData,
|
|
1803
|
+
}, null, 2),
|
|
1804
|
+
},
|
|
1805
|
+
],
|
|
1806
|
+
};
|
|
1807
|
+
}
|
|
1483
1808
|
case 'search_routes': {
|
|
1484
1809
|
const result = await stellify.searchRoutes(args);
|
|
1485
1810
|
const routes = result.data || result;
|
|
@@ -52,6 +52,8 @@ export interface CreateRouteParams {
|
|
|
52
52
|
path: string;
|
|
53
53
|
method: string;
|
|
54
54
|
type?: string;
|
|
55
|
+
controller?: string;
|
|
56
|
+
controller_method?: string;
|
|
55
57
|
data?: any;
|
|
56
58
|
}
|
|
57
59
|
export interface CreateElementParams {
|
|
@@ -84,6 +86,7 @@ export declare class StellifyClient {
|
|
|
84
86
|
saveStatement(statement: string, data: any): Promise<any>;
|
|
85
87
|
createRoute(params: CreateRouteParams): Promise<any>;
|
|
86
88
|
getRoute(route: string): Promise<any>;
|
|
89
|
+
saveRoute(route: string, data: any): Promise<any>;
|
|
87
90
|
searchRoutes(params: {
|
|
88
91
|
search?: string;
|
|
89
92
|
type?: string;
|
package/dist/stellify-client.js
CHANGED
|
@@ -71,6 +71,10 @@ export class StellifyClient {
|
|
|
71
71
|
const response = await this.client.get(`/route/${route}`);
|
|
72
72
|
return response.data;
|
|
73
73
|
}
|
|
74
|
+
async saveRoute(route, data) {
|
|
75
|
+
const response = await this.client.put(`/route/${route}`, { uuid: route, ...data });
|
|
76
|
+
return response.data;
|
|
77
|
+
}
|
|
74
78
|
async searchRoutes(params) {
|
|
75
79
|
const response = await this.client.get('/route/search', { params });
|
|
76
80
|
return response.data;
|
package/package.json
CHANGED
package/server.json
CHANGED
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
"url": "https://github.com/Stellify-Software-Ltd/stellify-mcp",
|
|
7
7
|
"source": "github"
|
|
8
8
|
},
|
|
9
|
-
"version": "0.1.
|
|
9
|
+
"version": "0.1.18",
|
|
10
10
|
"packages": [
|
|
11
11
|
{
|
|
12
12
|
"registryType": "npm",
|
|
13
13
|
"identifier": "@stellisoft/stellify-mcp",
|
|
14
|
-
"version": "0.1.
|
|
14
|
+
"version": "0.1.18",
|
|
15
15
|
"transport": {
|
|
16
16
|
"type": "stdio"
|
|
17
17
|
},
|