AutoCAD DWG MCP Server

Local setup required. This server has to be cloned and prepared on your machine before you register it in Claude Code.
1

Set the server up locally

Run this once to clone and prepare the server before adding it to Claude Code.

Run in terminal
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -r requirements.txt
python app.py
2

Register it in Claude Code

After the local setup is done, run this command to point Claude Code at the built server.

Run in terminal
claude mcp add autocad-dwg-mcp -- python "<FULL_PATH_TO_MCP_FOR_MS_COPILOT_AGENTHON>/dist/index.js"

Replace <FULL_PATH_TO_MCP_FOR_MS_COPILOT_AGENTHON>/dist/index.js with the actual folder you prepared in step 1.

README.md

A FastAPI-based MCP server scaffold to extract material tables from DWG files.

Minimal MCP Server

간단한 MCP(Model Context Protocol) 서버 스캐폴드입니다. Python 3.12.10용 FastAPI 예시를 제공합니다.

Endpoints:

  • GET /health - 상태 확인
  • POST /mcp - 간단한 MCP-style 요청 처리 (예: {"requestId":"id","input":{"text":"..."}})
  • GET /mcp/tools - MCP 도구 목록 샘플

Python 3.12.10

간단한 FastAPI 기반 MCP 서버가 추가되었습니다.

설치 및 실행 (Windows PowerShell):

# 가상환경 생성
python -m venv .venv
# 가상환경 활성화
.\.venv\Scripts\Activate.ps1
# 의존성 설치
pip install -r requirements.txt
# 서버 실행
python app.py

또는 개발 모드로 직접 uvicorn 실행:

python -m pip install --upgrade pip
pip install -r requirements.txt
uvicorn src.mcp_server:app --reload --port 3000

포트는 환경변수 PORT로 변경 가능합니다.

AutoCAD DWG 도구 설정

config.env 파일을 수정하여 AutoCAD 도구 설정을 변경할 수 있습니다:

# AutoCAD DWG 폴더 경로
DWG_FOLDER=C:\CAD\Drawings

# 재료 테이블 추출 설정
LAYER_SHOP_FIELD=SHOP-FIELD
ROW_TOLERANCE=3.0
COL_TOLERANCE=40.0

# 카테고리 헤더 (쉼표로 구분)
MATERIAL_CATEGORIES=SHOP MATERIAL,FIELD MATERIAL

설정 항목 설명:

  • DWG_FOLDER: DWG 파일을 검색할 기본 폴더 경로
  • LAYER_SHOP_FIELD: 재료 테이블이 포함된 레이어명
  • ROW_TOLERANCE: 행 클러스터링 허용 오차 (픽셀 단위)
  • COL_TOLERANCE: 열 할당 허용 오차 (픽셀 단위)
  • MATERIAL_CATEGORIES: 카테고리 헤더명 (쉼표로 구분)

이 구현은 예시용 매우 단순한 에코 응답을 제공합니다. 실제 MCP 규격에 맞게 확장하세요.

Environment Variables

DWG_FOLDERThe base folder path to search for DWG files
LAYER_SHOP_FIELDThe layer name containing the material table
ROW_TOLERANCERow clustering tolerance in pixels
COL_TOLERANCEColumn assignment tolerance in pixels
MATERIAL_CATEGORIESComma-separated list of category header names
PORTPort for the FastAPI server

Configuration

claude_desktop_config.json
{"mcpServers": {"autocad-dwg": {"command": "python", "args": ["/path/to/app.py"], "env": {"DWG_FOLDER": "C:\\CAD\\Drawings"}}}}

Try it

Extract the material table from the latest DWG file in my CAD folder.
List all material categories found in the current AutoCAD drawing.
Process the shop field layer in the drawing files and summarize the material requirements.

Frequently Asked Questions

What are the key features of AutoCAD DWG MCP Server?

FastAPI-based MCP server scaffold. Configurable DWG folder path scanning. Layer-specific material table extraction. Adjustable row and column clustering tolerances.

What can I use AutoCAD DWG MCP Server for?

Automating the extraction of bill of materials from CAD drawings. Standardizing material data processing across multiple DWG files. Integrating AutoCAD drawing data directly into AI-assisted project workflows.

How do I install AutoCAD DWG MCP Server?

Install AutoCAD DWG MCP Server by running: python -m venv .venv && .\.venv\Scripts\Activate.ps1 && pip install -r requirements.txt && python app.py

What MCP clients work with AutoCAD DWG MCP Server?

AutoCAD DWG MCP Server works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep AutoCAD DWG MCP Server docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare