mix phia.design.mcp (phia_ui v0.1.17)

Copy Markdown View Source

Starts the PhiaUI Design MCP server for Claude Code integration.

The MCP (Model Context Protocol) server lets Claude Code build Phoenix LiveView UIs by describing them in natural language. Claude uses 15 tools to browse components, insert them into a scene, configure attributes/slots, and export production-ready code.

Usage

mix phia.design.mcp

The server communicates over stdio using JSON-RPC 2.0 (MCP protocol). Configure Claude Code to use it by adding to .mcp.json:

{
  "mcpServers": {
    "phiaui-design": {
      "command": "mix",
      "args": ["phia.design.mcp"],
      "env": {"MIX_ENV": "dev"}
    }
  }
}

Workflow Example

  1. Configure MCP as shown above
  2. Open Claude Code in your Phoenix project
  3. Ask: "Design a dashboard with stat cards, a bar chart, and a data grid"
  4. Claude browses the catalog, inserts components, configures attrs
  5. Ask: "Export as MyAppWeb.DashboardLive"
  6. Claude exports a complete LiveView module
  7. Run mix compile — it works

Available Tools

Component manipulation

ToolDescription
insert_phia_componentInsert a component by name with attrs and slots
set_phia_attrUpdate attributes on a node by ID
set_phia_slotUpdate slot content (e.g., inner_block text)
delete_phia_nodeRemove a node and its children
move_phia_nodeMove a node to a new parent at index

Catalog browsing

ToolDescription
get_phia_component_infoGet attrs, slots, variants for a component
get_phia_catalogList all 829 components grouped by tier
get_phia_familiesList composable family groups (card, form, etc.)

Templates and themes

ToolDescription
insert_phia_pageApply a page template (dashboard, settings, auth, etc.)
set_phia_themeSwitch theme (zinc, slate, rose, blue, green, violet)
get_phia_themeGet current theme

Export

ToolDescription
export_heexExport scene as HEEx template
export_liveviewExport as complete LiveView module
get_scene_treeGet scene structure as JSON
clear_sceneClear all nodes