Get the FREE Ultimate OpenClaw Setup Guide →

autocad

🏗️ Python MCP server for AutoCAD automation - Create walls, doors, windows & building structures programmatically via COM interface with intelligent layer management

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio thepiruthvirajan-autocad-mcp-server python C:\path\to\your\autocad-mcp-server\test_script.py \
  --env PYTHONPATH="C:\path\to\your\autocad-mcp-server"

How to use

This AutoCAD MCP Server provides programmatic control over AutoCAD through COM automation. Built as a Python-based MCP server, it exposes capabilities to manage drawing entities, layers, and structures using natural language or direct API calls. It integrates with Claude Desktop and other MCP clients, enabling you to create rooms, walls, doors, windows, and other architectural elements, assign them to appropriate layers, and query drawing information such as layers and entity counts. Typical workflows include asking Claude to create a room with specific dimensions, querying the current drawing status, or batch-manipulating entities across layers. The server supports both conversational usage via Claude and direct API usage for custom integrations via the provided Python interface (e.g., AutoCADCOMServer).

How to install

Prerequisites:

  • Operating System: Windows (COM automation required)
  • AutoCAD installed (any version with COM support)
  • Python 3.8 or higher
  • Claude Desktop (for MCP integration) or another MCP client

Installation steps (Method 1: Using pip - Recommended):

  1. Clone the repository and set up the environment git clone https://github.com/yourusername/autocad-mcp-server cd autocad-mcp-server

  2. Create and activate a virtual environment python -m venv venv

    Windows

    venv\Scripts\activate

    macOS/Linux (if ever supported)

    source venv/bin/activate

  3. Install the package in editable mode pip install -e .

  4. Ensure dependencies are installed pip install mcp>=1.0.0 pywin32>=306

Method 2: Using uv (Faster) for environments that support it:

  1. Install uv pip install uv
  2. Clone and setup as above
  3. Create environment and install uv venv uv pip install -e .

Notes:

  • The package relies on Windows COM automation; ensure AutoCAD is accessible from the environment where the server runs.
  • If you plan to run tests or examples, the repository includes test_script.py used for quick connectivity checks.

Additional notes

Tips and common issues:

  • Ensure AutoCAD is open and ready before starting the MCP server or testing via test_script.py.
  • If Claude Desktop cannot find the MCP server, verify the Claude config path and restart Claude Desktop after updating the MCP configuration.
  • Use the provided environment variable PYTHONPATH to point Claude to your local project, if running from a custom location.
  • For advanced usage, the Direct API section demonstrates how to instantiate AutoCADCOMServer and perform operations like creating structures and querying entities.
  • If you encounter permission issues with COM registration, run the terminal as Administrator on Windows.
  • When running in a virtual environment, ensure the environment’s Python interpreter is the one invoking the MCP server.

Related MCP Servers

Sponsor this space

Reach thousands of developers