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
热门

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

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

内容与创意
未扫描158.5k

内部沟通

by anthropics

Universal
热门

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

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

内容与创意
未扫描158.5k

平面设计

by anthropics

Universal
热门

先生成视觉哲学,再落地成原创海报、艺术画面或其他静态设计,输出 .png/.pdf,强调构图、色彩与空间表达,适合需要高完成度视觉成品的场景。

做海报、插画或静态视觉稿时,用它能快速产出兼顾美感与版式的PNG/PDF成品,原创设计更省心,也更适合规避版权风险。

内容与创意
未扫描158.5k

相关 MCP Server

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

内容与创意
255

用于Adobe Photoshop自动化的MCP server,让AI assistants直接控制Photoshop。

内容与创意
158

by roomi-fields

热门

Automate Google NotebookLM — Q&A with citations, audio, video, content generation

内容与创意
105

评论