# best-cad-mcp

A Windows MCP server that links AI agents to live AutoCAD sessions. It inspects DWG elements via entity handles, plans guarded edits, and tests geometry.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 33
- Author: LokmenoWer
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/LokmenoWer/best-cad-mcp
- Updated: 2026-10-01
- HTML: https://affpapa.org/en/nevibecode/mcp/best-cad-mcp

## What it does

This server connects your coding assistant to a running AutoCAD instance on Windows via stdio. Rather than relying on raster snapshots, the agent tracks precise entity handles across model space. It constructs a structured intermediate graph, evaluates dimensional bindings, and prepares explicit CADPlans.

Safety sits at the core of the architecture. Every modification undergoes dry-run validation before committing to the document. To safeguard COM apartment threading, all AutoCAD calls execute sequentially on a dedicated event-loop worker. Scan states and audit data live locally in an SQLite database.

The server requires AutoCAD running under the exact same Windows user profile. Without Python 3.11 or later and an active CAD license, communication fails immediately.

## Requirements
- Needs: Python and uv (commands run via uvx)
- Environment variables: `CAD_MCP_WORKSPACE_ROOT` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env CAD_MCP_WORKSPACE_ROOT=<CAD_MCP_WORKSPACE_ROOT> --transport stdio best-cad-mcp -- uvx best-cad-mcp
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from best-cad-mcp <command>

### Codex

**Platform CLI**
```bash
codex mcp add best-cad-mcp --env CAD_MCP_WORKSPACE_ROOT=<CAD_MCP_WORKSPACE_ROOT> -- uvx best-cad-mcp
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from best-cad-mcp <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "best-cad-mcp": {
            "command": "uvx",
            "args": [
                "best-cad-mcp"
            ],
            "env": {
                "CAD_MCP_WORKSPACE_ROOT": "<CAD_MCP_WORKSPACE_ROOT>"
            }
        }
    }
}
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from best-cad-mcp <command>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "best-cad-mcp": {
            "type": "stdio",
            "command": "uvx",
            "args": [
                "best-cad-mcp"
            ],
            "env": {
                "CAD_MCP_WORKSPACE_ROOT": "<CAD_MCP_WORKSPACE_ROOT>"
            }
        }
    }
}
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from best-cad-mcp <command>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e CAD_MCP_WORKSPACE_ROOT=<CAD_MCP_WORKSPACE_ROOT> best-cad-mcp uvx best-cad-mcp
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from best-cad-mcp <command>

## When to use it
- Inspect DWG elements by targeting persistent entity handles
- Generate multi-view mechanical drawings from structured specifications
- Run dry-run validations on geometric constraints before saving
- Export verified drawings to DXF and PDF for visual review

## Example prompts
- Inspect the current DWG drawing and list all unconstrained dimensions
- Build a CADPlan to generate a flanged coupling and run a dry-run check
- Verify geometric constraints across the active model and plot to PDF

## Similar
- [Next AI Draw.io](https://affpapa.org/en/nevibecode/mcp/next-ai-drawio.md) — MCP server · ★ 36398
- [tldraw](https://affpapa.org/en/nevibecode/mcp/tldraw.md) — MCP server · ★ 51091
- [Figma-Context-MCP](https://affpapa.org/en/nevibecode/mcp/figma-context-mcp.md) — MCP server · ★ 16062
- [Agent-Native Assets](https://affpapa.org/en/nevibecode/mcp/agent-native-assets.md) — MCP server · ★ 7506
- [Remove AI Watermarks](https://affpapa.org/en/nevibecode/mcp/remove-ai-watermarks.md) — MCP server · ★ 6114
- [Dembrandt](https://affpapa.org/en/nevibecode/mcp/dembrandt.md) — MCP server · ★ 3821

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
