multiCAD-mcp

multiCAD-mcp

Controls CAD applications (AutoCAD, ZWCAD, etc.) via AI assistants through the Model Context Protocol, enabling drawing, layer management, and automation through natural language or direct tool calls.

Category
访问服务器

README

multiCAD-mcp

Control your CAD applications with your AI assistant through the Model Context Protocol (MCP).

Documentation License Python MCP

Documentation: https://AnCode666.github.io/multiCAD-mcp/

What is multiCAD-mcp?

multiCAD-mcp is an MCP server that lets you control your CAD software using AI assistants like Claude for desktop or Cursor. Whether you're drawing shapes, managing layers, automating repetitive tasks, o doing complex ones, you can do it all through text-based instructions.

Features

  • Multiple CAD Support: Works with AutoCAD®, ZWCAD®, GstarCAD®, and BricsCAD®
  • 7 Unified MCP Tools: Clean access to 55 CAD commands for drawing, layers, entities, blocks, and files
  • Block Attributes (v0.2.0+): Read and write block attribute values
  • Block Creation: Create blocks from entities or user selection
  • Simple command execution: "Draw a red circle at 50,50 with radius 25" - no complex syntax needed
  • Complex tasks execution: "Draw the graph of y = sen(X) and label the axes"
  • Simple Integration: Works with Claude, Cursor, VS Code, and any MCP-compatible client
  • Fast & Reliable: Efficient COM-based architecture for real-time CAD control
  • Flexible: Direct tool calls or natural language - choose what works for you

System Requirements

  • Windows OS (required - uses Windows COM technology)
  • Python 3.10 or higher
  • One or more CAD applications installed in your computer

Installation

Detailed installation instructions are available in docs/01-SETUP.md.

Quick start:

# Install uv (if not installed)
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

# Clone
git clone https://github.com/AnCode666/multiCAD-mcp.git
cd multiCAD-mcp
uv sync --dev
uv run python -m pip install --upgrade pywin32

Setup with Claude Desktop

Add this to your claude_desktop_config.json:

{
  "mcpServers": {
    "multiCAD": {
      "command": "C:\\path\\to\\multiCAD-mcp\\.venv\\Scripts\\python.exe",
      "args": ["C:\\path\\to\\multiCAD-mcp\\src\\server.py"]
    }
  }
}

Important: Use the full path to the Python interpreter in your virtual environment (.venv\Scripts\python.exe), not the system py command. This ensures Claude Desktop uses the correct Python environment with all required dependencies installed.

Replace C:\path\to\multiCAD-mcp with your actual installation path.

Usage Examples

Direct Tool Calls

multiCAD-mcp provides 7 unified MCP tools that provide access to 54 different CAD commands. This architecture is designed for high efficiency, allowing multiple operations to be dispatched in single calls, reducing API overhead by up to 70%.

  • Drawing & Shapes: Lines, circles, arcs, rectangles, polylines, and splines.
  • Block Management: Create blocks (from entities or selection), insert (batch/single), list, and audit.
  • Layer Management: Create, list, rename/delete (batch), and toggle visibility.
  • Entity Manipulation: Move, rotate, scale, copy/paste, and selection (by type/layer/color).
  • Property Management: Change color/layer (batch/single) and set color ByLayer.
  • Data & Export: Extract data (JSON), export to Excel (total or selected), and entity debug.
  • View & Navigation: Zoom extents, fit view, and undo/redo operations.
  • Files & Session: Save (DWG/DXF/PDF), new/close drawings, and multi-drawing switching.
  • Connection & Control: Connection lifecycle, diagnostics, and natural language fallback.

[!TIP] Each tool accepts multiple operations in a single call using a compact shorthand format, reducing API overhead by up to 70%.

Selected Entity Export

Export or extract data from only the entities currently selected in your CAD viewport:

# Export selected entities to Excel
export_data(scope="selected", format="excel", filename="selected_entities.xlsx")

# Extract selected entity data as JSON
export_data(scope="selected", format="json")

Complex Tasks

You can ask your AI assistant to execute complex tasks that require multiple tools, such as drawing graphs of equations, complex title blocks, or data tables.

Configuration

Edit src/config.json to customize:

{
  "logging_level": "INFO",
  "cad": {
    "autocad": {
      "startup_wait_time": 20,
      "command_delay": 0.5
    }
  },
  "dashboard": {
    "port": 8888
  },
  "output": {
    "directory": "~/Documents/multiCAD Exports"
  }
}

Key settings:

  • logging_level: Set to DEBUG, INFO, WARNING, or ERROR to control log verbosity
  • startup_wait_time: Seconds to wait for CAD application to start (increase if CAD is slow)
  • command_delay: Delay between commands in seconds
  • dashboard.port: Web dashboard port (default: 8888)
  • open_dashboard: [host, port] — open web dashboard in browser (default from config.json: 8888)
  • output.directory: Default directory for saved drawings and exports

Troubleshooting

Checking Logs

multiCAD-mcp generates detailed logs to help diagnose issues:

Log Location: logs/multicad_mcp.log (created automatically in the project's logs/ directory)

View logs:

# View latest 50 log entries
Get-Content logs/multicad_mcp.log -Tail 50

# View all logs
Get-Content logs/multicad_mcp.log

# Monitor logs in real-time (updates automatically)
Get-Content logs/multicad_mcp.log -Wait -Tail 10

Adjust log level in src/config.json:

{
  "logging_level": "DEBUG"
}

Available levels (from most to least verbose):

  • DEBUG: Detailed information for diagnosing problems
  • INFO: General informational messages (default)
  • WARNING: Warning messages for potential issues
  • ERROR: Error messages only

Note: Restart the MCP server after changing configuration.

"Connection failed"

  • Make sure your CAD application is running
  • Check that you have the correct version installed
  • Verify Windows COM is properly configured
  • Use manage_session with {"action": "status"} to diagnose the issue
  • Check logs for detailed error messages (see above)

The dashboard provides a real-time view of the CAD state. You can manually refresh the data using the "Refresh Now" button.

  • Dashboard Port: Change dashboard.port in src/config.json to your preferred port.
  • Manual Refresh: Click the refresh button to sync with current CAD state.

"Not connected"

  • The server automatically connects on first use
  • If it fails, restart the CAD application and try again
  • Use manage_session with {"action": "connect"} to re-establish connection
  • Review logs to identify connection issues

Commands not working

  • Check your CAD application's command line for messages or errors
  • Ensure coordinates are in valid format (e.g., "0,0" for 2D, "0,0,0" for 3D)
  • Verify connection status with manage_session{"action": "status"}
  • Enable DEBUG logging to see detailed command execution information

Documentation

Supported CAD Applications

Application Status Notes
AutoCAD 2018+ ✅ Full Support Primary implementation
ZWCAD 2020+ ✅ Full Support Uses AutoCAD-compatible API
GstarCAD 2020+ ✅ Full Support Uses AutoCAD-compatible API
BricsCAD 21+ ✅ Full Support Uses AutoCAD-compatible API

Project Status

Version 0.2.0 - Unified tool architecture, block attribute management, and modern packaging.

License

Apache License 2.0 - see LICENSE file for details.

Acknowledgments

This project builds upon:

Support

For issues, questions, or feature requests, please open an issue on the repository.


Need help setting up? Start with the installation steps above.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选