io.github.C48H74/autocad-mcp
Provides live integration with AutoCAD and AutoCAD Plant 3D through COM, allowing AI assistants to inspect and control open drawings, manage layers and entities, insert blocks, read and update block attributes, export and import attribute data via Excel, add native dimensions, plot to PDF, and store or retrieve project metadata. It also supports an offline DXF workflow for creating, editing, querying, auditing, and exporting drawings.
Click on "Deploy 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., "@io.github.C48H74/autocad-mcp export the open AutoCAD drawing to PDF as support-plan.pdf"
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.
AutoCAD MCP for Piping & Pipe Supports
Connect an AI assistant to AutoCAD / Plant 3D, live through COM or headless through ezdxf. One typed contract, two engines, 50 tools.
Install · Showcase · Tools · Engines · Limits · Config · Changelog

Not a mockup. Every line on this A1 sheet was drawn by the tools this server exposes (layers, ISA 5.1 instrument balloons, valves, tag lines, stream table, title block), then rendered headlessly. Rebuild it with python examples/showcase/pid.py docs/images. All data is fictional.
v0.3.1. 188 automated tests (simulated AutoCAD, offline DXF engine, real stdio subprocess) plus 7 opt-in live tests that passed on AutoCAD Plant 3D 2021 only. Other versions and native Plant 3D objects are not certified. See validation notes.
Showcase
Three complete A1 sheets, each one generated by a script in examples/showcase/ that calls the same engine the MCP tools use. Every sheet is saved as .dxf (opens in AutoCAD) and .png.
Sheet | What it shows | Rebuild |
P&ID | Tank TK-101 with nozzles N1-N8, parallel pumps P-101A/B, flow loop FT/FIC/FCV with bypass, heat exchanger E-101 with temperature control and steam trap, thermal relief PSV, battery limit, stream table, legend, notes, equipment list, title block |
|
Tank with nozzles and foundation | 50 m3 vertical tank, elevation and plan 1:30, Detail A (anchorage) and Detail B (nozzle N2 8" 150# RFWN) 1:5, chain dimensions, nozzle schedule, design data, bill of materials |
|
General arrangement (plot plan) | Plot plan 1:250 with roads, dike, tanks, pump pad, pipe rack, exchanger skid, buildings, fire water, coordinate grid, computed distance table, sections A-A and B-B 1:50 |
|

Tank sheet: dimensioned elevation and plan, anchorage and nozzle details, nozzle schedule.

Plot plan 1:250: the distance table is computed from the equipment coordinates, not typed.
Smaller examples from examples/gallery.py:
|
|
|
|
The images are an approximate ezdxf/matplotlib render, not an AutoCAD capture. The showcase is also a test: tests/test_showcase.py runs all three scripts and checks doc.audit() for errors.
Related MCP server: AutoCAD MCP Pro
What's new in 0.3
Track | What it adds |
Headless DXF engine |
|
Live AutoCAD additions |
|
Scaled drawings |
|
Safer by default | File I/O limited to |
Fixed | Layer color/linetype now applied by the DXF engine; queries no longer leave an empty undo step |
Workflow: ask for a DXF copy of the drawing, let the assistant edit, dimension and export it offline, or work live in the open drawing. A DWG cannot be read without AutoCAD.
Why this exists
Built by a piping and pipe-supports engineer, so the focus is on what that work needs: block attributes (TAG / TIPO / LINHA), layers, coordinates, support registers that can be audited and compared by TAG across revisions, and Excel round-trips. It is not a general CAD toolbox; it is a narrow tool with its limits written down.
flowchart LR
A["AI assistant / MCP client"] <-->|stdio| B["MCP server<br/>50 tools, profiles lean/core/full"]
B --> G["Guards: allowed folders, read-only,<br/>confirm/dry_run, audit log"]
G --> L["Live engine: single COM worker"]
G --> H["Headless engine: ezdxf"]
G --> Q["Support QA: snapshot, audit, compare"]
L <--> D["AutoCAD / Plant 3D<br/>open drawing"]
L --> P1["PDF from the real plotter"]
L <--> X["Excel .xlsx keyed by TAG"]
H <--> F["DXF files"]
H --> P2["PDF / PNG / SVG<br/>matplotlib render"]
Q -.-> L
Q -.-> HInstall
git clone https://github.com/C48H74/autocad-mcp.git
cd autocad-mcp
py -3 -m venv .venv
.\.venv\Scripts\python.exe -m pip install -e ".[dev]" # installs ezdxf and matplotlib too
Copy-Item config.example.toml config.toml
.\.venv\Scripts\python.exe -m pytest -m "not autocad"Or uv sync and uv run python -m pytest -m "not autocad". The project uses MCP SDK 1.x (mcp<2).
Requirements: Python 3.11+ (64-bit, same architecture as AutoCAD). Live COM needs Windows with a licensed AutoCAD desktop (or the Plant 3D environment) running with a test drawing open, under the same user and privilege level as the MCP client. The headless DXF engine runs on any OS.
Wire it to Claude Desktop
Edit %APPDATA%\Claude\claude_desktop_config.json (Settings, Developer, Edit Config) with absolute paths:
{
"mcpServers": {
"autocad": {
"command": "C:\\path\\to\\autocad-mcp\\.venv\\Scripts\\python.exe",
"args": ["-m", "autocad_mcp"],
"env": { "AUTOCAD_MCP_CONFIG": "C:\\path\\to\\autocad-mcp\\config.toml" }
}
}
}Fully quit and reopen Claude Desktop; the autocad server should list 50 tools. Start with status and verify the active drawing and units. Any local stdio client can use the same command, args and environment variable. Internal tool descriptions and diagnostics are currently in Portuguese.
Tools
50 tools in 11 groups. Signatures and defaults: docs/tools.md.
Group | Tools |
Session |
|
Layers |
|
Query |
|
Drawing |
|
Blocks |
|
Excel |
|
Dimensions / plot / project data (live) |
|
DXF read (offline) |
|
DXF write (offline) |
|
Support QA |
|
Advanced |
|
Support register quality. Capture a complete support register, find duplicate TAGs and missing attributes, reconcile project-provided expected tags, and compare revisions by TAG even when CAD handles change. Audit and comparison run offline on captured snapshots. They do not validate structural loads or native Plant 3D data. Workflow and limits.
Example prompts
"Read the attributes of every SUP-TEST block and give me a table with TAG, TIPO, LINHA and X/Y."
"Import suportes.xlsx (block SUP-TEST, key TAG). Do a dry run first and tell me how many insert and how many update."
"Change TIPO to ANCORA on all blocks of line 10-P-1001. Show a preview and apply only after I confirm."
"Create an A1 sheet at 1:30 with a tank elevation, dimension the nozzles and export a PDF."
The two engines
Capability | COM (live AutoCAD) | ezdxf (headless) |
Live document control | yes | no |
Runs without AutoCAD, any OS | no | yes |
Native DIMENSION | yes | yes ( |
Paper layouts and viewports | via drawing | yes |
PDF plot | real plotter ( | matplotlib render (approximate) |
Block attributes read/write | yes | yes |
Excel round-trip keyed by TAG | yes | via DXF read |
Read-only SQL over entities | no | yes ( |
DWG read/write | yes | no (DXF only) |
3D solids | not exposed | not copied (ezdxf cannot import 3DSOLID) |
Grouped drawing edits use StartUndoMark/EndUndoMark; one-step undo was verified live on Plant 3D 2021 (100-block import undone with one Ctrl+Z). This is not automatic rollback and does not cover file writes or run_lisp. Selected destructive actions need confirm=true; batch tools support dry_run. The flag is not independent human authorization.
Limits
Plant 3D. Generic AutoCAD objects only, through COM. No Plant 3D .NET SDK, DataLinksManager, project database, spec-driven routing or native isometrics. Proxy objects may expose only generic properties and bounding boxes.
Certification. Live tests passed on AutoCAD Plant 3D 2021 only. Rotated UCS has not been validated.
Model space only; block definitions must already exist. Constant attributes need care.
Renders are approximate. PNG/PDF from the headless engine come from ezdxf + matplotlib. Hatch patterns at small scale (for example AR-CONC) can look speckled.
DWG needs AutoCAD. The headless engine reads and writes DXF.
run_lispis off by default; its filtering is partial protection, not a sandbox.Showcase sheets are fictional and use a made-up drawing standard; they are not for construction.
Configuration
Copy config.example.toml to config.toml or set AUTOCAD_MCP_CONFIG to its absolute path.
Setting | Default | Meaning |
| false | Optional AutoLISP execution |
| false | Allow starting AutoCAD |
| AutoCAD.Application | Registered COM application |
| 120 | Wait limit; does not cancel blocked COM calls |
| full |
|
| false | JSONL trail in |
| 500 | Maximum results per page |
| 2000 | Maximum Excel rows per call |
| 3000 | Up to this many entities, queries scan directly (no empty undo step) |
| [] | Folders for all file I/O (DXF, PDF, PNG, Excel). Empty = only |
| false | Opt in to unrestricted file paths |
Environment overrides: AUTOCAD_MCP_CONFIG, AUTOCAD_MCP_READ_ONLY=1, AUTOCAD_MCP_ALLOWED_DIRS, AUTOCAD_MCP_WORKSPACE. Logs go to stderr and rotating logs/server.log; stdout is reserved for MCP. Review logs before sharing.
Troubleshooting
Symptom | Check |
| Open AutoCAD; check COM registration and matching user/privileges |
| Finish commands and close dialogs (a command waiting for ENTER blocks COM) |
COM timeout | A modal dialog may be blocking COM; the call may still be running |
Tools missing | Absolute paths, valid JSON, correct Python environment, client restart |
Excel write failure | Close the workbook; check permissions and allowed directories |
Development
.\.venv\Scripts\python.exe -m pytest -m "not autocad" # 188 tests
.\.venv\Scripts\python.exe examples\gallery.py # small gallery -> docs/images
.\.venv\Scripts\python.exe examples\showcase\pid.py docs\imagesCI runs the same suite on Linux and Windows (simulated COM). More: CONTRIBUTING.md, SUPPORT.md, SECURITY.md, CODE_OF_CONDUCT.md, source comparison.
Safety
This server can modify and save drawings. Work on copies, keep backups, review previews before confirming, and do not open confidential client drawings with an assistant unless your company policy allows it.
Author
Daniel de Souza Paixão, piping stress and pipe-supports engineer. Built from day-to-day drawing work, then exposed through MCP.
License
MIT © 2026 Daniel de Souza Paixão. Third-party inspirations: see NOTICE.
AutoCAD is a trademark of Autodesk, Inc. This project is independent and not affiliated with or endorsed by Autodesk.
Available Tools
50 toolsadd_dimensionADestructive
Cria uma cota nativa (entidade DIMENSION) no espaço modelo. Desfazível com um Ctrl+Z.
QUANDO USAR: cotar distâncias entre suportes, diâmetros, raios e ângulos direto no desenho aberto.
Parâmetros por tipo: linear (rotação por angle_deg: 0 = horizontal [padrão], 90 = vertical): p1, p2, location
(ponto por onde passa a linha de cota); aligned: p1, p2, location (ponto do texto); radius e diameter: center, radius,
angle_deg (direção do ponto na circunferência; padrão 45); angular: vertex, p1, p2, location (ponto do texto). layer opcional.
Exemplo: add_dimension(kind="linear", p1=[0,0], p2=[1500,0], location=[750,-200], layer="COTAS")
O estilo/tamanho vem do estilo de cota ativo do desenho (DIMSTYLE); a ferramenta não o altera.
Inputs: kind (required), p1, p2, layer, +5 more. Returns: object
add_mtextADestructive
Adiciona texto de várias linhas (MText). QUANDO USAR: notas e legendas; use \P para quebra de linha.
Parâmetros: text, point (canto de inserção), width (> 0, largura da caixa), height (altura do texto; opcional), layer. Exemplo: add_mtext("NOTA 1:\PVer suporte tipo GUIA", [0, -200], 800, height=3.5, layer="TEXTO").
Inputs: text (required), point (required), width (required), layer, +1 more. Returns: object
add_textADestructive
Adiciona texto de linha única. QUANDO USAR: rótulos curtos (TAG, cota, nota).
Parâmetros: text, point (inserção), height (> 0, unidade do desenho), rotation (GRAUS), layer. Exemplo: add_text("PS-101", [1250, 830], 3.5, layer="TEXTO").
Inputs: text (required), point (required), height (required), layer, +1 more. Returns: object
audit_support_registerARead-only
Audita TAGs duplicadas, campos vazios e cadastro esperado; totais por linha/tipo sem inferências.
QUANDO USAR: QA de cadastro antes da entrega ou importação Excel; não dimensiona suportes. Parâmetros: snapshot completo, allowed_types/expected_tags fornecidos pelo projeto, limit=1..500. Exemplo: audit_support_register(snapshot, allowed_types=["GUIA", "ANCORA"]). Funciona sem AutoCAD.
Inputs: snapshot (required), limit, allowed_types, expected_tags. Returns: object
check_layer_standardARead-only
Relata entidades do espaço modelo em camadas FORA do padrão informado (não altera nada).
QUANDO USAR: auditoria de desenho antes da entrega ("tem algo fora das camadas do padrão?"). Parâmetros: allowed_layers (nomes ou padrões com * e ?, ex. ["PIPE-", "SUPORTES"]), ignore_layers (padrão ["0", "Defpoints"]), limit (máx. de entidades de amostra por camada). Retorna, por camada fora do padrão: contagem, tipos e handles de amostra; e as camadas do padrão que não existem no desenho. Não verifica o conteúdo interno de blocos. Exemplo: check_layer_standard(["PIPE-", "SUPORTES", "EIXOS"]).
Inputs: allowed_layers (required), limit, ignore_layers. Returns: object
compare_support_registerARead-only
Compara revisões por TAG; mostra inseridos/removidos, deslocamentos e atributos alterados.
QUANDO USAR: revisão de cadastros de suportes com unidades/filtros idênticos; funciona sem AutoCAD. Parâmetros: before/after completos; position_tolerance na unidade do desenho (não tolerância normativa). Exemplo: compare_support_register(before, after, position_tolerance=1.0). TAGs ambíguas não são casadas.
Inputs: after (required), before (required), limit, position_tolerance, +1 more. Returns: object
copy_entityADestructive
Copia uma entidade count vez(es), cada cópia deslocada mais um displacement (arranjo linear).
QUANDO USAR: repetir um item em passo constante (ex. suportes a cada 3000). Máx. 500 cópias. Parâmetros: handle, displacement ([dx, dy(, dz)]), count (≥ 1). Exemplo: copy_entity("2F1A", [3000, 0, 0], count=5).
Inputs: handle (required), displacement (required), count. Returns: object
create_layerADestructive
Cria uma camada (se já existir, não altera nada e avisa).
QUANDO USAR: antes de desenhar/inserir em uma camada nova. Não é destrutivo. Parâmetros: name (sem < > / \ " : ; ? * | , = `), color (índice ACI 1-255 ou nome: red/vermelho, yellow, green, cyan, blue, magenta, white), linetype (deve estar carregado; HIDDEN/CENTER/DASHED/PHANTOM são carregados de acad.lin automaticamente). Exemplo: create_layer("SUPORTES", color="green", linetype="Continuous").
Inputs: name (required), color, linetype. Returns: object
delete_entitiesADestructive
Apaga entidades pelos handles. DESTRUTIVO: exige confirm=true. Tudo-ou-nada; um Ctrl+Z desfaz.
QUANDO USAR: só quando o usuário pediu para apagar. FLUXO: dry_run=true lista o que seria apagado; depois confirm=true. Se algum handle não existir, nada é apagado e o erro lista os ausentes. Parâmetros: handles (lista de strings hex), confirm, dry_run. Exemplo: delete_entities(["2F1A", "2F1B"], dry_run=true).
Inputs: handles (required), confirm, dry_run. Returns: object
draw_circleADestructive
Desenha um círculo. QUANDO USAR: furos, bocais em planta, marcações.
Parâmetros: center ([x, y] ou [x, y, z]), radius (> 0, unidade do desenho), layer. Exemplo: draw_circle([500, 500], 25.4, layer="EIXOS").
Inputs: center (required), radius (required), layer. Returns: object
draw_lineADestructive
Desenha uma linha no espaço modelo. Desfazível com um Ctrl+Z.
QUANDO USAR: eixos, referências e traçados simples. Parâmetros: start/end ([x, y] ou [x, y, z] na unidade do desenho), layer (existente; opcional — sem layer usa a camada ativa). Exemplo: draw_line([0, 0], [1500, 0], layer="EIXOS").
Inputs: end (required), start (required), layer. Returns: object
draw_polylineADestructive
Desenha uma polilinha por vértices. Todos os Z iguais → polilinha leve 2D (com elevação); Z variados → polilinha 3D.
QUANDO USAR: contornos, traçados de linha de tubulação em planta, perímetros. Parâmetros: points (≥ 2 pontos [x, y] ou [x, y, z]), closed (fecha a figura), layer. Exemplo: draw_polyline([[0,0],[1000,0],[1000,500]], closed=true, layer="EIXOS").
Inputs: points (required), layer, closed. Returns: object
dxf_add_dimensionsADestructive
Cota um DXF (cotagem): linear, alinhada, raio, diâmetro e angular, com bloco de cota nativo.
QUANDO USAR: cotar vãos, distâncias entre suportes, diâmetros de furo; gera cotas reais (entidade DIMENSION). Parâmetros: path; dimensions (lista); layout; output_path. Campos comuns: layer, color, dimstyle (padrão "EZDXF"), text_height, arrow_size, decimals, lfac (fator linear: texto = distância x lfac, p/ desenho em escala), text (substitui o valor; "<>" = medida). linear{base,p1,p2,angle} aligned{p1,p2,offset} radius{center,radius,angle} diameter{center,radius,angle} angular{line1:[[x,y],[x,y]],line2:[[x,y],[x,y]],base}. Exemplo: dxf_add_dimensions(path="a.dxf", dimensions=[{"kind":"linear","p1":[0,0],"p2":[1500,0],"base":[0,-200],"layer":"COTAS"}])
Inputs: path (required), dimensions (required), layout, output_path. Returns: object
dxf_add_entitiesADestructive
Adiciona em lote entidades a um DXF: line, circle, arc, polyline, text, mtext, point, ellipse, hatch, insert.
QUANDO USAR: desenhar offline. Valida tudo antes de salvar: se uma entidade falhar, nada é gravado. Parâmetros: path; entities (lista de objetos com "type"); layout (omita para o modelo); output_path. Campos: line{start,end} circle{center,radius} arc{center,radius,start_angle,end_angle} polyline{points,closed} text{insert,text,height,rotation} mtext{insert,text,height} hatch{points,pattern,scale} insert{block,insert,attributes} ellipse{center,major_axis,ratio}; todos aceitam layer e color (ACI). Exemplo: dxf_add_entities(path="a.dxf", entities=[{"type":"line","start":[0,0],"end":[100,0],"layer":"EIXOS"}])
Inputs: path (required), entities (required), layout, output_path. Returns: object
dxf_auditARead-only
Audita a estrutura do DXF (erros que o AutoCAD acusaria ao abrir) sem alterar o arquivo.
QUANDO USAR: antes de publicar/entregar um DXF gerado ou recebido; relata erros e itens corrigíveis. Parâmetros: path. Exemplo: dxf_audit(path="entrega.dxf")
Inputs: path (required). Returns: object
dxf_createADestructive
Cria um DXF novo e vazio (com estilos de cota e tipos de linha padrão) sem abrir o AutoCAD.
QUANDO USAR: iniciar um desenho offline (esquema de suporte, folha de detalhe) para preencher com dxf_add_entities. Parâmetros: path (.dxf); units (mm, cm, m, in, ft); version (R2000..R2018); overwrite (padrão false). Exemplo: dxf_create(path="suporte-S12.dxf", units="mm")
Inputs: path (required), units, version, overwrite. Returns: object
dxf_create_layerADestructive
Cria (ou confirma) uma camada em um DXF.
QUANDO USAR: preparar camadas (SUPORTES, COTAS, EIXOS) antes de desenhar. Parâmetros: path; name; color (ACI 1-255); linetype (ex. "DASHED"); output_path (salva cópia, preserva o original). Exemplo: dxf_create_layer(path="a.dxf", name="COTAS", color=3)
Inputs: name (required), path (required), color, linetype, +1 more. Returns: object
dxf_create_layoutADestructive
Cria um layout (folha) de papel num DXF, com viewports que enquadram o modelo em escala.
QUANDO USAR: montar a folha de impressão antes de dxf_export (PDF). Parâmetros: path; name; paper (A4, A3, A2, A1, A0); landscape; margins_mm; output_path; viewports [{center:[x,y] no papel, width, height em mm, view_center:[x,y] no modelo, scale: papel/modelo (0.01 = 1:100)}]. Exemplo: dxf_create_layout(path="a.dxf", name="Folha1", paper="A3", viewports=[{"center":[210,148],"width":380,"height":260,"view_center":[750,0],"scale":0.1}])
Inputs: name (required), path (required), paper, landscape, +3 more. Returns: object
dxf_define_blockADestructive
Define um bloco (com atributos opcionais) em um DXF para depois inserir com dxf_add_entities type=insert.
QUANDO USAR: criar o símbolo de suporte (ex. SUP-GUIA) com TAG/TIPO/LINHA offline. Parâmetros: path; name; entities (mesmo formato de dxf_add_entities, sem hatch/insert aninhado recomendado); attributes (lista de tags, ex. ["TAG","TIPO","LINHA"]); output_path. Exemplo: dxf_define_block(path="a.dxf", name="SUP-GUIA", entities=[{"type":"circle","center":[0,0],"radius":50}], attributes=["TAG","TIPO"])
Inputs: name (required), path (required), entities (required), attributes, +1 more. Returns: object
dxf_delete_entitiesADestructive
Apaga entidades de um DXF (exige confirm=true; dry_run mostra a prévia sem gravar).
QUANDO USAR: remover entidades erradas. Prefira output_path para manter o original. Parâmetros: path; handles; confirm; dry_run; output_path. Exemplo: dxf_delete_entities(path="a.dxf", handles=["2A3"], confirm=True, output_path="a_limpo.dxf")
Inputs: path (required), handles (required), confirm, dry_run, +1 more. Returns: object
dxf_exportADestructive
Renderiza o modelo ou um layout do DXF para PDF, PNG ou SVG, sem AutoCAD (motor ezdxf + matplotlib).
QUANDO USAR: gerar PDF de entrega ou imagem de pré-visualização; o formato vem da extensão de output.
Parâmetros: path; output (.pdf, .png ou .svg); layout (omita para o modelo); dpi (30-600); background ("white" = traço preto sobre branco, "default").
Exemplo: dxf_export(path="a.dxf", output="a.pdf", layout="Folha1")
Observação: é uma renderização aproximada (não idêntica ao plotter do AutoCAD).
Inputs: path (required), output (required), dpi, layout, +1 more. Returns: object
dxf_get_entityARead-only
Devolve os detalhes completos de uma entidade do DXF pelo handle.
QUANDO USAR: depois de dxf_query, para ver geometria/atributos de uma entidade específica. Parâmetros: path; handle (hexadecimal, ex. "2A3"). Exemplo: dxf_get_entity(path="a.dxf", handle="2A3")
Inputs: path (required), handle (required). Returns: object
dxf_infoARead-only
Resume um DXF sem abrir o AutoCAD: versão, unidades, camadas, layouts, blocos, estilos de cota, extensão.
QUANDO USAR: primeiro passo antes de qualquer outra ferramenta dxf_*; confirma unidades e nomes de camada/layout. Parâmetros: path = caminho do .dxf dentro das pastas permitidas. Exemplo: dxf_info(path="C:/Users/eu/autocad-mcp-workspace/linha-L12.dxf")
Inputs: path (required). Returns: object
dxf_insert_support_symbolADestructive
Insere um pictograma de suporte de tubulação (GUIA, ANCORA, APOIO, MOLA) com atributos TAG/TIPO/LINHA.
QUANDO USAR: montar offline o desenho/cadastro de suportes; o bloco SUP- é criado se ainda não existir e depois pode ser lido com dxf_read_attributes. Os pictogramas são simplificados, não seguem uma norma. Parâmetros: path; kind (GUIA, ANCORA, APOIO, MOLA); insert [x, y]; tag; line (nº da linha); size (largura do símbolo, unidades do desenho; padrão 100); layer; output_path. Exemplo: dxf_insert_support_symbol(path="a.dxf", kind="GUIA", insert=[1200, 0], tag="S-014", line="L-12", layer="SUPORTES")
Inputs: kind (required), path (required), insert (required), tag, +4 more. Returns: object
dxf_modify_entitiesADestructive
Altera entidades de um DXF: camada, cor, mover, girar, escalar e atributos de bloco.
QUANDO USAR: ajustes em lote de um DXF (mudar camada de suportes, deslocar um trecho, corrigir TAG). Parâmetros: path; handles; layer; color; translate [dx,dy,dz]; rotate_deg (+ rotate_center); scale (>0); attributes {"TAG":"S-01"} (só blocos); output_path (recomendado: salva cópia). Exemplo: dxf_modify_entities(path="a.dxf", handles=["2A3"], attributes={"TIPO":"GUIA"}, output_path="a_rev1.dxf")
Inputs: path (required), handles (required), color, layer, +6 more. Returns: object
dxf_queryARead-only
Lista entidades de um DXF com filtros e paginação (curingas * e ? em layer/block).
QUANDO USAR: inspecionar ou contar entidades de um DXF sem AutoCAD; pagine com offset/limit (máx. 500). Parâmetros: path; type (LINE, CIRCLE, ARC, LWPOLYLINE, TEXT, MTEXT, INSERT, DIMENSION...); layer; block; layout (omita para o modelo); limit; offset. Exemplo: dxf_query(path="a.dxf", type="INSERT", block="SUP-*", layer="SUPORTES", limit=100)
Inputs: path (required), type, block, layer, +3 more. Returns: object
dxf_read_attributesARead-only
Lê os atributos de blocos (ex.: suportes TAG/TIPO/LINHA) direto do DXF, sem AutoCAD.
QUANDO USAR: extrair o cadastro de suportes de um DXF exportado, ou preparar planilha/auditoria offline. Parâmetros: path; block_filter (ex. "SUP-"); layer_filter. Recusa mais de 2000 blocos (restrinja o filtro). Exemplo: dxf_read_attributes(path="linha.dxf", block_filter="SUP-")
Inputs: path (required), block_filter, layer_filter. Returns: object
dxf_sql_queryARead-only
Consulta o DXF com SQL SELECT sobre um índice em memória (tabelas entities e attributes).
QUANDO USAR: perguntas agregadas (contagens por camada, blocos sem TAG, comprimento total por camada). Parâmetros: path; sql (somente SELECT; colunas entities: handle,type,layer,color,block,x,y,z,text,length,radius; attributes: handle,block,tag,value); limit (máx. 1000). Exemplo: dxf_sql_query(path="a.dxf", sql="SELECT layer, COUNT(*) n, SUM(length) L FROM entities GROUP BY layer")
Inputs: sql (required), path (required), limit. Returns: object
export_blocks_to_excelADestructive
Exporta blocos para .xlsx: HANDLE, BLOCO, CAMADA, X, Y, Z, ROTACAO, ESCALA_X/Y/Z + uma coluna por TAG.
QUANDO USAR: gerar a lista/tabela de suportes do desenho, ou obter uma planilha-modelo para depois editar e reimportar (o arquivo gerado é aceito por import_blocks_from_excel e sync_attributes_from_excel). Só lê o desenho. Se o arquivo já existir, sobrescrever exige confirm=true (a planilha tem aba INFO com a unidade). Parâmetros: block_name (curinga * e ?), path (.xlsx, caminho na máquina do usuário), layer (opcional), sheet_name, confirm. Coordenadas na unidade do desenho. Exemplo: export_blocks_to_excel("SUP-*", "C:\proj\suportes.xlsx", layer="SUPORTES").
Inputs: path (required), block_name (required), layer, confirm, +1 more. Returns: object
get_entityARead-only
Propriedades completas de UMA entidade pelo handle (geometria, cor, tipo de linha, atributos de bloco).
QUANDO USAR: depois de query_entities/read_block_attributes, para inspecionar um item específico. Parâmetros: handle (string hexadecimal, ex. "2F1A"). Exemplo: get_entity("2F1A").
Inputs: handle (required). Returns: object
import_blocks_from_excelADestructive
Insere ou atualiza blocos, linha a linha, a partir de uma planilha .xlsx. Um único Ctrl+Z desfaz tudo.
QUANDO USAR: carregar a tabela de suportes (TAG, TIPO, X, Y, Z, LINHA...) no desenho. FLUXO SEGURO: dry_run=true primeiro (relata inserir/atualizar/erro por linha sem tocar no desenho), depois execute. Inserções não pedem confirmação; se alguma linha ATUALIZA um bloco existente, exige confirm=true. Parâmetros: path/sheet/header_row; mapping ({coluna_excel: alvo}, alvo ∈ x,y,z,rotation(graus),scale, scale_x/y/z,layer,block,handle,ignore ou "attr:TAG"; sem mapping, detecta X/Y/Z/BLOCO/CAMADA/ROTACAO/ ESCALA/HANDLE por nome e trata as demais colunas como atributos de mesmo nome); block_name (bloco padrão das linhas sem coluna de bloco); key_tag (atributo-chave, ex. "TAG": linha cujo valor já existe no desenho ATUALIZA o bloco em vez de inserir duplicado); layer (camada padrão); update_position (também move blocos existentes; padrão false); create_missing_layer. Célula em branco = ignorar (não apaga o atributo). Erros por linha não abortam o lote. Exemplo: import_blocks_from_excel("C:\proj\suportes.xlsx", block_name="SUP-GUIDE", key_tag="TAG", layer="SUPORTES", dry_run=true).
Inputs: path (required), layer, sheet, confirm, +7 more. Returns: object
insert_blockADestructive
Insere UMA referência de bloco (definição já existente) e preenche atributos por TAG.
QUANDO USAR: para colocar um suporte/símbolo em coordenadas conhecidas. Para muitos blocos a partir de planilha, use import_blocks_from_excel. Desfazível com um Ctrl+Z. Parâmetros: name (bloco existente; ver list_block_definitions), point ([x, y] ou [x, y, z] na unidade do desenho), scale (número ou [sx, sy, sz]), rotation (GRAUS, anti-horário), layer (existente, ou crie com create_missing_layer=true), attributes ({TAG: valor}; tags não existentes geram aviso). Exemplo: insert_block("SUP-GUIDE", [1250.5, 830, 4200], rotation=90, layer="SUPORTES", attributes={"TAG": "PS-101", "LINHA": "10-P-1001"}).
Inputs: name (required), point (required), layer, scale, +3 more. Returns: object
list_block_definitionsARead-only
Lista as definições de bloco do desenho e as TAGS de atributo de cada uma.
QUANDO USAR: antes de insert_block (para saber nomes e tags válidos) ou de montar planilhas. Parâmetros: name_filter (curinga * e ?, ex. "SUP-"), include_xrefs, count_instances (conta as referências no espaço modelo; mais lento), limit/offset (paginação; as tags só são lidas para a página pedida). Exemplo: list_block_definitions(name_filter="SUP-", count_instances=true).
Inputs: limit, offset, name_filter, include_xrefs, +1 more. Returns: object
list_documentsARead-only
Lista os desenhos abertos no AutoCAD (nome, caminho, salvo?, ativo?).
QUANDO USAR: antes de set_active_document, ou quando há mais de um desenho aberto e é preciso saber em qual as ferramentas vão atuar (sempre no desenho ATIVO). Exemplo: list_documents() → data.documents[0].name == "SUPORTES-01.dwg".
Inputs: no named parameters. Returns: object
list_layersARead-only
Lista as camadas do desenho: nome, cor (ACI), tipo de linha, ligada, congelada, bloqueada.
QUANDO USAR: para conhecer a estrutura de camadas antes de desenhar, inserir blocos ou checar padrão. Parâmetros: name_filter (curinga * e ?, ex. "PIPE-"; opcional), limit (0 = padrão do servidor), offset (paginação). Exemplo: list_layers(name_filter="SUP", limit=20).
Inputs: limit, offset, name_filter. Returns: object
move_entityADestructive
Move uma entidade por um vetor de deslocamento. Desfazível com Ctrl+Z.
QUANDO USAR: reposicionar um item já localizado (query_entities). Parâmetros: handle, displacement ([dx, dy] ou [dx, dy, dz], unidade do desenho). Exemplo: move_entity("2F1A", [100, 0, 0]).
Inputs: handle (required), displacement (required). Returns: object
plot_to_pdfADestructive
Plota o desenho aberto para PDF usando a impressora "DWG To PDF.pc3" do próprio AutoCAD (plotter real).
QUANDO USAR: gerar o PDF de entrega com a mesma fidelidade do comando PLOT; para PDF sem AutoCAD use dxf_export. Parâmetros: path (.pdf, dentro das pastas permitidas); layout (nome; omita para o layout ativo; "Model" = modelo); plot_extents (true = enquadra a extensão; false = usa a configuração salva do layout); overwrite (padrão false). Exemplo: plot_to_pdf(path="C:/Users/eu/autocad-mcp-workspace/S12.pdf", layout="Folha1", overwrite=true) Efeitos: desliga BACKGROUNDPLOT durante a plotagem (restaura depois) e pode mudar a configuração de plotagem do layout.
Inputs: path (required), layout, overwrite, plot_extents. Returns: object
project_data_getARead-only
Lê dados de projeto gravados no DWG por project_data_set (uma chave ou todas).
QUANDO USAR: recuperar metadados do projeto guardados no desenho. Parâmetros: key (omita para listar todas as chaves). Exemplo: project_data_get(key="REV")
Inputs: key. Returns: object
project_data_setADestructive
Guarda um texto de projeto DENTRO do DWG (dicionário XRecord "AUTOCAD_MCP"), preservado ao salvar/abrir.
QUANDO USAR: registrar metadados do projeto no próprio desenho (revisão, nº do documento, norma, responsável). Parâmetros: key (até 64 caracteres; sem espaços nas pontas), value (texto até 2000 caracteres). Exemplo: project_data_set(key="REV", value="B - 2026-10-05")
Inputs: key (required), value (required). Returns: object
query_entitiesARead-only
Busca entidades por filtros (via SelectionSet + códigos DXF) e devolve resumo paginado.
QUANDO USAR: para "achar" coisas no desenho: todas as linhas da camada X, blocos de um tipo, textos numa região. Para propriedades completas use get_entity(handle). Parâmetros: type (nome DXF: LINE, CIRCLE, LWPOLYLINE, TEXT, MTEXT, INSERT...; lista com vírgula; apelidos: block, polyline), layer (curinga * e ?), block_name (só INSERT; usa o nome efetivo, então pega blocos dinâmicos), bbox ([xmin, ymin, xmax, ymax] na unidade do desenho; bbox_mode "window" = inteiramente dentro, "crossing" = toca a janela), limit/offset (paginação; limit 0 = padrão). Exemplo: query_entities(type="INSERT", block_name="SUP-*", layer="SUPORTES", limit=25).
Inputs: bbox, type, layer, limit, +3 more. Returns: object
read_block_attributesARead-only
Lê referências de bloco: handle, posição, camada e dicionário TAG → valor de atributos.
QUANDO USAR: para "ler a tabela de suportes do desenho", conferir TAGs, ou antes de atualizar valores. Parâmetros: block_name (curinga * e ?; vazio = todos os blocos), layer (curinga), limit/offset (paginação; 0 = padrão do servidor). Exemplo: read_block_attributes(block_name="SUP-*", layer="SUPORTES", limit=100).
Inputs: layer, limit, offset, block_name. Returns: object
run_lispADestructive
Executa UMA expressão AutoLISP no AutoCAD via SendCommand. Desligado por padrão (enable_lisp no config.toml).
QUANDO USAR: só quando nenhuma outra ferramenta faz o serviço (ex.: comando específico do Plant 3D). LIMITAÇÕES REAIS: SendCommand é ASSÍNCRONO e NÃO devolve o resultado do LISP — para ler um valor, faça o LISP gravá-lo em uma variável de sistema (SETVAR "USERS1" ...) e leia com outra ferramenta/no AutoCAD; não entra no agrupamento de undo do servidor (o AutoCAD cria o próprio passo). Exige confirm=true; expressão em uma linha, ≤ 2000 caracteres, parênteses balanceados; funções de arquivo/registro/processo são bloqueadas (defesa parcial, não é sandbox). Toda execução é registrada no log. Parâmetros: expression, confirm, wait_seconds (espera até 30 s o AutoCAD ficar ocioso). Exemplo: run_lisp('(setvar "USERS1" (rtos (getvar "DIMSCALE")))', confirm=true).
Inputs: expression (required), confirm, wait_seconds. Returns: object
save_documentADestructive
Salva o desenho ativo POR CIMA do arquivo atual (operação destrutiva: exige confirm=true).
QUANDO USAR: só quando o usuário pediu para gravar. Desenho sem nome (nunca salvo) é recusado — peça ao usuário para usar SALVARCOMO no AutoCAD. Sem confirm=true retorna ok=false com a prévia. Parâmetros: confirm (bool). Exemplo: save_document(confirm=true).
Inputs: confirm. Returns: object
set_active_documentADestructive
Torna ativo um desenho já aberto, pelo nome (ex.: "SUPORTES-01.dwg") ou caminho completo.
QUANDO USAR: para trocar o desenho-alvo das demais ferramentas. Não abre arquivos novos. Parâmetros: name (str) — nome ou caminho; comparação sem diferenciar maiúsculas. Exemplo: set_active_document("SUPORTES-01.dwg").
Inputs: name (required). Returns: object
snapshot_support_registerARead-only
Captura cadastro completo e limitado de suportes, sem alterar entidades ou salvar arquivos.
QUANDO USAR: antes de revisar atributos ou comparar revisões. Exige filtro explícito de bloco/camada. Parâmetros: block_filter, layer_filter, key_tag/type_tag/line_tag; nomes de atributos configuráveis. Exemplo: snapshot_support_register(block_filter="SUP-*", type_tag="TYPE", line_tag="LINE"). Retorna data.snapshot para audit_support_register/compare_support_register; recusa exceder o limite.
Inputs: key_tag, line_tag, type_tag, block_filter, +1 more. Returns: object
statusARead-only
Diagnóstico do AutoCAD: conectado?, versão, desenho ativo, unidades, nº de entidades, comando ativo.
QUANDO USAR: sempre como PRIMEIRA chamada de uma conversa e ao suspeitar de problema (erro de conexão, "AutoCAD ocupado"). Se o AutoCAD estiver fechado, retorna ok=false com error.code="autocad_not_running" (nunca inicia o AutoCAD sozinho). Parâmetros: nenhum. Exemplo: status() → data.document.units == "mm".
Inputs: no named parameters. Returns: object
sync_attributes_from_excelADestructive
Atualiza ATRIBUTOS de blocos já existentes casando pela TAG-chave (não insere nem move nada).
QUANDO USAR: a planilha é a fonte da verdade dos dados (TIPO, LINHA, PESO...) e o desenho deve refletí-la. FLUXO SEGURO: dry_run=true (mostra antes→depois, não encontrados e ambíguos); depois confirm=true. Como altera valores em massa, qualquer mudança real exige confirm=true. Um Ctrl+Z desfaz tudo. Parâmetros: path/sheet/header_row, key_tag (atributo-chave, ex. "TAG"; a planilha precisa de coluna com esse nome), block_name (restringe o universo; curinga), mapping ({coluna_excel: "TAG_DO_ATRIBUTO"}; sem mapping, cada cabeçalho é o nome da tag). Célula em branco = mantém o valor do desenho. Exemplo: sync_attributes_from_excel("C:\proj\suportes.xlsx", key_tag="TAG", dry_run=true).
Inputs: path (required), key_tag (required), sheet, confirm, +4 more. Returns: object
system_capabilitiesARead-only
Informa capacidades e restrições sem conectar ou iniciar AutoCAD.
QUANDO USAR: antes de escolher ferramentas; distingue configuração de conexão real. Parâmetros: nenhum. Exemplo: system_capabilities() informa read_only e limitações Plant 3D.
Inputs: no named parameters. Returns: object
update_block_attributesADestructive
Altera atributos de UM bloco (handle) ou de vários (filter). Sobrescrita exige confirm=true.
QUANDO USAR: corrigir/preencher TAG, TIPO, LINHA etc. FLUXO SEGURO: 1) dry_run=true para ver o antes→depois; 2) repetir com confirm=true. Sem confirm, se houver sobrescrita de valor existente ou mais de 1 bloco afetado, retorna ok=false com a prévia. Um único Ctrl+Z desfaz tudo. Parâmetros: attributes ({TAG: novo valor}; '' limpa), handle (string hex) OU filter ({"block_name": "SUP-", "layer": "SUPORTES", "where": {"LINHA": "10-P-1001"}}), dry_run, confirm. Exemplo: update_block_attributes({"TIPO": "GUIA"}, filter={"block_name": "SUP-", "where": {"TIPO": "SHOE"}}, dry_run=true).
Inputs: attributes (required), filter, handle, confirm, +1 more. Returns: object
zoom_extentsADestructive
Enquadra a vista atual em todos os objetos do desenho (ZOOM Extents).
QUANDO USAR: depois de inserir/desenhar coisas, para o usuário enxergar o resultado. Não altera o desenho (não entra no histórico de desfazer). Exemplo: zoom_extents().
Inputs: no named parameters. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 50 tools
Every description carries an explicit 'QUANDO USAR' clause and the two execution modes (live AutoCAD vs. offline DXF files) are usually stated, so an agent can pick correctly in most cases. The surface is nonetheless mirrored — dxf_query/query_entities, dxf_get_entity/get_entity, dxf_delete_entities/delete_entities, dxf_add_dimensions/add_dimension, dxf_read_attributes/read_block_attributes — and a few overlap pairs (read_block_attributes vs snapshot_support_register vs export_blocks_to_excel; update_block_attributes vs sync_attributes_from_excel) require the agent to read carefully before choosing.
Almost everything is snake_case verb_noun (draw_line, insert_block, list_layers, delete_entities) and the offline family consistently uses a dxf_ prefix (dxf_create_layer, dxf_add_entities, dxf_query). Minor deviations exist: bare nouns like status, dxf_info, system_capabilities, and the inconsistent order in project_data_set/project_data_get.
At 50 tools this is well past the point where an agent can hold the surface in mind, and roughly a third of the catalog is a second implementation of concepts already offered in live mode. The domain is genuinely broad (drafting, blocks, layers, dimensions, Excel round-trip, plotting, support-register QA), but bundling both live and offline stacks into one server inflates the set substantially.
Coverage is strong across the lifecycle: draw/query/get/move/copy/delete entities, define/insert/read/update blocks, layer creation and auditing, dimensions, layout creation and PDF export, document listing/activation/save, and project metadata stored in the DWG. The main gaps are live-entity property editing (no live tool to change an existing entity's layer, color, rotation, or scale — only move/copy, while dxf_modify_entities covers this offline) and no way to open/create a DWG or purge layers.
Related MCP Connectors
Read, query, edit and render DWG drawings with AI. No AutoCAD required.
- AutoMEPDeprecatedapp.automep
Edit AutoCAD and Revit MEP drawings from Claude or ChatGPT in plain English.
DXF and PDF/X-4 for AI agents: structured facts, PNG renders, an interactive in-chat viewer.
AI Hub for AEC — 50+ 3D formats, clash detection, ACC integration via Autodesk Platform Services.
Related MCP Servers
- FlicenseNot gradedqualityAmaintenanceEnables AI agents to draft, edit, read, and validate CAD drawings either by driving a live AutoCAD session over COM or headlessly through ezdxf on any platform, spanning mechanical parts, architectural plans, P&IDs, ISO-compliant dimensioning and GD&T, and quantity takeoffs into spreadsheets.-
- FlicenseNot gradedqualityAmaintenanceEnables AI agents to drive production-grade CAD automation either live through COM on Windows or headlessly via ezdxf on any platform, using one typed contract across both engines. It covers drawing creation, P&ID, mechanical and architectural drafting, ISO GD&T and dimension-tolerance validation, takeoffs, and drawing understanding.-
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to drive AutoCAD automation through one typed contract over two engines — live COM on Windows or headless ezdxf anywhere — to draft, edit and read drawings, including mechanical parts and sheets, architectural plans with measured room areas, and P&ID diagrams. It also critiques existing drawings, checks scales and topology, and produces takeoff workbooks.MIT
- FlicenseNot gradedqualityAmaintenanceEnables AI agents to automate AutoCAD drafting, drawing understanding, and quantity takeoffs either through a live COM connection on Windows or headlessly via ezdxf on any platform. It covers P&ID, mechanical, and architectural workflows with ISO/ANSI standards — symbols, dimensions, layers, frames, title blocks, parts lists, schedules, and validation of drawings made by others.-



