An MCP (Model Context Protocol) server that provides AI assistants with direct access to Base UI React component information, documentation, and metadata.
This MCP server enables AI assistants to seamlessly interact with the Base UI component library, following the shadcn MCP pattern.
5 Essential Tools:
- π search_components - Find components by fuzzy matching
- π¦ get_component_examples - Get full code examples + component API
- πΏ install_base_ui - Get install commands + setup instructions
- β get_setup_checklist - Verify installation and troubleshoot
- π οΈ Easy Setup - One command integration with Cursor
For Cursor, Claude Code, VS Code, or Codex:
npx base-ui-mcp-server@latest init --client cursor
This automatically creates the correct MCP configuration file for your editor with zod validation and smart error handling.
git clone https://github.com/morksen123/base-ui-mcp-server.git
cd base-ui-mcp-server
npm install
npm run build
npm run dev # Development mode
npm start # Production mode
npm run mcp:inspect
The MCP server is automatically configured when using the CLI command above.
Manual configuration:
{
"mcpServers": {
"base-ui": {
"command": "npx",
"args": ["base-ui-mcp-server", "mcp"]
}
}
}
One-command setup:
npx base-ui-mcp-server@latest init --client cursor
This creates .cursor/mcp.json
with the proper configuration using zod validation and configuration merging. Restart Cursor and you're ready to use Base UI components!
π Full Cursor Documentation
npx base-ui-mcp-server@latest init --client claude
npx base-ui-mcp-server@latest init --client vscode
npx base-ui-mcp-server@latest init --client codex
Find components using fuzzy matching.
{ "query": "dialog", "limit": 10 }
Get complete working code + full API reference.
{ "name": "DialogRoot", "variant": "css-modules" }
Get installation commands and setup instructions for Base UI.
{ "runCommand": false }
Verify Base UI setup and troubleshoot issues.
{}
Built with zod validation, configuration merging, and smart error handling:
src/
βββ index.ts # Server entry point & CLI
βββ cli/
β βββ init.ts # MCP client integration (Cursor, VS Code, etc.)
βββ mcp/ # MCP server implementation
β βββ index.ts # Server setup & tool definitions
β βββ handlers.ts # Tool request handlers
β βββ utils.ts # MCP utilities
βββ config/ # Configuration system
β βββ index.ts # Config loading & validation
β βββ schema.ts # Zod schemas for config
βββ constants.ts # Fallback data & constants
βββ errors/ # Custom error classes
βββ fetchers/ # GitHub API integration
βββ tools/ # Tool implementations
βββ utils/ # Utilities (spinner, package manager, etc.)
npm run dev # Auto-rebuild
npm run build # Build TypeScript
npm test # Run tests
npm run typecheck # Type checking
Tests are colocated with source files following shadcn pattern:
npm test # Run all tests (87 tests)
npm test -- src/fetchers/github-fetcher.test.ts # Run specific test
Test Coverage:
- 87 tests across 5 test suites
- MCP Handlers: 564 lines (26 tests)
- GitHub Fetcher: 473 lines (16 tests)
- Config System: 223 lines (17 tests)
- Search Utils: 283 lines (11 tests)
- Fetch JSON: 355 lines (17 tests)
- Total: 1,898 lines of tests
For higher rate limits when fetching component data:
export GITHUB_TOKEN=your_github_token_here
For network requests behind a proxy:
export https_proxy=http://your-proxy-server:8080
Configure additional component registries in your project's components.json
:
{
"registries": {
"@shadcn": "https://ui.shadcn.com/r/{name}.json",
"@base-ui": "https://base-ui.com/r/{name}.json"
}
}
See CONTRIBUTING.md for guidelines.
MIT License - see LICENSE file for details.
- Base UI - Component library by MUI
- shadcn/ui - MCP pattern reference and inspiration
- Model Context Protocol - Protocol specification
Built following the shadcn MCP pattern