- Accordion
- Alert
- Alert Dialog
- Aspect Ratio
- Autocomplete
- Avatar
- Badge
- Breadcrumb
- Button
- Button Group
- Calendar
- Card
- Carousel
- Checkbox
- Collapsible
- Combobox
- Command
- Context Menu
- Data Table
- Date Picker
- Dialog
- Drawer
- Dropdown Menu
- Empty
- Field
- Hover Card
- Input Group
- Input OTP
- Input
- Item
- Kbd
- Label
- Menubar
- Native Select
- Navigation Menu
- Pagination
- Popover
- Progress
- Radio Group
- Resizable
- Scroll Area
- Select
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Sonner (Toast)
- Spinner
- Switch
- Table
- Tabs
- Textarea
- Toggle
- Toggle Group
- Tooltip
MCP Server
Give your AI assistant first-class access to spartan UI documentation, components, and blocks.
@spartan-ng/mcp is a Model Context Protocol server that exposes the spartan ecosystem as tools, resources, and prompts. MCP clients such as Claude Desktop, Cursor, and other AI assistants can use it to answer questions about spartan components with up-to-date API tables and code examples, fetched live from spartan.ng and cached on disk per version.
Setup
Add the server to your MCP client configuration. No installation is required - it runs on demand via npx :
{
"mcpServers": {
"spartan-ui": {
"command": "npx",
"args": ["-y", "@spartan-ng/mcp"]
}
}
}Prefer a global install? Install the package and point the command at the binary:
npm install -g @spartan-ng/mcp
{
"mcpServers": {
"spartan-ui": {
"command": "spartan-mcp"
}
}
}Tools
The server registers 17 tools, grouped by purpose:
- Components:
spartan_components_list,spartan_components_get(withextract: 'code' | 'api'),spartan_components_dependencies, andspartan_accessibility_check. - Blocks:
spartan_blocks_list,spartan_blocks_get, andspartan_blocks_dependencies. - Docs:
spartan_docs_getandspartan_meta. - Health:
spartan_health_check,spartan_health_instructions, andspartan_health_command. - Cache:
spartan_cache_status,spartan_cache_clear,spartan_cache_rebuild,spartan_cache_switch_version, andspartan_cache_list_versions.
Resources and prompts
Beyond tools, the server exposes resources for direct component lookups and prompts for common workflows.
- Resources:
spartan://components/listand per-componentspartan://component/{name}/api,/examples, and/full. - Prompts:
spartan-get-started,spartan-compare-apis,spartan-implement-feature,spartan-troubleshoot, andspartan-list-components.
Configuration
Behaviour can be tuned with environment variables:
SPARTAN_MCP_CACHE_DIR- directory for the on-disk version cache. Defaults to$XDG_CACHE_HOME/spartan-mcp, falling back to~/.cache/spartan-mcp.SPARTAN_CACHE_TTL_MS- TTL for the in-memory fetch cache (default 5 minutes).SPARTAN_CACHE_TTL_HOURS- TTL before on-disk cached entries are considered stale (default 24 hours).
On This Page