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.
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
- Clone the repository:
git clone https://github.com/GaneshHayagrivanM/onyx-CAD-MCP.git
cd onyx-CAD-MCP
- Install Python dependencies:
pip install -r requirements.txt
-
Ensure 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.py
-
The server will start on
http://localhost:5000by default -
Connect 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.md
Contributing
- 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
/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
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
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.
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.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
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.
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.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
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.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.