UML-MCP Server
local-only server
The server can only run on the client’s local machine because it depends on local resources.
Integrations
Generates UML diagrams of multiple types including class, sequence, activity, use case, state, component, deployment, and object diagrams from natural language or PlantUML code
UML-MCP-Server
UML-MCP Server is a UML diagram generation tool based on MCP (Model Context Protocol), which can help users generate various types of UML diagrams through natural language description or directly writing PlantUML code.
Functional Features
- Supports multiple UML diagram types: class diagram, sequence diagram, activity diagram, use case diagram, state diagram, component diagram, deployment diagram, object diagram
- UML diagrams can be generated through natural language description
- You can directly use PlantUML code to generate UML diagrams
- Return PlantUML code and accessible URL links for easy sharing and viewing
- Simultaneously save the generated UML diagram locally and provide the local file path
- Support custom save path and specify the output directory for UML images
- As an MCP server, it can integrate with clients that support MCP, such as Claude
- A comprehensive logging system that records server operating status and operation logs
Installation
Installing via Smithery
To install UML Diagram Generation Tool for Claude Desktop automatically via Smithery:
Manual Installation
- Clone repository:
- Create and activate a virtual environment:
- Install dependencies:
Usage Method
Used as a Python Library
Configure MCP in Cursor
The Cursor supports MCP (Model Context Protocol) servers, allowing you to directly generate UML diagrams using UML-MCP Server in the Cursor. The configuration steps are as follows:
- Ensure that the latest version of Cursor IDE (which supports MCP functionality) is installed.
- Open the configuration file of Cursor:
- On macOS:
~/Library/Application Support/Cursor/config.json
- On Windows:
%APPDATA%\Cursor\config.json
- On Linux:
~/.config/Cursor/config.json
- Add or modify the 'mcpServer' section in the configuration file:
Configuration Description:
- UML-MCP-Server: The name of the MCP server can be modified as needed
- Command: Use UV as the running command
args
:- directory: Specify the absolute path of the project directory
run
: Run the command- uml_mcp_server.py: Main program file
output_dir
: Specify the output directory for UML images
Please modify the following path according to your actual situation:
- Replace '/Users/Yourpath/UML-MCP Server' with the actual path of your UML-MCP Server project
- Replace '/Users/Yourpath/uml-output' with the directory path where you want to save the UML image
- Save the configuration file and restart the Cursor.
- Use UML-MCP Server in Cursor:
- Open a new chat window
- In the toolbar at the bottom of the chat interface, you will see the "UML-MCP Server" tool icon
- Clicking on this icon will bring up the options menu for UML tools
- Select the UML diagram type you need (such as "Generate Class Diagram", "Generate Sequence Diagram", etc.)
Using UML Tools in Cursor
In the Cursor, you can input:
For example:
The Results Returned by UML Tools
Regardless of how UML tools are used, Cursor will call UML-MCP-Server and return the following:
- PlantUML Code - You can copy this code to use in other PlantUML tools
- PlantUML URL - You can open this URL in a browser to view the generated UML diagram
- Local file path - The generated UML image is saved in this local path
For example:
You can view the generated UML diagram in the following ways:
- Click on the returned URL link to view in the browser
- Open the local file path in the file browser to view the saved image
- In Cursor, you can use Markdown syntax to directly display images in the chat window
Troubleshooting
If you encounter problems while using UML-MCP Server, you can try the following steps:
- Check log files: View the log files in the 'logs' directory for error details
- Verify Dependency Installation: Ensure that all dependencies are installed correctly
- Check network connection: Ensure that PlantUML server (www.plantuml.com) can be accessed
- Check output directory permissions: Ensure that the program has permission to write to the 'output' directory
Common problems and solutions:
- Unable to generate UML diagram: Check for error messages in the log, which may be due to network issues or temporary unavailability of PlantUML server
- Image not saved locally: Check if the 'output' directory exists and has write permission
- MCP server cannot start: Check the log file to ensure there are no port conflicts or other program errors
Contribution
Welcome to contribute code, report issues, or provide improvement suggestions! Please participate in project development through GitHub Issues or Pull Requests.
License
This project adopts the MIT license. Please refer to the LICENSE document for details.
This server cannot be installed
A tool that generates various UML diagrams through natural language descriptions or PlantUML code, functioning as an MCP server that can integrate with clients like Claude.