ai-cad
Provides tools for interacting with AutoCAD via COM automation, including running Lisp commands, sending commands, probing viewports, and diagnosing access, as well as DXF-related tools for entity extraction and blank size analysis.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ai-cadextract entities from drawing.dxf on layer stone-*"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
AI-CAD
AI-CAD is a cleaned-up rebuild of an earlier CAD automation prototype. The first stable core focuses on offline DXF parsing, entity extraction, geometry normalization, and stone blank size analysis.
What Is Included
DXF parsing with
ezdxfUnified entity dictionaries for lines, arcs, circles, polylines, text, and inserts
Layer/type filtering and drawing summaries
Minimum oriented bounding rectangle analysis
Multi-part stone grouping by endpoint connectivity
JSON, CSV, and optional Excel export
Automation-loop contracts for future computer-use and AutoLISP adapters
AutoCAD current-viewport assistant contracts for MCP/AutoLISP integration
A small CLI and focused pytest coverage
An MCP server (
aicad.mcp_server, built on FastMCP) exposing the DXF tools and, on Windows, timeout- andIsQuiescent-guarded AutoCAD COM tools plus a registry-driven catalog for driving external AutoLISP scripts
Heavy visual rendering and experimental tooling are intentionally left outside this rebuilt core. AutoCAD COM execution is now available as an optional, adapter-style layer through the MCP server (Windows + pywin32), kept behind automation contracts so the geometry/DXF core stays backend-independent. The current-viewport assistant direction is documented in docs/VIEWPORT_ASSISTANT.md, the general edit/validation loop in docs/AUTOMATION_LOOP.md, and migration notes in docs/MIGRATION.md.
Related MCP server: AutoCAD MCP Pro
Install
python -m pip install -e .For Excel export:
python -m pip install -e ".[excel]"For development:
python -m pip install -e ".[dev,excel]"CLI
aicad summary path/to/file.dxf
aicad extract path/to/file.dxf --layer "stone-*"
aicad blank path/to/file.dxf --margin 2
aicad export path/to/file.dxf --format json --output output/entities.jsonYou can also run the package module directly:
python -m aicad summary path/to/file.dxfPython API
from aicad import calculate_blank_size, extract_entities
entities = extract_entities("drawing.dxf", layer_filter="stone-*")
blank = calculate_blank_size("drawing.dxf", margin=2.0)Every public API function returns a response dictionary:
{
"success": True,
"data": ...,
"error": None,
"metadata": {...},
}MCP Server
aicad ships an MCP server (FastMCP) so agents can call the toolkit directly.
Install the extra and run it:
python -m pip install -e ".[mcp]"
python -m aicad.mcp_serverRegister it with an MCP client (e.g. a project .mcp.json):
{
"mcpServers": {
"ai-cad": { "command": "python", "args": ["-m", "aicad.mcp_server"] }
}
}Tools:
DXF (cross-platform):
aicad_extract_entities,aicad_blank_size,aicad_validate_dxf,aicad_build_viewport_probe,aicad_pingAutoCAD COM (Windows, optional):
autocad_get_active_document,autocad_run_lisp,autocad_send_command,autocad_probe_viewport,autocad_diagnose_access— every COM call runs on a worker thread with a timeout and anIsQuiescentguard, so a busy AutoCAD returns a clean error instead of hanging the server.Script catalog:
aicad_list_scripts,aicad_describe_script,autocad_run_script— a registry-driven layer for discovering and running your own AutoLISP commands through thin headless wrappers. The registry is read at call time, so adding a script needs no server restart.
Windows integrity note: the COM tools require AutoCAD and the MCP process to run at the same integrity level (both normal, or both "as administrator"). A mismatch (e.g. AutoCAD elevated, MCP not) blocks COM/ROT access and surfaces as an "invalid class string" error —
autocad_diagnose_accessreports this directly.
Repository Layout
src/aicad/ Core Python package
tests/ Reproducible tests and generated fixtures
docs/ Migration notes and project context
.codex/ Agent-facing context notesAutomation Direction
The intended editing loop has two modes:
visible computer-use validation for screenshots, UI inspection, and interactive diagnosis
quiet AutoLISP/headless automation for deterministic background edits and validation
Both modes should report through aicad.automation contracts so the geometry and DXF core stays independent from the CAD execution backend.
The next practical focus is the AutoCAD current-viewport assistant: Codex acts as the reasoning brain, while an MCP/AutoLISP backend reads the active view, selected entities, or a requested world-coordinate window and returns formatted JSON.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/putaojuju/autocad-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server