Skip to main content
Glama

PlantUML MCP Server

A Model Context Protocol (MCP) server that provides PlantUML diagram generation capabilities for Claude Desktop and Claude Code.

Available Tools

  1. generate_plantuml_diagram - Generate diagrams and get embeddable URLs (SVG/PNG), optionally save locally

  2. encode_plantuml - Encode PlantUML code for URL sharing

  3. decode_plantuml - Decode PlantUML from encoded strings

Available Prompts

  1. plantuml_error_handling - Guidelines for handling PlantUML syntax errors and implementing auto-fix workflows

This prompt provides Claude instances with comprehensive instructions on how to:

  • Detect PlantUML syntax errors using native server validation

  • Implement intelligent auto-fix workflows for common syntax issues

  • Parse structured error responses and apply appropriate corrections

  • Handle validation failures gracefully with retry logic

The prompt enables Claude to automatically detect and fix common PlantUML errors like missing tags, invalid arrow syntax, typos in keywords, and missing quotes, making PlantUML diagram generation more reliable and user-friendly.

Quick Setup

For Claude Code

# Using default PlantUML server
claude mcp add plantuml --scope user --env PLANTUML_SERVER_URL=https://www.plantuml.com/plantuml -- npx plantuml-mcp-server

For Claude Desktop

Add this to your Claude Desktop MCP configuration (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

{
  "mcpServers": {
    "plantuml": {
      "command": "npx",
      "args": ["plantuml-mcp-server"],
      "env": {
        "PLANTUML_SERVER_URL": "https://www.plantuml.com/plantuml"
      }
    }
  }
}

To use your own PlantUML server, change the PLANTUML_SERVER_URL environment variable.

Then restart Claude Desktop/Code to activate the MCP server.

Related MCP server: UMLmcp

What You Can Do

After setup, you can ask Claude to:

  • Generate PlantUML diagrams and get embeddable SVG/PNG URLs

  • Create sequence diagrams, class diagrams, architecture diagrams

  • Use advanced PlantUML features like !include directives and external libraries

  • Encode/decode PlantUML for URL sharing

  • Save diagrams locally with secure path restrictions

Saving Diagrams Locally

The generate_plantuml_diagram tool supports saving diagrams to local files via the output_path parameter.

Security: By default, files can only be saved within the current working directory. Only .svg and .png extensions are allowed.

To allow additional directories, set the PLANTUML_ALLOWED_DIRS environment variable:

# Allow specific directories (colon-separated)
PLANTUML_ALLOWED_DIRS=/home/user/diagrams:/tmp/output

# Allow any directory (use with caution)
PLANTUML_ALLOWED_DIRS=*

Examples

C4 diagram for plantuml-mcp-server

> add c4 diagram for this project in readme 'C4 diagram for plantuml-mcp-server' section

C4 Container Diagram - PlantUML MCP Server

Sequence diagram for plantuml-mcp-server

> add sequence diagram in readme in architecture section

PlantUML MCP Server Architecture

OAuth2 Authorization Code Flow Diagram

> show me basic oauth2 flow png, open it in browser

OAuth2 Authorization Code Flow


Development Setup

Prerequisites

  • Node.js 18+

  • npm

Local Installation

# Clone and setup
git clone https://github.com/mzagar/plantuml-mcp-server.git
cd plantuml-mcp-server
make setup

Development Commands

# Show all available commands
make help

# Build and run all tests
make clean build test-all

Environment Variables

Variable

Description

Default

PLANTUML_SERVER_URL

PlantUML server URL

https://www.plantuml.com/plantuml

PLANTUML_ALLOWED_DIRS

Additional directories for output_path (colon-separated, or * for any)

CWD only

License

MIT License - see LICENSE file for details.

Available Tools

3 tools
decode_plantumlC

Decode encoded PlantUML string back to PlantUML code

ParametersJSON Schema
NameRequiredDescriptionDefault
encoded_stringYesEncoded PlantUML string to decode

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool decodes encoded strings but doesn't cover error handling (e.g., invalid input), performance traits, or output format (e.g., returning plain text PlantUML code). This leaves significant gaps in understanding how the tool behaves beyond its basic function.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose with zero waste. It is appropriately sized and front-loaded, making it easy for an agent to parse quickly without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is incomplete. It doesn't explain what the decoded output looks like (e.g., PlantUML code format), error conditions, or dependencies on sibling tools. For a tool with no structured data beyond the input schema, more contextual information is needed to guide effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, with the parameter 'encoded_string' fully documented in the schema. The description adds no additional meaning beyond what the schema provides (e.g., format details or examples), so it meets the baseline score of 3 for high schema coverage without extra value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with a specific verb ('decode') and resource ('encoded PlantUML string'), and it distinguishes the action from encoding or generating diagrams. However, it doesn't explicitly differentiate from sibling tools like 'encode_plantuml' beyond the opposite direction, leaving some room for improvement.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing an encoded string), exclusions, or comparisons to sibling tools like 'encode_plantuml' or 'generate_plantuml_diagram', leaving the agent to infer usage context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

encode_plantumlB

Encode PlantUML code for URL usage

ParametersJSON Schema
NameRequiredDescriptionDefault
plantuml_codeYesPlantUML diagram code to encode

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden but only states the basic function. It doesn't disclose behavioral traits such as encoding format, error handling, performance, or security aspects (e.g., input validation), leaving significant gaps for a tool that likely transforms data.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without any wasted words. It's appropriately sized and front-loaded, making it easy to understand quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the simple input schema (1 parameter, 100% coverage) and no output schema, the description is minimally adequate but incomplete. It lacks details on output format, error cases, or integration context, which are important for a tool that encodes data for URLs.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds no parameter-specific information beyond the schema, which has 100% coverage and fully documents the single parameter. This meets the baseline of 3, as the schema handles the heavy lifting without extra value from the description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Encode') and the resource ('PlantUML code'), specifying it's for URL usage. It distinguishes from siblings like 'decode_plantuml' (reverse operation) and 'generate_plantuml_diagram' (creation), but doesn't explicitly contrast them in the description.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides minimal guidance by mentioning 'for URL usage', implying use when embedding PlantUML in URLs. However, it lacks explicit when-to-use scenarios, prerequisites, or alternatives (e.g., when to use vs. generate_plantuml_diagram), offering no detailed context for selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

generate_plantuml_diagramA

Generate a PlantUML diagram with automatic syntax validation and error reporting for auto-fix workflows. Returns embeddable image URLs for valid diagrams or structured error details for invalid syntax that can be automatically corrected. Optionally saves the diagram to a local file.

ParametersJSON Schema
NameRequiredDescriptionDefault
plantuml_codeYesPlantUML diagram code. Will be automatically validated for syntax errors before generating the diagram URL.
formatNoOutput image format (SVG or PNG)svg
output_pathNoOptional. Path to save diagram locally. Automatically creates all necessary parent directories. Restricted to current working directory by default. Set PLANTUML_ALLOWED_DIRS env var (colon-separated paths, or "*" for unrestricted) to allow additional directories. Only .svg and .png extensions permitted.

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden and does well by disclosing key behavioral traits: it performs automatic syntax validation, returns embeddable image URLs or structured error details for auto-fix, and optionally saves to a local file with directory restrictions. However, it lacks details on rate limits, authentication needs, or error handling specifics.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core purpose and key features in the first sentence, followed by additional details in a structured manner. Every sentence adds value without redundancy, making it efficient and easy to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (3 parameters, no output schema, no annotations), the description is fairly complete, covering the main functionality, validation, outputs, and optional file saving. However, it could benefit from more details on error handling or response formats to fully compensate for the lack of output schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description adds minimal value beyond the schema, mentioning 'automatic syntax validation' for plantuml_code and 'Optionally saves the diagram to a local file' for output_path, but does not provide additional semantic context. This meets the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Generate a PlantUML diagram') and distinguishes it from siblings by mentioning 'automatic syntax validation and error reporting for auto-fix workflows' and 'Returns embeddable image URLs for valid diagrams or structured error details for invalid syntax that can be automatically corrected.' This goes beyond just restating the name and differentiates from decode_plantuml and encode_plantuml.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for when to use this tool ('Generate a PlantUML diagram with automatic syntax validation and error reporting for auto-fix workflows'), but does not explicitly state when not to use it or mention alternatives like the sibling tools. The guidance is implicit rather than explicit about tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

A3.7/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose: decode_plantuml reverses encoding, encode_plantuml prepares code for URLs, and generate_plantuml_diagram creates diagrams with validation. There is no overlap or ambiguity between these functions, making tool selection straightforward for an agent.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern with snake_case (decode_plantuml, encode_plantuml, generate_plantuml_diagram). The naming is predictable and readable, adhering to a uniform style throughout the set.

Tool Count5/5

With 3 tools, this server is well-scoped for handling PlantUML encoding, decoding, and diagram generation. Each tool earns its place by covering essential operations without bloat, making the count appropriate for the domain.

Completeness5/5

The tool set provides complete coverage for core PlantUML workflows: encoding for URLs, decoding back to code, and generating diagrams with validation and error handling. There are no obvious gaps, as these tools support the full lifecycle from code to visual output.

Maintenance

ActivityNo data
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables AI assistants to generate UML diagrams through natural language by rendering PlantUML code into PNG or SVG images. Supports sequence diagrams, class diagrams, use case diagrams, and other UML chart types with Base64-encoded output.
    7
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables users to generate PlantUML code for UML Class and Sequence diagrams using Google Gemini AI. Supports both domain JSON input and free text descriptions to create structured UML diagrams.
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables generating cloud architecture diagrams, flowcharts, sequence diagrams, and more using three rendering engines: mingrammer/diagrams, Mermaid, and PlantUML.
    3
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/infobip/plantuml-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server