Skip to main content

Diagram as Code MCP Server

GitHub Repository License: MIT

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.

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

  1. Clone this repository
  2. Install Python dependencies:
    pip install -r requirements.txt
    
  3. Run the server:
    </code></pre>
    </li>
    </ol>
    <p>python -m hkopenai.diagram_as_code_mcp_server</p>
    <pre><code>
    ### Running Options
    
    - Default stdio mode: `python -m hkopenai.diagram_as_code_mcp_server`
    - SSE mode (port 8000): `python -m hkopenai.diagram_as_code_mcp_server --sse`
    - Serve 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:
    
    1. Add this configuration to your Cline MCP settings (cline_mcp_settings.json):
    ```json
    {
    "hk-prompt-server": {
     "disabled": false,
     "timeout": 3,
     "type": "stdio",
     "command": "python",
     "args": [
       "-m",
       "hkopenai.diagram_as_code_mcp_server",
       "--tool"
     ]
    }
    }
    

    Testing

    Tests are available in tests. Run with:

    pytest
    

Release files for hkopenai.diagram-as-code-mcp-server 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hkopenai.diagram-as-code-mcp-server 0.2.1
File Size Uploaded
hkopenai_diagram_as_code_mcp_server-0.2.1.tar.gz 5.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hkopenai.diagram-as-code-mcp-server 0.2.1
File Interpreter ABI Platform
hkopenai_diagram_as_code_mcp_server-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 12.2 kB

Release files / hkopenai_diagram_as_code_mcp_server-0.2.1.tar.gz

Download URL hkopenai_diagram_as_code_mcp_server-0.2.1.tar.gz
Size 5.8 kB
Tags Source
SHA-256 checksum
How to use checksums
15ce79b5f7652b54295def4033173de6ef12ba20d5571621e8a52cfe766ac24a
BLAKE2b-256 checksum
How to use checksums
b79a0ed8255b2ab5b302ef66ef6eaa32844595ec47d3728d5952d7ca022a293b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Release files / hkopenai_diagram_as_code_mcp_server-0.2.1-py3-none-any.whl

Download URL hkopenai_diagram_as_code_mcp_server-0.2.1-py3-none-any.whl
Size 6.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a03ec4e86f227ee3f626eaa95dbac0e6e90c9bad747ad02c70820d7c523cd160
BLAKE2b-256 checksum
How to use checksums
48e4aaffed37c6fa2e31c0b27fc356a397237a9bb01ce747326adf347d8f2007
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page