meetayyab/motiff-design-mcp
If you are the rightful owner of motiff-design-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
The Motiff Design MCP server integrates Motiff designs with AI-powered IDEs, enabling seamless conversion of designs into code.
Motiff Design MCP
A Model Context Protocol (MCP) server for integrating Motiff designs with AI-powered IDEs like Cursor. This MCP enables seamless conversion of Motiff designs into code by providing structured access to design content and previews.
Features
- Design Content Fetching: Get complete HTML representation of Motiff designs with all styling intact
- Design Previews: Generate preview images of designs for visual reference
- Task-based Processing: Reliable handling of design content generation through task-based architecture
- Authentication: Secure access through Motiff API tokens
- Performance: Optimized for quick response times and efficient processing
Requirements
Motiff Develop Mode
This MCP server requires Develop Mode to be enabled in your Motiff account:
- Enable Develop Mode in your Motiff account
- Open your Motiff design file
- Toggle Develop Mode using:
- The Develop Mode switch in the interface, or
- Keyboard shortcut: ⇧ Shift + D
Without Develop Mode enabled, the MCP server will not be able to access design content.
Installation
# Using npm
npm install -g motiff-design-mcp
# Using yarn
yarn global add motiff-design-mcp
Configuration
Cursor Setup
- Open or create
~/.cursor/mcp.json - Add the following configuration:
"motiff-design-mcp": {
"command": "npx",
"args": ["-y", "motiff-design-mcp"],
"env": {
"MOTIFF_TOKEN": "your_motiff_token"
}
}
- Replace
your_motiff_tokenwith your Motiff API token - Restart Cursor to apply the changes
Environment Variables
Alternatively, you can set environment variables directly:
# Required: Motiff API token
export MOTIFF_TOKEN="your_motiff_token"
# Optional: Custom API endpoint (defaults to https://api.motiff.com)
export MOTIFF_HOST="https://your-custom-endpoint.com"
Usage
In Cursor
-
Ensure Develop Mode is enabled in your Motiff interface (⇧ Shift + D)
-
Paste a Motiff design URL in Cursor's chat:
https://motiff.com/file/{docId}?nodeId={nodeId}&type=dev
- The MCP server will automatically:
- Fetch the design content
- Generate a preview
- Provide the content to Cursor for code generation
Available Tools
motiff_get_design
Fetches the complete HTML representation of a design node.
Parameters:
docId: The document ID from the Motiff URLnodeId: The specific node ID to fetchdebug(optional): Enable debug mode
motiff_get_preview
Gets a preview image of the design node.
Parameters:
docId: The document ID from the Motiff URLnodeId: The specific node ID to fetch
Development
Prerequisites
- Node.js >= 18.0.0
- npm or yarn
- Motiff account with Develop Mode enabled
Setup
- Clone the repository:
git clone https://github.com/yourusername/motiff-mcp-server
cd motiff-mcp-server
- Install dependencies:
npm install
- Build the project:
npm run build
- For development with watch mode:
npm run dev
API Response Format
Design Content Response
interface DesignResponse {
content: Array<{
type: 'text';
text: string; // HTML content
}>;
isError?: boolean;
}
Preview Response
interface PreviewResponse {
content: Array<{
type: 'image';
data: string; // Base64 encoded image
mimeType: string;
}>;
isError?: boolean;
}
Error Handling
The MCP server provides detailed error messages for common issues:
- Authentication errors (invalid or missing token)
- Invalid document or node IDs
- Network connectivity issues
- Task processing failures
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT License - see the file for details.
Author
Muhammad Tayyab
- Website: https://www.iamtayyab.com
- Email: meetayyab@gmail.com
Support
For support, please create an issue in the GitHub repository or contact the author directly.