
ranvirw18/autocad-mcp-server
Developer toolsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
A production-grade Model Context Protocol (MCP) server for AutoCAD on Windows, enabling AI assistants (Claude Desktop, ChatGPT, Cursor, etc.) to control AutoCAD through natural language.
概要
A production-grade Model Context Protocol (MCP) server for AutoCAD on Windows, enabling AI assistants (Claude Desktop, ChatGPT, Cursor, etc.) to control AutoCAD through natural language. - for CAD operations - for native Windows automation - - "Draw a 100x50 rectangle" → creates geometry - with reconnection logic - for safety - for debugging and monitoring - covering all tools and edge cases - using FastMCP framework - Python 3.11+ - FastMCP - MCP framework - pyautocad - AutoCAD COM wrapper - pywin32 - Windows COM support - Pydantic - Data validation - uv - Fast Python package manager 1. - Draw a line between two points - Parameters: x1, y1, x2, y2 - Returns: Object ID of created line 2. - Draw a circle - Parameters: center_x, center_y, radius - Returns: Object ID of created circle 3. - Draw a rectangle - Parameters: x, y, width, height - Returns: List of object IDs (polyline + entities) 4.
README
以下は原文 README の抜粋です。原文を見る。
AutoCAD MCP Server
A production-grade Model Context Protocol (MCP) server for AutoCAD on Windows, enabling AI assistants (Claude Desktop, ChatGPT, Cursor, etc.) to control AutoCAD through natural language.
Features
- 10 Comprehensive MCP Tools for CAD operations
- AutoCAD COM API Integration for native Windows automation
- Natural Language Control - “Draw a 100x50 rectangle” → creates geometry
- Automatic Connection Management with reconnection logic
- Full Type Hints & Pydantic Validation for safety
- Production Logging for debugging and monitoring
- Unit Tests covering all tools and edge cases
- Fast & Lightweight using FastMCP framework
Tech Stack
- Python 3.11+
- FastMCP - MCP framework
- pyautocad - AutoCAD COM wrapper
- pywin32 - Windows COM support
- Pydantic - Data validation
- uv - Fast Python package manager
Available Tools
Drawing Tools
-
create_line - Draw a line between two points
- Parameters:
x1,y1,x2,y2 - Returns: Object ID of created line
- Parameters:
-
create_circle - Draw a circle
- Parameters:
center_x,center_y,radius - Returns: Object ID of created circle
- Parameters:
-
create_rectangle - Draw a rectangle
- Parameters:
x,y,width,height - Returns: List of object IDs (polyline + entities)
- Parameters:
-
create_text - Add text annotation
- Parameters:
text,x,y,height - Returns: Object ID of created text
- Parameters:
Layer Management
-
create_layer - Create a new layer
- Parameters:
layer_name - Returns: Layer name (or error if exists)
- Parameters:
-
list_layers - List all layers in document
- No parameters
- Returns: List of layer names
Analysis & Measurement
- calculate_area - Calculate area of closed shape
- Parameters:
object_id - Returns: Calculated area value
- Parameters:
Document Operations
-
save_drawing - Save active drawing
- Parameters:
file_path(optional, defaults to current) - Returns: Success message with file path
- Parameters:
-
export_pdf - Export drawing to PDF
- Parameters:
output_path - Returns: Success message with PDF path
- Parameters:
-
get_active_document - Get active document info
- No parameters
- Returns: Document name and full path
Installation
Prerequisites
- Windows 10/11 (AutoCAD COM API is Windows-only)
- AutoCAD 2020+ installed and running
- Python 3.11+ with pip
- uv package manager (recommended)
Step 1: Clone Repository
git clone https://github.com/yourusername/autocad-mcp-server.git
cd autocad-mcp-server
Step 2: Install Dependencies
Using uv (fastest):
uv sync
Or using pip:
python -m venv venv
venv\Scripts\activate
pip install -r requirements.txt
Step 3: Install pywin32 COM Support
インストール
This server does not publish a one-line install command.
Open the repository installation guide MCP 初心者?mcpskill.org のガイドから始めましょう →設定
{
"mcpServers": {
"autocad": {
"command": "python",
"args": ["-m", "src.server"],
"cwd": "d:/autocad-mcp-server"
}
}
}