Sparx Systems Forum
Enterprise Architect => General Board => Topic started by: Takeshi K on May 29, 2025, 02:26:13 pm
-
I have released the MCP (Model Context Protocol) server for Enterprise Architect.
You can connect MCP clients like Claude application and Enterprise Architect and ask to LLM about your model.
For detail and download the installer, please visit our page:
https://www.sparxsystems.jp/en/MCP/
(It is free to use. Not a paid product.)
-
WOW,
Thanks alot.
By the way, which LLM has the best understanding of the EA API and underlying table structure?
Shimon
-
I do not know it because I have not let any LLM understand the API and/or the table structure. I cannot imagine why we need it or in what situation.
-
Hi,
For writing scripts, I recently found AI very helpful. If one of the LLM's would have the whole API and the whole table structure, it would write much more accurate scripts.
For instance, I wanted to create Requirements trace diagrams for each 15 requirements in each package (we have over 4,000 requirements).
I got it done by AI.
Sincerley,
Shimon
-
Great job!
This is an impressive tool that enhances model interaction and accessibility for users.
-
Hello Williami,
Thank you for your comment. After my first post, I have updated my add-in several times to add more tools (features), fix bugs, and offer the installer for 32-bit version of Enterprise Architect.
Now I think the add-in offers enough features for exploring your model.
Please tell me if you have any idea, quetions and/or bugs.
-
Great job @Takeshi. Very helpful. Many thanks.
I was trying to create a BPMN diagram. The result was nice. After some corrections MCP created Activities, Gateways and Connectors. But it struggled with Events. I think that this could be fixed easily:
BPMN2.0::Event (the base Event type from the BPMN2.0 profile):
The error is "Invalid type" for BPMN2.0: : Event.
So EA's MCP Server recognizes:
✓ BPMN2.0::Activity
✓ BPMN2.0::Gateway
✓ BPMN2.0::SequenceFlow
✓ Event (plain, without profile) -> this not what we want
X BPMN2.0::Event - "Invalid type"
X BPMN2.0::StartEvent - "Invalid parent for ObiectNode"
X BPMN2.0::EndEvent - "Invalid parent for ObiectNode"
This appears to be a limitation or naming inconsistency in EA's BPMN2.0 profile implementation through the MCP Server.
Or do I have to add a context file with the Creation Rules for Archimate?
-
I was also trying to create an ArchiMate diagram with VSCode, Copilot, and MCP for EA. The documentation says "When using other notations such as ArchiMate, defining and passing similar content in advance ensures accurate processing."
So, I was trying prompts like
- Create a new element of type Component with stereotype ArchiMate3::ApplicationComponent named "CRM"
- Create an element of type ApplicationComponent with stereotype ArchiMate3::ApplicationComponent named "CRM" in the application layer package
MCP always answered with "invalid Type". I also tried to provide Copilot with Creation Rules, like your implementation does for Claude. So, I used the MDG-XML-file.
But nothing works. Any ideas?
-
Hello Viking,
Thank you for your feedback about the MCP add-in.
First, I would like to tell that the issue which BPMN events cannot be created is NOT a bug of my add-in nor an issue of my add-in. This is originally EA's Automation Interface problem.
About the BPMN events, there are two forms. One is the normal (isolated) event, and another is the edge-mounted event. Both has the same BPMN 2.0::StartEvent stereotype.
When we create the BPMN 2.0::StartEvent with Collection.AddNew(name, "BPMN 2.0::StartEvent"), EA always creates the edge-mounted form. But the edge-mounted objects require its parent, so the MCP command always fails. There is no way to specify which form we create for the AddNew method when a stereotype has two or more forms.
Anyway, I have added a workaround for the BPMN events. Please call the tool (MCP method) with BPMN2.0::StartEvent, BPMN2.0::IntermediateEvent and BPMN2.0::EndEvent on the latest MCP server version 2.0.3. You can now create these events.
And during the test of this workaround, I found another issue which we cannot change the type of event (Timer, Message, etc.). This is also an issue of the Automation Interface, so I also added another workaround to update the BPMN properties (tagged values) correctly.
Could you try again with the latest installer?
About your second post, maybe your MCP client sends the string 'CRM' for the type of a new element. In Enterprise Architect, there is no element type 'MCP' so the 'invalid type' is reasonable. About a prompt, the prompts which are offered my MCP add-in are useful to start. In some MCP client such as the Claude for Desktop, we can specify and see the prompts.
-
Hi Takeshi-san,
- "Could you try again with the latest installer?" -> I removed my current version, downloaded the file again from sparxsystems.jp/en/MCP and installed it. But it says that it is the same version as the other one: 2.0.2.
- Could you make your creations rules available so that they can also used in Copilot, for example.
- "When using other notations such as ArchiMate, defining and passing similar content in advance ensures accurate processing." Could you provide examples, please? I tried a lot with Copilot and it was not able to create any Archimate element. Or is this also only possible with Claude Desktop?
V.
-
Hi Viking,
I have downloaded the installers from my website, as the same as other people, and the installers are correctly updated.
Could you clear the cache of your web browser or use a different browser/network to download the installer?
The installation timestamps are set to 4 November.
About the prompt for the AI, following is the SysML prompt which is offered by the MCP add-in.
-------------
When creating a new element, connector or diagram in the SysML 1.5, you need to specify the following word for its type.
# Diagrams
The following diagram types are supported, as well as the internal type values for creation diagrams.
- Requirement diagram: 'SysML1.4::Requirement'
- Block Definition diagram: 'SysML1.4::BlockDefinition'
- Activity diagram: 'SysML1.4::Activity'
- State Machine diagram: 'SysML1.4::StateMachine'
- Use Case diagram: 'SysML1.4::UseCase'
Diagram types not included in the above list are not currently supported.
# Elements
The following types are currently supported: If a type has a bracketed name, that name must be specified when creating it.
## Requirement diagrams
- Requirement: 'SysML1.4::Requirement'
## Block Definition diagrams
- Block: 'SysML1.4::Block'
- Interface Block: 'SysML1.4::InterfaceBlock'
- Signal
(The following is omitted)
-------------
HTH,
-
Hi Takeshi,
I have now installed the correct version: 2.0.3.
I haven't tested your workaround solution for BPMN yet, but I will definitely do so. Thank you very much for the workaround solution. I really appreciate it.
I only tested BMPN because I wanted to see what is possible with your MCP, as BPMN is the most complicated notation in my opinion.
I am currently trying to create ArchiMate elements, as we normally use ArchiMate. Unfortunately, still no ArchiMate elements are created, only UML case elements. The properties show ArchiMate3 as profile, but the stereotype is not selected. You say in https://www.sparxsystems.jp/en/MCP/: "When using other notations such as ArchiMate, defining and passing similar content in advance ensures accurate processing." Do you mind to add a prompt here to create an ArchiMate ApplicationComponent?
-
Hi Viking,
I will try to offer a prompt for ArchiMate 3, but could you try if the MCP add-in works for ArchiMate?
1. launch Enterprise Architect, create a new ArchiMate diagram and then leave it (keep open)
2. for your LLM, tell the rule like the following:
When we create an ArchiMate component in Enterprise Architect, its type is 'ArchiMate3::ArchiMate_ApplicationComponent'.
3. then ask to your LLM like:
Create a new ArchiMate component named 'Test' in the currently open diagram in Enterprise Architect.
-
I tried it and it was successful. ArchiMate_ApplicationComponent has beeen assigned correctly to component. Many thanks, Takeshi.
Hopefully also the rest will be created. But I think so.
-
Can I change the Rectangle Notation to Icon Notation? I tried several ways. set_element_property does not change diagram object properties which would be necessary for my understanding.
Can I tell MCP the size of the created elements?
-
Hi Takeshi, I tried to create a more detailed UML class diagram now. Two important features are missing from my point of view:
- I cannot create attributes. Copilot says: "The current implementation has a limitation: the set_element_property tool treats custom properties as "Tagged Values" in EA, not as proper UML dass attributes."
- I cannot add cardinalities.
Is there also a work-around?
-
Hi Viking,
Thank you for your comment.
- Notation and size in diagrams
Currently, it is not easy to offer the 'tools' (MCP methods) for them, but I have added a feature to support the Template Package in Enterprise Architect.
Could you update the MCP addin to the latest (version 2.1.0) and then create a Template Package in your model, and then add a Archimate Compornent with your faviorite style?
- Adding attributes
Currently the MCP addin does not offer a tool to add attributes. I will add the feature in the future.
- cardinalities
On the version 2.1.0, we can modify the Multiplicities of connectors. Does this solve your situation?
-
Hi Takeshi, Many thanks.
- I will try 2.1.0.
- Do you mind to also add the capability to add attributes? For me this is one of the most important feature of an UML class diagram (so so much for other diagrams), because I more use it do describe concepts precisely.
- Resizing can wait.
- But icon notation would be great.
V.
-
Yes, the implementation of attributes and operations is currently underway. However, it will take longer to be released.
-
Hi Takeshi,
"I haven't tested your workaround solution for BPMN yet, but I will definitely do so.". Here are finally my test results:
- The sterotypes are used and displayed for all elements I was using: events (!), activities, gateways.
- As part of the prompt I said which task types to use, but I got only 'abstractTasks'. I will futher investigate this issue.
- mcp created lanes for each involved role. But it arranged them as a row (not on top of each other), And it did not put the respective activities into the lanes. Instead Copilot says: "The fundamental issue: The MCP server's createelement and setelementproperty commands don't seem to support proper BPMN lane Containment. This is similar to the limitation we found with UML attributes - the MCP Server (v2.1.0.0) doesn't expose all the necessary commands for complete BPMN diagram modeling."
- The layout is quite good. But it is vertical and cannot be changed. BPMN diagrams are more horizonal and this should be the outcome, if the layout cannot be adapted.
- The created diagram is not correct but my understanding is that mcp cannot help here (e.g., only diverging gateways have been created, but not converging ones).
V.
-
Hi Viking,
Thank you for checking the behaviour in BPMN model.
Unfortunately, creating beautiful diagrams with the Pools and Lanes with the current MCP server. The server must offer functions ('tools' in the MCP world) to specify the location of elements and connectors.
I will consider offering these functions, but not in the near future.
-
I will consider offering these functions, but not in the near future.
On top of my wish list are attributes for UML classes. Would this be possible in the near future?
-
good info
-
The implementation for adding/modifying attributes and operations (including parameters) has been completed, now I am testing if they work well. I needed to change some internal existing behaviour to support them, so I need to check all main features.
I think I can release the new installer today or tomorrow.
-
The implementation for adding/modifying attributes and operations (including parameters) has been completed...
I think I can release the new installer today or tomorrow.
Great news
-
The version 2.2.0 has been released. I found and fixed some issues during my tests, but there may still be others.
-
The version 2.2.0 has been released. I found and fixed some issues during my tests, but there may still be others.
I tested the newest version for my UML Class Diagrams. It now creating elements, connectors, attributes, and cardinalities. Awesome :)
For any reason it does not create the model anymore (empty "diagram" also cretaed, opened, and selected). So, I have to move the elements from the project brwoser to the diagram.
-
Yes, new elements will no longer be placed on diagrams for various reasons, mainly due to user requests and ideas on how to use this MCP, as well as to improve performance.
We can now place multiple elements at once using the place_element_on_diagram tool. I will update the add-in so that it can create two or more elements at once, saving on AI costs and improving performance.
-
Yes, new elements will no longer be placed on diagrams for various reasons, mainly due to user requests and ideas on how to use this MCP, as well as to improve performance.
We can now place multiple elements at once using the place_element_on_diagram tool. I will update the add-in so that it can create two or more elements at once, saving on AI costs and improving performance.
Sorry, I don't understand. I can create new elements, but cannot create a diagram using them? Or do you mean that I have to tell the agent in addition, that I want to place the new elements on a diagrams?
-
We can create elements and diagrams, and place existing elements onto them. As I mentioned in my last post, I split the tool into two for better performance and to support more situations. However, we usually do not need to specify which tool the agent should use to fulfil our requests, as the agent can automatically determine this.
Simply make your requests to the AI. The AI will generate the necessary packages, diagrams, elements and connectors, and then place the elements on the diagrams.
-
Hi Viking and all who are interested in auto-generation by AI,
Regard to the following Viking comment, now the latest MCP server can generate better BPMN diagrams including Pools, Lanes, better layout, etc.
"I haven't tested your workaround solution for BPMN yet, but I will definitely do so.". Here are finally my test results:
- The sterotypes are used and displayed for all elements I was using: events (!), activities, gateways.
- As part of the prompt I said which task types to use, but I got only 'abstractTasks'. I will futher investigate this issue.
- mcp created lanes for each involved role. But it arranged them as a row (not on top of each other), And it did not put the respective activities into the lanes. Instead Copilot says: "The fundamental issue: The MCP server's createelement and setelementproperty commands don't seem to support proper BPMN lane Containment. This is similar to the limitation we found with UML attributes - the MCP Server (v2.1.0.0) doesn't expose all the necessary commands for complete BPMN diagram modeling."
- The layout is quite good. But it is vertical and cannot be changed. BPMN diagrams are more horizonal and this should be the outcome, if the layout cannot be adapted.
- The created diagram is not correct but my understanding is that mcp cannot help here (e.g., only diverging gateways have been created, but not converging ones).
Example request for your AI (LLM):
Please create the following process as BPMN diagram within the currently selected package.
1. When an order email arrives from a customer, the responsible staff member in the relevant department reviews the email contents.
2. If the contents are acceptable, that staff member performs the ordering procedure.
3. If the contents are problematic, the department manager reviews the contents, after which the original staff member performs the ordering procedure.
4. Once the ordering procedure is complete, create an order report and finalize the process.
Result:
(by Claude Desktop, free plan)
(https://www.sparxsystems.jp/en/MCP/BPMN_Generation_Sample.png)
I have not modify anything including position and size. We need to use the prompt for BPMN which is offered by the MCP add-in.
Enjoy!
-
Hi Takeshi,
Looks nice and all, but I'm afraid I'm still a bit underwhelmed by all this.
It looks to me like this AI agent does only does the stuff I can easily do myself.
I would be really enthousiastic if it would do the hard stuff
- Do proper layout of my diagram
- all elements the same size
- elements as the same horizontal/vertical level
- elements the same distance from eachother
- all connectors the correct style (mostly orthogonal rounded)
- all connectors correctly attached to the correct point of an element (mostly center, unless there are multiple connectors on the same side)
- link pools/Lanes with the proper elements (e.g. PartnerRole etc...)
- make blackbox pools (such as customer) actually blackbox.
To make it actually work in a serious modelling environment, it should need to learn and follow the guidelines of the organisation.
I don't want to rain on your parade, and I'm sure it's really technically a very advanced tool.
But for now I'm not yet able to recommend usage of such a tool to my clients.
Geert
-
Hi Geert,
Thank you so much for your comment. Your comments are very welcome and I agree some of your comments.
About the following points, maybe we can solve by requesting AI to do so.
- all elements the same size
- elements as the same horizontal/vertical level
- elements the same distance from each other
- link pools/Lanes with the proper elements (e.g. PartnerRole etc...)
My addin already has the interface for those.
About the connector style and routing, currently we cannot specify them. Especially latter, maybe you know, this is not easy to route nicely in the current EA API/storing data format...
I think it's important to consider how we use AI/LLM in our business/work. I once heard someone say that if we want 100% quality, we shouldn't use AI. If we think we can skip 80% of our work with AI, AI is our friend.
For example, if we want, we can create hundreds of BPMN diagrams from very large Word documents by asking AI to generate diagrams and then waiting for it to finish. Of course, we would still need to manipulate layouts and correct AI misunderstandings, but I think this is easier and faster than creating all the BPMN diagrams manually one by one. In Enterprise Architect in particular, adding pools, changing their size, adding lanes inside pools (which then requires us to change the size of the pools again), adding BPMN elements, connecting them and layouting them beautifully are very tedious work.
However, someone (e.g. one of my colleagues - he never use AI) might argue that many low-quality artifacts are worse, and that creating them manually results in a higher quality product (and we can save time, compared to 'fix' AI generated artifacts.) Yes, that is also correct. The most important thing, I think, is how, where and when we use AI.
-
Hi Takeshi, the command seems to have a bug. 'get_element_information' always returns 'empty' for 'Owned Diagrams'. Goal is to find out the composite diagram / child diagram of elements.
-
It looks to me like this AI agent does only does the stuff I can easily do myself.
All this can be achieved by just using natural language. Even my grandfather would be able to create a BPMN diagram now.
To make it actually work in a serious modelling environment, it should need to learn and follow the guidelines of the organisation.
You can teach your agent (easily) and the results will quickly improve.
I don't want to rain on your parade, and I'm sure it's really technically a very advanced tool.
But for now I'm not yet able to recommend usage of such a tool to my clients.
I would, I do, we do.
-
Regard to the following Viking comment, now the latest MCP server can generate better BPMN diagrams including Pools, Lanes, better layout, etc.
Just great !
-
Hi Takeshi, the command seems to have a bug. 'get_element_information' always returns 'empty' for 'Owned Diagrams'. Goal is to find out the composite diagram / child diagram of elements.
Hi Viking,
I have checked the above issue, but I cannot reproduce it. This means that the MCP returns child diagrams when you create a diagram by 'New Child Diagram' | 'Composite Structure Diagram' from the context menu, or when you add or move a diagram in the Browser window.
However, if you 'link' a diagram from the 'New Child Diagram' | 'Select Composite Diagram' context menu option, the linked diagram is not included in the 'Owned Diagrams' information because it is not owned by an element, just linked.
If you can easily reproduce the issue with the newly created project file, please send me the file. ([email protected])
-
Yes, you are right. We we are "just" using Composite Diagrams only, not Composite Structure Diagrams.
But even my agent is confused about this distinction. Copilot using your mcp says, that "Elements with Composite Diagrams: 0". It does not say "Elements with Composite Structure Diagrams: 0".
Can your mcp be extended to also return Composite Diagrams? This feature is part of Enterprise Architect, that's why it should be also supported by your mcp. Our child diagrams cannot be moved into the structure of the parent diagram, because many parent diagrams are using these Composite Diagrams. Otherwise, this restriction would dominate our complete repository and we could not order it accoring our standards.
-
The 'Composite Diagrams' and 'Composite Structure Diagrams' are terms in the context menu. I don't understand exactly what these terms refer to.
But my current implementation of the MCP is 'owned diagrams', not 'Composite Diagrams' nor 'Composite Structure Diagrams', nor linked diagram. And this 'owned' means that diagrams under the target element in the Browser.
I think that there could be an option to add 'linked diagram' or 'related diagram' to return the 'Composite Diagrams' in the menu item. Anyway, the linked diagram (i.e., the 'Composite Diagrams' in the menu item) is not owned, so I think it is not correct to include the diagram to 'owned diagrams'. Please wait the next release:-)
-
Would a user care, if it is an owned or other referenced diagram? I think, only one or the other can be added to an element. And both are diagrams.
Or just adding composite to get_element_information?
-
Would a user care whether it is an owned or an other-referenced diagram? I think only one of the two can be added to an element. And both are diagrams.
Or just adding composite to get_element_information?
I asked Google Gemini what the difference was between Composite and Composite Structure Diagrams:
While the terms are often used interchangeably, there is a technical distinction in how they are defined in the UML specification versus how they are used in industry jargon and modelling tools.
1. The Official Term: Composite Structure Diagram. The UML Composite Structure Diagram is the formal name for the diagram type introduced in UML 2.0. It is a structural diagram that lets you “peek inside” a complex classifier (such as a Class or Component) to see how its internal parts work together.
- Focus: It shows the internal structure of a single class or component at runtime.
- Key Elements: It uses Parts, Ports, Connectors, and Collaborations.
- Use Case: You would use this to model how a “Car” class is internally composed of an “Engine”, “Wheels,” and “Transmission,” and how those parts are wired together via specific ports.
2. The Shorthand: Composite Diagram. In most conversations, “Composite Diagram” is simply a shorthand for “Composite Structure Diagram.” There is no official diagram type in the UML 2.5 standard named just “Composite Diagram.”
However, there are three common ways this term is used that can confuse:- Tool-Specific Features: In tools such as Sparx Enterprise Architect, a “Composite Diagram” is a child diagram nested beneath a parent element. For example, if you double-click a Class and it opens a sub-diagram, that sub-diagram is called a “composite diagram,” regardless of whether it is a state machine, activity, or structure diagram.
- Composition in Class Diagrams: Some beginners use “composite diagram” to describe a standard Class Diagram that heavily uses the Composition relationship (indicated by the solid black diamond line).
- Design Patterns: It is occasionally confused with a diagram illustrating the Composite Design Pattern, which is a specific way of organising objects into tree structures to represent part-whole hierarchies.
So, everybody is confused...
Unless this is a hallucination, then a UML Composite Structure Diagram is an EA Composite Diagram; but not vice-versa!
Another problem is that EA sometimes conflates Composition with Nesting (I’ve spoken about the difference many times in the past). You’ll see Gemini did not make that conflation. What EA calls a Composite diagram is, in fact, a Nested diagram.
These days, of course, language isn’t important. It’s the “vibe” that counts...
HTH,
Paolo
-
Many thanks, Paolo.
There should be at least a possibility to retrieve this information, regardless of the theory behind it.
-
- Tool-Specific Features: In tools such as Sparx Enterprise Architect, a “Composite Diagram” is a child diagram nested beneath a parent element. For example, if you double-click a Class and it opens a sub-diagram, that sub-diagram is called a “composite diagram,” regardless of whether it is a state machine, activity, or structure diagram.
Even the fact that Gemini is using the phrase "Sparx Enterprise Architect" is enough to say that it's pulling from sources that shouldn't be trusted. It's equivalent to "International Business Rhapsody". It may not be hallucinating, but drawing from unreliable sources is just as bad.
Unless this is a hallucination, then a UML Composite Structure Diagram is an EA Composite Diagram; but not vice-versa!
Another problem is that EA sometimes conflates Composition with Nesting (I’ve spoken about the difference many times in the past). You’ll see Gemini did not make that conflation. What EA calls a Composite diagram is, in fact, a Nested diagram.
I disagree with both the Gemini interpretation of what a Composite diagram is as well as your assertion that it is actually a Nested Diagram.
The UML Composite Structure Diagram is a particular type of diagram that shows the internal structure of a particular namespace. EA generalizes that to include Composite behavior and allows new types of Composite diagrams to be defined in a profile. Neither requires actually being nested within in the Namespace it is documenting. EA defaults to that behavior but allows the diagram to be in another namespace, while UML doesn't have anything to say on it.
And yes, Gemini did conflate the two terms and you used that conflation to argue your point.
-
I think the term "composite diagram" is a bit unfortunate as it has connotations that it probably shouldn't have.
When explaining the concept to EA users I often use "linked diagram". I explain to them that this works like a hyperlink. It is the diagram that is opened when doubleclicking on the element.
For me it does not have any other meaning, and it only exists to help us humans navigate the model.
Geert
-
Hi Takeshi, I tested v2.3.11. The mcp identifies the linked diagrams now. Many thanks.
But Copilot throws an issue:
' Sorry, your request failed. Please try again.
Copilot Request id: 37d72ba4-1757-43e8-becc-6763ef90ff8d
GH Request Id: 647D:3E781C:528352:5B6037:696F8921
Reason: Request Failed: 400 {"error" : {"message": "missing required Copilot-Vision-Request header for Vision requests","code" :""}} '
With the older version I also got this issue, but it was gone later. Any ideas?
-
But Copilot throws an issue:
' Sorry, your request failed. Please try again.
Copilot Request id: 37d72ba4-1757-43e8-becc-6763ef90ff8d
GH Request Id: 647D:3E781C:528352:5B6037:696F8921
Reason: Request Failed: 400 {"error" : {"message": "missing required Copilot-Vision-Request header for Vision requests","code" :""}} '
This error seems that there was an error between Copilot and GitHub (GH). My add-in never returns an error or requests the Copilot-Vision-Request header. This error maybe relates to Copilot Vision feature, so I cannot help you.
-
I think the term "composite diagram" is a bit unfortunate, as it has connotations that it probably shouldn't have.
When explaining the concept to EA users, I often use "linked diagram". I explain to them that this works like a hyperlink. It is the diagram that is opened when double-clicking on the element.
For me, it does not have any other meaning, and it only exists to help us humans navigate the model.
Geert
Wot 'e sed!
Paolo
-
This error seems that there was an error between Copilot and GitHub (GH). My add-in never returns an error or requests the Copilot-Vision-Request header. This error maybe relates to Copilot Vision feature, so I cannot help you.
Agreed. It seems more a problem with GitHub and the LLM. I tried several LLMs and one did not throw this exception.