AutoCAD LT AutoLISP MCP server

Enables natural language control of AutoCAD LT through AutoLISP code generation and execution for creating engineering drawings, process equipment symbols, and complete process diagrams via keyboard simulation.
Back to servers
Setup instructions
Provider
hvkshetry
Release date
Mar 21, 2025
Language
Python
Stats
62 stars

This MCP server enables natural language control of AutoCAD LT 2024/2025, allowing you to create engineering drawings and P&ID diagrams through conversational prompts. It generates and executes AutoLISP code in response to your commands, bridging Claude or other LLM clients with AutoCAD LT.

Prerequisites

  • AutoCAD LT 2024 or newer (with AutoLISP support)
  • Python 3.10 or higher
  • Claude Desktop or other MCP client application
  • Optional: CAD Tools Online P&ID Symbol Library (for full P&ID functionality)

Installation

1. Install Dependencies

git clone https://github.com/hvkshetry/autocad-mcp.git
cd autocad-mcp
python -m venv venv
venv\Scripts\activate
pip install -r requirements.txt

2. Configure Claude Desktop

For users WITH CTO Library:

{
  "mcpServers": {
    "autocad-mcp": {
      "command": "path\\to\\autocad-mcp\\venv\\Scripts\\python.exe",
      "args": ["path\\to\\autocad-mcp\\server_lisp_fast.py"]
    }
  }
}

For users WITHOUT CTO Library:

{
  "mcpServers": {
    "autocad-mcp": {
      "command": "path\\to\\autocad-mcp\\venv\\Scripts\\python.exe",
      "args": ["path\\to\\autocad-mcp\\server_lisp.py"]
    }
  }
}

3. CTO Library Setup (Optional but Recommended)

If you have the CAD Tools Online P&ID Library:

  1. Install the CTO library to C:\PIDv4-CTO\
  2. Verify the following directories exist:
    • C:\PIDv4-CTO\VALVES\
    • C:\PIDv4-CTO\EQUIPMENT\
    • C:\PIDv4-CTO\PUMPS-BLOWERS\
    • C:\PIDv4-CTO\TANKS\
    • (and other standard categories)

If you DON'T have the CTO Library:

  • Use server_lisp.py instead of server_lisp_fast.py
  • P&ID tools will not work, but all basic drawing operations remain available
  • You can still create custom blocks and use standard AutoCAD functionality

4. Start AutoCAD and Server

  1. Launch AutoCAD LT

    • Create or open a drawing
    • Ensure command line is visible
  2. Start the Server

    # For users with CTO library (recommended)
    start_fast_server.bat
    
    # For users without CTO library
    start_lisp_server.bat
    
  3. Test the Connection

    test_connection.bat
    

Available Tools

Basic Drawing Tools

  • create_line: Draw lines between points
  • create_circle: Create circles with center and radius
  • create_text: Add text labels with rotation support
  • create_polyline: Create polylines from point series
  • create_rectangle: Create rectangles from corner points
  • batch_create_lines: Create multiple lines efficiently
  • batch_create_circles: Create multiple circles efficiently
  • batch_create_texts: Create multiple text entities efficiently

Block and Layer Management

  • insert_block: Insert blocks with attributes and positioning
  • set_layer_properties: Create/modify layers with full properties
  • move_last_entity: Move recently created entities
  • update_block_attribute: Modify block attributes after insertion

P&ID and Process Tools (CTO Library Required)

  • setup_pid_layers: Create standard P&ID drawing layers
  • insert_pid_symbol: Insert any symbol from CTO library
  • insert_pid_equipment_with_attribs: Insert equipment with proper attributes
  • insert_valve_with_attributes: Insert valves with CTO attributes
  • insert_equipment_tag: Add equipment identification tags
  • insert_equipment_description: Add equipment description blocks
  • insert_line_number_tag: Add process line identification
  • draw_process_line: Draw process piping between points
  • connect_equipment: Connect equipment with orthogonal routing
  • add_flow_arrow: Add directional flow indicators

Advanced Operations

  • create_arc: Create arcs with center, radius, and angles
  • create_ellipse: Create ellipses with major axis and ratio
  • create_mtext: Add multiline formatted text
  • create_linear_dimension: Add linear dimensions
  • create_hatch: Add hatching to closed areas
  • list_pid_symbols: List available symbols by category

Usage Examples

Basic Drawing

"Draw a line from (0,0) to (100,100)"
"Create a circle at (50,50) with radius 25"
"Add text 'Equipment Room' at position (75,125)"

P&ID Creation (with CTO Library)

"Set up P&ID layers for a new drawing"
"Insert a centrifugal pump at (100,100) with tag P-101"
"Add a gate valve at (150,100) with size 6 inches and tag V-201"
"Connect the pump P-101 to valve V-201 with process piping"
"Add equipment tag P-101 above the pump"

Process Flow Creation

"Create a wastewater treatment process with screening, primary clarifier, aeration basin, and secondary clarifier"
"Insert a clarifier at (200,100) with equipment number CL-301"
"Add line number 8"-WW-001 to the main process line"

Batch Operations

"Create 10 circles in a grid pattern with centers every 50 units"
"Draw process lines connecting all equipment in sequence"
"Add equipment tags for all pumps with sequential numbering"

Configuration for Users Without CTO Library

If you don't have the CAD Tools Online library, you can still use this MCP server effectively:

1. Use the Standard Server

Replace the server command with:

"args": ["path\\to\\autocad-mcp\\server_lisp.py"]

2. Alternative Approaches

Instead of CTO symbols, you can:

  • Use standard AutoCAD blocks
  • Create simple geometric representations
  • Use text labels for equipment identification
  • Import your own symbol library

3. Example Alternative Usage

"Draw a circle to represent a pump at (100,100)"
"Add text 'P-101 Centrifugal Pump' next to it"
"Create a rectangle for a tank at (200,100)"
"Connect them with a line for piping"

Performance Optimization

Fast Mode Benefits

  • 80% faster drawing operations using batch tools
  • 90% faster server initialization with essential files only
  • Clipboard-based script execution for complex operations

Performance Settings

Adjust performance based on your system:

# Fast systems
set_performance_mode(fast_mode=True, minimal_delay=0.03)

# Slower systems (more reliable)
set_performance_mode(fast_mode=False, minimal_delay=0.1)

Troubleshooting

Common issues and solutions:

LISP Loading Issues

  • Problem: "LOAD failed" errors
  • Solution: Add LISP directory to AutoCAD trusted paths

CTO Library Issues

  • Problem: "File not found" for P&ID symbols
  • Solution: Verify CTO installation path or use standard server
  • Alternative: Use server_lisp.py without P&ID functionality

Window Focus Problems

  • Problem: Commands not reaching AutoCAD
  • Solution: Ensure AutoCAD is active, run as Administrator

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "autocad-mcp" '{"command":"path\\to\\autocad-mcp\\venv\\Scripts\\python.exe","args":["path\\to\\autocad-mcp\\server_lisp_fast.py"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "autocad-mcp": {
            "command": "path\\to\\autocad-mcp\\venv\\Scripts\\python.exe",
            "args": [
                "path\\to\\autocad-mcp\\server_lisp_fast.py"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "autocad-mcp": {
            "command": "path\\to\\autocad-mcp\\venv\\Scripts\\python.exe",
            "args": [
                "path\\to\\autocad-mcp\\server_lisp_fast.py"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later