Diagram as Code MCP Server
This is a MCP server to provide mermaid js validation tools and prompt for MCP client
Why Use This MCP Server?
This MCP server is essential for MCP clients working with Mermaid.js diagrams. Large Language Models (LLMs) might be trained with older data and outdated Mermaid.js syntax, and they may not have enough content trained to effectively fix syntax errors. This server addresses these critical limitations by providing specialized tools to assist in authoring, validating, and automatically fixing Mermaid.js syntax, ensuring diagrams are correctly formatted and functional.
Related MCP server: MCP Anthropic Server
Features
No Brackets Description: A prompt to instruct bots to avoid using brackets in descriptions.
Mermaid.js Support: A tool to assist in authoring, validating, and fixing syntax for Mermaid.js diagrams.
Setup
Clone this repository
Install Python dependencies:
Run the server:
Running Options
Default stdio mode:
python -m hkopenai.diagram_as_code_mcp_serverSSE mode (port 8000):
python -m hkopenai.diagram_as_code_mcp_server --sseServe prompt as tool:
python -m hkopenai.diagram_as_code_mcp_server --tool
Cline Integration
Cline does not support prompt from mcp server at this moment. The prompt is provided as tool:
To connect this MCP server to Cline using stdio:
Add this configuration to your Cline MCP settings (cline_mcp_settings.json):
Testing
Tests are available in tests. Run with: