TA

thewisekape/autocad-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

11 stars 4 forks 质量 71 趋势 18Apache-2.0

Unified MCP server for AutoCAD — File IPC, COM (multi-CAD), and headless DXF backends. 22 tools, ~130+ operations. Apache 2.0.

概览

A unified MCP (Model Context Protocol) server for AutoCAD that combines three backend strategies into a single, extensible package. Set the backend via environment variable: For AutoCAD LT, load the LISP dispatcher: 1. Open AutoCAD LT 2. In the command line, type: (load "/path/to/autocad-mcp/lisp-code/mcp_dispatch.lsp") 3. The MCP server will automatically detect the running AutoCAD instance - Python 3.10+ - mcp[cli] -- MCP protocol framework - ezdxf -- DXF read/write - matplotlib + Pillow -- Screenshot rendering - structlog -- Structured logging - pywin32 -- Windows COM + Win32 API (Windows only) - openpyxl -- Excel export Built by combining the best of: - puran-water/autocad-mcp -- Dual backend architecture, File IPC, execute_lisp - ngk0/autocad-mcp -- 19 tool categories, xref/layout/electrical, 232 tests - AnCode666/multiCAD-mcp -- COM multi-CAD support, batch operations, NLP, Excel export Licensed under the Apache License, Version 2.0. See LICENSE and NOTICE for details.

README

以下为原文 README 节选,完整内容请查看原文。

AutoCAD MCP Server v5.0 — Unified

A unified MCP (Model Context Protocol) server for AutoCAD that combines three backend strategies into a single, extensible package.

Three Backends

Backend Connection Requirements Multi-CAD Platform
File IPC AutoLISP dispatcher + Win32 PostMessage AutoCAD LT 2024+ No Windows
COM Windows COM automation AutoCAD 2018+ / ZWCAD / GstarCAD / BricsCAD Yes Windows
ezdxf Headless DXF generation None (pure Python) N/A Any

22 MCP Tools

# Tool Operations Description
1 drawing create, open, save, info, purge, plot_pdf, undo, redo, audit, units, limits, wblock File/drawing management
2 entity create_line/circle/polyline/rectangle/arc/ellipse/mtext/hatch, list, count, get, copy, move, rotate, scale, mirror, offset, array, fillet, chamfer, erase, explode, join, extend, trim, break_at Entity CRUD + modification
3 layer list, create, set_current, set_properties, freeze, thaw, lock, unlock Layer management
4 block list, insert, insert_with_attributes, get_attributes, update_attribute, define Block operations
5 annotation create_text, create_dimension_linear/aligned/angular/radius, create_leader Text, dimensions, leaders
6 pid setup_layers, insert_symbol, list_symbols, draw_process_line, connect_equipment, insert_valve/instrument/pump/tank P&ID engineering
7 view zoom_extents, zoom_window, zoom_center, pan, zoom_scale, screenshot, layer_visibility Viewport control
8 system status, health, runtime, init, execute_lisp Server management
9 query entity_properties, entity_geometry, drawing_summary, layer_summary, text_styles, dimension_styles, linetypes, block_tree, drawing_metadata Read-only queries
10 search text, by_attribute, by_window, by_proximity, by_type_and_layer, by_block_name, by_handle_list, equipment_find, equipment_inspect, find_text, batch_find_and_tag Find operations
11 geometry distance, length, area, bounding_box, polyline_info Measurements
12 select filter, bulk_move, bulk_copy, bulk_erase, bulk_set_property, find_replace_text, find_replace_attribute, layer_rename, layer_merge Bulk operations
13 modify set_property, set_text Property changes
14 validate layer_standards, text_standards, orphaned_entities, attribute_completeness, connectivity, duplicates, zero_length, qc_report QC checks
15 export entity_data, bom, data_extract, layer_report, block_count, drawing_statistics Data export
16 xref list, attach, detach, reload, bind, path_update, query_entities External references
17 layout list, create, switch, delete, viewport_create, viewport_set_scale, viewport_lock, page_setup, titleblock_fill, batch_plot Layouts & viewports
在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "autocad": { "command": "uv", "args": ["--directory", "/path/to/autocad-mcp", "run", "python", "-m", "autocad_mcp"], "env": { "AUTOCAD_MCP_BACKEND": "auto" } } } }