AutoCAD MCP Server
Provides tools for creating and managing architectural floor plans in AutoCAD via AutoLISP code generation, including wall creation, door/window insertion, room labeling, and building code compliance checking.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@AutoCAD MCP ServerCreate a wall from (0,0) to (120,0) with thickness 6"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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
Related MCP server: Minimal MCP Server for AutoCAD DWG
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
Clone the repository:
git clone https://github.com/GaneshHayagrivanM/onyx-CAD-MCP.git
cd onyx-CAD-MCPInstall Python dependencies:
pip install -r requirements.txtEnsure AutoCAD is installed and accessible on your system
Configure the server settings in
config/settings.pyif needed
Quick Start
Start the AutoCAD MCP Server:
python server/app.pyThe server will start on
http://localhost:5000by defaultConnect to AutoCAD:
curl -X POST http://localhost:5000/api/autocad/connect \
-H "Content-Type: application/json" \
-d '{"instance_id": "default"}'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.mdContributing
Fork the repository
Create a feature branch
Add tests for new functionality
Ensure all tests pass
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
/docsReview 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
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/GaneshHayagrivanM/onyx-CAD-MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server