plantuml-mcp-server
PlantUML-MCP-Server
Documentation
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-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.
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' 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 18+
- 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-allEnvironment 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.
Frequently asked questions
What is plantuml-mcp-server?
plantuml-mcp-server is PlantUML-MCP-Server
How do I install plantuml-mcp-server?
Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.
Is plantuml-mcp-server open source?
Yes — it is hosted on GitHub at https://github.com/infobip/plantuml-mcp-server and has 53 stars.
Related MCP tools
🔥 Official Firecrawl MCP Server - Adds powerful web scraping and search to Cursor, Claude and any other LLM clients.
Use any LLMs (Large Language Models) for Deep Research. Support SSE API and MCP server.
Enhanced MCP server for interactive user feedback and command execution in AI-assisted development, featuring dual interface support (Web UI and Desktop Application) with intelligent environment detection and cross-platform compatibility.
A powerful Zotero AI and MCP plugin with ChatGPT, Gemini 3.7, Claude Fable 5, Claude Opus 5, DeepSeek V4, Grok, OpenRouter, Kimi k3, GLM 5.3, SiliconFlow, GPT-oss, Gemma 4, Qwen 3.8
Connect your browser to AI models. Just use Dia on Chrome, Arc or Firefox.
文颜 MCP Server 可以让 AI 自动将 Markdown 文章排版后发布至微信公众号。
Run your own MCP server? See who uses it and what to fix.
Measure it with TrackMCP