staruml-mcp
Allows generating UML diagrams from Mermaid code in StarUML.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@staruml-mcp Generate a class diagram for a User model with fields id, name, email"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
staruml-mcp
Model Context Protocol (MCP) server for StarUML. Lets AI agents (Claude Code, Cursor, VS Code Copilot, Codex) drive StarUML programmatically — generate UML diagrams from Mermaid, execute any built-in command, CRUD elements, save projects, and more.
How it fits together
AI Agent ──MCP──► staruml-mcp (this package) ──HTTP──► StarUML
:58321 (built-in, 4 tools)
:58322 (extension, 15 tools)Package | What it is | Where it runs |
| MCP server for AI agents | your machine via |
StarUML plugin adding 15 HTTP endpoints | inside StarUML (install once via Extension Manager) |
Using only Mermaid-based diagram tools? Install
staruml-mcponly. The 4 built-in tools work.Want the full 19 tools (project save/open, element CRUD, execute any StarUML command)? Install both.
Related MCP server: Figma MCP Write Bridge
Prerequisites
StarUML v7.0.0+ with API Server enabled (see below)
Node.js 20+ on the machine running the AI agent
(Optional)
staruml-mcp-extensioninstalled in StarUML — required for 15 of the 19 tools
Enable StarUML API Server
Edit settings.json at:
Windows:
%APPDATA%\StarUML\settings.jsonmacOS:
~/Library/Application Support/StarUML/settings.jsonLinux:
~/.config/StarUML/settings.json
Add or update:
{
"apiServer": true,
"apiServerPort": 58321
}Restart StarUML.
Verify:
curl http://localhost:58321/
# → "Hello from StarUML API Server!"Install & Use
Claude Code (recommended — HTTP transport)
Start the server in a terminal:
npx -y staruml-mcp --transport http
# listens on http://localhost:58323/mcp by defaultRegister with Claude Code:
claude mcp add --transport http staruml http://localhost:58323/mcpPort
58323is the canonical HTTP port, chosen to sit alongside StarUML's built-in API (58321) andstaruml-mcp-extension(58322). Override with--port <n>if needed.
Restart Claude Code. Ask:
"What StarUML tools do you have?"
Claude Desktop (stdio transport)
Edit %APPDATA%\Claude\claude_desktop_config.json (Windows) or ~/Library/Application Support/Claude/claude_desktop_config.json (macOS):
{
"mcpServers": {
"staruml": {
"command": "npx",
"args": ["-y", "staruml-mcp"]
}
}
}Restart Claude Desktop.
Cursor / VS Code Copilot / Codex CLI
Point your MCP client at npx -y staruml-mcp (stdio) or http://localhost:58323/mcp (HTTP).
CLI
staruml-mcp [options]
-t, --transport <type> stdio | http (default: stdio)
-p, --port <number> HTTP listen port (default: 58323)
--api-port <number> StarUML built-in API port (default: 58321)
--ext-port <number> staruml-mcp-extension port(default: 58322)
--api-host <url> StarUML API host prefix (default: http://localhost)
-V, --version Print version
-h, --help Show helpTools Exposed
Built-in (always available, port 58321)
Tool | Description |
| Generate a UML diagram from Mermaid code. |
| List all diagrams in the current project (id, name, type). |
| Get metadata of the currently focused diagram. |
| Export a diagram as PNG by its ID. |
Extension tools (require staruml-mcp-extension, port 58322)
Tool | Description |
| List all 138+ built-in StarUML command IDs. |
| Execute any built-in command (e.g. |
| Current project's filename + top-level elements. |
| Project file lifecycle. |
| Query model elements. |
| Element CRUD. |
| Diagram management. |
To enable extension tools: install staruml-mcp-extension in StarUML (Tools → Extension Manager → Install From URL → https://github.com/ezrabrilliant/staruml-mcp-extension).
Example Prompts
"Create an ER diagram in StarUML for a POS database: users, menus, transactions with relationships."
"Generate a sequence diagram for JWT login: frontend → /api/auth/login → AuthService → DB → JWT response."
"Show me the current diagram in StarUML."
"Export diagram with ID
xyz123as an image."
Development
git clone https://github.com/ezrabrilliant/staruml-mcp.git
cd staruml-mcp
npm install
npm run dev # tsx watch on src/
npm run build # bundle to dist/
npm test # vitest
npm run typecheck # tsc --noEmitArchitecture
AI Agent (Claude Code / Cursor / VS Code / …)
│
│ MCP (stdio or Streamable HTTP)
▼
staruml-mcp (this package)
│
│ HTTP JSON-RPC
▼
StarUML API Server (port 58321)
│
▼
StarUML Application (v7+)Acknowledgments
Inspired by staruml/staruml-mcp-server (official stdio-only server by Minkyu Lee, StarUML creator). This project reimplements it with multi-transport support and strict TypeScript.
License
MIT © Ezra Brilliant Konterliem
Available Tools
21 toolsclose_diagramB
Close a diagram tab by its ID. Requires staruml-mcp-extension to be installed in StarUML. Install from https://github.com/ezrabrilliant/staruml-mcp-extension
Inputs: id (required).
create_diagramA
Create a typed UML diagram. The 'type' is a metamodel class name (e.g. 'UMLClassDiagram', 'UMLUseCaseDiagram', 'UMLSequenceDiagram', 'UMLActivityDiagram', 'ERDDiagram'). Unlike generate_diagram (Mermaid), this gives a native empty diagram you can populate via create_element. Requires staruml-mcp-extension to be installed in StarUML. Install from https://github.com/ezrabrilliant/staruml-mcp-extension
Inputs: type (required), parentId (required), name.
create_edge_with_viewA
Connect two existing Views on a diagram with a typed relationship edge. Edge types: 'UMLAssociation' (use case), 'UMLControlFlow' (activity), 'UMLMessage' (sequence), 'UMLGeneralization', 'UMLDependency'. tailViewId is the source, headViewId is the target. Use view IDs from create_element_with_view results. Requires staruml-mcp-extension to be installed in StarUML. Install from https://github.com/ezrabrilliant/staruml-mcp-extension
Inputs: type (required), parentId (required), diagramId (required), headViewId (required), +6 more.
create_elementA
Create a new UML model element (MODEL ONLY — not placed on any diagram canvas). For native typed diagrams (Use Case, Activity, Class), use create_element_with_view instead so shapes appear in the diagram. The 'type' is a metamodel class name. Requires staruml-mcp-extension to be installed in StarUML. Install from https://github.com/ezrabrilliant/staruml-mcp-extension
Inputs: type (required), parentId (required), name.
create_element_with_viewB
Create a model element AND its visual View on a diagram in one call. Use for populating native typed diagrams (UMLUseCaseDiagram, UMLActivityDiagram, UMLClassDiagram, etc.). Type examples: 'UMLActor', 'UMLUseCase', 'UMLAction', 'UMLInitialNode', 'UMLFinalNode', 'UMLDecisionNode', 'UMLClass', 'UMLComponent', 'UMLNode'. Returns view._id (for edge connections) and model._id. Requires staruml-mcp-extension to be installed in StarUML. Install from https://github.com/ezrabrilliant/staruml-mcp-extension
Inputs: type (required), parentId (required), diagramId (required), x, +4 more.
delete_elementB
Delete an element from the project. Requires staruml-mcp-extension to be installed in StarUML. Install from https://github.com/ezrabrilliant/staruml-mcp-extension
Inputs: id (required).
execute_commandA
Execute any built-in StarUML command by its ID. Use get_all_commands to discover available IDs. Requires staruml-mcp-extension to be installed in StarUML. Install from https://github.com/ezrabrilliant/staruml-mcp-extension
Inputs: id (required), args.
find_elementsA
Find elements by metamodel type and/or name. Examples: type='UMLClass', name='User'. Omit both to return all. Requires staruml-mcp-extension to be installed in StarUML. Install from https://github.com/ezrabrilliant/staruml-mcp-extension
Inputs: name, type.
generate_diagramA
Generate a UML diagram in StarUML from Mermaid code. Supported Mermaid diagram types: classDiagram, sequenceDiagram, flowchart, erDiagram, mindmap, requirementDiagram, stateDiagram. StarUML must be running with apiServer enabled.
Inputs: code (required).
get_all_commandsA
List all registered StarUML command IDs (e.g. 'project:save', 'view:fit-to-window', 'alignment:align-left'). Useful to discover what execute_command can trigger. Requires staruml-mcp-extension to be installed in StarUML. Install from https://github.com/ezrabrilliant/staruml-mcp-extension
Inputs: no named parameters.
get_all_diagrams_infoA
Get metadata (id, name, type) for all diagrams in the currently open StarUML project.
Inputs: no named parameters.
get_current_diagram_infoA
Get metadata for the currently active (focused) diagram in StarUML.
Inputs: no named parameters.
get_diagram_image_by_idA
Retrieve a PNG image of a diagram by its ID. Use get_all_diagrams_info first to obtain IDs.
Inputs: diagramId (required).
get_element_by_idA
Retrieve a model element by its internal ID. Requires staruml-mcp-extension to be installed in StarUML. Install from https://github.com/ezrabrilliant/staruml-mcp-extension
Inputs: id (required).
get_project_infoA
Get the current StarUML project's filename and top-level element summary. Requires staruml-mcp-extension to be installed in StarUML. Install from https://github.com/ezrabrilliant/staruml-mcp-extension
Inputs: no named parameters.
new_projectA
Create a new empty StarUML project (discards unsaved changes in current project). Requires staruml-mcp-extension to be installed in StarUML. Install from https://github.com/ezrabrilliant/staruml-mcp-extension
Inputs: no named parameters.
open_projectB
Open a StarUML project file (.mdj). Requires staruml-mcp-extension to be installed in StarUML. Install from https://github.com/ezrabrilliant/staruml-mcp-extension
Inputs: filename (required).
save_projectA
Save the current StarUML project. If filename is given, saves to that path. Otherwise saves to current path. Requires staruml-mcp-extension to be installed in StarUML. Install from https://github.com/ezrabrilliant/staruml-mcp-extension
Inputs: filename.
save_project_asA
Save the current StarUML project to a new path. Requires staruml-mcp-extension to be installed in StarUML. Install from https://github.com/ezrabrilliant/staruml-mcp-extension
Inputs: filename (required).
switch_diagramA
Focus (open tab) a diagram by its ID. Requires staruml-mcp-extension to be installed in StarUML. Install from https://github.com/ezrabrilliant/staruml-mcp-extension
Inputs: id (required).
update_elementB
Set a property on an existing element. Requires staruml-mcp-extension to be installed in StarUML. Install from https://github.com/ezrabrilliant/staruml-mcp-extension
Inputs: id (required), field (required), value.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 21 tools
Most tools have distinct purposes, but create_element and create_element_with_view could be confused; however, descriptions clarify the difference. Overall, only a minor overlap.
All tools follow a consistent verb_noun snake_case pattern (e.g., get_project_info, create_element, save_project). Only generate_diagram deviates slightly from create_diagram, but both are verbs.
21 tools is well-scoped for a UML modeling server, covering project, diagram, element, edge, and command operations without being excessive.
The surface covers project management, element CRUD, diagram creation (native and Mermaid), edge creation, and image retrieval. Minor gaps like diagram deletion are missing, but core workflows are present.
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
A Model Context Protocol server for Wix AI tools
Model Context Protocol server for Studex tools, notifications, and profile integrations
Model Context Protocol server for the Apideck Unified API. Connect any MCP-compatible agent framework to 100+ accounting systems, HRIS platforms, file storage providers, and more through one integration. More information https://www.apideck.com/mcp-server
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI to remotely control StarUML for generating UML diagrams (use case, class, sequence, ER, etc.) via MCP protocol or REST API.-
- AlicenseBqualityDmaintenanceA Model Context Protocol server that enables AI agents to programmatically create, modify, and manage Figma documents via a WebSocket bridge and Figma plugin.116MIT
- AlicenseNot gradedqualityDmaintenanceModel Context Protocol server that standardizes tool discovery, execution, and context management for AI applications.MIT
- AlicenseNot gradedqualityBmaintenanceAn MCP server for AI assistants to programmatically create and manage Entity-Relationship Diagrams in StarUML, including full CRUD operations and PostgreSQL DDL generation.MIT