Back to Discover

lambdacad-mcp

connector

Psalmustrack

AI drafting in BricsCAD on Linux: 100 tools, 2D + 3D solids, via a pure AutoLISP bridge

View on GitHub
0 starsSynced Aug 7, 2026

Install to Claude Code

/plugin marketplace add Psalmustrack/lambdacad-mcp

README

λ lambdacad-mcp

Let AI draw in your CAD. An MCP server for any AutoLISP-capable CAD — no COM, no SDK, no plugins. Pure AutoLISP. The reference adapter drives BricsCAD on Linux: the first MCP server for a professional DWG CAD on Linux.

License: Apache 2.0 Platform: Linux Python 3.10+ Tools: 100 MCP Registry Glama score lambdacad-mcp MCP server

"Draw a DN80 flange: front view, hatched section, dimensions — then model it in 3D."

lambdacad-mcp demo: AI draws a complete flange in BricsCAD, 2D + 3D

Real-time capture, unedited: front view with bolt circle, hatched section, radial/diameter dimensions, leader, title block — then the same flange modeled as a 3D solid with an AI-written parametric AutoLISP loop and one boolean subtraction. ~20 seconds, 12 tool calls.

Complete 2D drawing, drawn by Claude3D solids with booleansClean render for AI vision
2D flange3D solidsbracket render

Why this exists

Every other MCP server for a professional DWG CAD (multiCAD-mcp, autocad-mcp, CAD-MCP, ...) talks to the CAD through Windows COM — none of them can run on Linux, and none of them does real 3D.

BricsCAD is the professional DWG CAD that does run natively on Linux. This server drives it through a mechanism that needs no API at all: an AutoLISP file bridge. The MCP server writes LISP expressions to a file, triggers a tiny MCP command inside the CAD, and reads the result back. That's the whole trick — and it unlocks everything the CAD can do, including 3D solid modeling.

Because the bridge is plain AutoLISP + standard DXF entmake + AutoCAD-compatible commands, it is portable by construction: AutoCAD, ARES Commander (also Linux-native!), ZWCAD, GstarCAD and the IntelliCAD family all speak the same language. Porting means swapping the autoload file name and the keystroke trigger — adapters welcome.

MCP client (Claude, Cursor, ...)            BricsCAD (Linux)
        │                                        │
        ▼                                        ▼
  server.py (FastMCP, 100 tools)          c:MCP AutoLISP command
        │        writes LISP  ──►  /tmp/mcp_bricscad.in
        │        triggers via xdotool ──► reads, evals line by line
        │        reads result ◄──  /tmp/mcp_bricscad.out

What it can do

  • Full 2D drafting — lines/arcs/polylines/splines, real HATCH (with islands), dimensions incl. radius/diameter/angular, leaders, linetypes (chain/hidden), text styles, trim/extend/fillet/chamfer/offset/mirror/arrays, blocks
  • Semantic shapesslot, bolt_circle, rounded_rect, polygon, center_mark: one call, the server does the math
  • 3D solid modeling — box/cylinder/sphere/cone/wedge/torus, extrude/revolve/sweep, union/subtract/intersect, slice — and flatshot_view: auto-generate correct 2D drawing views from the 3D model
  • Batch & atomicdraw_batch executes N operations in one round-trip, wrapped in one undo group (one batch = one Ctrl+Z)
  • Talk about what the user selectedget_selection reads the GUI pickfirst set; select_by/select_window highlight what the AI found before acting; modify tools accept "selection"
  • Verification without screenshots — bounding boxes, key points, exact lengths/areas, intersection checks (collision detection), solid volume/centroid
  • Eyes when neededrender_view: BricsCAD's internal PNG render (clean, no UI, ~30 KB) for vision models
  • Deliverables — save DWG, export DXF and PDF
  • Escape hatchrun_lisp evaluates arbitrary AutoLISP (multi-line, multi-expression): capable models write parametric code and love it

Full reference: docs/TOOLS.md · How it works: docs/ARCHITECTURE.md

Measured, not promised

MetricResult
Tool calls for a complete dimensioned flange200 → 22 (9× fewer round-trips vs primitive-per-call)
Trigger latency0.25 s per call
Error reportingper-line LISP errors (msg=L2: ...) → models self-correct without screenshots
Exactnessentity_length on an r=20 circle: 125.664 / 1256.637 (2πr, πr² exact)

Details and model-behavior notes (Sonnet writes parametric LISP, Haiku uses typed tools): docs/BENCHMARKS.md

Quick start

Requirements: Linux, BricsCAD (any recent version — tested on V26), Python 3.10+, xdotool.

git clone https://github.com/Psalmustrack/lambdacad-mcp
cd lambdacad-mcp
./install.sh

The installer creates a venv, installs the AutoLISP bridge into BricsCAD's Support/on_doc_load.lsp (idempotent, marker-delimited), and prints ready-to-paste config for Claude Code / Claude Desktop.

Then:

  1. Start BricsCAD and open a drawing (the bridge loads when a document opens).
  2. Start a new AI session — the bricscad tools appear.
  3. Ask: "draw the plan of a 4×3 m room with a door and dimensions".

Configuration (env vars)

VariableDefaultPurpose
BRICS_DISPLAYsession $DISPLAYX display where BricsCAD runs (e.g. :77 for a nested Xephyr)
BRICS_COMPACToff1 = expose only 14 essential tools (~1k schema tokens instead of ~7k) for clients that inject every schema
BRICS_MCP_IN / BRICS_MCP_OUT/tmp/mcp_bricscad.{in,out}bridge file paths

Security note

run_lisp and run_command execute arbitrary code inside BricsCAD by design — that's what makes the server fully general. Only connect MCP clients you trust, and treat the bridge files as trusted input. The bridge itself never loads foreign files (read+eval only) and honors BricsCAD's SECURELOAD.

Troubleshooting

SymptomFix
ERR: BricsCAD window not foundIs BricsCAD running on BRICS_DISPLAY?
ERR: no response from BricsCADIs a drawing open (not the Start page)? The bridge loads on document open.
Commands typed into the drawing as textClick once inside the drawing area so the command line has focus, then retry.
WaylandWorks via XWayland; if your compositor struggles with heavy CAD redraws, run BricsCAD under a nested X server (Xephyr) and set BRICS_DISPLAY.

Related projects

ProjectCADPlatform3D
λ lambdacad-mcp (this)any AutoLISP CAD — BricsCAD referenceLinuxyes
multiCAD-mcpAutoCAD/BricsCAD/ZWCAD via COMWindowsno
puran-water/autocad-mcpAutoCAD LT (LISP bridge)Windowsno
hvkshetry/autocad-mcpAutoCAD LTWindowsno
freecad-mcp (various)FreeCADcross-platformyes (FreeCAD)

Credit where due: multiCAD-mcp inspired the project; puran-water/autocad-mcp independently validated the LISP-bridge approach on Windows.

Roadmap

  • Focus-free dispatch (targeted X synthetic events — no window activation)
  • In-process socket bridge (no keystroke trigger, ~0 latency)
  • VIEWBASE paper-space drawing views; sheet metal (SMUNFOLD) and BIM commands
  • Compact-mode behavioral benchmark

License

Apache 2.0 — with an explicit patent grant and trademark protection for the lambdacad-mcp name.

Rendered live from Psalmustrack/lambdacad-mcp's GitHub README — not stored, always reflects the source repo.

0 Install Methods

No plugins listed in this repo's manifest.

0 Comments

Login required
Log in to post a comment or update on this repo.

No comments yet — be the first to share an update.