Get the FREE Ultimate OpenClaw Setup Guide →

uml

MCP server from Swayingleaves/uml-mcp-server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
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:

  1. Clone the repository (replace with the actual repo URL): git clone https://github.com/yourusername/UML-MCP-Server.git cd UML-MCP-Server

  2. 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

  3. Install dependencies from requirements.txt: pip install -r requirements.txt

  4. Ensure the entry point is available:

    • uml_mcp_server.py should exist in the project root (or adjust to the correct path)
  5. Run the MCP server (example): python uml_mcp_server.py

  6. 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

Sponsor this space

Reach thousands of developers