Code-driven SVG diagram library for TypeScript/Node.js. Generate publication-quality architecture diagrams, flowcharts, and neural network diagrams with just a few lines of code. Features 10
shapes, 11 arrow heads, smart auto-routing with obstacle avoidance, and multi-format export (SVG/PNG/JPG/WebP/PDF). AI agents can generate diagrams through natural language via MCP integration.
Overview
Features
- 10 built-in shapes: Rect, Circle, Diamond, Trapezoid, Cylinder, Cuboid, Sphere, Stack, Text, Image
- 11 arrow head styles with open variants
- Smart auto-routing with obstacle avoidance (v0.2.0+)
- Layout helpers: row(), col(), grid(), group()
- Export to SVG, PNG, JPG, WebP, PDF
- No browser required — pure Node.js
MCP Tools
create_diagram— Generate SVG diagrams from TypeScript codeget_element_types— List all available shapes and their parameters
Quick Start
npm install figcraft
Documentation
Server Config
{
"mcpServers": {
"figcraft": {
"command": "npx",
"args": [
"figcraft-mcp"
]
}
}
}