Cursor Integration¶
Connect UML-MCP to Cursor to generate diagrams in the editor.
Overview¶
Cursor connects to UML-MCP as an MCP server so you can generate and view UML and other supported diagram types in the editor.
Setup¶
1. Install UML-MCP¶
Install the server on your machine. See Installation.
Add the server from the registry (Smithery CLI)¶
If you use the Smithery CLI (Node.js 20+), you can add the published UML server to Cursor without hand-editing JSON:
npm install -g @smithery/cli@latest
smithery auth login
smithery mcp add antoinebou12/uml --client cursor
Restart Cursor after the command finishes. This is the supported registry flow; some docs or clients may phrase it informally as “install MCP server uml.” The server id on Smithery is antoinebou12/uml (same project as this repo’s UML-MCP).
Legacy one-liner (older CLI shape):
Try a backend-to-frontend diagram¶
After the server is connected, you can render PlantUML from the repo, for example examples/backend-to-frontend.puml. Ask the assistant to run generate_uml with diagram_type component (or deployment) and the file’s source, or paste the @startuml … @enduml block into the tool.
2. Cursor Configuration¶
- Open the MCP config for Cursor (or use Cursor Settings → MCP):
- Windows:
%APPDATA%\Cursor\User\globalStorage\cursor.mcp\mcp.json - macOS:
~/Library/Application Support/Cursor/User/globalStorage/cursor.mcp/mcp.json -
Linux:
~/.config/Cursor/User/globalStorage/cursor.mcp/mcp.json -
Merge the
mcpServersblock fromconfig/cursor_config.jsonin this repo, or copy the same structure fromconfig/README.md. The example uses server keyuml-mcp,args:["-u", "server.py"](relative tocwd), andenvforKROKI_SERVER,MCP_OUTPUT_DIR, andMCP_DIAGRAM_FALLBACK. Setcwdto your repo root (the sample uses${workspaceFolder}if your Cursor build expands it; otherwise use an absolute path). See Configuration for environment variables.
3. Test the Integration¶
- Restart Cursor after saving the configuration
- In a conversation with Cursor, ask it to create a UML diagram
- Cursor can call the UML-MCP server and show the diagram
Example prompt:
Troubleshooting¶
Server Connection Issues¶
If Cursor cannot connect to the UML-MCP server:
- Verify the server is running by launching it manually first
- Check paths in your configuration are correct and absolute
- Ensure you have the required permissions for the directories
- Check Cursor logs for connection errors
Diagram Generation Problems¶
If diagrams aren't being generated correctly:
- Verify the UML-MCP server is running without errors
- Check the output directory permissions
- Try generating different diagram types to isolate the issue
- Verify that all required dependencies are installed
Advanced configuration¶
Custom Templates¶
You can customize how diagrams appear in Cursor by modifying the templates in the UML-MCP server. See Advanced Configuration for details.
Output Formats¶
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.
Optional: Sequential Thinking MCP¶
UML-MCP does not include Sequential Thinking. For multi-step reasoning before calling generate_uml, add a second MCP server entry alongside uml-mcp in your Cursor MCP configuration (for example install Sequential Thinking from the Cursor MCP server directory if you use that distribution). The assistant can call its sequentialthinking tool (thought, thoughtNumber, totalThoughts, nextThoughtNeeded, and related fields), then call UML-MCP’s generate_uml with the final diagram source. Worked narratives appear under Mermaid tutorials and PlantUML prompts and SVG.