How zh19980811/easy-mcp-autocad works
Project type and purpose
• This is an open-source “Model Context Protocol” (MCP) server for AutoCAD, written in Python.
• It lives as a standalone executable (server.py → PyInstaller → server.spec) that your LLM client (e.g., Claude Desktop) spawns and communicates with over standard I/O.
• Its purpose is to expose a set of CAD-focused “tool” APIs (draw_line, draw_circle, export_to_database, etc.) to a large language model, translate those calls into COM calls against a running AutoCAD instance, and optionally persist CAD elements in a local SQLite database.
File structure
• Top-level scripts:
• server.py: entry point that implements the MCP protocol and dispatches incoming requests.
• main.py: may hold CLI or bootstrap logic (if separate from server.py).
• autocad_manager.py: encapsulates all COM interactions with AutoCAD (drawing commands, layer management, scanning).
• db_manager.py: manages SQLite connections, schema, and CRUD operations for CAD element storage.
• requirements.txt & pyproject.toml: declare Python dependencies (e.g., pywin32, sqlite3, any JSON/RPC library).
• server.spec: PyInstaller specification for bundling into a standalone .exe.
• .python-version, .gitignore: environment and VCS hygiene.
• CAD-mpc简单实现.mp4: demo video (not part of runtime).
README for additional insights
• System requirements section tells you it runs only on Windows (due to COM).
• Usage section shows how a user configures Claude Desktop to launch “autocad_mcp_server.exe” and how the protocol is registered as an MCP server.