dxf-cad-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| dxf_createA | 创建一个新的空 DXF 文件。 Args: path: 输出文件完整路径(.dxf)。 dxfversion: DXF 版本,可选 R12/R13/R14/R2000/R2004/R2007/R2010/R2013/R2018, 默认 R2010(兼容性最好的常用版本;AutoCAD 2024 全部支持)。 给老软件用就选更老的版本。 |
| dxf_drawA | 向 DXF 图纸追加 2D 实体;文件不存在时自动创建。 每个实体是一个 dict,公共可选字段:layer(图层名,默认 0)、 color(ACI 数字 / 颜色名如 "red" / "#RRGGBB")。 实体类型与必填字段: line: start, end polyline: points[[x,y],...], closed(bool, 默认 false) rectangle: corner[x,y], width, height circle: center[x,y], radius arc: center[x,y], radius, start_angle, end_angle(度, 逆时针) ellipse: center[x,y], major_radius, ratio(0~1), rotation(度, 可选) point: point[x,y] text: point[x,y], text, height, rotation(度, 可选) mtext: point[x,y], text, char_height, width(可选) |
| dxf_dimensionsA | 向 DXF 图纸追加尺寸标注;文件不存在时自动创建。 每个标注是一个 dict,公共可选字段:layer、color、dimstyle(默认 "Standard")、 text(自定义标注文字,不传则显示实测值)。 标注类型与必填字段(坐标单位与绘图一致): linear: p1, p2, location[标注线位置点, 可选], angle(0=水平标注, 90=垂直) aligned: p1, p2, location[标注线位置点, 可选] radius: center, radius, angle(引线方向, 度, 可选), location(可选) diameter: center, radius, angle(可选), location(可选) angular: center, p1, p2[两条射线的端点], location(标注弧位置点, 可选, 不传则画在角平分线上) 返回值含每个标注的实测测量值(measurement),可直接核对。 注意:标注的预览渲染是 ezdxf 的简化实现,与 AutoCAD 的显示可能有差异 (例如 angular 预览可能显示补角);打开 AutoCAD 后 CAD 会按定义点 重新渲染,以 CAD 显示为准。 |
| dxf_hatchA | 向 DXF 图纸追加填充(HATCH);文件不存在时自动创建。 每个填充是一个 dict: points (必填) 闭合多边形边界顶点 [[x,y],...](按序首尾自动闭合) pattern "solid"(实底,默认)或标准图案名,如 "ANSI31"(斜线)、 "ANSI32"、"CROSS"(网格)、"DOTT"/"DOTS"、"NET"、"GRAVEL"、 "BRICK"、"AR-CONC"(混凝土)、"TRUSS"(桁架)、"WAVES" 等 scale 图案缩放(默认 1.0,越大线越疏) angle 图案旋转角度(默认 0) layer / color 公共可选字段 注意:圆形/弧线边界暂不支持(仅多边形边界);复杂边界建议拆成多个填充。 |
| dxf_splinesB | 向 DXF 图纸追加样条线(SPLINE);文件不存在时自动创建。 每个样条是一个 dict: points (必填) 拟合点 [[x,y],...](≥3 个,样条穿过这些点) degree 样条阶数,2 或 3(默认 3) layer / color 公共可选字段 |
| dxf_blocksA | 定义图块(BLOCK)并向图纸插入图块引用(INSERT);文件不存在时自动创建。 blocks: 图块定义列表,每个: name (必填) 图块名(已存在同名图块会报错) base_point 插入基准点(可选,默认 [0,0]) entities (必填) 图块内实体,格式与 dxf_draw 的 entities 完全相同 (line/polyline/rectangle/circle/arc/ellipse/point/text/mtext) refs: 图块引用列表(可省略),每个: block (必填) 图块名 insert (必填) 插入点 [x,y] rotation 旋转角度(可选,度) x_scale / y_scale 缩放(可选,默认 1) layer / color 公共可选字段 |
| dxf_layersB | 创建或更新图层。 每个图层: {name(必填), color(可选, 同 color 规则), linetype(可选, 如 "Continuous"/"Dashed"/"Center"/"Hidden")}. 文件不存在时先创建。 |
| dxf_readB | 检查一张 DXF 图纸:DXF 版本、实体总数与类型分布、包围盒、图层列表。 |
| dxf_renderA | 把 DXF 渲染成 PNG 预览图(纯本地,不需要打开 AutoCAD)。 Args: path: 源 DXF 文件。 png_path: 输出 PNG 路径。 dpi: 分辨率,默认 150(100~300)。 background: 背景色,"white"/"black"/"dark" 或 #RRGGBB。 |
| dxf_export_pdfA | 把 DXF 导出为矢量 PDF(线条/文字保持矢量,可无限放大,适合打印归档)。 Args: path: 源 DXF 文件。 pdf_path: 输出 PDF 路径。 background: 背景色,"white"/"black"/"dark" 或 #RRGGBB。 page_size: "auto"(默认,按图纸包围盒自适应)或 "A4"/"A3"/"A2"(横版)。 |
| dxf_open_in_autocadB | 把 DXF(或 DWG)文件打开到本机的 AutoCAD(macOS Args: path: 要打开的图纸文件。 prefer: 可选,指定优先使用的 .app 路径(默认自动选择 /Applications/Autodesk 下的 AutoCAD,完整版优先)。 |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 11 tools
Each tool targets a distinct operation: creation, entity drawing, dimensions, hatching, splines, blocks, layers, reading, and three separate output targets (PNG/PDF/AutoCAD). The only minor overlap is dxf_create vs dxf_draw (draw auto-creates), but their intent is clearly separated in the descriptions.
All tools share a consistent dxf_ prefix, but the suffix convention is mixed: some use verbs (dxf_create, dxf_draw, dxf_read, dxf_render) while others use plural nouns (dxf_dimensions, dxf_splines, dxf_hatch, dxf_blocks, dxf_layers). Still readable and predictable enough overall.
11 tools is well-scoped for a DXF manipulation server, with each tool covering a distinct CAD concept or output format. No bloat and no obviously trivial tools.
The server covers creation, drawing, annotation, blocks, layers, inspection, and export well, but it is append-only: there is no way to modify or delete existing entities or layers, and hatch boundaries cannot be circular/arc. These are notable gaps for iterative CAD editing workflows.