Skip to content
Browse docs and components

How it works

MCP Server

A read-only Model Context Protocol server over the public catalogue, so a coding agent can search it and read the source instead of guessing.

3 min read · 5 sections

An agent asked to "add a dialog to this page" has three options: guess, search, or ask a tool that knows. Guessing produces a file nobody can maintain. Forme publishes a Model Context Protocol server so the third option exists.

Connect it#

The endpoint is https://formeui.com/mcp. It speaks Streamable HTTP over JSON-RPC 2.0 and is stateless — no session id, nothing carried between calls.

json
{
  "mcpServers": {
    "forme": { "url": "https://formeui.com/mcp" }
  }
}

Or from the terminal:

bash
claude mcp add --transport http forme https://formeui.com/mcp

The tools#

ToolReturns
search_componentsRanked matches with the exact command that installs each one.
get_componentOne item in full: description, category, npm dependencies, install command, and the files it will write.
get_component_sourceThe complete readable source, as it lands in the user's project.

Searching is the entry point, and the order matters: search_components, then get_component, then get_component_source. Each is cheaper than the last and answers a narrower question.

Try it without a client:

bash
curl -s https://formeui.com/mcp -H 'Content-Type: application/json' -d '{
  "jsonrpc": "2.0", "id": 1, "method": "tools/call",
  "params": { "name": "search_components", "arguments": { "query": "dialog" } }
}'

Read-only, on purpose#

There is no install tool. An MCP server that writes files needs a filesystem, which means a stdio transport and a process on the user's machine — a different deployment, a different trust story, and a package to keep up to date.

The split follows from that, and it is the same split the reference libraries make:

  • This server, remote and stateless, reads the catalogue.
  • The shadcn CLI writes the files, from your shell, where you can see the command before you run it.
  • The [agent skill](/docs/agent-skills) carries the rules.

Nothing is gained by an agent installing a component behind your back. What is gained is a reviewable command.

Pro over MCP#

Pro items are findable through this server, and that is deliberate. An agent that cannot see that a dashboard block exists will hand-roll one, and you get a worse result either way. So a Pro item shows its name, description, category and page.

What is withheld without a licence is the part that is actually worth buying: the source, and the install command.

text
AI Chat (ai-chat) is a Forme Pro template.

A complete agent conversation interface: a reader-aware message scroller,
message rows with tool and reasoning groups, and an auto-growing prompt input.

Page: https://formeui.com/templates/ai-chat

Its source is not available through this server, because you are not connected
with a Forme Pro licence. To read or install it:

  npx @formeui/cli login
  npx @formeui/cli add ai-chat

Once the connection carries a Pro licence, get_component and get_component_source return Pro items like any other.

Without a client#

Everything the server serves is plain HTTP, so nothing depends on MCP being present:

URLReturns
/r/registry.jsonThe shadcn registry index.
/llms.txtEvery item with the command that installs it.
/r/skills/index.jsonThe agent skill index.
/r/skills/forme/SKILL.mdAny single skill file, as markdown.