IP

infobip/plantuml-mcp-server

数据科学与机器学习

本页由 AI 翻译,技术细节请以原文为准。 查看原文

55 stars 5 forks 质量 83 趋势 20MIT

infobip/plantuml-mcp-server 是从 https://github.com/infobip/plantuml-mcp-server. 导入的 MCP 服务器候选

概览

infobip/plantuml-mcp-server 是从 https://github.com/infobip/plantuml-mcp-server. 导入的 MCP 服务器候选

概述(AI 翻译)

一款模型上下文协议(MCP)服务器,提供 Claude Desktop 和 Claude Code 的 PlantUML 图生成功能。

可用工具

  1. generate_plantuml_diagram - 生成图表并获取可嵌入的URL(SVG/PNG),可选择本地保存
  2. encode_plantuml - 用于URL共享的PlantUML编码代码
  3. decode_plantuml - 从编码字符串解码PlantUML

可用提示

  1. plantuml_error_handling - 处理 PlantUML 语法错误和实现自动修复工作流程的指南

该提示为Claude实例提供了全面的指导,教你如何:

  • 利用原生服务器验证检测 PlantUML 语法错误
  • 实现针对常见语法问题的智能自动修复工作流程
  • 解析结构化错误响应并应用相应的修正
  • 通过重试逻辑优雅地处理验证失败

该提示使 Claude 能够自动检测和修复常见的 PlantUML 错误,如缺少标签、无效箭头语法、关键词中的错别字和缺少引号,使 PlantUML 图表生成更加可靠且用户友好。

快速布置

为了克劳德·代码

克劳德桌面版

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

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

在 GitHub 查看完整 README

安装

npx plantuml-mcp-server
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "plantuml": { "command": "npx", "args": ["plantuml-mcp-server"], "env": { "PLANTUML_SERVER_URL": "https://www.plantuml.com/plantuml" } } } }