Staruml Mcp

io.github.ezrabrilliant由 GitHub 账号 ezrabrilliant 发布v0.2.0更新于 Oct 24, 2026

MCP server for StarUML — generate UML diagrams from AI agents via stdio or HTTP.

已验证STDIO仅桌面开发者工具媒体与设计

概览

AI 生成的概览

一个本地 MCP 服务器,让 AI 助手驱动 StarUML:从 Mermaid 生成 UML 图、查看和导出图表,并管理项目元素。

可以做什么
从 Mermaid 代码生成 UML 图,列出或查看当前项目中的图表,包括当前聚焦图表的元数据,并按 ID 将图表导出为 PNG。安装配套 StarUML 扩展后,可列出并执行 StarUML 内置命令,以及新建、打开、保存和另存项目。按 ID 或搜索查询模型元素,并创建、更新或删除元素。创建原生类型图表、切换图表和关闭图表。
适用场景
适合希望助手直接在 StarUML 中构建或编辑 UML 模型的场景,例如把描述转成 ER 图或时序图、导出图表图片,或用脚本修改 StarUML 项目和元素。
运行要求
以 npm 包形式通过 npx 在本地运行,运行助手的机器需要 Node.js 20+。需要 StarUML v7.0.0+ 正在运行,并在 settings.json 中启用 API 服务器(端口 58321)。完整的 19 个工具需要在 StarUML 内安装 staruml-mcp-extension 插件。默认使用 stdio,HTTP 模式监听端口 58323。
安装前请注意
创建、更新、删除元素以及保存、另存、打开或新建项目的工具会改动 StarUML 项目文件,批准前请确认操作。扩展需从外部仓库安装到 StarUML 内。服务器通过本地 HTTP 端口与 StarUML 通信,这些端口必须可访问。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Staruml Mcp,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

staruml-mcp

[npm version] [npm downloads] [CI] [license] [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)
PackageWhat it isWhere it runs
staruml-mcp (this repo)MCP server for AI agentsyour machine via npx -y staruml-mcp
staruml-mcp-extensionStarUML plugin adding 15 HTTP endpointsinside StarUML (install once via Extension Manager)
  • Using only Mermaid-based diagram tools? Install staruml-mcp only. The 4 built-in tools work.
  • Want the full 19 tools (project save/open, element CRUD, execute any StarUML command)? Install both.

Prerequisites

  • StarUML v7.0.0+ with API Server enabled (see below)
  • Node.js 20+ on the machine running the AI agent
  • (Optional) staruml-mcp-extension installed in StarUML — required for 15 of the 19 tools

Enable StarUML API Server

Edit settings.json at:

  • Windows: %APPDATA%\StarUML\settings.json
  • macOS: ~/Library/Application Support/StarUML/settings.json
  • Linux: ~/.config/StarUML/settings.json

Add or update:

json
{  "apiServer": true,  "apiServerPort": 58321}

Restart StarUML.

Verify:

bash
curl http://localhost:58321/# → "Hello from StarUML API Server!"

Install & Use

Claude Code (recommended — HTTP transport)

Start the server in a terminal:

bash
npx -y staruml-mcp --transport http# listens on http://localhost:58323/mcp by default

Register with Claude Code:

bash
claude mcp add --transport http staruml http://localhost:58323/mcp

Port 58323 is the canonical HTTP port, chosen to sit alongside StarUML's built-in API (58321) and staruml-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):

json
{  "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 help

Tools Exposed

Built-in (always available, port 58321)

ToolDescription
generate_diagramGenerate a UML diagram from Mermaid code.
get_all_diagrams_infoList all diagrams in the current project (id, name, type).
get_current_diagram_infoGet metadata of the currently focused diagram.
get_diagram_image_by_idExport a diagram as PNG by its ID.

Extension tools (require staruml-mcp-extension, port 58322)

ToolDescription
get_all_commandsList all 138+ built-in StarUML command IDs.
execute_commandExecute any built-in command (e.g. project:save, view:fit-to-window).
get_project_infoCurrent project's filename + top-level elements.
save_project / save_project_as / new_project / open_projectProject file lifecycle.
get_element_by_id / find_elementsQuery model elements.
create_element / update_element / delete_elementElement CRUD.
create_diagram (typed native) / switch_diagram / close_diagramDiagram 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 xyz123 as an image."

Development

bash
git clone https://github.com/ezrabrilliant/staruml-mcp.gitcd staruml-mcpnpm installnpm run dev          # tsx watch on src/npm run build        # bundle to dist/npm test             # vitestnpm run typecheck    # tsc --noEmit

Architecture

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

来源:README.md,提交 3a58d81

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.2.0最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分