UML-MCP logo

UML-MCP

by antoinebou12

UML-MCP is a diagram generation server that implements the Model Context Protocol (MCP), enabling seamless diagram creation directly from AI assistants and other applications. It supports various diagram types, including UML, Mermaid, and D2.

View on GitHub

Last updated: N/A

What is UML-MCP?

UML-MCP is a diagram generation server that provides UML diagram generation capabilities through various diagram rendering engines. It implements the Model Context Protocol (MCP) for easy integration with AI tools.

How to use UML-MCP?

To use UML-MCP, you need to install the server, configure it with your desired diagram rendering services (like PlantUML or Kroki), and then interact with it through the MCP protocol. You can use the provided tools to generate specific diagram types by providing the diagram code and output directory.

Key features of UML-MCP

  • Multiple Diagram Types: Supports UML, Mermaid, D2, Graphviz, ERD, and more.

  • MCP Integration: Seamlessly integrates with LLM assistants supporting the Model Context Protocol.

  • Multiple Output Formats: Supports SVG, PNG, PDF, and other format options.

  • Easy Configuration: Works with local and remote diagram rendering services.

Use cases of UML-MCP

  • Generating UML diagrams for software design documentation.

  • Creating sequence diagrams to visualize interactions between objects.

  • Generating activity diagrams to model business processes.

  • Integrating diagram generation into AI assistants for automated documentation.

FAQ from UML-MCP

What diagram types are supported?

UML-MCP supports a wide range of diagram types, including UML (Class, Sequence, Activity, etc.), Mermaid, D2, Graphviz, ERD, BlockDiag, BPMN, and C4 with PlantUML.

How do I configure the server to use a local PlantUML or Kroki server?

You can configure the server to use local PlantUML or Kroki servers by setting the USE_LOCAL_PLANTUML and USE_LOCAL_KROKI environment variables to true and providing the correct URLs for PLANTUML_SERVER and KROKI_SERVER.

How do I integrate UML-MCP with Cursor?

You can integrate UML-MCP with Cursor by adding a configuration entry to Cursor's settings, specifying the command to run the mcp_server.py script.

What are the available tools?

The server implements multiple diagram generation tools such as generate_uml, generate_class_diagram, generate_sequence_diagram, generate_mermaid_diagram, and more. You can list the available tools by running the server with the --list-tools option.

Where are the generated diagrams saved?

By default, generated diagrams are saved in the ./output directory. You can change this by setting the MCP_OUTPUT_DIR environment variable.