Server data from the Official MCP Registry
Windows AutoCAD MCP server for handle-first CAD automation, validation, and drawing exports.
Windows AutoCAD MCP server for handle-first CAD automation, validation, and drawing exports.
Valid MCP server (2 strong, 1 medium validity signals). No known CVEs in dependencies. Package registry verified. Imported from the Official MCP Registry. Trust signals: trusted author (3/3 approved).
4 files analyzed · 1 issue found
Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.
This plugin requests these system permissions. Most are normal for its category.
Set these up before or after installing:
Environment variable: CAD_MCP_WORKSPACE_ROOT
Add this to your MCP configuration file:
{
"mcpServers": {
"io-github-lokmenower-best-cad-mcp": {
"env": {
"CAD_MCP_WORKSPACE_ROOT": "your-cad-mcp-workspace-root-here"
},
"args": [
"best-cad-mcp"
],
"command": "uvx"
}
}
}From the project's GitHub README.
best-cad-mcp is a Windows AutoCAD MCP server for agents that need to inspect,
reason about, modify, validate, and export real DWG drawings. It runs locally,
talks to AutoCAD through Windows COM, and exposes a handle-first CAD automation
workflow through the Model Context Protocol.
This project is in beta. The main architecture, command-line entry points, workspace database, and core CAD workflows are in place, but the tool surface is still evolving. Treat it as production-oriented infrastructure for controlled local workflows, not as a fire-and-forget CAD robot.
Most CAD automation demos can draw a line, a circle, or a rectangle. Real agent workflows need more:
best-cad-mcp is built around those requirements. The server combines broad
AutoCAD tool coverage with a local SQLite workspace database, CAD understanding
artifacts, visual grounding, prompt assets, and a guarded CADPlan execution
path.
| Area | Capabilities |
|---|---|
| AutoCAD operations | Drawing primitives, editing, layers, blocks, attributes, dimensions, tables, hatches, layouts, plotting, view control, 3D solids, file export, queries, selection, and utility tools. |
| Handle-first inspection | Scan a drawing into SQLite, query structured metadata, explain entities, and edit by the handles returned by AutoCAD. |
| CAD understanding | CAD-IR, drawing summaries, semantic objects, semantic graphs, dimension binding, extracted constraints, validation reports, and MCP resources. |
| Visual review | Export clean view images, optional numeric overlays, and sidecar mapping data for pixel/world/entity grounding. |
| CADPlan | Validate, dry-run, and explicitly execute multi-step drawing or repair plans with variables, dependencies, captured handles, postconditions, transactional execution, and rollback attempts. |
| Agent memory | Store workspace context and model-private spatial annotations in SQLite instead of hiding helper geometry, XData, labels, or marks inside the DWG. |
| Prompt and skill assets | Prompt files for understanding, precise drawing, VLM review, and repair; assembly drawing skill references for standards-aware workflows. |
The server currently registers hundreds of MCP tool entry points. The intended workflow is not to call random primitives until a drawing looks right; it is to scan, understand, plan, modify by handle, validate, and visually confirm.
best-cad-mcp does not include AutoCAD, replace an AutoCAD license, or provide
a cloud CAD renderer. It assumes AutoCAD is installed and can be automated on
the same Windows account that runs the MCP server.
The project also does not promise perfect geometric interpretation from a
screenshot. Visual grounding tools return candidates, confidence, and warnings;
agents should confirm important targets with explain_entity and structured
metadata before editing.
Optional visual-review helpers can use system renderers such as ImageMagick,
Inkscape, librsvg, Chrome, or Edge, or the Python dependencies installed through
the visual extra.
git clone https://github.com/LokmenoWer/best-cad-mcp.git
cd best-cad-mcp
python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
python -m pip install -e .
Install optional visual-review dependencies:
python -m pip install -e ".[visual]"
Install development dependencies:
python -m pip install -e ".[dev]"
For published releases, install the package directly:
python -m pip install best-cad-mcp
The installed console commands are:
cad-mcp
cad-mcp-doctor
The server is an MCP stdio process. In normal use, your MCP client starts it from configuration rather than from an interactive terminal.
Before live CAD work, verify the runtime:
cad-mcp-doctor --check-autocad
The same check is available as an MCP tool:
check_runtime_environment(check_autocad=true, require_visual_export=false)
The preflight reports Windows, Python, package availability, workspace
writability, optional visual renderer support, and AutoCAD COM connectivity
when check_autocad=true. Treat ok=false as a blocker before drawing or
editing.
Strict startup mode is available for deployments that should refuse to start when required checks fail:
$env:CAD_MCP_STRICT_PREFLIGHT = "1"
$env:CAD_MCP_PREFLIGHT_CHECK_AUTOCAD = "1"
$env:CAD_MCP_PREFLIGHT_REQUIRE_VISUAL = "0"
cad-mcp
Set CAD_MCP_PREFLIGHT_REQUIRE_VISUAL=1 when visual export support is a hard
runtime requirement.
Start the MCP client from the workspace whose CAD metadata should be used.
Runtime data is stored under that workspace unless CAD_MCP_WORKSPACE_ROOT is
set.
This repository includes .codex/config.toml for project-scoped Codex usage.
After trusting the project, Codex can start the local checkout.
User-level configuration after pip install -e . or package installation:
[mcp_servers.best-cad-mcp]
enabled = true
command = "cad-mcp"
cwd = "C:/path/to/best-cad-mcp"
startup_timeout_sec = 30
tool_timeout_sec = 120
default_tools_approval_mode = "approve"
Configuration that runs from a checkout virtual environment:
[mcp_servers.best-cad-mcp]
enabled = true
command = "C:/path/to/best-cad-mcp/.venv/Scripts/python.exe"
args = ["-m", "src.server"]
cwd = "C:/path/to/best-cad-mcp"
startup_timeout_sec = 30
tool_timeout_sec = 120
default_tools_approval_mode = "approve"
Keep raw or destructive tools interactive:
[mcp_servers.best-cad-mcp.tools.send_command]
approval_mode = "prompt"
[mcp_servers.best-cad-mcp.tools.execute_cad_plan]
approval_mode = "prompt"
[mcp_servers.best-cad-mcp.tools.delete_entity]
approval_mode = "prompt"
[mcp_servers.best-cad-mcp.tools.delete_entities]
approval_mode = "prompt"
[mcp_servers.best-cad-mcp.tools.erase_selection_entities]
approval_mode = "prompt"
[mcp_servers.best-cad-mcp.tools.delete_layer]
approval_mode = "prompt"
[mcp_servers.best-cad-mcp.tools.purge_drawing]
approval_mode = "prompt"
[mcp_servers.best-cad-mcp.tools.audit_drawing]
approval_mode = "prompt"
[mcp_servers.best-cad-mcp.tools.save_drawing]
approval_mode = "prompt"
[mcp_servers.best-cad-mcp.tools.close_drawing]
approval_mode = "prompt"
This repository includes:
.mcp.json, which registers the local stdio server as best-cad-mcp..claude/settings.json, which enables the server and asks before raw or
destructive tools.The checked-in .mcp.json uses CLAUDE_PROJECT_DIR:
{
"mcpServers": {
"best-cad-mcp": {
"command": "python",
"args": ["${CLAUDE_PROJECT_DIR:-.}/src/server.py"],
"env": {
"CAD_MCP_WORKSPACE_ROOT": "${CLAUDE_PROJECT_DIR:-.}",
"PYTHONPATH": "${CLAUDE_PROJECT_DIR:-.}"
}
}
}
}
If dependencies live only in the project virtual environment, change command
to:
"C:/path/to/best-cad-mcp/.venv/Scripts/python.exe"
Use claude mcp list or /mcp inside Claude Code to confirm that the server
is connected.
check_runtime_environment(check_autocad=true).open_drawing when the user supplies a DWG path.scan_all_entities(clear_db=true, detail_level="minimal", topology_detail="summary").build_drawing_ir, then summarize_drawing.detect_semantic_objects(domain="mechanical") or another suitable domain.bind_all_dimensions, extract_drawing_constraints, and check_drawing_constraints.validate_geometry.export_view_image_with_mapping(include_overlay=true) when visual evidence matters.ground_vlm_region or ground_vlm_overlay_id for VLM findings.explain_entity(handle) before editing.check_runtime_environment(check_autocad=true).create_new_drawing.save_as
variables, and postconditions.validate_cad_plan, then dry_run_cad_plan.execute_cad_plan(..., allow_modify=true) only after modification is authorized.scan_all_entities, build_drawing_ir, validate_geometry, and export a review image.This workflow is for a single external image of a mechanical part or assembly drawing. The VLM call stays on the agent side; MCP validates and compiles the structured result.
prepare_image_trace(image_path, domain="mechanical").prepare_visual_semantic_context(image_id) to gather normalized,
high-contrast, and edge-emphasized VLM inputs plus the open-vocabulary
component hypothesis contract.copy_drawing_from_image prompt with the normalized image and tile
index, then ask the VLM for ImageDrawingSpec/v1 JSON.validate_image_drawing_spec(spec, image_id).submit_image_drawing_spec(image_id, spec, source_model=...).compile_image_spec_to_cad_plan(image_id).validate_image_fidelity_contract(spec, cad_plan).validate_cad_plan, then dry_run_cad_plan.execute_cad_plan(..., allow_modify=true, transactional=true).scan_all_entities, build_drawing_ir, validate_geometry, and
export_view_image_with_mapping(include_overlay=true) for visual diff.Fidelity rules are strict. A chamfered square must not become a square, a filleted rectangle must keep its radii or arc segments, hole patterns must keep their repeated-feature relationship, and dimensions must become real dimension entities rather than text. If the image is unclear, the spec should record an uncertainty instead of silently guessing or simplifying.
export_view_image_with_mapping(include_overlay=true).ground_vlm_overlay_id for overlay IDs or ground_vlm_region for pixel boxes.explain_entity.propose_repair_plan or propose_constraint_repair_plan for selected issues.Runtime metadata is stored by default at:
<workspace>/.cad_mcp/workspace.db
The database scopes data by workspace, drawing, conversation, and thread. This keeps identical handles in different drawings from colliding and lets parallel agent sessions keep private annotations and query history separate.
execute_query is read-only, scoped, and bounded. Use public table names such
as cad_entities; direct main.<table> access is blocked so one workspace
cannot bypass scoped views. Result sets default to 1,000 rows, 5 seconds, and
about 1 MB of JSON. Tune with tool parameters or:
CAD_MCP_SQL_MAX_ROWSCAD_MCP_SQL_TIMEOUT_MSCAD_MCP_SQL_MAX_RESULT_BYTESUseful workspace tools:
get_workspace_contextset_workspace_contextactivate_workspace_drawinglist_workspace_drawingsget_database_maintenance_statusmaintain_databaseclear_understanding_cacheget_legacy_database_statusCAD understanding tools return structured ToolResult dictionaries:
{
"ok": true,
"message": "",
"data": {},
"handles": [],
"warnings": [],
"next_tools": []
}
Read-only understanding tools do not modify the DWG. Semantic objects, constraints, validation reports, view snapshots, and VLM mappings are stored in the workspace database.
scan_all_entities(clear_db=true) clears stale semantic objects, constraints,
validation reports, and view snapshots for the active thread by default. Pass
clear_understanding=false only when cached understanding artifacts should
survive a rescan.
Key understanding tools include:
build_drawing_ir and export_drawing_irsummarize_drawingfind_entities_by_descriptionexplain_entitydetect_semantic_objects, get_semantic_graph, and find_semantic_objectsbind_dimension_to_geometry and bind_all_dimensionsextract_drawing_constraints, check_drawing_constraints, and get_drawing_constraintsvalidate_geometry and get_validation_reportpropose_repair_plan and propose_constraint_repair_planlist_cad_resources and get_cad_resourcebuild_drawing_ir returns CAD-IR v2 by default. The top-level shape is stable
for agents:
{
"schema_version": "cad-ir/v2",
"generated_at": "...",
"manifest": {
"profile": "agent",
"sections": ["overview", "entities", "layers"],
"counts": {},
"limits": {},
"warnings": []
},
"drawing": {
"name": "active.dwg",
"path": "",
"units": "unknown",
"extents": {},
"counts": {}
},
"quality": {
"scan_state": "scanned",
"coverage": {},
"issues": [],
"recommended_next_tools": []
},
"sections": {}
}
Use sections to request only the needed payloads:
overview, entities, layers, blocks, topology, semantics,
constraints, validation, views, and quality. The default entity index is
compact and includes handles, entity type, layer, bbox, semantic tags, topology
availability, and constraint/validation flags. Pass include_raw=true only when
full decoded geometry and properties are needed. entity_limit defaults to
1000; truncation is reported in both manifest.warnings and quality.issues.
The CAD resource layer also exposes focused v2 slices:
cad://drawing/current/ir/overview and
cad://drawing/current/ir/entities.
CADPlan is the guarded path for multi-step drawing or repair. It is best for changes that touch multiple entities, need reviewable intent, or should be dry-run before execution.
{
"plan_id": "mounting-plate",
"description": "Draw a plate with four mounting holes",
"units": "mm",
"risk_level": "low",
"requires_confirmation": true,
"variables": {
"origin": [0, 0, 0]
},
"steps": [
{
"step_id": "plate",
"op": "draw_rectangle",
"args": {
"corner1": "$origin",
"corner2": [120, 80, 0],
"layer": "M-PART"
},
"writes": true,
"save_as": "$plate",
"postconditions": [
{"type": "exists", "target": "$plate"}
]
}
],
"constraints": [
{"type": "distance", "expected": 120.0}
]
}
Executable CADPlan operations include common drawing, editing, layer, dimension, hatch, and block operations. Valid CAD actions that are not yet bound inside CADPlan can still be called through their direct MCP tools.
CADPlan validation disallows raw send_command, SQL mutation, purge, and audit
operations by default. During execution, a bound tool failure, ok=false,
success=false, or recognizable error text stops the plan and triggers rollback
attempts when rollback is enabled.
export_view_image_with_mapping(include_overlay=true) creates:
For dense drawings, pass overlay_granularity="both" to include primitive
overlay IDs such as E001.P02, overlay_style="som" for Set-of-Mark-style
labels, and include_tiles=true to emit a tile index for large-view review.
Use ground_vlm_region(snapshot_id, bbox) for VLM pixel boxes and
ground_vlm_overlay_id(snapshot_id, overlay_id) for overlay IDs. Call
explain_entity on top candidates before editing.
Structured VLM review output can be validated and persisted with
validate_vlm_review_output, submit_vlm_review, and get_vlm_findings.
Confirmed findings can be fused into the semantic graph with
fuse_vlm_findings_into_semantic_graph or promoted into validation reports with
promote_vlm_finding_to_validation_issue. analyze_engineering_drawing_stages
returns a staged engineering-drawing interpretation JSON covering layout
segmentation, annotation detection, VLM parsing, and reconciliation.
evaluate_vlm_grounding scores persisted findings against expected handles and
issue types for regression suites. CAD-IR also exposes a vlm_findings section,
and resources include
cad://drawing/current/vlm-findings and
cad://drawing/current/engineering-interpretation.
Top/plan modelspace views are the most reliable. Twisted views, UCS changes, 3D views, and complex layout viewport cases can return warnings or lower confidence.
The prompts/ directory contains MCP prompt source files for:
These prompts are intentionally workflow-oriented. They tell agents to route complex drawings through CAD-IR, semantic objects, constraints, validation, visual grounding, and guarded CADPlan execution instead of simplifying assemblies, section/detail views, BOMs, title blocks, hatches, dimensions, or 3D intent into generic lines and text.
The .agents/skills/draw-assembly-diagrams skill provides agent-facing
assembly drawing workflows. Assembly rules are modular:
references/assembly/index.md selects the applicable standard module.references/assembly/standards/generic-mechanical.md is the default
mechanical assembly module.send_command behind manual approval.The server may create these files in the active workspace:
.cad_mcp/workspace.db.cad_mcp/workspace.db-wal.cad_mcp/workspace.db-shmcad_mcp.logcad_visual_exports/They are runtime artifacts and should not be committed.
The active database is .cad_mcp/workspace.db. If a retired root-level
autocad_data.db exists from older versions, check_runtime_environment and
get_legacy_database_status report it as a warning. Archive or delete it after
confirming no old MCP process still uses it.
Logs are UTF-8 and rotate by size. Configure with:
CAD_MCP_LOG_PATHCAD_MCP_LOG_MAX_BYTESCAD_MCP_LOG_BACKUP_COUNTCAD_MCP_LOG_LEVELCAD_MCP_MCP_LOG_LEVELEach log line includes workspace, drawing, and thread IDs for correlation.
src/
server.py MCP tool, prompt, and resource definitions
cad_controller.py AutoCAD COM bridge
cad_database.py SQLite persistence
cad_tools/ Tool implementations grouped by CAD domain
cad_understanding/ CAD-IR, semantics, constraints, validation, grounding
prompts/ Prompt sources loaded by MCP prompt functions
scripts/ Verification and smoke-test scripts
tests/ Unit tests that mock COM-dependent behavior
.agents/skills/ Agent skill guidance and assembly standards
.codex/ Project-scoped Codex MCP config
.claude/ and .mcp.json Claude Code MCP config
server.json MCP registry metadata
Run unit tests that do not require AutoCAD:
python -m pytest -q -m "not autocad_com"
Run the full test suite available in the current environment:
python -m pytest
Run the AutoCAD MCP tool smoke verifier:
python scripts\verify_autocad_mcp_tools.py
Run the CAD understanding workflow smoke benchmark:
python scripts\verify_cad_understanding_workflow.py
Unit tests mock COM-dependent behavior and do not require AutoCAD. Smoke verification requires a local AutoCAD COM session.
The release workflow builds distributions, runs non-AutoCAD tests on Windows,
validates server.json, publishes to PyPI, and publishes MCP registry metadata
for tagged releases.
src: set the server cwd to the repository
root or set PYTHONPATH to the repository root.CAD_MCP_WORKSPACE_ROOT.visual extra or a supported
renderer such as ImageMagick, Inkscape, librsvg, Chrome, or Edge.best-cad-mcp tool instead of relying on an agent-side temporary COM script.explain_entity.Contributions are welcome. Good changes usually include:
src/cad_tools/ or
src/cad_understanding/,src/server.py when a new capability should be exposed,Avoid committing .cad_mcp/, logs, exported review images, local databases,
virtual environments, build outputs, or AutoCAD smoke-test artifacts.
The model-private annotation and pointer-style workflow is conceptually informed by the public Pointer-CAD project and paper: https://github.com/Snitro/Pointer-CAD
No Pointer-CAD source code is copied into this repository.
MIT. See LICENSE.
Be the first to review this server!
by Modelcontextprotocol · Developer Tools
Read, search, and manipulate Git repositories programmatically
by Modelcontextprotocol · Developer Tools
Web content fetching and conversion for efficient LLM usage
by Toleno · Developer Tools
Toleno Network MCP Server — Manage your Toleno mining account with Claude AI using natural language.