Blog · Inventor · 1 Oct 2026 · Last updated 10 Oct 2026 · 6 min read · By Stefano B.
How to drive Autodesk Inventor from the terminal without an MCP server
There is no official Inventor MCP server, and you do not need one. An AI agent can drive Inventor 2025 over COM from the command line, from VBScript or Python, even while someone is using Inventor. The method that works, the ones that do not, the error codes you will see, and the rules that keep a run from breaking.
Short answer: attach to the Inventor that is already open with GetObject, from a VBScript run with cscript. That gives an AI agent working in a terminal, such as Claude Code, the whole Inventor API: open files, create drawings, read geometry, export DXF and PDF. No MCP server, no add-in, no plugin. Python works too, with late binding (see below), and the agent can do all of it while you keep working in the same Inventor.
Everything below was tested on Inventor 2025 on Windows 11, during months of batch work on hundreds of steel parts for our CAD drawing automation.
The method that works
- Open Inventor yourself and leave it open. The script attaches to it, it does not start it.
- Write the script as a
.vbsfile. - Attach with
GetObject, and stop with a clear message if Inventor is not running. - Run it with
cscript //nologo script.vbsfrom the terminal. The agent reads the output and decides the next step.
' attach.vbs - run with: cscript //nologo attach.vbs
Dim oApp
On Error Resume Next
Set oApp = GetObject(, "Inventor.Application")
If Err.Number <> 0 Then
WScript.Echo "ERROR: Inventor is not running (err " & Err.Number & ": " & Err.Description & ")"
WScript.Quit 3
End If
On Error Goto 0
oApp.SilentOperation = True ' no dialogs during Open/Add
WScript.Echo "Attached. Open documents: " & oApp.Documents.Count
SilentOperation = True before Documents.Open or Documents.Add stops the dialogs that would otherwise freeze the script waiting for a click nobody will make.
The four methods that do not work
| Method | What happens | Why |
|---|---|---|
CreateObject("Inventor.Application") with Inventor open |
0x80080005 CO_E_SERVER_EXEC_FAILURE |
It tries to start a second Inventor. |
CreateObject with Inventor closed |
error 429 |
No running server to attach to. |
Inventor.exe /Automation |
The process stays at about 70 MB, never registers and dies | Not a usable way to start a scriptable instance here. |
GetActiveObject from PowerShell |
Type library is not registered (0x80131165) |
Use cscript instead. |
Rule: GetObject first, CreateObject only as a fallback. Never close or hide an instance you attached to: it is the user's.
When VBScript is not enough: compiled C
Some API methods return arrays by reference: SurfaceEvaluator.GetNormal, Evaluator2D.GetParamExtents, Matrix.AsArray. VBScript cannot call them. We tried every route:
| Caller | Result |
|---|---|
| VBScript | Type mismatch (13) |
| PowerShell 7, late-bound | Cannot convert psobject to ref |
| PowerShell 7, typed | Cannot convert System.__ComObject to Inventor.Application |
| Compiled C# | works |
The agent writes a small C# program and compiles it with the csc.exe that ships with .NET Framework:
csc.exe /target:exe /platform:x64 /out:Probe.exe ^
/reference:"C:\Program Files\Autodesk\Inventor 2025\Bin\Autodesk.Inventor.Interop.dll" Probe.cs
Four traps:
- Copy the Interop DLL next to the
.exe, or it fails at run time withFileNotFoundException. - The .NET Framework
csc.exeis an old compiler: no tuples. Inventor.Fileclashes withSystem.IO.File. Qualify one of them.- Run
csc.exefrom PowerShell, not Git Bash. Git Bash turns/nologointo a file path.
From Python, while you keep working
Since October 2026 we also drive Inventor from Python (pywin32), in the same Inventor the user has open, without asking them to stop. Tested on Inventor 2025.2.
import pythoncom, win32com.client.dynamic as dy
app = dy.Dispatch(pythoncom.GetActiveObject("Inventor.Application")
.QueryInterface(pythoncom.IID_IDispatch))
late = lambda o: dy.Dispatch(o._oleobj_.QueryInterface(pythoncom.IID_IDispatch))
doc = late(app.Documents.Open(r"C:\work\part.stp", False)) # False = invisible
# ... work on doc ...
doc.Close(True) # True = skip save
Rules that came out of it:
- Use late binding.
win32com.client.GetActiveObjectfailed withKeyError: '_dispobj_', and a document fromDocuments.Addcame back as a genericDocumentwith noComponentDefinition. Wrapping every object indynamic.Dispatch, as above, fixed both. - Open and create documents invisible (
Documents.Open(path, False),Documents.Add(type, template, False)). Nothing appears on the user's screen. - Never touch documents you did not open. List them first: if one has unsaved changes (
Dirty = True), it is the user's work. Close only yours, by name, and check the list again at the end. Invisible documents can stay inDocumentsafterClose, so close in a loop and re-list. - iLogic rules run from Python through the add-in:
ApplicationAddIns.ItemById("{3BDD8D79-2179-4B11-8A5A-257B1C0263AC}").Automation, thenAddRule(doc, name, text)andRunRule(doc, name), on an invisible document. Late binding is what makes the calls that take a document work. - A rule must not open a window. A
MessageBoxwaits for a click nobody makes. For unattended runs, write messages to a file.
When a rule breaks, the user sees it
- A compile error opens a modal window on the user's screen ("Rule Compile Errors in ...") and the script waits forever. Run with a timeout, then list the windows of the Inventor process. Pressing Cancel through UI Automation left the window open;
WindowPattern.Close()closed it. - After a failed call, iLogic can stay broken. We got
Catastrophic failure (0x8000FFFF)on every rule, even a one-line one, until Inventor was restarted. Restarting is the user's call: save their work first. - VB names are not case-sensitive. A variable called
oNis the keywordOn: "Keyword is not valid as an identifier". ConstaboveSub Main()gives "Statement is not valid in a namespace". Declare insideSub Main.
Errors you will meet, and what they mean
| Symptom | Cause | Fix |
|---|---|---|
Unspecified error on export, naming nothing |
Opening an .idw also opens its .ipt; closing the .idw does not close the model. The orphans break the next export. |
Close every document the script opened, even when it fails. |
Save fails with Unspecified error, and the file on disk is the old version |
Several Inventor processes running | Check for one process before saving. Back up first, and verify the backup's checksum. |
Documents.Add hangs, Close returns 0 and closes nothing |
UserInteractionDisabled = True with a visible drawing |
Restart Inventor. |
| The script never starts | A modal window is open in Inventor (for example Measure) | Close it. A script cannot get past it. |
Get-Process breaks with "cannot convert" |
Two Inventors open: it returns an array | Find the right one through Application.MainFrameHWND. |
A renamed .ipt stays locked after Close True |
Renaming broke the link to the .idw; Inventor keeps the file |
Do not rename parts that drawings point to while Inventor is open. |
cscript runs past two minutes |
Large drawings, normal | Wait. Do not launch it again while it runs. |
| Half the files are new and half are old | An interrupted run | Look at file times: two separate groups means a mixed folder. Run it all again. |
Do and don't
Do
- Attach with
GetObjectfromcscript. - Set
SilentOperation = Truebefore opening or creating documents. - Close what you open, in every exit path.
- Copy a style before you change it. Built-in styles are shared by other annotations.
- Leave documents with unsaved changes alone. They belong to the user: close without saving.
- Read API signatures from the Interop DLL by reflection. Enum values written from memory were wrong.
Don't
- Don't start a second Inventor.
- Don't edit title block definitions by script. It corrupted a template.
- Don't use
Diminside aFor Eachin VBScript: it fails on the second pass. - Don't use
CIntfor counts or IDs: it overflows at 32767. UseCLng. - Don't trust "no error".
AddTitleBlockwith prompt strings returned success and left every field empty.
Questions people ask
Is there an official Inventor MCP server? Not as of October 2026. Autodesk has an official MCP server for Revit and one for its product help pages, which only reads documentation. For Inventor there are community projects, and they wrap the same COM API shown here. You can use that API directly: the terminal is the interface.
Can Python drive Inventor?
Yes, with late binding (win32com.client.dynamic), see above. We use it when the agent works in the Inventor someone is using. VBScript and compiled C# still work as described.
Does Inventor have to be open? Yes. The script attaches to the running application.
Can it run iLogic rules from outside?
From Python with late binding, yes: AddRule and RunRule on the iLogic add-in's Automation object. From VBScript the calls that take a document fail, and you need a bridge: how to run an iLogic rule from outside Inventor.
How do you know a run worked? By opening what it produced. A script that ends without errors has not proved anything. See Inventor API errors and what they mean.
If you would rather have the drawings than the scripts: CAD drawing automation for steel fabrication.