PlantUML MCP Server
PlantUML MCP Server lets Claude generate, validate, save, and share PlantUML diagrams through MCP tools.
Generate PlantUML diagrams and get embeddable SVG or PNG URLs.
Automatically validate PlantUML syntax and return structured errors for auto-fix workflows.
Optionally save diagrams locally as
.svgor.png, with path restrictions and automatic parent-directory creation.Encode PlantUML code for URL sharing and decode encoded PlantUML strings.
Use a prompt with guidelines for detecting and fixing common PlantUML syntax errors.
Create sequence diagrams, class diagrams, architecture diagrams, C4 diagrams, OAuth2 flow diagrams, and other PlantUML diagrams, including
!includeand external libraries.
Provides PlantUML diagram generation capabilities, including tools for creating and encoding diagrams, generating embeddable SVG/PNG URLs, and creating various diagram types like sequence diagrams, class diagrams, and C4 architecture diagrams.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@PlantUML MCP Server generate a sequence diagram for user login flow"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
PlantUML MCP Server
A Model Context Protocol (MCP) server that provides PlantUML diagram generation capabilities for Claude Desktop and Claude Code.
Available Tools
generate_plantuml_diagram- Generate diagrams and get embeddable URLs (SVG/PNG), optionally save locallyencode_plantuml- Encode PlantUML code for URL sharingdecode_plantuml- Decode PlantUML from encoded strings
Available Prompts
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-serverFor 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
!includedirectives and external librariesEncode/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' sectionSequence diagram for plantuml-mcp-server
> add sequence diagram in readme in architecture sectionOAuth2 Authorization Code Flow Diagram
> show me basic oauth2 flow png, open it in browserDevelopment Setup
Prerequisites
Node.js 22.12.0 or later
npm
Local Installation
# Clone and setup
git clone https://github.com/mzagar/plantuml-mcp-server.git
cd plantuml-mcp-server
make setupDevelopment Commands
# Show all available commands
make help
# Build and run all tests
make clean build test-allLocal MCP Smoke Test
Test the compiled server in this checkout through mcpc:
Requires Node.js 22.12.0 or later, npm, Make, and network access.
# Install project dependencies, then build and test the local server
npm ci --ignore-scripts --no-audit --no-fund --engine-strict
make test-mcpcIf mcpc is missing from PATH, the target installs the official Apify CLI with npm install --global --no-audit --no-fund @apify/mcpc. It reuses an existing installation without upgrading it and checks mcpc --version before testing. The smoke test has been verified with mcpc 0.6.0.
This is a global CLI installation, not a project dependency. It requires permission to write to the npm global prefix. The target never uses sudo. If installation fails or the CLI is still not on PATH, the test stops with instructions. You can also install it manually with npm install -g @apify/mcpc.
make test-mcp is an alias. make test-all runs the unit/type checks and this MCP test, including the CLI installation check. Running node scripts/test-mcpc.mjs directly does not install the CLI.
The test verifies all three tools, the prompt, Unicode roundtrip, diagram URLs, SVG/PNG files, C4 rendering, syntax errors, and output-path restrictions.
It always renders synthetic diagrams through https://www.plantuml.com/plantuml, so network access is required. It does not use a published npm server or an existing user session.
The runner creates its own temporary config, private MCPC_HOME_DIR, working directory, and output directory. Its @local session is isolated from user sessions and closed after success, failure, or interruption. It retains images and results.json in the artifact directory printed by the command.
Success ends with PASS local mcpc smoke test and exit code 0. Missing prerequisites, network errors, failed assertions, or cleanup failures return a nonzero exit code.
For a trusted corporate CA, run:
NODE_EXTRA_CA_CERTS=/absolute/path/to/trusted-ca.pem make test-mcpcThe runner forwards this setting to the server. Do not disable TLS validation. If cleanup fails, use its printed private home: MCPC_HOME_DIR="<artifact-directory>/mcpc" mcpc close @local. Do not close sessions in your default mcpc home.
Agent instructions are in AGENTS.md.
Environment Variables
Variable | Description | Default |
| PlantUML server URL |
|
| Additional directories for | CWD only |
License
MIT License - see LICENSE file for details.
MCP Registry Listings
Available Tools
3 toolsdecode_plantumlA
Decode encoded PlantUML string back to PlantUML code
Inputs: encoded_string (required).
encode_plantumlB
Encode PlantUML code for URL usage
Inputs: plantuml_code (required).
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.
Inputs: plantuml_code (required), format, output_path.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
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.
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.
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.
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
Related MCP Connectors
Render, validate, encode/decode PlantUML diagram-as-code; 22 diagram types. Free, no auth.
Generate dynamic Mermaid diagrams and charts with AI assistance. Customize styles and export diagr…
Draw architecture diagrams, UML, planning boards and clickable wireframes from your AI assistant.
Diagrams, badges, charts and QR codes as plain image URLs you can paste into Markdown.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables 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-
- AlicenseNot gradedqualityDmaintenanceEnables 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
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to generate UML diagrams from text descriptions using PlantUML, supporting multiple output formats (PNG, SVG, PDF), syntax validation, and diagram source extraction.MIT
- AlicenseNot gradedqualityCmaintenanceEnables generating cloud architecture diagrams, flowcharts, sequence diagrams, and more using three rendering engines: mingrammer/diagrams, Mermaid, and PlantUML.56 PyPI3MIT
Appeared in Searches
- PlantUML Diagramming Tool and UML Diagram Creation
- 2D technical layout diagram for residential lawn irrigation system with measurements
- Tools for creating architectural and technical diagrams
- A tool for generating class and architecture diagrams from code or technical descriptions
- Information about C4 diagrams