How veelenga/claude-mermaid works
Project type and purpose
• It integrates with Claude Code (and any MCP-compatible client) to provide two tools: mermaid_preview (browser live-preview) and mermaid_save (export to SVG/PNG/PDF).
File structure
• Top-level plugin metadata:
• .claude-plugin/plugin.json & marketplace.json → metadata for Claude Code plugin system
• .mcp.json, .npmignore, tsconfig.json, vitest.config.ts, GitHub/workflows CI files
• src/ (core application code)
• index.ts – MCP CLI entrypoint & command router
• handlers.ts – implements the two MCP tools (mermaid_preview, mermaid_save)
• live-server.ts – combined HTTP + WebSocket server for live-reload
• page-renderer.ts + src/preview static assets – HTML/CSS/JS for the browser UI
• types.ts & constants.ts
• test/ – unit and integration tests for each module
• start-server.js – helper to launch server standalone
README for additional insights
• Ports 3737–3747 for HTTP/WebSocket live reload
• Persistent working files + logs under user’s config directory
• Two MCP tools defined, with their parameters and behaviors