dooi-mcp
v1.0.4
Published
MCP server for safely consuming dooi templates/components
Downloads
116
Maintainers
Readme
dooi-mcp
A Model Context Protocol (MCP) server for safely consuming and installing dooi-ui templates and components. This server enables AI assistants to fetch, install, and customize UI components and templates with intelligent dependency management.
Features
- 🚀 One-shot workflows - Complete template/component installation with single commands
- 🔄 Smart dependency resolution - Automatic detection and installation of component dependencies
- 📦 Batch operations - Install multiple components efficiently
- ✏️ Text customization - Brand name replacements and text edits with AST awareness
- 🛡️ Safe installation - Preview mode, conflict resolution, and dry-run support
- 🎯 Path strategies - Built-in support for Next.js App Router, Vite React, and custom paths
Installation
npm install -g dooi-mcpUsage with Claude Desktop
Add to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"dooi": {
"command": "dooi-mcp"
}
}
}Restart Claude Desktop to load the MCP server.
Usage with Cursor
To set up the dooi-mcp server in Cursor:
Create or edit
mcp.jsonin one of these locations:- Project-level:
<project-root>/.cursor/mcp.json - Global:
~/.cursor/mcp.json(macOS/Linux) or%USERPROFILE%\.cursor\mcp.json(Windows)
- Project-level:
Add the server configuration (recommended - uses npx, no global install needed):
{ "mcpServers": { "dooi": { "command": "npx", "args": ["-y", "dooi-mcp@latest"] } } }Alternative: Global installation:
npm install -g dooi-mcpThen configure:
{ "mcpServers": { "dooi": { "command": "dooi-mcp" } } }For local development:
{ "mcpServers": { "dooi": { "command": "node", "args": ["${workspaceFolder}/dooi-mcp/dist/server.js"] } } }Restart Cursor to load the MCP server
Verify:
- The dooi-mcp server should appear in Cursor's MCP servers list
- 9 tools should be available for use by the AI
For more information, see the official Cursor MCP documentation.
Usage with Other MCP Clients
The server communicates via stdio and follows the MCP protocol specification. Launch with:
npx dooi-mcpAvailable Tools
🚀 Recommended Workflows
dooi_workflow_applyTemplate
One-shot template installation workflow - perfect for getting started with complete project templates.
Parameters:
id(required): Template ID from dooi-uidestRoot(required): Destination project root directorybrand(optional): Brand name for text replacementspathStrategy(optional):'next-app'|'vite-react'- Path resolution strategypathMap(optional): Custom path mapping objecteditPlan(optional): Text edit plan for customizationsautoDeps(optional): Auto-install npm dependencies (default: true)
Example:
{
"id": "landing-hero-1",
"destRoot": "/path/to/project",
"brand": "Acme Inc",
"pathStrategy": "next-app",
"autoDeps": true
}dooi_workflow_applyComponent
Fast component installation workflow - great for individual UI components.
Parameters: Same as dooi_workflow_applyTemplate
Example:
{
"id": "button-primary",
"destRoot": "/path/to/project",
"pathStrategy": "vite-react"
}🔧 Core Tools
dooi_list
Enumerate all available templates and components from dooi-ui.
Parameters: None
Returns: List of available templates/components with metadata
dooi_fetch
Fetch a template/component into a staging directory for inspection or manual installation.
Parameters:
id(required): Template/component IDref(optional): Git reference/versionoptions(optional): Fetch options (timeout, environment variables)
Returns: Staging directory path and metadata
dooi_resolve_uses
Analyze a staged component to discover additional required dependencies.
Parameters:
stageDir(required): Path to staging directory
Returns: Array of additional component IDs needed
dooi_fetchBatch
Fetch multiple components/templates in a single operation.
Parameters:
ids(required): Array of component/template IDs
Returns: Array of staging results
dooi_install
Copy files from staging directory to project with conflict resolution.
Parameters:
stageDir(required): Path to staging directorydestRoot(required): Destination project rootpathMap(optional): Path mapping configurationinclude(optional): File patterns to includeexclude(optional): File patterns to excludemode(optional):'skip'|'overwrite'|'rename'- Conflict resolutiondryRun(optional): Preview mode without actual changes
Returns: Installation results with file operations
dooi_textEdit
Perform text replacements while preserving code structure using AST analysis.
Parameters:
destRoot(required): Project root directoryplan(required): Edit plan objectinclude: File patterns to includeexclude: File patterns to excludereplacements: Array of replacement specsfind: Exact string to findfindRegex: Regex pattern to findreplaceWith: Replacement text
options:dryRun: Preview modelimitChangedFiles: Maximum files to changepreviewContextLines: Context lines for preview
Example:
{
"destRoot": "/path/to/project",
"plan": {
"include": ["**/*.tsx", "**/*.ts"],
"exclude": ["**/node_modules/**"],
"replacements": [
{
"find": "OldBrandName",
"replaceWith": "NewBrandName"
}
],
"options": {
"dryRun": false
}
}
}dooi_installDeps
Install npm packages using the project's package manager.
Parameters:
cwd(required): Working directorypackages(required): Array of package namespm(optional):'npm'|'yarn'|'pnpm'- Package manager (auto-detected)flags(optional): Additional CLI flags
Example:
{
"cwd": "/path/to/project",
"packages": ["react", "react-dom"],
"pm": "npm"
}Resources
The server exposes dooi-ui templates and components as MCP resources with URI scheme:
dooi://template/<template-id>
dooi://component/<component-id>Prompts
Pre-configured prompts for common workflows:
install-template: Guided template installationinstall-component: Guided component installationcustomize-text: Text customization workflow
Development
Local Development
# Clone repository
git clone <repository-url>
cd dooi-mcp
# Install dependencies
npm install
# Build
npm run build
# Run in development mode
npm run devTesting
npm test
npm run test:coverageProject Structure
dooi-mcp/
├── src/
│ ├── server.ts # MCP server entry point
│ ├── adapters/mcp/ # MCP protocol adapters
│ ├── capabilities/ # MCP capabilities
│ │ ├── tools/ # Tool implementations
│ │ ├── resources/ # Resource providers
│ │ └── prompts/ # Prompt templates
│ ├── core/ # Core business logic
│ │ ├── install.ts # Installation engine
│ │ ├── workflow.ts # Workflow orchestration
│ │ ├── errors.ts # Error handling
│ │ └── logger.ts # Logging
│ └── edits/ # Text editing with AST
└── dist/ # Compiled outputRequirements
- Node.js >= 18.0.0
- npm/yarn/pnpm
License
MIT
Author
David Im
Contributing
Contributions welcome! Please read the contributing guidelines before submitting PRs.
Support
For issues and questions:
- GitHub Issues: Create an issue
- Documentation: dooi-ui documentation
