This guide explains how to integrate UML-MCP with Cursor for generating diagrams directly in your editor.
Cursor can connect to the UML-MCP server through the Model Context Protocol (MCP), allowing you to generate and visualize UML diagrams and other supported diagram types while you code.
Make sure you have the UML-MCP server properly installed and configured on your system. See the Installation guide for details.
Cursor requires specific configuration to connect to the UML-MCP server:
%APPDATA%\Cursor\config.json~/Library/Application Support/Cursor/config.json~/.config/Cursor/config.jsonmcpServers section:Example configuration (see also the config/cursor_config.json and config/README.md in the repo):
{
"mcpServers": {
"UML-MCP-Server": {
"command": "python",
"args": ["/path/to/uml-mcp/server.py"],
"cwd": "/path/to/uml-mcp"
}
}
}
Example prompt:
Create a UML class diagram for the current project structure.
If Cursor cannot connect to the UML-MCP server:
If diagrams aren’t being generated correctly:
You can customize how diagrams appear in Cursor by modifying the templates in the UML-MCP server. See Advanced Configuration for details.
Cursor works well with SVG and PNG formats. You can specify the preferred format in your prompts or configure defaults in the UML-MCP server.