Skip to main content
Glama
README.md
# Creo MCP

An MCP server that lets AI assistants (Claude, GPT, Gemini, local models) drive
**PTC Creo Parametric 11**: create real features (extrudes, holes, rounds, chamfers, shells,
sweeps, datums, any element-tree feature), read geometry, edit parameters and dimensions,
build assemblies and drawings, and export.

> Independent open-source project. Not affiliated with or endorsed by PTC.
> "Creo" and "Creo Parametric" are trademarks of PTC Inc.
> You need your own licensed copy of Creo. This repository contains no PTC files.

## How it works

```
                                  ┌─HTTP :9056──► CREOSON (Java, J-Link) ──────────────────┐
AI client ──MCP (stdio)──► creo_mcp (Python)                                               ├─► Creo 11
                                  └─HTTP :9057──► creo-otk (Object TOOLKIT Java, in Creo) ─┘
```

Two channels into Creo:

- **creo-otk** (`creo-otk/`): our own Object TOOLKIT Java app. Creo loads it at startup. It
  creates features through element trees, reads geometry, and runs `java_exec` for anything else.
  An optional C TOOLKIT helper DLL (`creo-otk/tk/`) adds a sketch solver for closed line/arc
  profiles.
- **CREOSON** ([GitHub](https://github.com/SimplifiedLogic/creoson), free, MIT): files,
  parameters, dimensions, assemblies, drawings, export, UDF placement. All ~200 CREOSON functions
  are reachable. `creoson-udf/` is a small CREOSON add-on for UDF placement.

More detail: [DESIGN.md](DESIGN.md) (architecture, rules, limits) and
[FINDINGS.md](FINDINGS.md) (research notes).

## Tools (85 in the default `core` set)

| Group | Tools |
|---|---|
| Session | `creo_status`, `creo_start`, `creo_stop`, `creo_dialogs`, `creo_set_working_dir`, `creo_list_files`, `otk_status`, `sketch_solver_enable` |
| Models | `model_new`, `model_open`, `model_list_in_session`, `model_activate`, `model_save`, `model_close`, `model_regenerate`, `model_info`, `model_rename`, `model_mass_properties` |
| Create features | `feature_box`, `feature_extrude`, `feature_revolve`, `feature_sweep`, `feature_boundary_blend`, `feature_fill`, `feature_merge`, `feature_solidify`, `feature_thicken`, `feature_rib`, `feature_hole`, `feature_round`, `feature_chamfer`, `feature_shell`, `feature_group`, `feature_pattern_axis` |
| Datums | `feature_datum_plane`, `feature_datum_plane_angle`, `feature_datum_axis`, `feature_datum_points`, `feature_datum_curve`, `feature_datum_curve_equation` |
| Sheet metal | `smt_planar_wall`, `smt_bend` |
| Any feature | `feature_tree_create`, `feature_tree_dump`, `feature_tree_redefine`, `toolkit_doc`, `toolkit_lookup` |
| Anything else | `java_exec` (Java against the full Object TOOLKIT API, inside Creo) |
| Geometry | `geometry_list`, `geometry_describe` |
| Feature tree | `feature_list`, `feature_suppress`, `feature_resume`, `feature_delete`, `feature_rename` |
| Params / dims / relations | `param_list`, `param_set`, `param_delete`, `dim_list`, `dim_set`, `relations_get`, `relations_set` |
| Materials | `part_set_material`, `part_set_material_props` |
| Assembly | `asm_list_components`, `asm_add_component`, `asm_assemble`, `asm_interference`, `asm_clearance` |
| Exchange / visual | `model_export`, `model_import`, `view_orient`, `creo_screenshot` |
| UDFs | `udf_list`, `udf_inspect`, `udf_place`, `udf_list_groups` |
| Pro/PROGRAM and macros | `program_get`, `program_set`, `macro_run` |
| Drawing | `drawing_create`, `drawing_add_view` |
| Everything in CREOSON | `creoson_list_functions`, `creoson_describe`, `creoson_call` |

Set `CREO_MCP_TOOLSET=full` to also get one typed tool per CREOSON function (`cs_<command>_<function>`,
199 more). Small models do better with `core`.

## Requirements

- **Windows** with **PTC Creo Parametric 11** and a valid license. Running an Object TOOLKIT app
  (creo-otk) and building the C TOOLKIT DLL may need extra PTC TOOLKIT licenses: check your PTC
  entitlement before you use those parts.
- **JDK 21** (any vendor, for example [Eclipse Temurin](https://adoptium.net/)). Creo uses it to run
  creo-otk, and the build scripts use it to compile the Java code.
- **CREOSON 3.0.2**: download the Windows server zip from the official
  [CREOSON releases](https://github.com/SimplifiedLogic/creoson/releases) and unzip it. The server zip includes its own JRE.
- **Python 3.11+**.
- **Git Bash** (for the `build.sh` scripts).
- Optional: **Visual Studio Build Tools (MSVC)** to build the C TOOLKIT sketch-solver DLL.

## Setup

1. Clone and create a virtual environment:

   ```powershell
   git clone https://github.com/theGodspeed1999/creo-mcp.git
   cd creo-mcp
   python -m venv .venv
   .venv\Scripts\pip install -e .
   ```

2. Set the paths (PowerShell, current user). Use your own folders:

   ```powershell
   setx CREO_HOME "C:\Program Files\PTC\Creo 11.0.1.0"
   setx CREOSON_HOME "C:\tools\creoson"
   setx JAVA_HOME "C:\Program Files\Eclipse Adoptium\jdk-21"
   ```

3. Build the Java parts (in Git Bash, from the repo folder). They compile against `otk.jar` and
   `pfcasync.jar` from your own Creo install, which are never copied into this repo:

   ```bash
   bash creo-otk/build.sh boot      # creo-otk-boot.jar + creo-otk.jar
   bash creoson-udf/build.sh        # creoson-udf.jar (optional: needed for udf_place)
   ```

4. Optional: build the sketch-solver DLL (Developer prompt or plain cmd with MSVC installed):

   ```powershell
   creo-otk\tk\build.bat
   ```

   Then call the `sketch_solver_enable` tool once. Creo shows a security prompt for the DLL the
   first time; answer it in Creo.

5. Add the server to your AI client. Copy `.mcp.json.example` to `.mcp.json` and fix the paths,
   or for Claude Code:

   ```powershell
   claude mcp add --scope user creo -- "C:\path\to\creo-mcp\.venv\Scripts\python.exe" -m creo_mcp
   ```

   Other clients (Claude Desktop, Cursor, Windsurf, Gemini CLI) use the same `mcpServers` JSON as
   `.mcp.json.example`. Codex CLI (`~/.codex/config.toml`):

   ```toml
   [mcp_servers.creo]
   command = 'C:\path\to\creo-mcp\.venv\Scripts\python.exe'
   args = ["-m", "creo_mcp"]
   env = { CREO_MCP_TOOLSET = "core" }
   ```

### Settings (environment variables)

| Variable | Default | Meaning |
|---|---|---|
| `CREO_HOME` | `C:\Program Files\PTC\Creo 11.0.1.0` | Creo install folder |
| `CREOSON_HOME` | `<repo>\creoson` | Unzipped CREOSON folder |
| `CREOSON_URL` | `http://localhost:9056/creoson` | CREOSON address |
| `CREO_MCP_JDK` or `JAVA_HOME` | (none; falls back to `<repo>\tools\jdk-21*`) | JDK 21 for creo-otk |
| `CREO_WORKDIR` | `<repo>\work` | Creo working folder |
| `CREO_VERSION` | `11` | Creo major version |
| `CREO_MCP_TOOLSET` | `core` | `core` or `full` |
| `CREOSON_EXTENSION_JAR` | `<repo>\creoson-udf\creoson-udf.jar` | CREOSON add-on jar |
| `CREOMCP_TK_DLL` | `<repo>\creo-otk\tk\creomcp_tk.dll` | Sketch-solver DLL |

## Quick demo

Start Creo through the server so creo-otk is loaded: ask the AI to call `creo_start`, or run
`.\start_creo.ps1`. (A Creo started from the desktop icon has no creo-otk; `creo_stop` it first.)

Then ask your AI something like:

> Make a new part BRACKET. Add a 100 x 60 x 10 mm plate, a 20 mm through hole in the middle,
> 5 mm rounds on the four vertical edges, then export a STEP file.

A typical tool flow: `model_new` → `feature_box` / `feature_extrude` → `geometry_list` (find face
and edge ids) → `feature_hole` → `feature_round` → `model_export`. Every feature result includes the
model's new bounding box and volume, so the AI can check its work. For a feature without its own
tool: `toolkit_doc("ProSweep")` → `feature_tree_dump` of a similar feature → edit →
`feature_tree_create`.

## Tests

All tests are in one file and run against a live Creo (the tests start it with `creo_start`):

```powershell
.venv\Scripts\python tests\test_all.py              # everything
.venv\Scripts\python tests\test_all.py otk mcp      # chosen sections
```

Sections: `creoson`, `tools`, `udf`, `watchdog`, `otk`, `primitives`, `mcp`. Test parts are copied
from Creo's own sample folders into `work\`.

## Known limits

- **Angled cut crash**: an angled polygon cut on a datum plane offset from TOP crashed Creo
  (`xtop.exe`, `EXCEPTION_ACCESS_VIOLATION`) twice in testing. Avoid that case for now. Plain solid
  extrudes work.
- **Sketch profiles without the DLL**: the Object TOOLKIT Java API cannot add sketch constraints,
  so closed line/arc loops do not make solids. Circles, ellipses, surfaces, thin solids and
  `feature_box` work. Build the C TOOLKIT DLL to lift this.
- **Modal dialogs block everything**: `creo_status` lists open Creo dialogs and `creo_dialogs`
  returns images of them. A person must answer them in Creo.
- **UDF placement can stall** if Creo waits for a manual pick ("Select ..."). Middle-click in Creo.
- **`java_exec` runs on Creo's main thread**: an endless loop freezes Creo.
- Windows and Creo 11 only. Tested on Creo 11.0.1.0 with CREOSON 3.0.2.
- `tests/test_all.py` checks a core tool count of 78; the server now has 85, so that one check
  fails until it is updated.

## License

MIT, see [LICENSE](LICENSE). Third-party notices: [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).

TDQS

B3.1/5.0

Scored across 85 tools

Disambiguation3/5

Most tools target distinct CAD operations, and the detailed descriptions help separate similar modeling features. However, there is real overlap between asm_add_component and asm_assemble, part_set_material and part_set_material_props, and model_info and model_mass_properties. The multiple general escape hatches (feature_tree_create, java_exec, creoson_call, macro_run) also have potentially unclear boundaries for an agent choosing an approach.

Naming Consistency4/5

Names are consistently snake_case and grouped by domain prefixes such as creo_, model_, feature_, asm_, part_, udf_, and drawing_. There are minor deviations in structure, such as model_mass_properties and part_set_material_props lacking a clean verb, but the convention remains readable and predictable.

Tool Count1/5

With 85 tools, the surface is far beyond a well-scoped MCP toolset and is likely to overwhelm tool selection and context. Even for a broad CAD domain, this is an extreme number that pushes most operations into a large, manually navigated catalog.

Completeness4/5

The set covers a very broad CAD lifecycle: Creo startup, model open/save/regenerate, feature creation, assembly placement and checks, drawings, sheetmetal, parameters, relations, UDFs, geometry queries, import/export, and advanced TOOLKIT/CREOSON escape hatches. Some gaps remain, such as dedicated drawing annotation tools, file deletion, and direct family-table/layer/note operations, but generic CREOSON calls can usually work around them.

Maintenance

ActivityNo data
ResponsivenessOutdated data