A diagram generation server supporting multiple UML and other diagram types, with various output formats. It integrates with rendering services like Kroki and PlantUML.
UML-MCP is a powerful diagram generation server that implements the Model Context Protocol (MCP), enabling seamless diagram creation directly from AI assistants and other applications.
UML-MCP supports a wide variety of diagram types:
Category | Diagram Types |
---|---|
UML | Class, Sequence, Activity, Use Case, State, Component, Deployment, Object |
Other | Mermaid, D2, Graphviz, ERD, BlockDiag, BPMN, C4 with PlantUML |
git clone https://github.com/yourusername/uml-mcp.git
cd uml-mcp
pip install -r requirements.txt
pip install -r requirements-dev.txt
Start the MCP server:
python mcp_server.py
This will start the server using stdio for communication with MCP clients.
To integrate with Cursor:
python mcp/install_to_cursor.py
Or manually configure in Cursor settings:
"mcpServers": {
"UML-MCP-Server": {
"command": "python",
"args": ["/path/to/uml-mcp/mcp_server.py"],
"output_dir": "/path/to/output"
}
}
MCP_OUTPUT_DIR
- Directory to save generated diagrams (default: ./output
)KROKI_SERVER
- URL of the Kroki server (default: https://kroki.io
)PLANTUML_SERVER
- URL of the PlantUML server (default: http://plantuml-server:8080
)USE_LOCAL_KROKI
- Use local Kroki server (true/false)USE_LOCAL_PLANTUML
- Use local PlantUML server (true/false)For detailed documentation, visit the docs directory or our documentation site.
UML-MCP is built with a modular architecture:
For local development:
# PlantUML
docker run -d -p 8080:8080 plantuml/plantuml-server
# Kroki
docker run -d -p 8000:8000 yuzutech/kroki
export USE_LOCAL_PLANTUML=true
export PLANTUML_SERVER=http://localhost:8080
export USE_LOCAL_KROKI=true
export KROKI_SERVER=http://localhost:8000
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
An MCP Server that provides UML diagram generation capabilities through various diagram rendering engines.
The server provides several resources via the uml://
URI scheme:
uml://types
: List of available UML diagram typesuml://templates
: Templates for creating UML diagramsuml://examples
: Example UML diagrams for referenceuml://formats
: Supported output formats for diagramsuml://server-info
: Information about the UML-MCP serverThe server implements multiple diagram generation tools:
generate_uml
: Generate any UML diagram
diagram_type
, code
, output_dir
generate_class_diagram
: Generate UML class diagrams
code
, output_dir
generate_sequence_diagram
: Generate UML sequence diagrams
code
, output_dir
generate_activity_diagram
: Generate UML activity diagrams
code
, output_dir
generate_usecase_diagram
: Generate UML use case diagrams
code
, output_dir
generate_state_diagram
: Generate UML state diagrams
code
, output_dir
generate_component_diagram
: Generate UML component diagrams
code
, output_dir
generate_deployment_diagram
: Generate UML deployment diagrams
code
, output_dir
generate_object_diagram
: Generate UML object diagrams
code
, output_dir
generate_mermaid_diagram
: Generate diagrams using Mermaid syntax
code
, output_dir
generate_d2_diagram
: Generate diagrams using D2 syntax
code
, output_dir
generate_graphviz_diagram
: Generate diagrams using Graphviz DOT syntax
code
, output_dir
generate_erd_diagram
: Generate Entity-Relationship diagrams
code
, output_dir
The server provides prompts to help create UML diagrams:
class_diagram
: Create a UML class diagram showing classes, attributes, methods, and relationshipssequence_diagram
: Create a UML sequence diagram showing interactions between objects over timeactivity_diagram
: Create a UML activity diagram showing workflows and business processesOn MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json
On Windows: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"uml_diagram_generator": {
"command": "python",
"args": [
"/path/to/uml-mcp/mcp_server.py"
]
}
}
}
The UML-MCP Server can also be integrated with Cursor:
{
"mcpServers": {
"uml_diagram_generator": {
"command": "python",
"args": [
"/path/to/uml-mcp/mcp_server.py"
]
}
}
}
usage: mcp_server.py [-h] [--debug] [--host HOST] [--port PORT] [--transport {stdio,http}] [--list-tools]
UML-MCP Diagram Generation Server
options:
-h, --help show this help message and exit
--debug Enable debug logging
--host HOST Server host (default: 127.0.0.1)
--port PORT Server port (default: 8000)
--transport {stdio,http}
Transport protocol (default: stdio)
--list-tools List available tools and exit
LOG_LEVEL
: Set logging level (DEBUG, INFO, WARNING, ERROR, CRITICAL)UML_MCP_OUTPUT_DIR
: Directory to store generated diagram filesKROKI_SERVER
: Kroki server URL for diagram renderingPLANTUML_SERVER
: PlantUML server URL for diagram renderingLIST_TOOLS
: Set to "true" to display tools and exitresult = tool.call("generate_class_diagram", {
"code": """
@startuml
class User {
-id: int
-name: string
+login(): boolean
}
class Order {
-id: int
+addItem(item: string): void
}
User "1" -- "many" Order
@enduml
""",
"output_dir": "/path/to/output"
})
# Clone the repository
git clone https://github.com/your-username/uml-mcp.git
cd uml-mcp
# Install dependencies
pip install -r requirements.txt
# Run the server
python mcp_server.py
For debugging, you can run the server with:
python mcp_server.py --debug
Debug logs will be stored in the logs/
directory.
# Run all tests
pytest
# Run specific tests
pytest tests/test_diagram_tools.py
An AI agent for the Playwright MCP server, enabling automated web testing and interaction.
Provides LLM access to the Cucumber Studio testing platform for managing and executing tests.
A test server for local MCP development and setup.
Query and analyze your Opik logs, traces, prompts and all other telemtry data from your LLMs in natural language.
A structured development workflow for LLM-based coding, including feature clarification, planning, phased development, and progress tracking.
An intelligent tool for AI assistants to present multiple UI component designs for user selection.
Evaluates product designs against Dieter Rams' 10 principles of good design.
Official MCP server for Sentry.
Interact with various build systems including Gradle, Maven, NPM/Yarn, Cargo, Python, Makefile, and CMake.
Parses HAR (HTTP Archive) files and displays requests in a simplified format for AI assistants.