Co-Pilot
Updated a month ago

draw-mcp

Eekusiadadus
0.0k
ekusiadadus/draw-mcp
78
Agent Score

πŸ’‘ Summary

Generates high-quality draw.io diagrams with features like font management and Japanese text support.

🎯 Target Audience

Software developers needing diagram generationProject managers visualizing workflowsTechnical writers creating documentationEducators designing instructional materialsUX/UI designers mapping user flows

πŸ€– AI Roast: β€œThe project may expose risks through external dependencies and shell execution for PNG generation. Ensure to validate and sanitize inputs to mitigate potential command injection vu”

Security AnalysisMedium Risk

The project may expose risks through external dependencies and shell execution for PNG generation. Ensure to validate and sanitize inputs to mitigate potential command injection vulnerabilities.

Claude Skill: draw.io Diagram Generator

A Claude Code skill for generating high-quality draw.io diagrams with proper font settings, arrow placement, and Japanese text support.

Features

  • Font Management: Ensures fontFamily is set on all text elements
  • Arrow Layering: Correct Z-order placement (arrows behind boxes)
  • Japanese Text Support: Proper width allocation for CJK characters
  • PNG Validation: Pre-commit hooks for automatic PNG generation
  • Best Practices: Comprehensive checklist and examples

Installation

Plugin Installation (Recommended)

# Via Claude Code marketplace /plugin marketplace add ekusiadadus/draw-mcp # Or install directly /plugin add https://github.com/ekusiadadus/draw-mcp

Manual Installation

Clone to your Claude Code skills directory:

# Global (personal use) git clone https://github.com/ekusiadadus/draw-mcp ~/.claude/skills/draw-io # Project-specific git clone https://github.com/ekusiadadus/draw-mcp .claude/skills/draw-io

Usage

Once installed, Claude Code will automatically use this skill when you ask to create draw.io diagrams.

Example Prompts

Create a simple flowchart showing: Start -> Process -> End

Draw an architecture diagram with Web Server, API, and Database

Create a sequence diagram for user login flow

Manual Trigger

If needed, you can explicitly request the skill:

Using the draw-io skill, create a flowchart for the authentication process

Requirements

draw.io CLI (for PNG export)

macOS:

brew install --cask drawio

Linux: Download from draw.io Desktop Releases

Python (for tests and validation)

pip install pytest

Project Structure

draw-mcp/
β”œβ”€β”€ .claude-plugin/
β”‚   β”œβ”€β”€ plugin.json          # Plugin manifest
β”‚   └── marketplace.json     # Marketplace configuration
β”œβ”€β”€ skills/
β”‚   └── draw-io/
β”‚       β”œβ”€β”€ SKILL.md         # Main skill definition
β”‚       β”œβ”€β”€ reference.md     # XML structure reference
β”‚       β”œβ”€β”€ examples.md      # Production-ready examples
β”‚       └── checklist.md     # Validation checklist
β”œβ”€β”€ scripts/
β”‚   └── convert-drawio-to-png.sh
β”œβ”€β”€ tests/
β”‚   └── test_drawio_skill.py
β”œβ”€β”€ docs/
β”‚   └── RULE.md
β”œβ”€β”€ .pre-commit-config.yaml
β”œβ”€β”€ .gitignore
β”œβ”€β”€ LICENSE
└── README.md

Key Rules

1. Font Settings

<!-- In mxGraphModel --> <mxGraphModel defaultFontFamily="Noto Sans JP" ...> <!-- In EVERY text element --> <mxCell style="...fontFamily=Noto Sans JP;fontSize=18;..." />

2. Arrow Placement

Arrows must be declared FIRST in XML to render behind other elements:

<root> <!-- Arrows first (background) --> <mxCell id="arrow1" edge="1" ... /> <!-- Boxes after (foreground) --> <mxCell id="box1" vertex="1" ... /> </root>

3. Japanese Text Width

Allocate 30-40px per Japanese character:

<!-- 6 characters Γ— 35px = 210px --> <mxGeometry width="220" ... />

4. PNG Verification

Always export to PNG and verify visually:

drawio -x -f png -s 2 -t -o diagram.png diagram.drawio

Pre-commit Hooks

This project includes pre-commit hooks for:

  1. XML Validation: Check font settings and structure
  2. PNG Conversion: Auto-generate PNG on commit
  3. Python Tests: Run skill validation tests

Setup:

pip install pre-commit pre-commit install

Running Tests

# Run all tests pytest tests/ -v # Run specific test file pytest tests/test_drawio_skill.py -v

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run tests: pytest tests/ -v
  5. Submit a pull request

License

MIT License - see LICENSE

Related Resources

Changelog

v1.0.0 (2025-12-16)

  • Initial release
  • Core skill with font, arrow, and text handling
  • Pre-commit hooks for validation
  • Comprehensive documentation and examples
5-Dim Analysis
Clarity8/10
Novelty7/10
Utility9/10
Completeness8/10
Maintainability7/10
Pros & Cons

Pros

  • Supports Japanese text and proper font settings
  • Automates PNG generation with pre-commit hooks
  • Comprehensive documentation and examples

Cons

  • Requires external draw.io CLI for PNG export
  • Installation may be complex for beginners
  • Limited to draw.io format

Related Skills

pytorch

S
toolCode Lib
92/ 100

β€œIt's the Swiss Army knife of deep learning, but good luck figuring out which of the 47 installation methods is the one that won't break your system.”

agno

S
toolCode Lib
90/ 100

β€œIt promises to be the Kubernetes for agents, but let's see if developers have the patience to learn yet another orchestration layer.”

nuxt-skills

S
toolCo-Pilot
90/ 100

β€œIt's essentially a well-organized cheat sheet that turns your AI assistant into a Nuxt framework parrot.”

Disclaimer: This content is sourced from GitHub open source projects for display and rating purposes only.

Copyright belongs to the original author ekusiadadus.