Skip to content

brlcad-mcp rc2

Pre-release
Pre-release

Choose a tag to compare

@rs0125 rs0125 released this 02 Sep 20:23

Build and edit BRL-CAD geometry by describing what you want. It talks to MGED
over the libmcpcad protocol.

You need a listener for it to connect to. If you would rather not compile one,
there is a prebuilt
libmcpcad build.

Since rc1:

  • Added full BYOK Support
  • IPC communication to BRLCAD via Unix Domain Socket

Install

tar xzf brlcad-mcp-rc2.tar.gz
cd brlcad-mcp-rc2

python -m venv .venv
.venv/bin/pip install -e '.[dev]'

Use -e, which keeps the package, the skills and the eval corpus in one tree.

Then copy the config and set a key:

cp .env.example .env
LLM_API_KEY=sk-...

That is enough for a listener on the default port. For a socket instead, set the
line that selects the transport:

BRLCAD_IPC_PATH=/tmp/brlcad.sock

.env.example lists every setting with its default. The .env nearest your
working directory is the one read, and the startup banner names that file along
with the model and listener it resolved, which is the quickest way to confirm
you are pointed where you think.

Run it

Start a listener, then:

.venv/bin/brlcad-mcp chat

Things to ask it

To check both halves are talking:

what objects are in this database?

Build something:

make a 50mm cube at the origin named block
put a 10mm hole through it along Z
verify block
render block from an isometric view

Give it a drawing:

/image ~/drawings/bracket.jpg model this bracket in BRL-CAD, named bracket

It reads the dimensions off the sheet and confirms them with you before it
builds anything, then renders views of the result. Correcting a number at that
point is much cheaper than rebuilding afterwards.

Some other things it handles:

find the overlaps in this model and fix them
make the hole 12mm
undo the last change

/trace shows which step is running and which tool it called, which helps when
a result surprises you. /help lists the rest.

Another model backend

LLM_PROVIDER names the wire format rather than the vendor. Leave it at
openai and set an endpoint to reach a gateway, vLLM, llama.cpp, LM Studio or
Ollama's /v1 port:

LLM_BASE_URL=http://gateway.internal/v1
LLM_MODEL=whatever-the-server-calls-it

For a native integration, install its extra and name it:

.venv/bin/pip install -e '.[anthropic]'
LLM_PROVIDER=anthropic
LLM_MODEL=claude-sonnet-4-5

LLM_EFFORT is one setting for every backend. docs/PROVIDERS.md has the full
list.

Two capabilities cannot be supplied by configuration: the model has to call
tools reliably, and reading a dimensioned drawing needs one that accepts images.

Without an API key

The tests and the eval harness in tool mode (no LLM Inference) do not need one:

.venv/bin/python -m pytest
BRLCAD_BUILD=/path/to/brlcad ./evals/run.sh

BRLCAD_BUILD accepts a build tree or an unpacked release. The harness builds
each case from known dimensions and checks the result with the raytracer.