AutoCAD MCP Server

AutoCAD MCP Server

A Flask-based MCP server that connects to AutoCAD and executes AutoLISP code to enable architectural floor plan creation and management through a REST API.

Category
Visit Server

README

AutoCAD MCP Server

A comprehensive Flask-based MCP (Model Context Protocol) server that connects to AutoCAD and executes AutoLISP code to facilitate architectural floor plan creation. This server provides a complete suite of tools for efficient creation, modification, and management of architectural drawings through programmatic interfaces.

Features

  • Flask-based REST API server with AutoCAD integration
  • AutoLISP code generation for architectural functions
  • Comprehensive architectural tools for floor planning
  • Real-time AutoCAD communication via COM/ActiveX interface
  • Building code compliance checking
  • Parametric component creation
  • Multi-format export capabilities
  • Template-based drawing setup

System Requirements

  • Windows 10/11 (required for AutoCAD COM interface)
  • AutoCAD LT 2022 or newer
  • Python 3.8+
  • Required Python packages (see requirements.txt)

Installation

  1. Clone the repository:
git clone https://github.com/GaneshHayagrivanM/onyx-CAD-MCP.git
cd onyx-CAD-MCP
  1. Install Python dependencies:
pip install -r requirements.txt
  1. Ensure AutoCAD is installed and accessible on your system

  2. Configure the server settings in config/settings.py if needed

Quick Start

  1. Start the AutoCAD MCP Server:
python server/app.py
  1. The server will start on http://localhost:5000 by default

  2. Connect to AutoCAD:

curl -X POST http://localhost:5000/api/autocad/connect \
  -H "Content-Type: application/json" \
  -d '{"instance_id": "default"}'
  1. Create your first wall:
curl -X POST http://localhost:5000/api/drawing/wall \
  -H "Content-Type: application/json" \
  -d '{
    "start_point": {"x": 0, "y": 0, "z": 0},
    "end_point": {"x": 120, "y": 0, "z": 0},
    "thickness": 6,
    "height": 96
  }'

Core Functions

Drawing Elements

  • create_wall - Create walls with specified dimensions
  • insert_door - Add doors to walls with swing directions
  • insert_window - Add windows with sill heights
  • create_room - Define room boundaries with area calculation

Layout & Organization

  • setup_grid - Create drawing grid with labels
  • create_layer - Manage drawing layers with properties
  • set_drawing_scale - Set drawing scale
  • setup_viewport - Create viewports

Annotation & Dimensions

  • add_text_note - Add text annotations
  • dimension_linear - Add linear dimensions
  • add_room_label - Label rooms with area

Furniture & Fixtures

  • insert_furniture - Place furniture with rotation and scale
  • create_cabinet - Create cabinet units
  • create_fixture - Add architectural fixtures

Utilities

  • calculate_area - Calculate polygon areas
  • generate_room_schedule - Create room schedules
  • check_building_code - Validate building codes
  • export_to_format - Export drawings (PDF, DXF, DWG)

Advanced Features

  • create_parametric_component - Create parametric objects
  • load_template - Load drawing templates
  • generate_3d_model - Generate 3D models from 2D plans
  • create_section - Create section views

API Documentation

See API.md for complete API documentation with examples.

User Guide

See USER_GUIDE.md for detailed usage instructions.

Configuration

Edit config/settings.py to customize:

  • Server host and port
  • AutoCAD connection settings
  • Default drawing parameters
  • Building code requirements
  • Logging configuration

Testing

Run the test suite:

python -m pytest tests/

Architecture

onyx-CAD-MCP/
├── server/
│   ├── app.py                 # Main Flask application
│   ├── autocad_interface.py   # AutoCAD COM interface
│   ├── lisp_generator.py      # AutoLISP code generation
│   ├── models.py              # Data models
│   └── utils.py               # Utility functions
├── lisp/
│   ├── core_functions.lsp     # Core AutoLISP functions
│   ├── architectural_tools.lsp # Architectural functions
│   └── utilities.lsp          # Utility functions
├── config/
│   └── settings.py            # Configuration
├── tests/
│   └── test_functions.py      # Test suite
├── docs/
│   ├── API.md                 # API documentation
│   └── USER_GUIDE.md          # User guide
├── requirements.txt
└── README.md

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Add tests for new functionality
  4. Ensure all tests pass
  5. Submit a pull request

License

MIT License - see LICENSE file for details

Support

For issues and questions:

  • Create an issue on GitHub
  • Check the documentation in /docs
  • Review the test files for usage examples

Changelog

Version 1.0.0

  • Initial release
  • Complete AutoCAD MCP server implementation
  • All core architectural functions
  • REST API with comprehensive error handling
  • AutoLISP code generation engine
  • Building code compliance checking
  • Template system for different project types

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured