PlantUML-MCP-Server
MCP server that provides PlantUML diagram generation capabilities
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-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.
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 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
Sequence diagram for plantuml-mcp-server
> add sequence diagram in readme in architecture section
OAuth2 Authorization Code Flow Diagram
> show me basic oauth2 flow png, open it in browser
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.
เซิร์ฟเวอร์ที่เกี่ยวข้อง
Scout Monitoring MCP
ผู้สนับสนุนPut performance and error data directly in the hands of your AI assistant.
Alpha Vantage MCP Server
ผู้สนับสนุนAccess financial market data: realtime & historical stock, ETF, options, forex, crypto, commodities, fundamentals, technical indicators, & more
Claude Desktop
An MCP server for interacting with Anthropic's Claude on the desktop, based on a DeepLearning.ai course example.
Unity Editor MCP
Enables AI assistants to interact directly with the Unity Editor for AI-assisted game development and automation.
CLI MCP Server
A secure MCP server for executing controlled command-line operations with comprehensive security features.
MCP SeriesGenerator
A .NET server for generating and validating vehicle serial numbers.
Fetter MCP
Get the most-recent Python package without vulnerabilities, and more.
Terraform Registry MCP Server
An MCP server for interacting with the Terraform Registry API. It allows querying for providers, resources, modules, and supports Terraform Cloud operations.
MCP Talk Demo Files
A collection of demo files for MCP servers and clients, illustrating various transport protocols and server capabilities using Python.
Universal Infinite Loop MCP Server
A goal-agnostic parallel orchestration framework implementing Infinite Agentic Loop patterns as a Model Context Protocol (MCP) server.
Jadx MCP Plugin
A Java plugin that exposes the Jadx decompiler API over HTTP for interaction with MCP clients.
Mong MCP Server
A moby-like random name generator for use with tools like Claude Desktop and VS Code Copilot Agent.