draw-uml-mcp
v0.2.0
Published
PlantUML diagram generation MCP server with templates, previews, and multi-format export
Downloads
21
Maintainers
Readme
draw-uml-mcp
A Model Context Protocol (MCP) server for PlantUML diagram generation, providing AI assistants with the ability to create, preview, and export UML diagrams.
Features
- 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
Installation
Global Installation
npm install -g draw-uml-mcpLocal Installation
npm install draw-uml-mcpUsage
As an MCP Server
Add to your MCP client configuration:
{
"mcpServers": {
"draw-uml": {
"command": "node",
"args": ["/path/to/draw-uml-mcp/dist/index.js"]
}
}
}MCP Tools
| 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 |
Example
Using with Claude Desktop
Add to your Claude Desktop config (~claude_desktop_config.json):
{
"mcpServers": {
"draw-uml": {
"command": "npx",
"args": ["-y", "draw-uml-mcp"]
}
}
}Sample PlantUML Code
@startuml
Bob -> Alice : Hello
Alice -> Bob : Hi there!
@endumlTemplates
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
Development
# Clone repository
git clone https://github.com/your-username/draw-uml-mcp
cd draw-uml-mcp
# Install dependencies
npm install
# Build
npm run build
# Watch mode
npm run dev
# Start server
npm startRequirements
- Node.js >= 18.0.0
- Network connection (for PlantUML server API)
License
MIT License - see LICENSE file for details
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Support
For issues and questions, please use the GitHub issue tracker.
