BPMN图管理MCP服务器

一款面向StarUML的MCP服务器,支持AI助手以编程方式创建、管理和导出BPMN图,用于业务流程建模与自动化。

  • by pontasan
  • HTML
  • 本地部署
  • 1 星标
  • 更新于
在 GitHub 查看 pontasan/staruml-controller-bpmn-mcp

使用说明

StarUML Controller MCP Server — BPMN Diagram

An MCP (Model Context Protocol) server specialized for BPMN Diagrams. Enables AI assistants like Claude to programmatically create and manage BPMN diagrams — participants, lanes, tasks, sub-processes, events, gateways, data objects, conversations, choreographies, and all flow types in StarUML.

Example: An EC Order Processing diagram created entirely via MCP tools — featuring 3 pools, 3 lanes, 9 task types, 5 event types, 5 gateway types, sub-processes, data objects, choreographies, conversations, and cross-pool message flows.

Architecture

Prerequisites

Upgrading from 1.x: version 2 needs the staruml-controller extension 2.x, which requires a password. Update the extension, staruml-controller-mcp-core and this package together. Pull and rebuild staruml-controller-mcp-core first, then this package.

Setup

1. Clone and build the core package

git clone https://github.com/pontasan/staruml-controller-mcp-core.git
cd staruml-controller-mcp-core
npm install && npm run build
cd ..

2. Clone and build this package

git clone https://github.com/pontasan/staruml-controller-bpmn-mcp.git
cd staruml-controller-bpmn-mcp
npm install && npm run build

3. Start the StarUML Controller Server

  1. Launch StarUML and open a project (or create a new one)
  2. From the menu bar, select Tools > StarUML Controller > Start Server...
  3. A dialog asks for the port (default: 12345) and the password. A random UUID is filled in as the password automatically; keep it, press Regenerate for a new one, or type your own. Click Start Server
  4. The HTTP server starts and the password is copied to the clipboard, so you can paste it into the MCP server setting (STARUML_PASSWORD). The password is remembered for the next start. To copy it again or to change it, stop the server and open Start Server... again: the dialog shows the password with Copy and Regenerate buttons
  5. All BPMN Diagram tools become available via MCP

4. Configure your AI assistant

Claude Code — add to your project's .mcp.json:

{
  "mcpServers": {
    "staruml-bpmn": {
      "command": "node",
      "args": ["/absolute/path/to/staruml-controller-bpmn-mcp/dist/index.js"],
      "env": { "STARUML_PASSWORD": "<password>" }
    }
  }
}

Or via CLI:

claude mcp add staruml-bpmn -e STARUML_PASSWORD=<password> -- node /absolute/path/to/staruml-controller-bpmn-mcp/dist/index.js

Claude Desktop — add to your config file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "staruml-bpmn": {
      "command": "node",
      "args": ["/absolute/path/to/staruml-controller-bpmn-mcp/dist/index.js"],
      "env": { "STARUML_PASSWORD": "<password>" }
    }
  }
}
  1. Restart your AI assistant.

Available Tools

All tools accept optional host and port parameters. Their defaults come from environment variables of the MCP server:

Variable Required Description
STARUML_PASSWORD Yes The password entered when the StarUML Controller server was started
STARUML_HOST No Host of the machine running StarUML (default: localhost)
STARUML_PORT No Port of the StarUML Controller server (default: 12345)

The password is never a tool parameter, so it does not pass through the AI conversation.

File paths: tools that write or read files (diagram_export, project_export, project_export_all, project_export_doc, project_import) use a path on the machine running this MCP server. save_project and open_project use a path on the machine running StarUML.

BPMN Diagram Tools

The core of this server — full CRUD for every BPMN Diagram resource.

Resource Tools
Diagrams bpmn_list_diagrams, bpmn_create_diagram, bpmn_get_diagram, bpmn_update_diagram, bpmn_delete_diagram
Participants bpmn_list_participants, bpmn_create_participant, bpmn_get_participant, bpmn_update_participant, bpmn_delete_participant
— Lanes bpmn_list_participant_lanes, bpmn_create_participant_lane
Tasks bpmn_list_tasks, bpmn_create_task, bpmn_get_task, bpmn_update_task, bpmn_delete_task
Sub Processes bpmn_list_sub_processes, bpmn_create_sub_process, bpmn_get_sub_process, bpmn_update_sub_process, bpmn_delete_sub_process
Events bpmn_list_events, bpmn_create_event, bpmn_get_event, bpmn_update_event, bpmn_delete_event
— Event Definitions bpmn_list_event_event_definitions, bpmn_create_event_event_definition
Gateways bpmn_list_gateways, bpmn_create_gateway, bpmn_get_gateway, bpmn_update_gateway, bpmn_delete_gateway
Data Objects bpmn_list_data_objects, bpmn_create_data_object, bpmn_get_data_object, bpmn_update_data_object, bpmn_delete_data_object
Conversations bpmn_list_conversations, bpmn_create_conversation, bpmn_get_conversation, bpmn_update_conversation, bpmn_delete_conversation
Choreographies bpmn_list_choreographies, bpmn_create_choreography, bpmn_get_choreography, bpmn_update_choreography, bpmn_delete_choreography
Annotations bpmn_list_annotations, bpmn_create_annotation, bpmn_get_annotation, bpmn_update_annotation, bpmn_delete_annotation
Sequence Flows bpmn_list_sequence_flows, bpmn_create_sequence_flow, bpmn_get_sequence_flow, bpmn_update_sequence_flow, bpmn_delete_sequence_flow
Message Flows bpmn_list_message_flows, bpmn_create_message_flow, bpmn_get_message_flow, bpmn_update_message_flow, bpmn_delete_message_flow
Associations bpmn_list_associations, bpmn_create_association, bpmn_get_association, bpmn_update_association, bpmn_delete_association
Data Associations bpmn_list_data_associations, bpmn_create_data_association, bpmn_get_data_association, bpmn_update_data_association, bpmn_delete_data_association
Message Links bpmn_list_message_links, bpmn_create_message_link, bpmn_get_message_link, bpmn_update_message_link, bpmn_delete_message_link
Conversation Links bpmn_list_conversation_links, bpmn_create_conversation_link, bpmn_get_conversation_link, bpmn_update_conversation_link, bpmn_delete_conversation_link

Common Tools

Shared infrastructure tools available across all StarUML Controller MCP servers.

General — status, elements, tags, project I/O
Tool Description
get_status Get server status, version, and endpoint list
get_element Get any element by ID
list_element_tags List tags on an element
create_element_tag Create a tag on an element
get_tag Get tag details
update_tag Update a tag
delete_tag Delete a tag
save_project Save project to a .mdj file
open_project Open a .mdj project file
Project — new, close, import, export
Tool Description
project_new Create a new empty project
project_close Close the current project
project_import Import a .mdj fragment into the project
project_export Export a model fragment to a .mdj file
project_export_all Export all diagrams as images (PNG/SVG/JPEG/PDF)
project_export_doc Export project documentation (HTML/Markdown)
Utility — undo, redo, search, validate, mermaid, generate
Tool Description
undo Undo the last action
redo Redo the last undone action
search Search elements by keyword with optional type filter
validate Run model validation
mermaid_import Import a Mermaid diagram definition
generate_diagram Generate a diagram from natural language (requires AI extension)
Diagrams — CRUD, export, layout, zoom
Tool Description
diagram_list List all diagrams (optionally filter by type)
diagram_create Create a new diagram of any type
diagram_get Get diagram details by ID
diagram_update Update diagram name
diagram_delete Delete a diagram
diagram_list_elements List all elements on a diagram
diagram_list_views List all views on a diagram
diagram_create_element Create a node element on a diagram
diagram_create_relation Create a relation between elements
diagram_export Export diagram as image (PNG/SVG/JPEG/PDF)
diagram_layout Auto-layout diagram with configurable direction
diagram_open Open/activate a diagram in the editor
diagram_zoom Set diagram zoom level
diagram_create_view_of Create a view of an existing model on a diagram
diagram_link_object Create a UMLLinkObject on an object diagram
Notes & Shapes — notes, note links, free lines, shapes
Tool Description
note_list List all notes on a diagram
note_create Create a note with text and position
note_get Get note details
note_update Update note text
note_delete Delete a note
note_link_list List all note links on a diagram
note_link_create Create a link between a note and an element
note_link_delete Delete a note link
free_line_list List all free lines on a diagram
free_line_create Create a free line on a diagram
free_line_delete Delete a free line
shape_list List all shapes on a diagram
shape_create Create a shape (Text, TextBox, Rect, RoundRect, Ellipse, Hyperlink, Image)
shape_get Get shape details
shape_update Update shape text
shape_delete Delete a shape
Views & Elements — positioning, styling, element management
Tool Description
view_update Move/resize a view (left, top, width, height)
view_update_style Update visual style (fillColor, lineColor, fontColor, fontSize, etc.)
view_reconnect Reconnect an edge to different source/target
view_align Align/distribute multiple views
element_update Update any element's name and documentation
element_delete Delete any element by ID
element_list_relationships List all relationships of an element
element_list_views List all views of an element across diagrams
element_relocate Move element to a different parent
element_create_child Create a child element (attribute, operation, etc.)
element_reorder Reorder element within parent (up/down)

Related Projects

This server is part of the StarUML Controller MCP family:

Server Diagram Type
staruml-controller-erd-mcp Entity-Relationship Diagram
staruml-controller-seq-mcp Sequence Diagram
staruml-controller-class-mcp Class / Package Diagram
staruml-controller-usecase-mcp Use Case Diagram
staruml-controller-activity-mcp Activity Diagram
staruml-controller-bpmn-mcp BPMN Diagram
staruml-controller-sysml-mcp SysML Diagram
and 18 more...

All servers share common tools and add diagram-specific tools on top. Install only what you need.

License

MIT