Coding agents
Let a coding agent install and use components: prompts, the MCP server, llms.txt.
Thrum ships a first-party MCP server at /api/mcp alongside lightweight plain-text files (/llms.txt and /components/<name>.md). Connect any MCP-compatible client to search168 components and 1,067 icons directly, read props and theme variables on demand, and install files with one CLI command.
Connect the Thrum MCP server
The endpoint https://thrumui.dev/api/mcp implements JSON-RPC 2.0 Streamable HTTP (protocol 2025-03-26) with no authentication required. Free source is available on request; Pro source is never served over MCP and always installs through the licensed CLI registry.
{
"mcpServers": {
"thrum": {
"type": "http",
"url": "https://thrumui.dev/api/mcp"
}
}
}Use this when your MCP client connects directly over Streamable HTTP (protocol 2025-03-26).
{
"servers": {
"thrum": {
"type": "http",
"url": "https://thrumui.dev/api/mcp"
}
}
}Standard workspace mcp.json format for editors and agent hosts that read a top-level "servers" object.
npx shadcn@latest mcp initReads the @thrum and @thrum-pro registries straight from your project components.json so an agent can install items through the shadcn MCP tools.
{
"mcpServers": {
"thrum": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://thrumui.dev/api/mcp"]
}
}
}Bridge for stdio-only MCP clients that do not speak Streamable HTTP natively.
Available MCP tools
Six read-only discovery tools are exposed by /api/mcp:
| Tool | Parameters | What it returns |
|---|---|---|
list_components | group?, tier?, limit? | Browse all 168 components, blocks and foundations, filtered by group or tier (free / pro). |
search_components | query, group?, tier?, limit? | Keyword search across names, titles, descriptions, groups and categories, returning ranked matches with install commands. |
get_component | name, include_source? | Return full markdown documentation, props, usage and install command for one component. Set include_source: true for rewritten source on free items (never Pro). |
get_install_command | name, pm? | Return the exact CLI command (npm, pnpm, yarn or bun) and components.json snippet for any component or icon. |
search_icons | query, category?, limit? | Search all 1,067 MIT stroke icons by name, category or tag, returning import statements and install commands. |
get_theme_guide | material?, theme?, radius? | Generate ready-to-paste :root CSS variables and <html data-material="frosted"> setup for solid or frosted glass and any corner radius (0 to 24 px). |
A prompt to paste
Paste this into any coding agent, then describe what you want built:
Add a Thrum component to this project. 1. Use the Thrum MCP server at https://thrumui.dev/api/mcp (search_components, get_component, search_icons), or read https://thrumui.dev/llms.txt and the component's /components/<name>.md page. 2. Check that the project uses shadcn/ui (it has a components.json file). If it does not, stop and tell me. 3. Run the install command returned by get_install_command or the markdown page. For a Pro component, verify components.json has the Thrum registries and THRUM_LICENSE_KEY is set (steps: https://thrumui.dev/docs/pro). Never print the key. 4. Use the component where I ask. Pass plain data props to charts and meters, always pass label, and use null for missing values. Do not rewrite the installed files. Do not hard-code colours: components follow the project's theme variables. Set sizes with className.
When you already know the component, open its page, go to Install, and choose the Prompt tab for a one-component prompt with the exact command and import line.
You should see
The agent queries /api/mcp (or fetches /llms.txt and one .md file), runs the CLI command, and imports from @/components/ui/ or @/components/. It should not hand-write chart code of its own.
Plain-text files for agents without MCP
If your agent fetches URLs instead of calling MCP tools, point it at /llms.txt first and fetch individual /components/<name>.md pages on demand rather than pasting the entire catalogue into context.
| Address | What is in it, and when to use it |
|---|---|
/llms.txt | Lightweight index: install rules, every docs page, every component with tier and .md link, and icon/MCP pointers.Start here when an agent cannot use MCP. It reads the index once, then fetches only the specific component page it needs. |
/llms-full.txt | Compact catalogue reference: install rules plus every item’s summary, install command, prop names and .md link.For offline or single-file search. Fetch individual /components/<name>.md pages (or call get_component over MCP) for complete usage examples and prop tables. |
/components/<name>.md | One component in full: install command, files, usage, data shape, full prop table, motion, sound, accessibility and changelog.Fetch on demand once you know the component name. “Copy page as markdown” on any component page copies the same text. |
All three files and the MCP server read from the same catalogue at build time, so they never drift from the component pages.
Rules an agent should follow
Put these in your project's agent instructions if you use Thrum often.
- Install, do not rewrite. Add components with the CLI and leave the installed files as they are. An update overwrites them.
- Pass plain data to data components. Chart, meter and number props are numbers, strings, arrays and objects. Format numbers with
format(Intl.NumberFormatOptions) andlocale, never with a function. - Keep
label. Every chart and graphic needs it. It is the name a screen reader hears and the caption of the hidden data table. - Use
nullfor a missing value. Not0,NaNorundefined. The chart draws a gap. - Do not hard-code colours. Components read the project's theme variables. To change a series colour, pass another theme variable to
color, such asvar(--chart-2). - Size with
className. A component fills the box it is given:h-64,w-40. - Leave sound to the visitor. Sound is off until someone turns it on. Never call
setSoundEnabled(true)on page load. Passsound={false}to keep one component silent. - Do not double-animate. Components already animate and respect reduced motion. Wrapping them in extra transitions breaks both.
- Never print, log or commit the licence key.