dxf-mcp
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., "@dxf-mcp Give me a parts list for assembly.dxf"
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.
dxf-mcp
An MCP server that gives an agent structured, read-only access to DXF drawings.
Most CAD automation exists to answer three questions, and shops still answer them by hand: what is in this drawing, what parts does it place, and does it follow our standards. This exposes those as tools, so a model can ask instead of a person opening the file.
Nothing here writes a drawing. The server reads.
Tools
Tool | What it does |
| DXF files under a directory, relative to the configured root |
| DXF version, units, layer and block counts, entity mix |
| Every layer with colour, linetype, on/locked state, entity count |
| Block insertions and their attributes, flattened into rows |
| Required layers, forbidden layers, expected units, empty layers |
| Case-insensitive search across TEXT, MTEXT and block attributes |
extract_bill_of_materials is the one worth explaining. A block insertion with
attributes is how a drawing records a placed component: PARTNO, QTY,
MATERIAL. Turning those into one row per component with attribute tags as
columns is the step between a drawing and an ERP or PLM record, and it is
normally either a bespoke LISP routine per shop or a person retyping.
Related MCP server: aspicio-dxf-viewer
Install
git clone https://github.com/OmniZenRaj/dxf-mcp
cd dxf-mcp
python3 -m venv .venv && .venv/bin/pip install -e .Configure
Point DXF_MCP_ROOT at the directory holding your drawings. Claude Desktop, in
claude_desktop_config.json:
{
"mcpServers": {
"dxf": {
"command": "/absolute/path/to/dxf-mcp/.venv/bin/dxf-mcp",
"env": { "DXF_MCP_ROOT": "/absolute/path/to/your/drawings" }
}
}
}VS Code, in .vscode/mcp.json:
{
"servers": {
"dxf": {
"type": "stdio",
"command": "/absolute/path/to/dxf-mcp/.venv/bin/dxf-mcp",
"env": { "DXF_MCP_ROOT": "/absolute/path/to/your/drawings" }
}
}
}The root is the security boundary
An MCP server hands file access to a model, which means the model chooses what to
open. DXF_MCP_ROOT is the only thing standing between that and the rest of the
disk, so it is enforced in one place and tested directly.
Paths are resolved before the containment check, so ../../etc/passwd and a
symlink pointing outside the root are both refused rather than followed. Relative
paths are taken as relative to the root, not to the process working directory,
because that is what a caller means. If DXF_MCP_ROOT is unset the root is the
working directory, which keeps the server runnable without configuration while
still confining it somewhere deliberate.
Example
> Which drawings under ./assemblies are missing a DIMENSIONS layer?
list_drawings("assemblies")
check_standards(path, required_layers=["DIMENSIONS"]) # per drawing
> Give me a parts list for assembly.dxf
extract_bill_of_materials("assembly.dxf")
-> 2 rows, columns MATERIAL / PARTNO / QTY
PART CCI-1042 qty 4 Oak (layer FRAME)
PART CCI-2088 qty 1 Steel (layer PANEL)Tests
.venv/bin/pip install -e ".[dev]"
.venv/bin/pytest # 16 unit tests
.venv/bin/python scripts/smoke_test.py # real stdio JSON-RPC against the built serverFixtures build a real DXF document with ezdxf rather than checking in a binary,
so the test drawing is readable as code and easy to extend.
The unit tests cover the DXF and path logic directly. The smoke test drives the
installed executable over stdio -- initialize, tools/list, a real
extract_bill_of_materials call, and a path-traversal attempt that must come back
isError -- because the MCP wiring is the part unit tests cannot see.
The confinement tests were checked by breaking the code on purpose: deleting the containment condition fails three of them, and resolving the path after the check rather than before fails the traversal and symlink cases. A test that never fails is not evidence.
Limitations
Reads DXF, not DWG. DWG is a closed format; converting with ODA File Converter or
dwg2dxf first is the usual route.
Bills of material come from block attributes. A drawing that records parts as
loose text rather than attributed blocks will produce no rows, which is correct
behaviour and not a bug, though find_text will still locate the text.
Licence
MIT.
Available Tools
6 toolscheck_standardsA
Check a drawing against drafting standards.
Reports missing required layers, forbidden layers and wrong units as errors,
and empty layers as warnings. passed reflects errors only, so a drawing with
warnings still passes.
Inputs: path (required), require_units, required_layers, forbidden_layers. Returns: path, passed, findings
drawing_summaryA
Describe one drawing: DXF version, units, layer and block counts, entity mix.
Call this first. It is cheap, and it tells you which of the other tools is worth calling on this file.
Inputs: path (required). Returns: path, units, dxf_version, layer_count, +4 more
extract_bill_of_materialsA
Extract a bill of materials from block insertions and their attributes.
Each placed block becomes a row and each attribute tag becomes a column, which
is the shape drawing data has to be in before it can reach an ERP or a PLM
record. Pass block to restrict the extract to one block name.
Inputs: path (required), block. Returns: path, rows, row_count, attribute_columns
find_textA
Search TEXT, MTEXT and block attributes for a substring, case-insensitively.
Useful for locating a part number or a revision note when you do not yet know which block or layer it lives on.
Inputs: path (required), needle (required). Returns: result
list_drawingsA
List DXF files available under a directory, relative to the configured root.
Inputs: directory, recursive. Returns: result
list_layersA
List every layer in a drawing with its colour, linetype, state and entity count.
Inputs: path (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool has a distinct purpose: listing files, searching text, summarizing drawings, listing layers, extracting BOMs, and checking standards. No overlap or ambiguity.
All tools follow a consistent verb_noun lowercase snake_case pattern (list_drawings, find_text, drawing_summary, etc.), making the naming predictable and clear.
With 6 tools, the set is compact and focused on the domain of DXF file inspection and processing. Each tool earns its place without redundancy or bloat.
The tools cover the key workflows: discovering files, searching content, summarizing, inspecting layers, extracting BOM data, and validating standards. No obvious gaps for typical DXF operations.
Maintenance
Related MCP Connectors
Read title blocks, parts lists, revision history and notes from 2D engineering drawings.
Fast multi-format CAD previews, geometry checks and conversion; measure and share in the workspace.
Geometry and CAD file metadata extraction for STL, OBJ, PLY, PCD, LAS/LAZ, glTF/GLB.
Headless CAD engine & MCP server for 2D/3D drafting, solids, DXF/SVG export, and automation.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceProvides DXF parsing, entity extraction, geometry analysis, and optional AutoCAD COM automation for CAD tasks.1MIT
- AlicenseNot gradedqualityBmaintenanceOpens, inspects, and renders DXF/CAD drawings for AI agents: describe_dxf returns structured facts (layers with actual drawn colors, units, bounds, text content) and render_dxf returns PNG images. On MCP Apps hosts like ChatGPT and Claude, view_dxf opens an interactive in-chat viewer with pan, zoom, and layer toggles.6MIT
- AlicenseAqualityDmaintenanceEnables reading, analyzing, and editing CAD files (DXF and DWG) via natural language, including entity queries, layer management, and safe copy-based edits.171MIT
- FlicenseNot gradedqualityAmaintenanceEnables AI agents to create, edit, inspect, and validate production drawings through one typed tool contract, driving either a live AutoCAD seat over COM on Windows or a headless ezdxf engine anywhere. It covers drafting, P&ID, mechanical, and architectural workflows with ISO/ANSI standards, dimension and tolerance checks, takeoffs, and drawing understanding.-