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.
Metadata
Release files for iflow-mcp_2niuhe-mcp_plantuml 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| iflow_mcp_2niuhe_mcp_plantuml-0.1.0.tar.gz | 10.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| iflow_mcp_2niuhe_mcp_plantuml-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 21.8 kB
Release files / iflow_mcp_2niuhe_mcp_plantuml-0.1.0.tar.gz
| Download URL | iflow_mcp_2niuhe_mcp_plantuml-0.1.0.tar.gz |
|---|---|
| Size | 10.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8aab7b5497fb62cd796fc131c523eff02e291769746236c2c5382a5f82b3e55b
|
|
BLAKE2b-256 checksum How to use checksums |
74c1795f51e83af84751d5e8e6139d2c98e28e2c7858153838adcd205aeaa04c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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}
|
Release files / iflow_mcp_2niuhe_mcp_plantuml-0.1.0-py3-none-any.whl
| Download URL | iflow_mcp_2niuhe_mcp_plantuml-0.1.0-py3-none-any.whl |
|---|---|
| Size | 10.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d9b6a9396336431d35c54d527d5fe2daa1929e45a51d4e6ebea76720527fe5b0
|
|
BLAKE2b-256 checksum How to use checksums |
2046c780360e4632c02b7b1c09de3b6cc1982579f237b09a1c73d58775291f63
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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}
|