Cameo MCP Bridge
An MCP (Model Context Protocol) server that connects AI coding assistants to CATIA Magic / Cameo Systems Modeler -- the industry-standard MBSE tool for SysML and UML modeling.
This lets Claude Code (or any MCP-compatible client) query, create, modify, inspect, validate, and visualize SysML/UML models inside a running Cameo instance through 162 tools covering capability negotiation, methodology-aware OOSEM workflows, semantic validation, state-machine semantics, elements, relationships, native matrices and tables, Relation Maps, reports, requirements import/export, validation suites, Teamwork/DataHub probes, diagrams, reusable verification, specifications, and guarded macro execution.
Claude Code <--stdio/MCP--> Python MCP Server <--HTTP/REST--> Java Plugin (Cameo JVM)
Why This Exists
MBSE tools like Cameo are powerful but manual. With this bridge, an AI assistant can:
- Build models from requirements -- "Create a state machine for ATM operations with idle, active, and maintenance states"
- Query and navigate models -- "Show me all blocks with the
<<requirement>>stereotype" - Generate diagrams -- Create sequence diagrams, BDDs, IBDs, state machines, and populate them with elements
- Export diagram images -- Get PNG snapshots of any diagram as base64
- Run Groovy scripts -- Escape hatch for anything the structured tools don't cover
- Inspect and modify specifications -- Read/write any UML property, tagged value, or constraint
How Is This Different?
This is the only open-source MCP server that integrates directly with a running Cameo instance, giving full access to SysML v1 models and the complete Cameo API surface.
Architecture
+-------------------+ +---------------------+ +---------------------------+
| | stdio | | HTTP | |
| Claude Code / |-------->| Python MCP Server |-------->| Java Plugin |
| Any MCP Client |<--------| (cameo_mcp) |<--------| (CameoMCPBridgePlugin) |
| | MCP | | JSON | |
+-------------------+ +---------------------+ +---------------------------+
| |
| 127.0.0.1:18740 |
| |
| Handler families: |
| - Project/elements |
| - Relationships |
| - Matrices/tables |
| - Diagrams/RelationMap |
| - UI/snapshots/probes |
| - Validation/reports |
| - Import/export |
| - Optional integrations|
+---------------------------+
|
+---------v---------+
| CATIA Magic / |
| Cameo JVM |
| (OpenAPI, EMF, |
| SessionManager) |
+-------------------+
Data flow for a write operation:
- MCP client calls a tool (e.g.,
cameo_create_element) - Python server translates to HTTP POST to the Java plugin
- Java handler dispatches to Swing EDT via
EdtDispatcher - On EDT: opens a
SessionManagersession, executes the operation, closes the session - JSON response flows back through the layers
All write operations are session-wrapped for undo/redo support. Read operations run on the HTTP thread pool (Cameo model reads are thread-safe).
Prerequisites
- CATIA Magic / Cameo Systems Modeler 2024x or newer (any bundle: Systems of Systems Architect, Cyber Systems Engineer, etc.)
- Java 17 JDK available to Gradle
- Python 3.10+ with
pip - Gradle 8.x (wrapper included)
Installation
Quick Install
git clone https://github.com/ajhcs/cameo-mcp-bridge.git
cd cameo-mcp-bridge
# Set your Cameo install path (default: D:/DevTools/CatiaMagic)
export CAMEO_HOME="/path/to/your/CatiaMagic"
# Optional: point the installer/Gradle at a Java 17 JDK explicitly
export JDK17_HOME="/path/to/jdk-17"
./install.sh
The install script:
- Builds the Java plugin with Gradle and passes
CAMEO_HOMEthrough automatically - Deploys it to
$CAMEO_HOME/plugins/com.claude.cameo.bridge/ - Creates or reuses
mcp-server/.venv/when not already inside a virtualenv - Installs the Python MCP server into that environment
- Registers the MCP server with Claude Code when the
claudeCLI is available
Manual Install
1. Build the Java plugin:
cd plugin
./gradlew assemblePlugin -PcameoHome="/path/to/CatiaMagic" -Pjdk17Home="/path/to/jdk-17"
Gradle must run on a Java 17 JDK. You can also set JDK17_HOME or JAVA17_HOME instead of passing -Pjdk17Home=....
2. Deploy to Cameo:
Copy the contents of plugin/build/plugin-dist/com.claude.cameo.bridge/ to:
<CAMEO_HOME>/plugins/com.claude.cameo.bridge/
3. Install the Python server:
cd mcp-server
python3 -m venv .venv
. .venv/bin/activate
python -m pip install -e .
On Windows shells, use .venv\\Scripts\\activate instead.
4. Register with your MCP client:
For Claude Code:
claude mcp add cameo-bridge --scope user -- /absolute/path/to/mcp-server/.venv/bin/python -m cameo_mcp.server
On Windows, the interpreter path is typically .venv\\Scripts\\python.exe.
For other MCP clients, configure stdio transport with the venv interpreter and command -m cameo_mcp.server.
5. Restart CATIA Magic, open a project, and verify:
> Check cameo status
If a newly added MCP tool returns HTTP 404 after an update, the Python server and Java plugin are out of sync. Rebuild/redeploy the plugin, then restart CATIA Magic so the new HTTP handlers are loaded.
The Python side now performs a capability handshake against the plugin before
non-status operations. If cameo_status or cameo_get_capabilities reports
compatibility.clientCompatible = false, stop and redeploy the matching plugin
before proceeding.
The Python MCP layer also ships a Phase 2 methodology surface for bounded OOSEM workflows. These tools build named artifact recipes, workflow guidance, conformance checks, semantic validation, and compact review packets on top of the low-level bridge.
What's New In 2.3.5
- Native Relation Map tools for create/configure, criteria templates, presentation inspection, graph readback, render/verify, snapshot diffing, and explicit refresh.
- Live UI introspection tools for active diagram, browser selection, selected symbols, and raw diagram/presentation property dumps.
- Probe-first route families for native validation, Report Wizard, requirements import/export, simulation, Teamwork, DataHub, variants, profiles, typed diagrams, and safety/cyber extensions.
- JSON/CSV requirements import/export with dry-run defaults, explicit write gates, scoped export, and tests.
- Native Report Wizard generation with template discovery and output-file receipts.
- Safer long-running CATIA operations: request timeouts on the Python side and serialized write sessions on the Java side.
Configuration
The Java plugin reads the port from system property cameo.mcp.port (default 18740). To change it, add to your Cameo *.vmoptions file:
-Dcameo.mcp.port=18741
And set CAMEO_BRIDGE_PORT=18741 in your environment before launching Claude Code.
For local health checks, the plugin now responds on both /api/v1/status and the legacy /status alias. The same applies to /api/v1/capabilities and /capabilities.
Tool Reference
Project, Session & UI (9 tools)
Methodology Packs (6 tools)
Elements (8 tools)
Supported element types: Package, Profile, Stereotype, Class, Block, Property, FlowProperty, Port, Interface, Activity, UseCase, Actor, StateMachine, State, Pseudostate, InitialState, Requirement, InterfaceBlock, ConstraintBlock, ValueType, DataType, Signal, Enumeration, Component, Comment, Constraint, CallBehaviorAction, OpaqueAction, ActivityPartition, InitialNode, ActivityFinalNode, FlowFinalNode, DecisionNode, MergeNode, ForkNode, JoinNode, InputPin, OutputPin, Operation
SysML aliases such as Block, Requirement, ConstraintBlock, InterfaceBlock, ValueType, and FlowProperty rely on the SysML profile being available. The bridge now treats missing required stereotypes as an error instead of silently producing plain UML elements.
Pseudostate currently maps to an initial pseudostate in the MVP.
For large projects, prefer cameo_list_containment_children over cameo_get_containment_tree. The recursive tree endpoint is still available for compatibility, but it can produce very large responses on real models.
Stereotypes & Tagged Values (3 tools)
If you create a custom profile through MCP, the typical sequence is:
- Create the
Profile - Create
Stereotypeelements inside it, optionally withmetaclasses=[...] - Call
cameo_apply_profileon the target model/package - Apply the new stereotypes to model elements
Relationships (2 tools)
Supported relationship types: Association, DirectedAssociation, Composition, Generalization, Dependency, ControlFlow, ObjectFlow, Transition, Connector, InformationFlow, ItemFlow, Allocate, Satisfy, Derive, Refine, Trace, Verify, Include, Extend
Connector supports nested-port partWithPort ownership. InformationFlow and ItemFlow support structured realizingConnector, conveyed, and SysML itemProperty payload data for IBD item-flow workflows. When you pass an IBD context element as ownerId, the bridge resolves the actual InformationFlow/ItemFlow containment to the nearest package because Cameo does not allow those relationships to be owned directly by a block.
Matrices & Generic Tables (8 tools)
Supported matrix kinds: refine, derive, satisfy, allocation, dependency
These tools target Cameo's native matrix artifacts:
refine->Refine Requirement Matrixderive->Derive Requirement Matrixsatisfy->Satisfy Requirement Matrixallocation->SysML Allocation Matrixdependency->Dependency Matrix
This matrix family is separate from the diagram shape/path API. It manages native matrix artifacts and returns row/column/cell data directly.
cameo_create_matrix also accepts optional row_types and column_types lists so native matrix artifacts can be constrained to specific domains when the underlying matrix kind supports it. Use cameo_list_matrix_kinds to see the validated kind aliases and live-proven example type domains.
Relation Maps, Snapshots & Probes (22 tools)
Relation Map native refresh can block CATIA's EDT on large maps. The bridge keeps refresh opt-in for create/configure/render/criteria/expand/collapse paths; call cameo_refresh_relation_map deliberately when you need native UI refresh behavior.
Advanced Native Surfaces (42 tools)
These route families intentionally fail closed when optional CATIA plugins, licenses, or live proof are missing. Preview/refusal payloads are part of the public contract, not placeholder errors.
Diagrams (24 tools)
Validated diagram request tokens: Class, Package, UseCase, Activity, Sequence, StateMachine, Component, Deployment, CompositeStructure, Object, Communication, InteractionOverview, Timing, Profile, BDD, IBD, Requirement Diagram, Parametric Diagram, RelationMap, Content Diagram
Use cameo_list_diagram_types if you want the accepted aliases too. Common forms such as InternalBlockDiagram, SysML IBD, ClassDiagram, and StateMachineDiagram are normalized to the validated token set automatically.
Verification (2 tools)
These verification tools are Python-side wrappers over the bridge's native diagram and matrix readback. They are intended for repeatable regression checks, visual sanity validation, and lightweight quantitative validation without dropping to raw macros.
Semantic Validation (4 tools)
These tools are the semantics-first layer for MBSE review. They use bridge readback plus lightweight Python heuristics to catch the common failure mode where a diagram looks plausible but does not hold together as a reviewable model.
Auto Remediation (2 tools)
These tools do not mutate the model. They exist to bridge the gap between validation and safe repair by returning structured preview steps that later apply flows can consume.
Proofing (2 tools)
Proofing is intentionally scoped to high-confidence name/text fixes. The proof report includes findings, metrics, sections, and a preview patch plan even when auto_apply is off.
Methodology Workflows (4 tools)
For PPTX assembly, install the Python dependencies from mcp-server/pyproject.toml so python-pptx is available in the MCP runtime environment.
State Machine Semantics (4 tools)
These tools give the MCP layer first-class state semantics instead of forcing agents to approximate them through generic specification writes or raw macro fallback.
Specification (3 tools)
Macros (1 tool)
The macro tool is an escape hatch for operations not covered by the structured tools. Scripts have full access to the Cameo OpenAPI, with project, application, primaryModel, and ef (ElementsFactory) pre-injected into the script context.
Important: Scripts that modify the model must manage their own sessions:
import com.nomagic.magicdraw.openapi.uml.SessionManager
SessionManager.getInstance().createSession(project, "My operation")
try {
// ... modify model ...
SessionManager.getInstance().closeSession(project)
} catch (Exception e) {
SessionManager.getInstance().cancelSession(project)
throw e
}
If a macro fails mid-session, use cameo_reset_session to recover.
Usage Examples
Create a SysML Block
Create a block called "Sensor" in the root model package
The AI will:
- Call
cameo_get_projectto find the root model ID - Call
cameo_create_elementwith type "Block", name "Sensor", and the root model ID as parent
Build A State Machine
Create a state machine for an ATM with states OFF, IDLE, ACTIVE, and MAINTENANCE.
Add an initial pseudostate and transitions: initial -> OFF, OFF -> IDLE on startup,
IDLE -> ACTIVE on card insert, ACTIVE -> IDLE on transaction complete, and any state
-> MAINTENANCE on service request.
Query and Modify
Find all requirements in the project and show me their IDs and text
Export Diagrams
Export the "System Overview" diagram as a PNG and save it to my desktop
Run a Groovy Script
Run a macro that lists all profiles loaded in the current project
Known Limitations
Diagram Layout (Primary Pain Point)
The bridge builds models correctly -- elements, relationships, directionality, stereotypes, and structure all come out right. The main gap is diagram presentation: layout, spacing, and visual properties of complex diagrams often need manual adjustment in Cameo's GUI.
cameo_list_diagram_shapes now discovers nested presentation elements recursively, but complex nested editing is still incomplete. Sequence diagrams, composite states, and other deeply nested presentations can still require manual cleanup or Groovy fallbacks. This means:
Workarounds:
- Use
cameo_execute_macrowith Groovy scripts that access nested presentation elements directly - Use
cameo_auto_layout(works well for simple diagrams, less so for complex state machines) - For sequence diagrams: the model is correct, so manual drag-and-drop in Cameo takes 5-10 minutes
- For state machines: widen shapes and toggle region name visibility manually
Current direction: Keep expanding structured editing for nested presentation elements so fewer workflows require macros.
Not Yet Implemented
- Native ReqIF apply -- bridge-owned JSON/CSV requirements import/export is live-verified; native ReqIF apply remains preview/refusal-only until a disposable ReqIF roundtrip is captured
- Optional-product writes -- Teamwork, DataHub, simulation, variants, and safety/cyber extension families expose capability probes and safe previews first; writes require separate live proof
- Remove stereotype -- can apply but not remove
- Delete/rename diagrams -- diagrams can be created and populated but not deleted or renamed through the bridge
- Element reparenting -- cannot move elements between packages
- Undo/redo -- sessions support undo in Cameo's UI, but no MCP tool to trigger it
- Bulk operations -- creating N elements requires N sequential API calls
- Model change notifications -- purely request/response; no event subscription
- File-based diagram export --
cameo_get_diagram_imagereturns base64 over the wire; no option to save directly to a file path (usecameo_execute_macrowithImageExporter.export(dpe, ImageExporter.PNG, file)as a workaround)
API Gaps
- DurationConstraint / TimeConstraint creation through macros is unreliable due to complex ownership chains in the Cameo API (
DurationInterval.setMin/setMaxrequiresDurationinstances with specific ownership that the API rejects); add these manually in Cameo's UI - Large diagram images can still exceed MCP client token limits at full resolution; prefer
cameo_get_diagram_image(include_image=false)for metadata-only reads or usemax_width/max_heightwithformat="jpeg"before dropping to a macro-based file export - Direct file export is still not first-class; if you need the bridge to save a diagram straight to disk, use
cameo_execute_macrowithImageExporter.export(...) - Session recovery edge case -- if a macro crashes mid-transaction,
cameo_reset_sessionmay itself throwTransactionAlreadyCommitedException; in this case, saving and reopening the project is the most reliable recovery
Compatibility
- Tested with CATIA Magic Systems of Systems Architect 2024x
- Should work with any Cameo Systems Modeler 2024x bundle (2024x+)
- Requires Groovy script engine (bundled with Cameo) for macro execution
- The Gradle build requires access to Cameo's
lib/directory for compile-time dependencies
Security Considerations
This bridge is designed for local development use only.
- The HTTP server binds to
127.0.0.1(localhost only) -- not accessible from the network - There is no authentication on the HTTP endpoints
- The
cameo_execute_macrotool executes arbitrary Groovy code inside the Cameo JVM with full access to the filesystem, network, and classloader - CORS headers are set to
*(wildcard) -- any webpage in a local browser could theoretically make requests to the bridge
Do not expose the bridge port to the network, run it on shared/multi-user machines without additional access controls, or use it in production environments without adding authentication.
Project Structure
cameo-mcp-bridge/
mcp-server/ # Python MCP server
cameo_mcp/
__init__.py
client.py # HTTP client for the Java plugin
server.py # MCP tool definitions (162 tools)
verification.py # reusable diagram/matrix verification helpers
methodology/ # Phase 2 pack registry + recipe runtime
registry.py
runtime.py
service.py
pyproject.toml
plugin/ # Java Cameo plugin
src/com/claude/cameo/bridge/
CameoMCPBridgePlugin.java # Plugin entry point
HttpBridgeServer.java # Embedded HTTP server + routing
handlers/
ProjectHandler.java # Project info, save
ElementQueryHandler.java # Element search, get, relationships
ElementMutationHandler.java # Create, modify, delete elements
RelationshipHandler.java # Create relationships
MatrixHandler.java # Native matrix artifacts
GenericTableHandler.java # Native Generic Tables
DiagramHandler.java # Full diagram lifecycle
RelationMapHandler.java # Relation Map graph/settings/rendering
UiStateHandler.java # Active diagram and selection state
SnapshotHandler.java # In-memory evidence snapshots
ValidationHandler.java # Native validation suites
ReportWizardHandler.java # Report Wizard templates/generation
ImportExportHandler.java # Requirements import/export
CriteriaHandler.java # Criteria expression helpers
TeamworkHandler.java # Teamwork read-only probes
DataHubHandler.java # DataHub capability/source probes
SimulationHandler.java # Simulation preview/run facade
ExtensionProbeHandler.java # Safety/cyber extension probes
ContainmentTreeHandler.java # Containment tree browsing
SpecificationHandler.java # Specification read/write
MacroHandler.java # Groovy script execution
util/
EdtDispatcher.java # EDT dispatch with session management
ElementSerializer.java # Element to JSON serialization
JsonHelper.java # JSON parsing utilities
plugin.xml # Cameo plugin descriptor
build.gradle # Gradle build config
install.sh # One-step installer
LICENSE
README.md
Development
Building the Plugin
cd plugin
./gradlew assemblePlugin -PcameoHome="/path/to/CatiaMagic"
The output goes to plugin/build/plugin-dist/com.claude.cameo.bridge/.
Running the MCP Server Standalone
python -m cameo_mcp.server
This starts the MCP server on stdio. It will fail to connect to the Java plugin unless Cameo is running with the plugin loaded.
Adding a New Tool
- Add the HTTP handler method in the appropriate Java handler class
- Register the route in
HttpBridgeServer.registerHandlers() - Add the async client function in
client.py - Add the MCP tool function with docstring in
server.py
The MCP tool docstrings are critical -- they are the AI's instruction manual. Include valid values, examples, common mistakes, and cross-references to related tools.
Contributing
Issues and pull requests welcome. If you're building something similar for other MBSE tools, let's talk.
Areas where contributions would be especially valuable:
- Additional element and relationship type support
- Bulk operation endpoints
- Test coverage
- Support for Cameo Teamwork Cloud projects
- SysML v2 profile support
License
Related: MBSE Agents
Use with mbse-agents for standards-aware modeling across aerospace, defense, automotive, and medical device domains. The agents provide practitioner-level domain knowledge (ARP4754A, DoDAF, ISO 26262, IEC 62304). This bridge provides direct tool access. Together: an AI that knows the standards at the clause level AND can modify your Cameo model.