PlantUML Diagrams

内容与创意

by infobip

创建 PlantUML 图表,支持自动语法校验、修复建议、可嵌入图片 URL,以及代码的编码与解码分享。

什么是 PlantUML Diagrams

创建 PlantUML 图表,支持自动语法校验、修复建议、可嵌入图片 URL,以及代码的编码与解码分享。

核心功能 (3 个工具)

generate_plantuml_diagram

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.

encode_plantuml

Encode PlantUML code for URL usage

decode_plantuml

Decode encoded PlantUML string back to PlantUML code

README

PlantUML MCP Server

smithery badge

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

bash
# 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):

json
{
  "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:

bash
# 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

code
> 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

code
> add sequence diagram in readme in architecture section

PlantUML MCP Server Architecture

OAuth2 Authorization Code Flow Diagram

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

OAuth2 Authorization Code Flow


Development Setup

Prerequisites

  • Node.js 18+
  • npm

Local Installation

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

Development Commands

bash
# Show all available commands
make help

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

Environment Variables

VariableDescriptionDefault
PLANTUML_SERVER_URLPlantUML server URLhttps://www.plantuml.com/plantuml
PLANTUML_ALLOWED_DIRSAdditional directories for output_path (colon-separated, or * for any)CWD only

License

MIT License - see LICENSE file for details.

常见问题

PlantUML Diagrams 是什么?

创建 PlantUML 图表,支持自动语法校验、修复建议、可嵌入图片 URL,以及代码的编码与解码分享。

PlantUML Diagrams 提供哪些工具?

提供 3 个工具,包括 generate_plantuml_diagram、encode_plantuml、decode_plantuml

相关 Skills

内部沟通

by anthropics

Universal
热门

按公司常用模板和语气快速起草内部沟通内容,覆盖 3P 更新、状态报告、领导汇报、项目进展、事故复盘、FAQ 与 newsletter,适合需要统一格式的团队沟通场景。

按公司偏好的模板快速产出状态汇报、领导更新和 FAQ,既省去反复改稿,也让内部沟通更统一、更专业。

内容与创意
未扫描111.8k

主题工厂

by anthropics

Universal
热门

给幻灯片、文档、报告和 HTML 落地页快速套用专业配色与字体主题,内置 10 套预设风格并支持现场生成新主题,适合统一品牌或内容视觉。

主题工厂能帮你把幻灯片、文档到落地页快速统一视觉风格,内置 10 套主题,还能按需即时生成新主题。

内容与创意
未扫描111.8k

文档共著

by anthropics

Universal
热门

围绕文档、提案、技术规格、决策记录等写作任务,按上下文收集、结构迭代、读者测试三步协作共创,减少信息遗漏,写出更清晰、经得起他人阅读的内容。

写文档、方案或技术规格时容易思路散、信息漏,它用结构化共著流程帮你高效传递上下文、反复打磨内容,还能从读者视角做验证。

内容与创意
未扫描111.8k

相关 MCP Server

热门

免费的加密新闻聚合 MCP,汇集 Bitcoin、Ethereum、DeFi、Solana 与 altcoins 资讯源。

内容与创意
130

by ProfessionalWiki

让 Large Language Model 客户端无缝连接任意 MediaWiki 站点,可创建、更新、搜索页面,并通过 OAuth 2.0 安全管理内容。

内容与创意16 个工具
72

借助 86+ 个云端 media processing robots,处理视频、音频、图像和文档。

内容与创意
71

评论