You signed in with another tab or window. Reload
to refresh your session. You signed out in another tab or window. Reload
to refresh your session. You switched accounts on another tab or window. Reload
to refresh your session. Dismiss alert
Swayingleaves / uml-mcp-server Public
2 stars
2 forks
Branches
Tags
Activity
Notifications
You must be signed in to change notification settings
master
Go to file
Code
| Name | | Name | Last commit message | Last commit date |
| --- | --- | --- | --- |
| Latest commit
-------------
History
-------
10 Commits
| | |
| .gitignore | | .gitignore | | |
| Dockerfile | | Dockerfile | | |
| README.md | | README.md | | |
| README_zh.md | | README_zh.md | | |
| cursor_config.json | | cursor_config.json | | |
| requirements.txt | | requirements.txt | | |
| smithery.yaml | | smithery.yaml | | |
| uml_mcp_server.py | | uml_mcp_server.py | | |
| View all files | | |
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.
To install UML Diagram Generation Tool for Claude Desktop automatically via Smithery
:
npx -y @smithery/cli install @Swayingleaves/uml-mcp-server --client claude
git clone https://github.com/yourusername/UML-MCP-Server.git
cd UML-MCP-Server
python -m venv uml-mcp-venv
source uml-mcp-venv/bin/activate # Linux/Mac
# Or
uml-mcp-venv\Scripts\activate # Windows
pip install -r requirements.txt
from fix_plantuml import generate_uml
# Create UML code
uml_code = """
@startuml
Title: Simple Class Diagram
class User {
-String name
-String email
+login()
+logout()
}
class Order {
-int id
-Date date
+process()
}
User "1" -- "many" Order: places
@enduml
"""
# Generate URLs, code, and local paths for UML diagrams
result = generate_uml(uml_code)
# Output result
print("PlantUML code: ")
print(result["code"])
print("\nPlantUML URL:")
print(result["url"])
print("\nLocal file path: ")
print(result["local_path"])
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
%APPDATA%\Cursor\config.json
On Linux: ~/.config/Cursor/config.json
Add or modify the 'mcpServer' section in the configuration file:
{
"mcpServers": {
"UML-MCP-Server": {
"command": "uv",
"args": [\
"--directory",\
"/Users/yourpath/UML-MCP-Server",\
"run",\
"uml_mcp_server.py"\
],
"output_dir": "/Users/yourpath/uml-output"
}
}
}
Configuration Description:
args
:run
: Run the commandoutput_dir
: Specify the output directory for UML imagesPlease modify the following path according to your actual situation:
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 Cursor, you can input:
For example:
1. Understand the certification process of the project
2. Generate UML code for the authentication process and generate a flowchart through UML-MCP Server
3. Attention: "output_dir": "/Users/edy/vs-code/bjwa-task-project/uml-output"
Regardless of how UML tools are used, Cursor will call UML-MCP-Server and return the following:
For example:
Class diagram generated:
PlantUML code:
@startuml
Title: User and Order System
class User {
-String name
-String email
+login()
+logout()
}
class Order {
-int id
-Date date
+process()
}
User "1" -- "many" Order: places
@enduml
PlantUML URL:
http://www.plantuml.com/plantuml/png/~1UDgCqB5Bn0G1k1zYWM_EfPYQYY0Qd9oQc9oQaPcKYYcKc9gMYaiKc9gK...
Local file path:
/Users/username/projects/UML-MCP-Server/output/class_diagram_12345.png
You can view the generated UML diagram in the following ways:
If you encounter problems while using UML-MCP Server, you can try the following steps:
Common problems and solutions:
Welcome to contribute code, report issues, or provide improvement suggestions! Please participate in project development through GitHub Issues or Pull Requests.
This project adopts the MIT license. Please refer to the LICENSE document for details.
No description, website, or topics provided.
No releases published
No packages published
You can’t perform that action at this time.