# Stellify MCP Server [![npm version](https://badge.fury.io/js/@stellisoft%2Fstellify-mcp.svg)](https://www.npmjs.com/package/@stellisoft/stellify-mcp) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) Model Context Protocol (MCP) server for [Stellify](https://stellisoft.com) - the AI-native code generation platform. ## What is This? This MCP server lets AI assistants (like Claude Desktop) interact with your Stellify projects to build Laravel and Vue.js applications incrementally. Instead of generating full code files at once, AI can: - Create file structures (classes, controllers, models, middleware, Vue components) - Add method signatures with type hints - Parse PHP/JavaScript code into structured JSON (statement-by-statement) - Convert HTML to Stellify elements in a single operation - Search existing code in your projects - Install reusable code from the global library - Build applications through natural conversation ## Quick Start ### Prerequisites - **Node.js 18 or higher** - **A Stellify account** - Sign up at [stellisoft.com](https://stellisoft.com) - **Claude Desktop** (or another MCP-compatible AI client) ### Installation Install globally via npm: ```bash npm install -g @stellisoft/stellify-mcp ``` ### Configuration 1. **Get your Stellify API token:** - Log into [Stellify](https://stellisoft.com) - Navigate to Settings → API Tokens - Click "Create New Token" - Copy your token 2. **Configure Claude Desktop:** Edit your Claude Desktop configuration file: - **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json` - **Windows:** `%APPDATA%\Claude\claude_desktop_config.json` - **Linux:** `~/.config/claude/claude_desktop_config.json` Add the Stellify MCP server: ```json { "mcpServers": { "stellify": { "command": "stellify-mcp", "env": { "STELLIFY_API_URL": "https://api.stellisoft.com/v1", "STELLIFY_API_TOKEN": "your-token-here" } } } } ``` 3. **Restart Claude Desktop** That's it! The Stellify tools should now be available in Claude Desktop. ## Usage Once configured, you can talk to Claude naturally to build applications: ### Example Conversations **Create a new controller:** ``` "Create a UserController in my Stellify project" ``` **Add methods:** ``` "Add a method called 'store' that takes a Request parameter and returns a JsonResponse" ``` **Implement method logic:** ``` "Add this implementation to the store method: $user = User::create($request->validated()); return response()->json($user, 201);" ``` **Build a Vue component:** ``` "Create a Counter component with an increment button" ``` **Convert HTML to elements:** ``` "Convert this HTML to Stellify elements:

Hello

" ``` **Search your codebase:** ``` "Search for all controller files in my project" "Find methods related to authentication" ``` ## Available Tools ### Project & Directory Tools #### `get_project` Get the active Stellify project for the authenticated user. **Call this first before any other operations.** **Parameters:** None **Returns:** - `uuid`: Project UUID (needed for most operations) - `name`: Project name - `directories`: Array of `{uuid, name}` for existing directories --- #### `get_directory` Get a directory by UUID to see its contents. **Parameters:** - `uuid` (required): The UUID of the directory --- #### `create_directory` Create a new directory for organizing files. **Parameters:** - `name` (required): Directory name (e.g., "js", "css", "components") --- ### File Tools #### `create_file` Create a new file in a Stellify project. This creates an empty file shell - no methods, statements, or template yet. **Parameters:** - `directory` (required): UUID of the directory (get from `get_project` directories array) - `name` (required): File name without extension (e.g., "Counter", "UserController") - `type` (required): File type - "class", "model", "controller", "middleware", or "js" - `extension` (optional): File extension. Use "vue" for Vue components. - `namespace` (optional): PHP namespace (e.g., "App\\Services\\"). Only for PHP files. - `includes` (optional): Array of fully-qualified class names to import (e.g., `["App\\Models\\User", "Illuminate\\Http\\Request"]`). Stellify will resolve these to file UUIDs, fetching from Laravel API or vendor directory if needed. **Directory selection:** Match the directory to your file's purpose. If the directory doesn't exist, create it first with `create_directory`. | File Type | Directory | Namespace | |-----------|-----------|-----------| | Controllers | `controllers` | `App\Http\Controllers\` | | Models | `models` | `App\Models\` | | Services | `services` | `App\Services\` | | Middleware | `middleware` | `App\Http\Middleware\` | | Vue/JS | `js` | N/A | **Example workflow:** 1. `create_file` → creates empty shell, returns file UUID 2. `create_statement` + `add_statement_code` → add variables/imports 3. `create_method` + `add_method_body` → add functions 4. `html_to_elements` → create template elements (for Vue) 5. `save_file` → finalize with all UUIDs wired together **Auto-dependency creation** (when `auto_create_dependencies: true`): When you create a file with code like: ```php validated()); return response()->json($user); } } ``` Stellify will: 1. Parse `use` statements to find dependencies (`User`, `Request`, `Socialite`) 2. Check Application DB for framework classes → find cached classes 3. For core Laravel classes → fetch from [api.laravel.com](https://api.laravel.com/docs/12.x/) 4. For vendor packages (Socialite, Spatie, etc.) → read from `vendor/` directory 5. Create missing App classes → create `User` model file 6. Wire up the file's `includes` array with all dependency UUIDs **Supported sources:** - **Laravel API** - Core `Illuminate\*` classes fetched from api.laravel.com - **Vendor packages** - `Laravel\Socialite\*`, `Laravel\Cashier\*`, `Spatie\*`, `Livewire\*`, etc. read directly from your `vendor/` directory using PHP-Parser The response includes a `dependencies` report showing what was created/resolved and from which source. --- #### `get_file` Get a file by UUID with all its metadata, methods, and statements. **Parameters:** - `uuid` (required): UUID of the file --- #### `save_file` Save/update a file with its full configuration. This finalizes the file after `create_file`. **Parameters:** - `uuid` (required): UUID of the file - `name` (required): File name (without extension) - `type` (required): File type ("js", "class", "controller", "model", "middleware") - `extension` (optional): File extension ("vue" for Vue SFCs) - `template` (optional): Array of root element UUIDs for Vue `