Mila is an active UI/UX intelligence system and MCP server for autonomous AI coding agents (Claude Code, Cursor, Windsurf, Antigravity, v0). Inspired by HorizonX's agent-first paradigm, Mila teaches AI coding tools how to build beautiful, production-ready interfaces with mathematical precision and zero "AI slop".
Mila ships as five installable npm packages: a curated component registry, an MCP server with 7 agent tools, a CLI, design rules, and an automated code reviewer — plus a live Mobbin-style demo website.
📚 Read the Complete Installation Guide — Install Mila as a dependency in your project. 📚 Read the Complete Integration Guide — Connect Mila to AI agents, import components, and prompt effectively.
- The 5 Packages
- Quickstart
- Available Components
- Available MCP Tools
- CLI Reference
- Connect to AI Agents
- Use the Registry Programmatically
- Demo Website
- Build & Test
- Project Structure
| Package | npm | Version | Purpose | Install |
|---|---|---|---|---|
| Registry | @mila/registry |
1.1.0 | Curated component + template registry (searchable catalog with copy-paste source) | bun add @mila/registry |
| MCP Server | @mila/mcp |
0.2.0 | MCP server — connects Mila to Cursor, Claude Code, Windsurf, Antigravity | bun add --dev @mila/mcp |
| CLI | @mila/cli |
1.0.0 | CLI — mila init, mila add, mila doctor, mila search |
bun add --dev @mila/cli |
| Rules | @mila/rules |
0.1.0 | Design intelligence rules (typography, colors, 8pt grid, 3D motion) | bun add @mila/rules |
| Review | @mila/review |
0.1.0 | Heuristic code auditor (magic numbers, contrast, accessibility, mobile) | bun add @mila/review |
All packages are TypeScript with full type declarations, published as ESM, and licensed MIT.
```bash
bun add @mila/registry bun add --dev @mila/mcp @mila/cli
npx mila init
npx mila add tilt-3d-card
npx mila doctor
npx mila search 3d ```
| Component | Category | Description | Deps |
|---|---|---|---|
| `spotlight-card` | card | Cursor-tracking radial spotlight border glow effect | react |
| `before-after-slider` | interactive | Smooth drag & touch-responsive before/after comparison slider | react |
| `tilt-3d-card` | 3d-motion | CSS 3D parallax tilt with concentric depth layers & dynamic glare | react |
| `particle-wave-3d` | 3d-motion | Canvas 3D wireframe particle landscape with cursor camera orbit | react |
| `screen-card` | card | Mobbin-style screen card with 3D tilt + open-source images | react, next |
| `image-from-url` | asset | Open-source image renderer (Lorem Picsum / Unsplash) with SVG fallback | next, react |
| `bento-grid` | bento | Asymmetrical grid with simulated agent terminal & live metrics | react |
| `hero-geometric` | hero | Geometric wireframe hero with ambient blur & dual CTA | react |
| `hero-section` | hero | 3D particle hero with canvas background & dual CTA | react, framer-motion, lucide-react |
| `floating-navbar` | nav | Scroll-aware floating pill navbar | react, lucide-react |
| `navbar` | nav | Full navigation bar with mobile drawer, category chips, auth actions | react, next, lucide-react |
| `pricing-section` | pricing | 3-tier pricing matrix with featured plan spotlight | react, lucide-react |
| `pricing-matrix` | pricing | Pricing cards with toggle switch & feature checklist | react |
| `bento-showcase` | bento | Asymmetrical bento grid with Framer Motion reveals & terminal tiles | react, framer-motion, lucide-react |
| Template | Components Used | Description |
|---|---|---|
| `modern-saas-landing` | floating-navbar, hero-geometric, bento-grid, pricing-matrix | Complete conversion-oriented SaaS landing page |
| Tool | Input | Output |
|---|---|---|
| `mila_search` | `query` (string), `category` (optional) | Matching components with name, description, category & tags |
| `mila_get_component` | `name` (component slug) | Full TSX source code, title, description & required deps |
| `mila_get_rules` | `topic` (typography/colors/layout/spacing/3d-motion/anti-patterns/all) | Design intelligence rules & mathematical principles |
| `mila_generate_theme` | `themeNameOrKeyword` | Accessible token palette + Tailwind v4 `@theme` block |
| `mila_get_template` | `templateName` (e.g. `modern-saas-landing`) | Complete multi-component page layout composition |
| `mila_review_code` | `code` (JSX/TSX snippet) | Quality score (0-100) with flagged issues & fix suggestions |
| `mila_auto_fix` | `code` (TSX snippet) | Refactored code with magic numbers replaced, mobile grids fixed, focus rings added |
`mila_generate_theme` supports: `electric-indigo`, `cyber-emerald`, `obsidian-mono`, `warm-editorial`, `fintech`, `crypto`, `luxury`, `neobrutalism`.
```bash npx mila init ``` Creates `.cursor/mcp.json` automatically. Or manually: ```json { "mcpServers": { "mila": { "command": "npx", "args": ["-y", "@mila/mcp"] } } } ```
```bash claude mcp add mila -- npx -y @mila/mcp ```
Add to `~/.codeium/windsurf/mcp_config.json` (same config as Cursor above).
Add to `~/.gemini/antigravity-cli/mcp.json` (same config as Cursor above).
Or run locally from source: `bun run packages/mcp-server/src/index.ts`
Sets up Mila in your project:
- Installs `@mila/mcp` as a devDependency
- Creates `.cursor/mcp.json` with the MCP server config
- Creates `components/ui/` directory
Copies a Mila component's source code directly into your `components/ui/` directory (shadcn-style). Automatically reports required peer dependencies.
```bash npx mila add tilt-3d-card # → components/ui/Tilt3DCard.tsx npx mila add screen-card # → components/ui/ScreenCard.tsx npx mila add particle-wave-3d # → components/ui/ParticleWave3D.tsx npx mila add navbar # → components/ui/Navbar.tsx ```
Search the component catalog by keyword or list all available components.
```bash npx mila search 3d # → tilt-3d-card, particle-wave-3d, hero-section, bento-showcase npx mila search hero # → hero-geometric, hero-section npx mila search # → lists all 14 components ```
Verifies your setup — checks ="@mila/registry` is installed, MCP config exists, and lists components in `components/ui/`.
```typescript import { registry, searchComponents, getComponentDetails } from "@mila/registry";
// List all components console.log(registry.components.map((c) => c.name));
// Search by keyword or category const results = searchComponents("3d", "3d-motion"); // → 2 components: tilt-3d-card, particle-wave-3d
// Get full source code for copy-paste const { entry, sourceCode } = getComponentDetails("tilt-3d-card"); console.log(entry.title); // "3D Perspective Tilt Card with Dynamic Glare" console.log(entry.dependencies); // ["react"] console.log(sourceCode); // Full TSX file contents ```
The `apps/web/` directory contains a live Next.js 15 showcase that demonstrates every Mila component and design rule:
- 3 pages: Home, Browse (search + category filter), Screen Detail
- 3D animations: Canvas particle landscape, CSS 3D tilt cards, Framer Motion reveals
- Images from open-source URLs: Renders from Lorem Picsum / Unsplash with SVG fallback (no API keys)
- Free SVG icons:
lucide-reactthroughout - Mila rules applied: neutral-950 dark canvas, 8pt spacing grid, WCAG AA contrast, focus rings
```bash cd apps/web bun install bun dev
```
```bash
bun run build
bun test
bun packages/mcp-server/src/index.ts
bun packages/cli/src/index.ts search 3d ```
Test suite (6 tests, all passing): ``` ✓ should search for 3D motion components by keyword ✓ should retrieve full 3D tilt card and 3D particle canvas source code ✓ should fetch 3D motion design rules ✓ should generate dynamic color themes and CSS variables ✓ should auto-fix bad AI code into clean production code ✓ should audit code and award passing scores to clean code ```
``` Mila/ ├── package.json # Workspace root (bun workspaces) ├── .cursorrules # Drop-in design rules for any project ├── INSTALL.md # Complete installation guide ├── INTEGRATION_GUIDE.md # End-to-end integration handbook │ ├── packages/ │ ├── registry/ → @mila/registry (component catalog + source files) │ │ ├── src/components/ # 14 production-ready .tsx components │ │ ├── src/templates/ # Page layout compositions │ │ ├── src/registry.json # Structured component manifest │ │ └── src/lib/data.ts # Registry query helpers │ │ │ ├── rules/ → @mila/rules (design intelligence) │ │ ├── src/*.md # Typography, colors, layout, 3D motion, anti-patterns │ │ └── src/theme-generator.ts # Adaptive theme generator │ │ │ ├── review/ → @mila/review (heuristic code auditor) │ │ └── src/index.ts # Scoring engine (0-100 quality score) │ │ │ ├── mcp-server/ → @mila/mcp (MCP server for AI agents) │ │ ├── src/index.ts # 7-tool MCP server (stdio transport) │ │ └── src/tools/ # Tool handlers │ │ │ └── cli/ → @mila/cli (developer CLI) │ └── src/index.ts # init / add / doctor / search │ ├── apps/ │ └── web/ → @mila/web (demo website — Mobbin-style gallery) │ ├── app/ # Next.js 15 app router (3 pages) │ ├── components/ # Hero, BentoShowcase, FeaturedGrid, etc. │ └── lib/data.ts # Screen data
tests/ └── mcp-server.test.ts # Integration test suite (6 tests) ```
Standard AI coding tools generate code that works logically but fails aesthetically:
- "AI Slop": Neon purple-to-pink gradient buttons and low-contrast ghost text
- Rigid Layouts: Arbitrary magic pixel widths (`w-[387px]`) that break on mobile
- Missing Interactions: Static cards with zero focus rings, hover lifts, or press feedback
Mila acts as your AI agent's dedicated design director:
- It provides a searchable registry of high-craft components
- It injects mathematical design rules (8pt rhythm, WCAG AA contrast, concentric radiuses)
- It performs instant heuristic audits (`mila_review_code`) before you commit
- It can auto-repair anti-patterns (`mila_auto_fix`)
Mila is authored by Missari Ahil and released under the MIT License. Inspired by HorizonX's agent-first design paradigm and the shadcn/ui copy-paste philosophy.
