Skip to main content
Glama
PROJECT_SUMMARY.mdβ€’9.03 kB
# πŸŽ‰ Mermaid MCP Connector - Project Summary ## Overview The **Mermaid MCP Connector** is a universal integration layer that enables the Mermaid MCP Server to work with various AI assistants and applications including GitHub Copilot, ChatGPT, Claude, and custom AI systems. ## βœ… What's Been Built ### 1. Core SDK (`src/index.ts`) - βœ… TypeScript-based MCP client wrapper - βœ… Connection management (connect/disconnect) - βœ… Tool listing and invocation - βœ… High-level methods for all MCP operations: - `generateDiagram()` - Generate diagrams from descriptions - `getDiagramTypes()` - List available diagram types - `getTemplates()` - Get pre-built templates - `validateSyntax()` - Validate Mermaid code - `exportDiagram()` - Export to SVG/PNG/PDF ### 2. REST API Server (`src/rest-api.ts`) - βœ… Express-based HTTP server - βœ… CORS enabled for web integration - βœ… RESTful endpoints: - `POST /api/diagram/generate` - Generate diagrams - `GET /api/diagram/types` - Get diagram types - `GET /api/templates` - Get templates - `POST /api/diagram/validate` - Validate syntax - `POST /api/diagram/export` - Export diagrams - `GET /health` - Health check - βœ… OpenAPI 3.0 specification at `/openapi.json` - βœ… ChatGPT plugin manifest at `/.well-known/ai-plugin.json` - βœ… Automatic JSON error handling ### 3. WebSocket Server (`src/websocket.ts`) - βœ… Real-time bidirectional communication - βœ… Message-based protocol - βœ… Supports all MCP operations - βœ… Client connection management - βœ… Error handling and graceful shutdown ### 4. CLI Tool (`src/cli.ts`) - βœ… Command-line interface for all operations - βœ… Commands: - `rest` - Start REST API server - `websocket` / `ws` - Start WebSocket server - `test` - Test MCP server connection - `generate <description>` - Generate diagram - `types` - List diagram types - `templates` - List templates - βœ… Help and version flags - βœ… Environment variable support ### 5. Documentation - βœ… **README.md** - Complete usage guide with examples - βœ… **INTEGRATION_GUIDE.md** - Comprehensive integration guide for: - GitHub Copilot - ChatGPT plugins - Claude - Custom AI assistants - Web applications (React/Vue) - Slack bots - Discord bots ### 6. Examples - βœ… `examples/basic-usage.js` - SDK usage example - βœ… `examples/rest-api-client.js` - REST API client example - βœ… `examples/websocket-client.js` - WebSocket client example ### 7. Configuration - βœ… `package.json` - NPM package configuration - βœ… `tsconfig.json` - TypeScript configuration - βœ… `.env.example` - Environment variables template - βœ… `.gitignore` - Git ignore rules ## πŸ“¦ Package Details ```json { "name": "@narasimhaponnada/mermaid-mcp-connector", "version": "1.0.0", "description": "Universal connector for Mermaid MCP Server", "main": "dist/index.js", "bin": { "mermaid-connector": "./dist/cli.js" } } ``` ## πŸš€ How to Use ### Install ```bash npm install -g @narasimhaponnada/mermaid-mcp-connector ``` ### Start REST API (for ChatGPT) ```bash mermaid-connector rest # Server: http://localhost:3000 # OpenAPI: http://localhost:3000/openapi.json ``` ### Start WebSocket (for real-time apps) ```bash mermaid-connector websocket # Server: ws://localhost:3001 ``` ### Use SDK in Your App ```typescript import { MermaidMCPConnector } from '@narasimhaponnada/mermaid-mcp-connector'; const connector = new MermaidMCPConnector(); await connector.connect(); const result = await connector.generateDiagram({ description: 'Create a flowchart for user login' }); console.log(result); await connector.disconnect(); ``` ### CLI Commands ```bash # Test connection mermaid-connector test # Generate diagram mermaid-connector generate "Create a sequence diagram" # List types mermaid-connector types # List templates mermaid-connector templates ``` ## 🎯 Integration Targets ### βœ… GitHub Copilot - Via VS Code extension using the SDK - Direct MCP integration via settings.json - Custom commands and code generation ### βœ… ChatGPT - Via REST API as a ChatGPT plugin - OpenAPI spec provided - Plugin manifest auto-served - Local development and production deployment supported ### βœ… Claude - Native MCP support (direct server connection) - No connector needed, but SDK available if wanted ### βœ… Custom AI Assistants - SDK for programmatic integration - REST API for HTTP-based integration - WebSocket for real-time integration ### βœ… Web Applications - REST API endpoints for frontend integration - CORS enabled - React/Vue/Angular compatible ### βœ… Chat Bots - Slack bot integration example - Discord bot integration example - Any chat platform via REST/WebSocket ## πŸ“Š Architecture ``` β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ AI Assistants & Applications β”‚ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ β”‚ Copilot β”‚ ChatGPT β”‚ Claude β”‚ Custom β”‚ β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β” β”‚ Mermaid MCP Connector β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β”‚ SDK β”‚ β”‚REST API β”‚ β”‚ WebSocket β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ MCP Protocol β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Mermaid MCP Server β”‚ β”‚ (Diagram Generation & Templates) β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ ``` ## πŸ”§ Technical Stack - **Language:** TypeScript 5.7.2 - **Runtime:** Node.js 18+ - **Framework:** Express.js (REST API) - **WebSocket:** ws library - **MCP SDK:** @modelcontextprotocol/sdk ^1.0.4 - **Build Tool:** TypeScript Compiler - **Package Manager:** npm ## πŸ“ Dependencies ### Production Dependencies ```json { "@modelcontextprotocol/sdk": "^1.0.4", "express": "^4.18.2", "cors": "^2.8.5", "ws": "^8.14.2", "dotenv": "^16.3.1" } ``` ### Dev Dependencies ```json { "@types/node": "^20.10.0", "@types/express": "^4.17.21", "@types/cors": "^2.8.17", "@types/ws": "^8.5.10", "typescript": "^5.7.2" } ``` ## πŸŽ‰ Benefits ### For Developers - βœ… **Easy Integration** - One package, multiple integration methods - βœ… **Type Safety** - Full TypeScript support - βœ… **Well Documented** - Comprehensive guides and examples - βœ… **Flexible** - Use SDK, REST API, or WebSocket as needed - βœ… **Production Ready** - Error handling, logging, graceful shutdown ### For AI Assistants - βœ… **OpenAPI Spec** - Standard REST API documentation - βœ… **ChatGPT Plugin** - Automatic manifest generation - βœ… **MCP Native** - Works with any MCP-compatible client - βœ… **Real-time** - WebSocket for live interactions ### For End Users - βœ… **Seamless** - Works with their favorite AI tools - βœ… **Fast** - Efficient communication protocols - βœ… **Reliable** - Robust error handling - βœ… **Powerful** - Full access to Mermaid MCP features ## πŸ“ˆ Next Steps ### Publishing to NPM 1. Update version in package.json 2. Run `npm run build` 3. Run `npm publish --access public` ### Testing 1. Run examples: `node examples/basic-usage.js` 2. Test REST API: `node examples/rest-api-client.js` 3. Test WebSocket: `node examples/websocket-client.js` ### Documentation - Add more integration examples - Create video tutorials - Write blog posts - Update main README ### Features to Add - Authentication/API keys - Rate limiting - Caching layer - Health monitoring - Metrics collection - Admin dashboard ## πŸ”— Links - **Main Project:** https://github.com/Narasimhaponnada/mermaid-mcp - **MCP Server:** @narasimhaponnada/mermaid-mcp-server - **Connector:** @narasimhaponnada/mermaid-mcp-connector - **Documentation:** See README.md and INTEGRATION_GUIDE.md ## πŸ“ž Support - **GitHub Issues:** https://github.com/Narasimhaponnada/mermaid-mcp/issues - **Email:** narasimha.ponnada@hotmail.com - **Discussions:** https://github.com/Narasimhaponnada/mermaid-mcp/discussions --- **Status:** βœ… Ready for Testing and NPM Publishing **Date:** November 3, 2025 **Version:** 1.0.0

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Narasimhaponnada/mcp-mermiad'

If you have feedback or need assistance with the MCP directory API, please join our Discord server