PlantUML MCP Server - Generate UML diagrams through MCP protocol
Project description
PlantUML MCP Server
This is a Model Context Protocol (MCP) server that exposes PlantUML diagram generation functionality through the MCP protocol. It allows AI assistants and other MCP clients to generate UML diagrams from text descriptions.
Features
- Generate PlantUML diagrams in SVG or PNG format
- Validate PlantUML code with detailed error messages
- Access diagram templates for different UML diagram types
- View example diagrams
- Create diagrams from templates with customizations
- Convert text descriptions to PlantUML diagrams (basic implementation)
Prerequisites
- Python 3.8+
- PlantUML server (local or remote)
- MCP client (like Claude Desktop)
Installation
- Install the required dependencies:
pip install -r requirements.txt
- Set the PlantUML server URL (optional):
export PLANTUML_SERVER="http://127.0.0.1:8000/plantuml/"
By default, it uses http://127.0.0.1:8000/plantuml/ which is the local PlantUML server.
Usage
Starting the MCP Server
Run the server:
python plantuml_mcp_server.py
This will start the MCP server on port 8765 (default). You can change the port by setting the PORT environment variable:
PORT=9000 python plantuml_mcp_server.py
Connecting to the MCP Server
You can connect to the MCP server using any MCP client, such as Claude Desktop:
- Open Claude Desktop
- Go to Settings > MCP Servers
- Add a new server with the URL:
http://localhost:8765/sse - Restart Claude Desktop
Available MCP Resources
plantuml://info- Information about the PlantUML serverplantuml://examples- Examples of PlantUML diagramsplantuml://templates/{diagram_type}- Templates for specific diagram types (class, sequence, component, activity, usecase)
Available MCP Tools
generate_diagram_base64(uml_code: str, format_type: str = "svg", timeout: int = 30) -> str- Generate a diagram from PlantUML code and return it as a base64 encoded stringvalidate_plantuml(uml_code: str) -> Dict[str, Union[bool, str]]- Validate PlantUML code and return validation result with error message if anycreate_diagram_from_template(diagram_type: str, customizations: str) -> str- Create a diagram from a template with customizationsconvert_text_to_diagram(text_description: str, diagram_type: str = "class") -> Dict[str, str]- Convert a text description to a PlantUML diagram
Example Usage
Once connected to an MCP client like Claude, you can use the PlantUML server like this:
Can you create a class diagram for a simple blog system with User, Post, and Comment classes?
The AI assistant can then use the MCP server to generate the diagram and display it.
License
This project is licensed under the same license as the main PlantUML web project.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file iflow_mcp_2niuhe_mcp_plantuml-0.1.0.tar.gz.
File metadata
- Download URL: iflow_mcp_2niuhe_mcp_plantuml-0.1.0.tar.gz
- Upload date:
- Size: 10.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8aab7b5497fb62cd796fc131c523eff02e291769746236c2c5382a5f82b3e55b
|
|
| MD5 |
807ab484e162b94124ece75d38342bd2
|
|
| BLAKE2b-256 |
74c1795f51e83af84751d5e8e6139d2c98e28e2c7858153838adcd205aeaa04c
|
File details
Details for the file iflow_mcp_2niuhe_mcp_plantuml-0.1.0-py3-none-any.whl.
File metadata
- Download URL: iflow_mcp_2niuhe_mcp_plantuml-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d9b6a9396336431d35c54d527d5fe2daa1929e45a51d4e6ebea76720527fe5b0
|
|
| MD5 |
346f22fc7ee55869494dc815d42c4166
|
|
| BLAKE2b-256 |
2046c780360e4632c02b7b1c09de3b6cc1982579f237b09a1c73d58775291f63
|