whatisgithub

What is petal-components-mcp?

petalframework/petal-components-mcp — explained in plain English

Analysis updated 2026-05-18

0TypeScriptAudience · developerComplexity · 2/5LicenseSetup · easy

In one sentence

An MCP server that gives AI coding assistants full schemas for the petal_components UI library, so they write idiomatic Phoenix LiveView markup instead of inventing raw styling.

Mindmap

mindmap
  root((petal-components-mcp))
    What it does
      Exposes component schemas
      Guides AI code generation
      MCP server
    Tech stack
      TypeScript
      Phoenix LiveView
      Elixir
    Tools
      list_components
      get_component
    Use cases
      AI-assisted UI coding
      Schema hosting
      Self-syncing snapshots

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Let Claude Code, Cursor, or Windsurf look up real petal_components schemas before writing Phoenix LiveView UI code.

USE CASE 2

Browse a catalogue of every available petal_components component with a one-line summary.

USE CASE 3

Fetch the full attribute, slot, and default value spec for a specific component with a usage example.

USE CASE 4

Host a self-updating component schema server that stays in sync with the latest petal_components release.

What is it built with?

TypeScriptMCPPhoenix LiveViewElixir

How does it compare?

petalframework/petal-components-mcp0xradioac7iv/tempfsabboskhonov/hermium
Stars000
LanguageTypeScriptTypeScriptTypeScript
Setup difficultyeasymoderatemoderate
Complexity2/53/54/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

The hosted server works with a single CLI command, running locally requires Node.js and Elixir/Mix for schema extraction.

MIT license: free to use, modify, and distribute, including commercially, as long as the copyright notice is kept.

So what is it?

petal-components-mcp is a server that helps AI coding assistants write correct code when building user interfaces with a component library called petal_components. The petal_components library is a set of pre-built UI components for Phoenix LiveView, which is a web framework for the Elixir programming language. Without this server, AI assistants writing Phoenix templates tend to invent their own styling from scratch and ignore the petal_components building blocks entirely, producing inconsistent output. With the server connected, the AI can look up exactly what each component accepts, its required and optional settings, and see a usage example before writing any code. The server follows the Model Context Protocol, a standard plug-in format that lets AI coding tools like Claude Code, Cursor, and Windsurf call out to external knowledge sources. It exposes two tools: list_components returns a catalogue of all available petal_components with a one-line description of each, and get_component returns the full specification for a single component, including all its accepted attributes, slots, named regions for child content, default values, and a working code example. The server is written in TypeScript and works by bundling a JSON snapshot of the entire petal_components library. That snapshot is generated automatically by a script that inspects the library's own component registry, so the schemas stay in sync with whatever version of petal_components is current. The hosted version runs at mcp.petal.build and can be added to Claude Code with a single command. Running it locally is also supported for development purposes, with the same extraction script pulling the latest petal_components release from Hex so nothing needs to be copied over by hand. Two more tools, a natural language search and a way to generate composed UI patterns from multiple components, are planned for a future release.

Copy-paste prompts

Prompt 1
Add petal-components-mcp to Claude Code with claude mcp add petal --transport http https://mcp.petal.build and build a Phoenix LiveView form using it.
Prompt 2
Use the get_component tool to show me the full schema for a specific petal_components component before I write HEEx markup.
Prompt 3
Run petal-components-mcp locally, regenerate schemas from the latest petal_components on Hex, and point Claude Code at the local server.
Prompt 4
Deploy petal-components-mcp to Fly.io and set up the custom domain with fly certs.

Frequently asked questions

What is petal-components-mcp?

An MCP server that gives AI coding assistants full schemas for the petal_components UI library, so they write idiomatic Phoenix LiveView markup instead of inventing raw styling.

What language is petal-components-mcp written in?

Mainly TypeScript. The stack also includes TypeScript, MCP, Phoenix LiveView.

What license does petal-components-mcp use?

MIT license: free to use, modify, and distribute, including commercially, as long as the copyright notice is kept.

How hard is petal-components-mcp to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is petal-components-mcp for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.