Skip to main content

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

  1. Install the required dependencies:
pip install -r requirements.txt
  1. 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:

  1. Open Claude Desktop
  2. Go to Settings > MCP Servers
  3. Add a new server with the URL: http://localhost:8765/sse
  4. Restart Claude Desktop

Available MCP Resources

  • plantuml://info - Information about the PlantUML server
  • plantuml://examples - Examples of PlantUML diagrams
  • plantuml://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 string
  • validate_plantuml(uml_code: str) -> Dict[str, Union[bool, str]] - Validate PlantUML code and return validation result with error message if any
  • create_diagram_from_template(diagram_type: str, customizations: str) -> str - Create a diagram from a template with customizations
  • convert_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)

Source distribution for iflow-mcp_2niuhe-mcp_plantuml 0.1.0
File Size Uploaded
iflow_mcp_2niuhe_mcp_plantuml-0.1.0.tar.gz 10.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for iflow-mcp_2niuhe-mcp_plantuml 0.1.0
File Interpreter ABI Platform
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}

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page