ModelContextProtocol (MCP) server for Magic UI is an official tool that allows you to integrate Magic UI components into your IDE using the Model Context Protocol. The server provides easy access to a comprehensive library of UI components, animations, and effects that can be used in your projects.
You can quickly install the MCP configuration using the Magic UI CLI:
npx @magicuidesign/cli@latest install <client>
To manually configure your IDE's MCP settings, add the following to your MCP configuration:
{
"mcpServers": {
"@magicuidesign/mcp": {
"command": "npx",
"args": ["-y", "@magicuidesign/mcp@latest"]
}
}
}
Once your MCP server is configured, you can ask it questions directly from your IDE to get Magic UI components. Some example prompts you can use:
The MCP server provides several specialized tools that can be called to access different categories of Magic UI components:
Use getLayout
to access components like:
Use getMedia
to access components like:
Use getMotion
to access components like:
Use getTextReveal
to access components like:
Use getTextEffects
to access components like:
Use getButtons
to access components like:
Use getEffects
to access components like:
Use getWidgets
to access components like:
Use getBackgrounds
to access components like:
Use getDevices
to access components like:
Some MCP clients have limitations on the number of tools they can call. For this reason, the MCP server groups components into categories. For more specific context on individual components, you can run the MCP server locally and modify the component grouping logic.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.