MCP_CAD
A local MCP server for controlled SOLIDWORKS automation, exposing typed operations for parts, assemblies, configurations, drawings, inspection, and verification.
README
MCP_CAD
MCP_CAD is a local Model Context Protocol (MCP) server for controlled SOLIDWORKS automation. It exposes typed operations for parts, assemblies, configurations, drawings, inspection, verification, and reusable automation plans.
The core server communicates over standard input/output and can be used by any MCP client that supports local stdio servers. It does not require a particular model provider.
[!IMPORTANT] SOLIDWORKS is proprietary software and is not included with MCP_CAD. A licensed local installation is required for live CAD operation. This project is independent and is not affiliated with, endorsed by, or sponsored by Dassault Systèmes or SOLIDWORKS.
What is included
- A Python MCP server built with FastMCP.
- A constrained
SolidWorksClientprotocol with three execution backends. - Part, assembly, configuration, drawing, inspection, and verification tools.
- Record-review-run plans for repeatable assembly, batch, and macro workflows.
- A local part index for reuse-oriented searches.
- A deterministic in-memory mock for development without SOLIDWORKS.
- An optional C# in-process add-in backend.
Call the MCP tool list_capabilities for the authoritative runtime tool inventory. See docs/TOOLS.md for detailed tool documentation.
Execution backends
| Backend | Selection | Platform and purpose |
|---|---|---|
| Mock | MCP_CAD_USE_MOCK=1 |
In-memory development and automated tests. Does not open or modify SOLIDWORKS files. |
| pywin32 COM | Default | Live Windows backend. Drives a running local SOLIDWORKS process out of process through COM. |
| C# add-in | MCP_CAD_USE_ADDIN=1 |
Opt-in Windows backend. Routes implemented operations to the in-process add-in through a local named pipe and falls back to pywin32 COM for operations not yet ported. |
The public tool surface uses millimetres for lengths and degrees for angles. Conversion to SOLIDWORKS-native units occurs at the backend boundary.
Some inputs accept localized SOLIDWORKS entity names, including English and Spanish default plane names. This is a compatibility feature for installations using different UI languages; the project documentation and API guidance use neutral English.
Requirements
For the core MCP server:
- Python 3.10 or newer.
uvfor the documented environment and run commands.- An MCP client that can start a local stdio server.
- Windows, a licensed local SOLIDWORKS installation, and
pywin32for live operation.
macOS and Linux can run the mock backend for development, but cannot use the live COM backends.
Install
Clone the repository, then install the core server:
git clone <repository-url> MCP_CAD
cd MCP_CAD
uv sync
Start the server directly in mock mode to confirm that the Python entry point loads:
MCP_CAD_USE_MOCK=1 uv run mcp_cad
PowerShell equivalent:
$env:MCP_CAD_USE_MOCK = "1"
uv run mcp_cad
The process waits for MCP messages on standard input. It is normal for it to appear idle when launched without an MCP client.
Configure an MCP client
Configure your client to run uv run mcp_cad with this repository as its working directory. The exact configuration location and property names depend on the client. A common stdio-server shape is:
{
"mcpServers": {
"mcp_cad": {
"command": "uv",
"args": ["run", "mcp_cad"],
"cwd": "C:\\path\\to\\MCP_CAD"
}
}
}
For a development session without SOLIDWORKS, add MCP_CAD_USE_MOCK=1 using the environment-variable syntax supported by your MCP client. Do not put model-provider API keys in the MCP_CAD server configuration; the core server does not need one.
Restart the MCP client after changing its server configuration. Then invoke:
list_capabilitiesto confirm tool discovery.verify_setupto identify the active backend and check the SOLIDWORKS connection.
An inactive-document warning from verify_setup is expected when no part or assembly is open.
Live SOLIDWORKS setup
- Install the project on the Windows workstation that runs SOLIDWORKS.
- Make sure
MCP_CAD_USE_MOCKis not set. - Start SOLIDWORKS and open a part or assembly.
- Start or restart the MCP client.
- Invoke
verify_setup.
The default live path is the out-of-process pywin32 COM backend. The C# add-in is optional; see addin/README.md for build, registration, verification, and removal instructions.
Privacy and safety boundary
MCP_CAD runs locally and exposes a bounded set of CAD operations; it does not itself provide a hosted model service. However, an MCP client or model provider may receive prompts, tool arguments, tool results, captured images, filenames, metadata, or other context that the client chooses to send. Review the client and provider configuration before using confidential designs.
The server does not make every operation read-only. Use source control or normal CAD backups, review tool calls, and test unfamiliar workflows on copies. Approval behavior is controlled by the MCP client or agent loop; do not assume every third-party MCP client will request confirmation before a mutating call.
Arbitrary VBA execution is disabled by default. Enabling it with
MCP_CAD_ENABLE_UNSAFE_MACROS=1 accepts code-execution risk; source review and
token scanning are not a sandbox.
Development
Lint and confirm the mock backend loads:
uv sync
uvx ruff check .
MCP_CAD_USE_MOCK=1 uv run mcp_cad
tools/addin_ping.py requires a live SOLIDWORKS session with the add-in enabled and must be run explicitly.
When adding a CAD operation, keep the protocol seam aligned:
- Add the method to
SolidWorksClient. - Implement deterministic mock behavior.
- Implement the pywin32 COM behavior.
- If appropriate, add or port the operation in the C# add-in.
- Expose the operation as an MCP tool.
Useful references:
- docs/TOOLS.md — tool arguments, results, and workflows.
- docs/DESIGN_GUIDE.md — part and assembly build/verification workflow.
- docs/DEPLOYMENT.md — installation, configuration, troubleshooting, updates, and removal.
- addin/README.md — optional in-process backend.
- docs/ARCHITECTURE.md — component boundaries and runtime flow.
- CONTRIBUTING.md — development and pull-request guidance.
- SECURITY.md — private reporting and security boundaries.
- NOTICE — trademark and third-party dependency notices.
License
Licensed under the Apache License, Version 2.0. Third-party
components retain their own licenses — see NOTICE.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。