Content
# Inventor MCP Server
A [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server that puts Autodesk Inventor under the control of an AI assistant via COM automation. It runs as a standalone process alongside a running Inventor instance and exposes tools that an MCP-capable client — e.g. Claude Desktop, Claude Cowork, or Cursor — can use to drive Inventor directly: sketching, creating features, assembling parts, generating drawings, and exporting files.
No plugin, no cloud connection: the server talks to your local Inventor installation directly over `pywin32`/COM.
## Requirements
- Windows with **Autodesk Inventor** installed (tested with 2027.1, should work with other reasonably recent versions)
- Python 3.10+
- An MCP-capable client (Claude Desktop, Claude Cowork, Cursor, VS Code, etc.)
## Installation
```bash
pip install "mcp[cli]" pywin32
```
Inventor needs to be running by the time the first tool is called (the server connects to an active instance, or starts a new one if needed).
## Adding it to your MCP client
Add the server to your client's config file (for Claude Desktop/Cowork this is `claude_desktop_config.json`):
```json
{
"mcpServers": {
"inventor-mcp": {
"command": "python",
"args": ["C:/path/to/inventor_mcp_server.py"]
}
}
}
```
Restart the client afterwards so the tools get picked up.
## Feature overview
### Connection
| Tool | Description |
|---|---|
| `ping` | Checks the connection to Inventor and returns the version |
### Base geometry & sketches
| Tool | Description |
|---|---|
| `create_part` | Create a new, empty part document (`.ipt`) |
| `create_box` | Box from a rectangle sketch + extrusion |
| `create_cylinder` | Cylinder from a circle sketch + extrusion |
| `create_revolve` | Revolved solid (disc, cylinder, tube/ring, partial revolve) |
| `extrude_cut` | Cut a rectangular pocket out of an existing body |
All sketch-based tools attempt to make their sketches **fully constrained** — with real dimensions (`DimensionConstraints`) and geometric constraints (`GeometricConstraints`) instead of loose, under-constrained geometry. Every tool's response reports the resulting constraint status (`fully` / `partially`); constraining is best-effort and never fails at the expense of the geometry itself.
### Features
| Tool | Description |
|---|---|
| `add_hole` | Hole at position (x, y); through-hole or with a given depth |
| `add_fillet` | Fillet; optionally filtered to `all`, `top`, `bottom`, or `vertical` edges |
| `add_chamfer` | Chamfer; same edge filters as `add_fillet` |
| `pattern_rectangular` | Rectangular pattern of the most recently created hole |
| `pattern_circular` | Circular pattern (bolt circle) of the most recently created hole |
### Parametrics
| Tool | Description |
|---|---|
| `get_parameters` | List all model parameters with name, expression, and value |
| `set_parameter` | Change a parameter via expression (e.g. `"50 mm"`) and update the model |
### Inspection
| Tool | Description |
|---|---|
| `get_properties` | Read iProperties (design tracking) |
| `get_mass_properties` | Mass, volume, surface area, center of mass |
| `list_features` | List existing features by type |
### File & export
| Tool | Description |
|---|---|
| `save_document` | Save the active document |
| `open_document` | Open an existing `.ipt`/`.iam`/`.idw` |
| `export_step` | STEP export |
| `export_stl` | STL export (3D printing) |
| `export_dxf` | DXF export (mainly for sheet-metal flat patterns) |
| `export_dwg` | DWG export of a drawing |
### Assemblies
| Tool | Description |
|---|---|
| `create_assembly` | Create a new, empty assembly (`.iam`) |
| `place_component` | Place a part/assembly at position (x, y, z) |
| `list_occurrences` | List components in the active assembly |
### Drawings
| Tool | Description |
|---|---|
| `create_drawing` | Create a drawing with 4 standard views (front, top, side, iso) from a model |
## Known limitations
- **No real assembly constraints.** `place_component` only positions components via coordinates; it doesn't set mate/flush relationships. Interactive face/edge selection without a UI is fragile, so this was deliberately left out rather than shipping something unreliable.
- **Patterns operate on the most recently created hole.** `pattern_rectangular` and `pattern_circular` deliberately duplicate only the last `add_hole` feature, not arbitrary features.
- **Fillet/chamfer without a filter affect all edges** of the first solid body. Use `edges="top"/"bottom"/"vertical"` to narrow it down; finer selection (e.g. individual named edges) isn't available.
- **Full constraint is best-effort.** In mixed-position cases (one coordinate exactly 0, the other not — e.g. `create_revolve` with an inner radius), the sketch currently ends up only partially constrained, since only positional dimensions are applied, not alignment constraints for the zero axis.
- **No sheet metal, no automatic drawing dimensioning/title block filling.** `create_drawing` only places views, without automatic dimensioning.
- Tested on Windows with Inventor 2027.1. Older/newer versions should generally work, since the code consistently uses `win32com.client.gencache` (real constants pulled from the type library) rather than guessed enum values — but individual versions haven't been tested.
## Notes for contributors
- The server uses `win32com.client.gencache.EnsureDispatch` to load real enum constants from Inventor's type library (`win32com.client.constants`) instead of guessing numeric values.
- Many COM return values are generically typed (e.g. `Document` instead of `PartDocument`, `SketchEntity` instead of `SketchLine`) and need to be cast to the concrete type via `win32com.client.CastTo(...)` before type-specific properties become accessible. This affects, among others, `PartDocument.ComponentDefinition`, `TranslatorAddIn.SaveCopyAs`, and `SketchLine.StartSketchPoint`.
- Dimensioning handles a special case: projecting the model origin into a sketch that already has a point at the same location causes Inventor to automatically merge the two points. An explicit coincident constraint between the now-merged pair is then invalid (`E_INVALIDARG`) and unnecessary — the server detects this via a coordinate comparison and skips the constraint.
- One operation per tool call; batching multiple operations into a single COM call has proven unstable.
## License
GPL-3.0
## Disclaimer
This project is an unofficial community tool and is not affiliated with Autodesk. Use at your own risk — in particular, write operations (creating features, saving, exporting) act directly on the open Inventor instance.