uml
MCP server from Swayingleaves/uml-mcp-server
claude mcp add --transport stdio swayingleaves-uml-mcp-server python uml_mcp_server.py \ --env VIRTUAL_ENV="Path to virtual environment (if used)"
How to use
UML-MCP-Server is an MCP (Model Context Protocol) service that powers UML diagram generation. It accepts requests containing natural language descriptions or direct PlantUML code and returns PlantUML code, a shareable PlantUML URL, and a local file path to the generated diagram. The server supports multiple diagram types including class, sequence, activity, use case, state, component, deployment, and object diagrams. You can drive it either by sending raw UML text, PlantUML code, or by leveraging high-level descriptions to have the tool generate the appropriate diagram. This MCP server is designed to be integrated with clients that support MCP, such as Cursor or Claude, enabling seamless diagram generation from conversational prompts or scripted workflows.
To use it, start the server (e.g., via a Python environment running uml_mcp_server.py). Then configure your MCP client to point to this server. You can supply either PlantUML code or a natural language description of the diagram you want. The server will return the PlantUML code, a direct URL to view the diagram online, and a local file path where the image is saved. This makes it easy to share diagrams, embed them in documents, or view them locally.
How to install
Prerequisites:
- Python 3.8+ installed on your system
- Optional: a virtual environment tool (venv, conda, etc.)
- Network access to PlantUML servers if you plan to fetch diagrams online
Installation steps:
-
Clone the repository (replace with the actual repo URL): git clone https://github.com/yourusername/UML-MCP-Server.git cd UML-MCP-Server
-
Create and activate a virtual environment (optional but recommended): python -m venv uml-mcp-venv
Linux/macOS
source uml-mcp-venv/bin/activate
Windows
uml-mcp-venv\Scripts\activate
-
Install dependencies from requirements.txt: pip install -r requirements.txt
-
Ensure the entry point is available:
- uml_mcp_server.py should exist in the project root (or adjust to the correct path)
-
Run the MCP server (example): python uml_mcp_server.py
-
If you prefer using a different invocation method (e.g., via uv/run configuration), adjust your command accordingly in your MCP client configuration.
Additional notes
Tips and considerations:
- Ensure the PlantUML service (online or local) is reachable if your diagrams rely on remote rendering.
- When running behind a firewall or restricted network, verify that outbound connections to PlantUML and image hosting URLs are allowed.
- If you customize the output directory, ensure write permissions are available for the process.
- Common issues often relate to missing dependencies or incorrect working directories; running in a virtual environment with a clearly set project root helps mitigate this.
- Check server logs (if available) for detailed error messages when an MCP request fails to generate a diagram.
Related MCP Servers
mcp-vegalite
MCP server from isaacwasserman/mcp-vegalite-server
github-chat
A Model Context Protocol (MCP) for analyzing and querying GitHub repositories using the GitHub Chat API.
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
pagerduty
PagerDuty's official local MCP (Model Context Protocol) server which provides tools to interact with your PagerDuty account directly from your MCP-enabled client.
futu-stock
mcp server for futuniuniu stock
mcp -boilerplate
Boilerplate using one of the 'better' ways to build MCP Servers. Written using FastMCP