Skip to main content

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

  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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

iflow_mcp_2niuhe_mcp_plantuml-0.1.0.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

iflow_mcp_2niuhe_mcp_plantuml-0.1.0-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

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

Hashes for iflow_mcp_2niuhe_mcp_plantuml-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8aab7b5497fb62cd796fc131c523eff02e291769746236c2c5382a5f82b3e55b
MD5 807ab484e162b94124ece75d38342bd2
BLAKE2b-256 74c1795f51e83af84751d5e8e6139d2c98e28e2c7858153838adcd205aeaa04c

See more details on using hashes here.

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

Hashes for iflow_mcp_2niuhe_mcp_plantuml-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d9b6a9396336431d35c54d527d5fe2daa1929e45a51d4e6ebea76720527fe5b0
MD5 346f22fc7ee55869494dc815d42c4166
BLAKE2b-256 2046c780360e4632c02b7b1c09de3b6cc1982579f237b09a1c73d58775291f63

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page