SS

staruml/staruml-mcp-server

开发工具官方

本页由 AI 翻译,技术细节请以原文为准。 查看原文

27 stars 10 forks 质量 80 趋势 14MIT

StarUML 是一款用于敏捷简洁建模的复杂建模工具。允许您通过提示创建图表或从图表生成代码。

概览

StarUML 是一款用于敏捷简洁建模的复杂建模工具。允许您通过提示创建图表或从图表生成代码。 - StarUML v7.0.0及以上版本- Node.js v22或更高版本 在 Claude Desktop 中设置claude_desktop_config.json如下: 你可以用 --api-port= 选项更改 StarUML 的 API 服务器端口。 - “在 StarUML 中为书店创建类图”- “在 StarUML 中创建 OAuth 认证的序列图”- “从当前 ERD 图在 StarUML 中生成 SQL DDL” - generate_diagram - get_current_diagram_info - get_all_diagrams_info - get_diagram_image_by_id 1. 克隆此仓库。2. 使用npm运行构建构建。3. 在Claude Desktop中更新claude_desktop_config.json,如下。4. 重启Claude Desktop。

概述(AI 翻译)

StarUML 是一款用于敏捷且简洁建模的复杂建模工具。StarUML MCP 服务器 允许您通过提示创建图表或从图表生成代码。

布置

前提条件:

  • StarUML v7.0.0 或更高
  • Node.js v22 或更高

在 Claude Desktop 中设置 claude_desktop_config.json 如下:

你可以用 --api-port= 选项更改 StarUML 的 API 服务器端口。

示例提示

  • “在StarUML中为书店创建类图”
  • “在StarUML中创建OAuth认证的序列图”
  • “从StarUML中的当前ERD图生成SQL DDL”

工具

  • generate_diagram
  • get_current_diagram_info
  • get_all_diagrams_info
  • get_diagram_image_by_id

德夫

  1. 克隆这个仓库。
  2. 用npm run build构建。
  3. 在 Claude Desktop 中更新 claude_desktop_config.json,如下所示。
  4. 重启 Claude Desktop。

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

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.

Requirements

  • StarUML v7.0.0 or higher (v8.1.0 or higher for execute_script)
  • Node.js v22 or higher

Use the version of StarUML MCP Server matching your StarUML:

StarUML StarUML MCP Server
v8 0.3.x (latest)
v7 0.1.0

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 [email protected] instead of staruml-mcp-server.

Claude Code

claude mcp add staruml -- npx -y staruml-mcp-server

Other 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 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

在 GitHub 查看完整 README

安装

npx -y staruml-mcp-server
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "staruml-mcp-server": { "command": "npx", "args": ["-y", "staruml-mcp-server"] } } }