{"_id":"@alfa95/diagram-mcp","name":"@alfa95/diagram-mcp","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@alfa95/diagram-mcp","version":"0.1.0","description":"Universal MCP server for creating diagrams — outputs Excalidraw, Draw.io, Mermaid, and SVG from a single API.","type":"module","main":"dist/index.js","bin":{"diagram-mcp":"dist/index.js"},"engines":{"node":">=18"},"scripts":{"build":"tsc","start":"tsx src/index.ts","dev":"tsx watch src/index.ts","check":"tsc --noEmit","test":"vitest run","prepublishOnly":"npm run build"},"dependencies":{"@modelcontextprotocol/sdk":"^1.22.0","elkjs":"^0.11.1","yargs":"^18.0.0","zod":"^3.23.0"},"devDependencies":{"@types/node":"^22.0.0","@types/yargs":"^17.0.35","tsx":"^4.20.0","typescript":"^5.7.0","vitest":"^2.0.0"},"keywords":["mcp","model-context-protocol","diagram","excalidraw","drawio","mermaid","svg"],"author":{"name":"as4195@gmail.com"},"license":"MIT","_id":"@alfa95/diagram-mcp@0.1.0","gitHead":"58c801d9de1adc721c37a92a54df19dd6537ab47","types":"./dist/index.d.ts","_nodeVersion":"20.19.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-CB3VkZDf4bsFvaJyFnkFafwLJkrSMyzuCQTphj9sOeyMOrVnsMFecG/RGBU4KVhu3xWvQW/uLYGitB3LmAbh2A==","shasum":"23e23018df27e260dab61b543e196bb04b0f2ad8","tarball":"https://registry.npmjs.org/@alfa95/diagram-mcp/-/diagram-mcp-0.1.0.tgz","fileCount":47,"unpackedSize":114172,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDv6Ph+JzkIfUnEAObntLZJCk3p2MHxd8DNWgx4e1lBdAIgEuWA0ezyutvyxWzwlJ22X4vUr8WIhAhqF8dN+MqDuW4="}]},"_npmUser":{"name":"alfa95","email":"as4195@gmail.com"},"directories":{},"maintainers":[{"name":"alfa95","email":"as4195@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/diagram-mcp_0.1.0_1773673205872_0.6731632230880209"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-16T15:00:05.795Z","0.1.0":"2026-03-16T15:00:06.010Z","modified":"2026-03-16T15:00:06.227Z"},"maintainers":[{"name":"alfa95","email":"as4195@gmail.com"}],"description":"Universal MCP server for creating diagrams — outputs Excalidraw, Draw.io, Mermaid, and SVG from a single API.","keywords":["mcp","model-context-protocol","diagram","excalidraw","drawio","mermaid","svg"],"author":{"name":"as4195@gmail.com"},"license":"MIT","readme":"# diagram-mcp\n\nAn MCP server that lets AI agents create diagrams through a single tool call. Outputs SVG, Excalidraw, Draw.io, and Mermaid from one API. Uses [ELK.js](https://github.com/kieler/elkjs) for automatic graph layout.\n\n## Installation\n\n```bash\nnpm install -D diagram-mcp\n```\n\n## MCP Configuration\n\nAdd to your `.cursor/mcp.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"diagram\": {\n      \"command\": \"npx\",\n      \"args\": [\"diagram-mcp\", \"--output-dir\", \"./diagrams\"]\n    }\n  }\n}\n```\n\n### Options\n\n| Flag | Default | Description |\n|------|---------|-------------|\n| `--output-dir`, `-o` | `.` | Directory for generated diagram files |\n\n## Tools\n\n### `createDiagram` (primary)\n\nCreate a complete diagram in one call. This is the recommended tool — much faster than creating nodes individually.\n\n```\ntitle:     \"my-diagram\"\ndirection: \"LR\"           # LR (horizontal) or TD (vertical)\nnodes:     [{ label, shape, color }]\nedges:     [{ from, to, label, style }]\nframes:    [{ label, nodeLabels }]\nformats:   [\"svg\"]        # svg, excalidraw, drawio, mermaid\n```\n\nOmit `x`/`y` on nodes to use automatic ELK layout.\n\n### Other tools\n\n| Tool | Description |\n|------|-------------|\n| `createNode` | Add a single node |\n| `createEdge` | Connect two nodes |\n| `deleteElement` | Remove a node or edge |\n| `getDiagramState` | Get diagram as markdown |\n| `exportDiagram` | Export to a specific format |\n| `setStyle` | Update colors / stroke |\n| `createFrame` | Group nodes into a frame |\n\n## Shapes\n\n| Shape | Use for |\n|-------|---------|\n| `rectangle` | Services, modules, components |\n| `cylinder` | Databases, caches, storage |\n| `ellipse` | Clients, users, external actors |\n| `diamond` | Decision points, guards, routers |\n| `hexagon` | Infrastructure (CDN, load balancer) |\n| `parallelogram` | Interceptors, middleware |\n\n## Colors\n\n`light-blue`, `light-green`, `light-red`, `light-yellow`, `light-purple`, `light-orange`, `white`, `gray`\n\n## Export Formats\n\n| Format | Extension | Opens in |\n|--------|-----------|----------|\n| `svg` | `.svg` | Any browser or image viewer |\n| `excalidraw` | `.excalidraw` | Excalidraw web or VS Code extension |\n| `drawio` | `.drawio` | draw.io web or VS Code extension |\n| `mermaid` | `.mermaid.md` | Any markdown previewer |\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-3b8407fffe55eb91a2c86c54b26e0ade"}