What is MCP?
MCP (Model Context Protocol) is an open protocol that standardizes how applications provide context to LLMs. This is useful for Magic UI because you can now give your AI-assisted IDE direct access to all Magic UI components so that it can generate code with minimal errors.Installation
Choose your installation method based on your IDE:- CLI (recommended)
- Manual
The fastest way to set up the MCP server is using the Magic UI CLI. It will automatically detect and configure your IDE.
Locate your IDE’s MCP configuration file
Add the Magic UI MCP server configuration
Verify the installation
Usage
Once installed, you can ask your AI assistant to use any Magic UI component. The MCP server provides the assistant with:- Component documentation and descriptions
- Complete prop type definitions
- Usage examples and code snippets
- Installation instructions
Example prompts
Here are some example prompts you can use with your AI assistant:- Reference the correct component from Magic UI
- Use proper TypeScript types
- Include necessary imports
- Apply appropriate props and styling
Verification
To verify the MCP server is working correctly:Troubleshooting
MCP server not appearing in IDE
MCP server not appearing in IDE
- Verify the configuration file path is correct for your IDE
- Check that the JSON syntax is valid
- Restart your IDE completely (not just reload)
- Check IDE console for error messages
AI assistant not using Magic UI components
AI assistant not using Magic UI components
- Explicitly mention “Magic UI” in your prompt
- Ask the assistant to “use the MCP server”
- Verify the MCP server is active in your IDE settings
Installation fails with CLI
Installation fails with CLI
- Make sure you have Node.js 18+ installed
- Try running with
--verboseflag for detailed logs - Fall back to manual installation
Supported IDEs
The Magic UI MCP server currently supports:- Cursor - AI-first code editor
- Windsurf - Codeium’s AI IDE
- Claude Desktop - Anthropic’s desktop app
- Cline - VS Code extension
- Roo-Cline - Enhanced Cline fork
More IDEs will be supported as MCP adoption grows. The manual installation method works with any MCP-compatible application.
Next steps
Browse components
Explore all available Magic UI components
Learn MCP
Read more about the Model Context Protocol