uml-diagram

Provides MCP-based UML generation from C++ sources and content for PlantUML diagrams.
  • python

0

GitHub Stars

python

Language

7 months ago

First Indexed

3 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs

You have a Model Context Protocol (MCP) server that analyzes C++ source and header files to extract class definitions, inheritance, and member details, then outputs clean PlantUML diagrams. This enables you to visualize your C++ codebase structure, relationships, and member visibility in a single, shareable diagram.

How to use

Use the MCP server either over HTTP or in stdio mode to generate UML diagrams from your C++ code. You can process an entire project directory to produce a PlantUML diagram, or supply file contents directly to generate diagrams from snippets. The server returns PlantUML text that you can render with PlantUML tools.

How to install

# Prerequisites
- Python 3.10 or higher
- Git

# Clone the project
git clone https://github.com/hydavinci/uml-diagram.git
cd uml-diagram

# Install Python dependencies
pip install -r requirements.txt
# or if you use uv tooling
uv sync

# Optional: build docker image
docker build -t uml-diagram-mcp .
# Docker deployment examples
# Run as HTTP server (default port 8081)
docker run -p 8081:8081 -e TRANSPORT=http uml-diagram-mcp

# Run as stdio server
docker run -e TRANSPORT=stdio uml-diagram-mcp

Configuration and usage notes

You can run the MCP server in two transports. HTTP mode serves requests over a network, while stdio mode communicates through standard input/output with a client.

# HTTP mode (default)
export TRANSPORT=http
python src/server.py
# Access: http://localhost:8081

# Stdio mode
export TRANSPORT=stdio
python src/server.py

Additional details

The server exposes two MCP endpoints for UML generation from C++ code. You can generate UML from a directory or from explicit file contents. When running in HTTP mode, you can connect with an MCP client to request diagrams for a given path. In stdio mode, you interact with the server through a local process, sending requests and receiving PlantUML diagrams as strings.

@startuml
class Animal {
    + virtual makeSound() = 0
    + virtual ~Animal() = default
    # std::string name_
    - int age_
}

class Dog {
    + makeSound() override
    + bark()
    - std::string breed_
    - bool isTrained_
}

Animal <|-- Dog
@enduml

If you provide a directory, the server returns a PlantUML diagram for all detected C++ classes and their relationships. If you provide file contents, the server analyzes the supplied code snippets and returns the corresponding diagram.


## Available tools

### generate\_cpp\_uml

Directory-based UML generation that analyzes a given path containing C++ files and returns a PlantUML diagram as a string.

### generate\_cpp\_uml\_from\_content

Content-based UML generation that accepts a dictionary mapping file names to contents and returns a PlantUML diagram as a string.
Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational