Metadata-Version: 2.5
Name: fusion360-mcp
Version: 0.1.1
Summary: MCP bridge that lets Claude Code drive Fusion 360 — run Python in the live session
Project-URL: Homepage, https://github.com/artapo/fusion360-mcp
Project-URL: Issues, https://github.com/artapo/fusion360-mcp/issues
Author: artapo
License: Apache-2.0
License-File: LICENSE
License-File: NOTICE
Keywords: autodesk,cad,claude,fusion360,mcp
Classifier: Environment :: Plugins
Classifier: Intended Audience :: Manufacturing
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Multimedia :: Graphics :: 3D Modeling
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# fusion360-mcp

Lets Claude Code drive Fusion 360: runs Python inside the live session with
the full API available — build geometry, read dimensions, walk the timeline.

*[Leia em português](README.pt-BR.md)*
[![Buy Me A Coffee](https://img.shields.io/badge/Buy%20Me%20A%20Coffee-support-FFDD00?logo=buymeacoffee&logoColor=black)](https://buymeacoffee.com/artapo)

```python
result = snapshot()
# doc: bearing.f3d  [mm]  sketches:7  timeline:16
# bodies: 11
#   outer_ring_flanged       173.978 mm3  17x17x4.6  faces:10
#   ball x7                    2.572 mm3  1.7x1.7x1.7  faces:1
```

## Install

```bash
uvx fusion360-mcp install
```

Installs all three pieces: the add-in inside Fusion, the `fusion360-api`
skill in `~/.claude/skills/`, and the MCP entry in Claude Code.

Then in Fusion: **Utilities → ADD-INS → Add-Ins**, select "Claude MCP" and
press **Run**. Tick *Run on Startup* to skip this next time. The add-in has
to be running for the bridge to answer.

```bash
uvx fusion360-mcp status      # what is installed where
uvx fusion360-mcp uninstall   # take it back out
```

Close Fusion before installing — it holds the add-in files open. The
installer detects this and tells you rather than corrupting the copy.

## Requirements

- Fusion 360 (Windows or macOS), version **2704.1.36 or newer** — that is the
  oldest build this was verified on. Older ones are untested, not known to be
  broken. The API changes between versions: `TimelineObject.deleteObject`, for
  instance, is missing before ~2705, so the bridge falls back to
  `entity.deleteMe()` for undo and rollback. Check yours with
  `result = app.version`.
- Claude Code
- Python 3.9+

No runtime dependencies: the MCP server speaks JSON-RPC using only the
standard library.

## How it works

Fusion only accepts API calls on its main thread. The add-in runs an HTTP
server on a background thread and hands each request to the main thread via
a `CustomEvent`; the HTTP thread blocks until the result comes back.

```
Claude Code  --stdio-->  server.py  --HTTP:8766-->  add-in  -->  Fusion
```

Requests carry a bearer token from `~/.claude-fusion-secret`, created on
first run. Without it any local process could execute Python in your Fusion
session.

## The tool

`fusion_eval` takes Python source and returns whatever you assign to
`result`. `adsk`, `app`, `ui`, `design` and `root` are pre-bound, plus three
helpers:

| | |
|---|---|
| `snapshot()` | Model state as compact text. Identical bodies collapse into one line, so a 50-instance pattern costs the same as one body. |
| `screenshot(w, h, view)` | Renders the viewport and returns the image inline. Expensive (~10k tokens) — prefer `snapshot()` when numbers are what matter. |
| `undo()` | Reverts the last call that changed the model. One level. A call that raises is rolled back automatically. |

## The skill

The package also installs the `fusion360-api` skill, which documents the
API's traps — internal units in cm and radians, signatures that vary per
feature, material names that follow the UI language. Every section came from
a real mistake.

The skill is the part that compounds. Code gets written once; the traps keep
being discovered, and each one someone writes down is a trap nobody after
them loses an hour to.

## Found a trap? Send it back

**If the API surprised you, that's worth a PR.** A method whose real name
differs from the obvious one, a signature that changes per feature, an
operation that fails silently, a value that only works in one unit — that is
exactly what belongs in the skill, and it's the kind of thing no
documentation lists because it only shows up in practice.

The bar is low on purpose. You don't need to fix anything or write well:

- **Two calls are enough** — the one that failed and the one that worked.
  Paste the real `fusion_eval` output, including the error message; that's
  what someone will search for when they hit the same wall.
- **Say what you were building.** Context separates a general trap from a
  one-off accident, and it's usually the difference between a note that
  helps and one that confuses.
- **One PR per finding.** Unrelated findings on separate branches review
  faster and don't block each other.
- **Corrections beat additions.** If something in the skill is wrong or went
  stale, saying so is more valuable than a new section — a skill that
  describes the tool wrongly is worse than an incomplete one. Put it in the
  title and it gets reviewed first.

The file is `src/fusion360_mcp/skill/SKILL.md`; the full rules are at the
top of it. It's written in English so contributors anywhere can maintain it.

Not sure it's worth reporting? Open the PR anyway. Deciding is the
maintainer's job, and an unreported trap costs the next person the same hour
it cost you.

## Contributing code

```bash
git clone https://github.com/artapo/fusion360-mcp
cd fusion360-mcp
python test_mcp_server.py    # passes whether Fusion is open or closed
```

The test runs without Fusion installed — it accepts either a live answer or
"Cannot reach Fusion". CI runs it on Linux, macOS and Windows.

## License

[Apache 2.0](LICENSE) — as permissive as MIT, plus an explicit patent grant
that protects both users and contributors.

Fusion 360 is a trademark of Autodesk, Inc. This project is not affiliated
with or endorsed by Autodesk.
