cad_mcp_server
Provides tools for interacting with AutoCAD through a .NET plugin and local HTTP bridge, enabling drawing, querying, editing, and export capabilities.
Provides tools for interacting with FreeCAD through a Python Workbench with a local HTTP API and information output panel, enabling drawing, querying, editing, and export capabilities.
Click on "Deploy 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., "@cad_mcp_serverdraw a 100x50 rectangle in AutoCAD and export it as DXF"
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.
DrawMCP
面向 AutoCAD / 中望CAD(ZWCAD)/ FreeCAD 的 MCP(Model Context Protocol)工具集:把三种 CAD 的绘图、查询、编辑与导出能力封装成 MCP 工具,供本地大模型或外部 Agent 调用。
本仓库包含以下组件:
cad_mcp_server/:MCP Server(HTTP + JSON-RPC 2.0,路径/mcp)cad_chat_desktop/:桌面 Chat GUI(PySide6 + LangChain 工具调用)cad_autocad_plugin/:AutoCAD .NET 插件(通过本地 HTTP Bridge 连接)cad_zwcad_plugin/:中望CAD(ZWCAD).NET 插件(通过本地 HTTP Bridge 连接)cad_freecad_workbench/:FreeCAD Workbench(Python 插件:本地 HTTP API + 信息输出面板)
文档导航(建议先读):
docs/README.md(完整导航)docs/freecad_setup.mddocs/zwcad_setup.md(中望 2026:真实程序集名、端口 56101、NETLOAD 步骤)docs/manual_test_cases.md(人工输入测试用例:逐条粘进聊天框的话术 + 该看到什么)
create_venv_env.bat/run_cad_mcp.bat/start_server.bat/start_gui.bat/start_all.bat便于快速跑通与联调。
1. 安装依赖
桌面 GUI 依赖 PySide6,建议 Python 3.12 或 3.13。
也可以直接运行根目录的 create_venv_env.bat 一键创建 venv 并安装依赖(默认放在仓库外 ..\_env\.venv312)。
建议把虚拟环境放到仓库外(仓库目录保持干净,便于上传 GitHub)。在仓库根目录下执行:
py -3.12 -m venv ..\_env\.venv312
..\_env\.venv312\Scripts\python -m pip install -r .\requirements.txt也可以直接使用根目录一键脚本(Windows):
创建 venv + 安装依赖:
create_venv_env.bat启动(三实例 + GUI):
run_cad_mcp.bat说明文档:
docs/windows_bats.md
更多环境说明见:
docs/python_env.mddocs/conda_env.md
2. 启动(Windows,CAD 插件/http 模式)
说明:
也可直接使用根目录一键脚本
start_server.bat autocad(或zwcad/freecad)。需要先在 CAD 插件侧配置 token,并在这里通过
CAD_PLUGIN_TOKEN传入同一个 token。三个 CAD 平台要并行,就起三个 MCP 实例(端口对应见
docs/platform_testing.md第 1 节)。
启动 MCP Server(连接插件):
$env:CAD_BRIDGE_MODE="http"
$env:CAD_PLUGIN_BASE_URL="http://127.0.0.1:56100"
$env:CAD_PLUGIN_TOKEN="<你的token>"
..\_env\.venv312\Scripts\python -m cad_mcp_server默认监听 http://127.0.0.1:9100/mcp(可通过 MCP_PORT 修改)。
3. 启动 MCP Server(可选:mock 自测)
也可用根目录一键脚本:start_server.bat mock 或 start_all.bat mock。
$env:CAD_BRIDGE_MODE="mock"
..\_env\.venv312\Scripts\python -m cad_mcp_server默认监听 http://127.0.0.1:9100/mcp(可通过 MCP_PORT 修改)。
服务端同时提供对外集成接口(REST / OpenAI tools / Skills),详见:
docs/integration/external_agent_integration.md
4. 启动桌面 GUI
也可用根目录一键脚本:start_gui.bat(或 start_all.bat mock 一次启动 server+gui)。
..\_env\.venv312\Scripts\python -m cad_chat_desktop默认:
LLM:LM Studio(
http://127.0.0.1:1234/v1,model=google/gemma-4-e4b)MCP Endpoint:
http://127.0.0.1:9100/mcp
也可以使用 conda(同样建议放到仓库外),详见 docs/conda_env.md。
5. 版权与许可
许可协议
本项目采用 MIT License,完整条款见 LICENSE。
Copyright (c) 2026
在遵守 MIT 条款(保留版权与本许可声明)的前提下,你可以自由使用、修改、分发本项目,包括用于商业用途。本项目按「原样」提供,不附带任何明示或默示担保。
AI 辅助开发说明
本项目的源代码与文档在开发过程中,使用了阿里云通义千问(Qwen)系列大模型辅助完成代码编写、文档整理等工作。
第三方组件与商标
Python 依赖(FastAPI、uvicorn、httpx、pydantic、PyYAML、langchain 等):版权归各自作者,许可多为 MIT / BSD,具体以各项目仓库声明为准;运行时经
pip install -r requirements.txt获取,本仓库不再分发。PySide6 / Qt for Python:采用 LGPLv3 等许可,本仓库仅以依赖方式引用,未修改其源码。
厂商 SDK 程序集:AutoCAD(
accoremgd/acdbmgd/acmgd)、中望CAD(ZwManaged/ZwDatabaseMgd)、FreeCAD 的头文件与程序集均为各厂商的专有软件,本仓库不随附、也不再分发这些文件,构建时只从本机已安装的官方程序目录引用。商标:AutoCAD、ZWCAD、FreeCAD、Qwen 等名称与商标归各自权利人所有,本项目与上述厂商之间不存在隶属、赞助或背书关系。
This server cannot be deployed
Maintenance
Related MCP Connectors
MCP server for progressive tool usage at any scale (see https://klavis.ai)
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
Host any HTTP API as a standard MCP server; auto-distribute to 12+ mainstream agent platforms.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to draw and manipulate 2D designs in a running AutoCAD instance through MCP tools, exposed via HTTP and a tunnel for cloud clients like ChatGPT and Manus.5MIT
- AlicenseBqualityCmaintenanceMCP server that lets AI draw in AutoLISP-capable CAD (reference BricsCAD on Linux) via a file bridge, enabling 2D drafting, 3D solid modeling, and verification with 100 tools.1283Apache 2.0
- FlicenseNot gradedqualityAmaintenanceEnables AI assistants to control CAD applications like AutoCAD, ZWCAD, GstarCAD, and BricsCAD through natural language or direct tool calls. Supports drawing, layer and entity management, block operations, data export, and file handling via 7 unified MCP tools covering 56 CAD commands.-
- FlicenseNot gradedqualityAmaintenanceEnables AI assistants like Claude for Desktop or Cursor to control AutoCAD, ZWCAD, GstarCAD, and BricsCAD through MCP, supporting drawing, layer, entity, block, file operations, data export, and complex multi-step CAD tasks via natural-language or direct tool calls.-