PlantUML diagram generation MCP server with templates, previews, and multi-format export
npm install draw-uml-mcpA Model Context Protocol (MCP) server for PlantUML diagram generation, providing AI assistants with the ability to create, preview, and export UML diagrams.
- Preview: Generate SVG previews of PlantUML diagrams
- Multi-format Export: Export to PNG, SVG, JPG, and PDF formats
- Template System: Built-in templates for common diagram types
- Validation: Real-time syntax validation
- Caching: Built-in response caching for performance
- MCP Compliant: Full compliance with Model Context Protocol
``bash`
npm install -g draw-uml-mcp
`bash`
npm install draw-uml-mcp
Add to your MCP client configuration:
`json`
{
"mcpServers": {
"draw-uml": {
"command": "node",
"args": ["/path/to/draw-uml-mcp/dist/index.js"]
}
}
}
| Tool | Description | Parameters |
|------|-------------|------------|
| preview | Generate SVG preview | code: string |generate
| | Generate diagram in specified format | code, format, returnBase64 |export
| | Export to file path | code, format, filePath |list_templates
| | List available templates | category? |get_template
| | Get template content | name |
Add to your Claude Desktop config (~claude_desktop_config.json):
`json`
{
"mcpServers": {
"draw-uml": {
"command": "npx",
"args": ["-y", "draw-uml-mcp"]
}
}
}
`plantuml`
@startuml
Bob -> Alice : Hello
Alice -> Bob : Hi there!
@enduml
Built-in templates are available for:
- Sequence Diagrams: Basic calls, async messages, alternatives
- Class Diagrams: Simple class, inheritance, associations
- Activity Diagrams: Flowcharts, decisions, parallel actions
- Component Diagrams: Components, interfaces, dependencies
- Use Case Diagrams: Actors, use cases, relationships
- State Diagrams: States, transitions, actions
`bashClone repository
git clone https://github.com/your-username/draw-uml-mcp
cd draw-uml-mcp
- Node.js >= 18.0.0
- Network connection (for PlantUML server API)
MIT License - see LICENSE file for details
Contributions are welcome! Please feel free to submit a Pull Request.
For issues and questions, please use the GitHub issue tracker.