StarUML MCP Server
OfficialThis server lets AI assistants work with StarUML by generating diagrams from Mermaid code and reading diagram information and images from the open project.
generate_diagram: Create a diagram in StarUML from Mermaid code (classDiagram, sequenceDiagram, flowchart, erDiagram, mindmap, requirementDiagram, stateDiagram).get_all_diagrams_info: List the ID, type, name and description of every diagram in the project.get_current_diagram_info: Get the ID, type, name and description of the diagram currently open in the editor.get_diagram_image_by_id: Retrieve a PNG image of a specific diagram by its ID so the AI can see it.
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 Server Create a UML class diagram for an online bookstore"
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 Server
StarUML is a sophisticated modeler for agile and concise modeling. StarUML MCP Server is a Model Context Protocol server that lets AI assistants such as Claude work with StarUML: create diagrams from prompts, read the diagrams in the current project, see diagram images, and query or modify models with scripts (e.g. generate code from diagrams).
How It Works
StarUML runs a local API server (http://127.0.0.1:58321 by default). StarUML MCP Server is a small Node.js program that the AI client runs over stdio, and it translates each MCP tool call to a request to the StarUML API server.
AI client (Claude Desktop, Claude Code, ...) ──stdio──▶ StarUML MCP Server ──HTTP──▶ StarUML (API server)StarUML must be running with a project open while you use the tools.
Related MCP server: PlantUML MCP Server
Requirements
Use the version of StarUML MCP Server matching your StarUML:
StarUML | StarUML MCP Server |
|
|
|
|
Setup
Claude Desktop
Add the server to claude_desktop_config.json (Settings > Developer > Edit Config) and restart Claude Desktop:
{
"mcpServers": {
"staruml-mcp-server": {
"command": "npx",
"args": ["-y", "staruml-mcp-server"]
}
}
}For StarUML v7, use staruml-mcp-server@0.1.0 instead of staruml-mcp-server.
Claude Code
claude mcp add staruml -- npx -y staruml-mcp-serverOther MCP Clients
Any MCP client that supports stdio servers can run the server with the command npx -y staruml-mcp-server.
Options
--api-port=<port>: Port of the StarUML API server (default:58321). Use it when you change the port in StarUML.
{
"mcpServers": {
"staruml-mcp-server": {
"command": "npx",
"args": ["-y", "staruml-mcp-server", "--api-port=60000"]
}
}
}StarUML Settings
In StarUML v8.1.0 or higher, the API server is configured in Preferences > API Server (restart StarUML after changing them):
Run on Start: Run the API server when StarUML starts (default: on).
Port: Port number of the API server (default:
58321). If you change it, pass the same port with--api-port.
The API server listens on the loopback address (127.0.0.1) only, so it cannot be reached from other machines.
API Access
With StarUML v8, when the MCP server calls StarUML for the first time, StarUML asks you to allow API access for "StarUML MCP Server". Click Allow to continue. The access is kept until StarUML is restarted, and StarUML asks again after a restart (the MCP server requests a new access automatically).
StarUML v7 does not ask for API access.
Tools
Tool | Description |
| Generate a diagram from Mermaid code. Supported diagrams: |
| Get the ID, type, name and description of all diagrams in the project. |
| Get the ID, type, name and description of the diagram currently open in the editor. |
| Get a PNG image of a diagram by its ID (from |
| Execute JavaScript code with the Scripting API in StarUML and get the result of the evaluation and the console outputs (StarUML |
execute_script
The code runs in the same environment as the Script Console of StarUML (QuickJS):
Globals:
app(app.repository,app.project,app.engine,app.factory,app.commands,app.selections,app.diagrams,app.dialogs,app.toast,app.preferences,app.metamodels, ...),type(element classes such astype.UMLClass) andconsole.The value of the last expression is returned as text. Console outputs (
console.log, ...) are returned too.Global variables are kept between executions.
Top-level
await,require(), timers, Node.js APIs and file access are not available.Changes made with
app.engine,app.factoryor anOperationBuildercan be undone in StarUML (Edit > Undo).
For example:
// names of all classes
app.repository.select("@UMLClass").map((c) => c.name);
// add a `createdAt` attribute to all classes
app.repository.select("@UMLClass").forEach((c) => {
app.factory.createModel({
id: "UMLAttribute",
parent: c,
field: "attributes",
modelInitializer: (a) => {
a.name = "createdAt";
a.type = "Date";
},
});
});Since scripts can change your models, review what the AI is going to run when your client asks for approval of the tool call.
Example Prompts
"Create a class diagram for book store in StarUML"
"Create a sequence diagram for OAuth authentication in StarUML"
"Explain the current diagram in StarUML"
"Review the class diagrams in StarUML and suggest improvements"
"Generate SQL DDL from the current ERD diagram in StarUML"
"Generate TypeScript interfaces from the classes in StarUML"
"Add a
createdAtattribute to all classes in StarUML""Find classes without documentation in StarUML"
Troubleshooting
Connection refused (
ECONNREFUSED): StarUML is not running, or the API server is off or uses another port. Check Preferences > API Server in StarUML and the--api-portoption.401 errors with StarUML
v8: An older version of StarUML MCP Server may be cached by npx. Usestaruml-mcp-server@latestonce or clear~/.npm/_npx."User denied API access": You clicked Deny in the dialog of StarUML. Call the tool again and click Allow.
execute_scriptfails:execute_scriptneeds StarUMLv8.1.0or higher. Update StarUML.
Dev
Clone this repository.
Install dependencies with
npm install.Build with
npm run build.Update
claude_desktop_config.jsonin Claude Desktop as below.Restart Claude Desktop.
{
"mcpServers": {
"staruml-mcp-server": {
"command": "node",
"args": ["<full-path-to>/staruml-mcp-server/build/index.js"]
}
}
}You can also test the tools with MCP Inspector by npm run inspect (after building).
Available Tools
4 toolsgenerate_diagramC
Generate a diagram in StarUML.
Inputs: code (required).
get_all_diagrams_infoA
Get information for all diagrams in StarUML.
Inputs: no named parameters.
get_current_diagram_infoA
Get information for the current diagram in StarUML.
Inputs: no named parameters.
get_diagram_image_by_idA
Get the image of a diagram by its ID in StarUML.
Inputs: diagramId (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool has a clearly distinct purpose: generating a new diagram, retrieving info for all diagrams, retrieving info for the current diagram, and retrieving an image by ID. No overlap or ambiguity.
All tool names follow a consistent verb_noun pattern with snake_case: generate_diagram, get_all_diagrams_info, get_current_diagram_info, get_diagram_image_by_id. The convention is uniform.
With 4 tools, the server is well-scoped for the StarUML domain, covering generation and information retrieval without unnecessary bloat.
The server provides generate, list, and retrieve operations for diagrams. Missing update/delete capabilities are a minor gap, but the core workflow of creating and inspecting diagrams is well-covered.
Maintenance
Related MCP Connectors
Create workflow, sequence, architecture, and mind map diagrams via AI assistants.
Generate dynamic Mermaid diagrams and charts with AI assistance. Customize styles and export diagr…
Design domain models and generate deterministic multi-stack code, driven by your coding agent.
Generate cloud architecture diagrams, flowcharts, and sequence diagrams.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables users to generate PlantUML code for UML Class and Sequence diagrams using Google Gemini AI. Supports both domain JSON input and free text descriptions to create structured UML diagrams.MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to generate UML diagrams from text descriptions using PlantUML, supporting multiple output formats (PNG, SVG, PDF), syntax validation, and diagram source extraction.10 npmMIT
- FlicenseNot gradedqualityDmaintenanceEnables AI to remotely control StarUML for generating UML diagrams (use case, class, sequence, ER, etc.) via MCP protocol or REST API.-
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to programmatically create and manage SysML diagrams in StarUML.MIT