ui-react-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ui-react-mcp Build a login form with ui-react"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
ui-react-mcp
An MCP server that gives AI assistants accurate, up-to-date documentation for @alexcruzgargallo/ui-react, my React component library.
Why
When an AI assistant writes code with a component library it doesn't know, it guesses: it invents props, variants that don't exist, or wrong import paths. This server lets the assistant ask the library directly which components exist, which props they take and which values are allowed, so the code it writes actually works.
Related MCP server: CDS Components MCP Server
Tools
Tool | What it does |
| Lists every component with a short description. |
| Finds components for a need, e.g. |
| Full docs for one component: import, props, allowed values, defaults and an example. |
| Generates JSX for a component and validates the props: an invalid value like |
Example of what the assistant gets back from get_usage_example with { "name": "Badge", "props": { "variant": "success", "size": "huge" } }:
```tsx
import { Badge } from "@alexcruzgargallo/ui-react";
<Badge variant="success">
Badge content
</Badge>
```
Warnings:
- Invalid value "huge" for "size". Allowed values: small, medium.How it works
ui-react ui-react-mcp
───────── ────────────
lib/components/*/index.tsx
│ (TypeScript types + JSDoc)
▼
scripts/generate-metadata.ts
│ react-docgen-typescript
▼
lib/metadata/components.json ──sync──▶ data/components.json
│
▼
Catalog (search, docs, examples)
│
▼
MCP tools over stdio ◀── AI assistantThe component docs come from the library's own TypeScript types and JSDoc comments, so there is a single source of truth: change a prop in
ui-react, regenerate the metadata, and the assistant sees the change.src/catalog.tsholds all the logic (lookup, search ranking, docs, example generation and validation) with no dependency on MCP, so it is easy to test.src/server.tsregisters the tools with the official MCP TypeScript SDK and useszodto validate their input.src/index.tsconnects the server over stdio.
Getting started
Requires Node.js 20 or later.
git clone https://github.com/AlexCruzGargallo/ui-react-mcp.git
cd ui-react-mcp
npm install
npm run buildThen add it to your AI client, replacing the path with the absolute path to your clone.
Claude Code
claude mcp add ui-react -- node /absolute/path/to/ui-react-mcp/dist/src/index.jsClaude Desktop, Cursor and other clients (mcpServers config)
{
"mcpServers": {
"ui-react": {
"command": "node",
"args": ["/absolute/path/to/ui-react-mcp/dist/src/index.js"]
}
}
}VS Code (.vscode/mcp.json)
{
"servers": {
"ui-react": {
"type": "stdio",
"command": "node",
"args": ["/absolute/path/to/ui-react-mcp/dist/src/index.js"]
}
}
}Now ask your assistant something like "Build a login form with ui-react" and it will look up the components before writing the code.
To use a local checkout of ui-react instead of the bundled metadata, set UI_REACT_METADATA to the path of its lib/metadata/components.json.
Development
npm test # build and run the tests (node:test)
npm run inspect # open the server in the MCP Inspector
npm run sync-metadata # pull the latest components.json from ui-reactThe tests cover the catalog logic and run the real MCP client against the server through an in-memory transport.
License
MIT
Available Tools
4 toolsget_componentGet component documentationA
Returns the full documentation of a component: import statement, props with their allowed values and defaults, and a usage example. Use it before writing code with the component.
Inputs: name (required).
get_usage_exampleGet usage exampleA
Generates a JSX example for a component. Optional props are validated against the library, so invalid variants or sizes are reported instead of silently used.
Inputs: name (required), props.
list_componentsList componentsA
Lists every component available in @alexcruzgargallo/ui-react with a short description.
Inputs: no named parameters.
search_componentsSearch componentsA
Finds components that match what the user wants to build, e.g. 'loading', 'form field' or 'status label'.
Inputs: query (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
list_components and search_components partly overlap (both surface components), though enumerate-vs-filter is a meaningful distinction. More problematic is that get_component already returns a usage example while get_usage_example separately generates a JSX example, so an agent may be unsure which to call for examples.
All four tools follow a clean verb_noun snake_case pattern (list_components, get_component, search_components, get_usage_example). The singular/plural difference reflects the actual semantics (one component vs many), not inconsistent convention.
Four tools is reasonable for a read-only component documentation server covering enumerate, fetch, search, and example generation. It is slightly thin — no category/browse or prop-lookup tool — but nothing is redundant at the count level.
The surface covers the core documentation lifecycle: discover (list/search), inspect (get_component), and apply (get_usage_example). Minor gaps like listing component categories or searching by prop are workarounds an agent can handle.
Maintenance
Related MCP Connectors
Live React design-system APIs, patterns, and code validation so AI agents build real UI, not slop.
Serves your design system and coding standards to coding agents, so they stop guessing.
Design system contracts, docs search, and usage validation for @digitaltableteur components.
React + Tailwind UI components and recipes your AI coding tool can search and install.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceProvides AI assistants with access to private React component library documentation, props, and code examples through type-safe TypeScript integration.-
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to search, understand, and generate code for design system components by syncing and indexing a component library.ISC
- AlicenseNot gradedqualityBmaintenanceProvides a real API for coding agents to look up design system components, props, and tokens, preventing guessed answers.9MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI coding agents to search across 340+ React UI registries, inspect component code and quality scores, compare options, detect a project's stack, and generate or execute safe transactional install plans. It provides read and write safeguards with dry-run planning and rollback.1MIT