1 Using an AI assistant
James edited this page 2026-11-25 00:30:55 -05:00

Using an AI assistant

Anvil can let an AI assistant work on your model with you. Connected, the assistant can read the document you have open -- the parameters, every feature and why one is red, the sketches, the faces and edges of each body -- look at the window, and make the changes you ask for: set a parameter, add a fillet, draw and dimension a sketch, extrude it. You see each change happen, and each one is a single step you can undo.

It works with any assistant whose program speaks the Model Context Protocol (MCP), such as Claude Code. Anvil 0.2.0 or later is needed.

Setting it up

1. Install or upgrade Anvil

On Fedora:

sudo dnf upgrade --refresh anvil      # or: sudo dnf install anvil

On CachyOS and Arch:

sudo pacman -Syu anvil

If Anvil is not installed yet, Installation adds the repository first. anvil --version should say 0.2.0 or later.

2. Turn on the assistant connection

The connection is off until you turn it on. In Anvil, choose Edit > Assistant connection; it stays on the next time you start Anvil, until you turn it off again.

To turn it on for one session only, start Anvil from a terminal with --assistant:

anvil --assistant my-part.anvil

3. Connect your assistant

Claude Code -- run once:

claude mcp add --scope user anvil -- anvil --mcp

--scope user makes Anvil available in every directory you run claude from; leave it out to add it to the current project only. claude mcp list should then show anvil as connected.

Other MCP clients -- add a server that runs the command anvil with the argument --mcp over standard input and output. Most clients take it in a JSON settings file like this:

{
  "mcpServers": {
    "anvil": { "command": "anvil", "args": ["--mcp"] }
  }
}

4. Try it

With Anvil open on a part, ask your assistant something about it:

claude "What's in the part I have open in Anvil?"

What to ask

  • Why is the fillet red? -- it reads the error and what it points at.
  • Make the wall thickness a parameter and set it to 2.4 mm.
  • Round the four vertical edges with a 3 mm fillet.
  • Sketch a 40 by 30 mm rectangle centred on the origin with a 10 mm hole in the middle, fully constrained, and extrude it 5 mm.
  • Put an M3 heat-set insert hole in the middle of the top face.
  • What have I got selected? -- select a face or an edge in Anvil, then ask about "this face".
  • Take a screenshot and tell me if the bosses line up.

The assistant can see what you see: ask it to look before and after a change.

What it can do

Read The whole document; one feature in detail; a sketch with its constraints, degrees of freedom and profiles; a body's faces and edges; your selection; what kinds of feature it can add
See A screenshot of the window or the viewport; it can turn the camera to a standard view
Change Set, add and remove parameters; add, change, rename, suppress, hide and delete features; draw in a sketch, constrain it and dimension it; undo and redo its own changes

It cannot save, export, or open and close files: those stay with you.

Staying in control

  • Every change is one step. It appears in Edit > Undo as Undo Assistant: ..., and Ctrl+Z takes it back like any change of your own. The assistant can undo its own changes, but never one of yours.
  • Nothing happens under your hands. While you are editing a sketch or have a feature dialog open, the assistant can look but not change anything; it is told to wait until you finish.
  • It is your model. Features the assistant adds appear on the timeline and in the browser like any other, and you can edit or delete them the same way.
  • Off by default, local only. Anvil listens only while the connection is on, and only on a socket on your own computer that only your user account can open. Only one Anvil window at a time takes connections: the first one started.

Privacy. Anvil itself sends nothing anywhere. But your assistant sends what it reads -- your model's numbers and names, and any screenshot -- to the AI service it uses, as part of the conversation. Don't connect it to a document you would not paste into that service.

Troubleshooting

"Anvil is not running with its assistant connection on"
Anvil is not open, or the connection is off. Open Anvil and turn on Edit > Assistant connection, or start it with anvil --assistant.
A second Anvil window does not answer
Only the first Anvil started takes connections; the log of the second says another is already serving. Close the other, or ask about the document in the first.
"the user is editing the sketch ..." or "... has a feature dialog open"
Finish the sketch (Finish Sketch) or press OK or Cancel in the dialog, then ask again.
The assistant does not list Anvil's tools
Check claude mcp list (or your client's equivalent), and that anvil --mcp runs from a terminal -- it waits for input; press Ctrl+D to leave it. An anvil installed outside your PATH has to be given to the client by its full path.
Anvil runs inside a sandbox or a different user
The connection is a socket in your runtime directory ($XDG_RUNTIME_DIR/anvil/). The assistant's program has to run as the same user, on the same computer, and see that directory.

For how it works inside, see the design.