MCP 服务器 + C++ 插件,用于从 AI 代理驱动 ZW3D 2025+
概览
让一个 AI 代理(Claude Code、光标等)在 a 中建模部分并检查结果(截图、体积、边界框)。目标是 ZW3D、ZWCAD。 整个MCP服务器运行在ZW3D内部,通过HTTP运行MCP。没有Python,没有Node,也没有额外的进程。 1. 从Releases下载zw3d-mcp-vX.Y.Z-win64.zip并解压。2. 然后将zw3dmcp.dll复制到 %APPDATA%\ZWSOFT\ZW3D\ZW3D 2025\custom\apilibs(如果缺少文件夹,请创建;为新版本更改年份)。3. 启动ZW3D。输出窗口显示 [ZW3D-MCP] MCP 端点:http://127.0.0.1:47823/mcp. 如果没有,运行命令 McpStart。4. 在客户端注册该端点: 光标: {“mcpServers”: {“zw3d”: {“url”: “[http://127.0.0.1:47823/mcp"}}}. 仅限 Stdio 的客户端需要桥接器,如 npx -y mcp-remote http://127.0.0.1:47823/mcp(未验证)。5. 向 AI 询问:”ping ZW3D“。 更多细节和故障排除:docs/INSTALL.md。命令 McpStart / McpStop 在 ZW3D 内切换服务。 服务器绑定在127.0.0。
概述(AI 翻译)
英语 |简体中文
让AI代理(Claude代码、光标等)在运行ZW3D 2025+**的中建模部分,并检查结果(截图、体积、边界框)。 目标是ZW3D,不是ZWCAD。
整个MCP服务器就是一个DLL**,运行在ZW3D内部,通过HTTP运行MCP。没有Python,没有Node,没有额外的进程。
快速开始
- 从Releases下载
zw3d-mcp-vX.Y.Z-win64.zip并解压。 - 关闭ZW3D,然后复制
zw3dmcp.dll到%APPDATA%\ZWSOFT\ZW3D\ZW3D 2025\custom\apilibs(如果缺少文件夹,请创建;新版本更改年份)。 - 启动ZW3D。输出窗口显示
[ZW3D-MCP] MCP endpoint: http://127.0.0.1:47823/mcp。如果没有,执行命令McpStart。 - 在客户端注册端点:
光标:{"mcpServers": {"zw3d": {"url": "http://127.0.0.1:47823/mcp"}}}。
仅限 Stdio 的客户端需要像 npx -y mcp-remote http://127.0.0.1:47823/mcp(未验证)这样的桥接器。
5. 问人工智能:“ping ZW3D”。
更多细节和故障排除:docs/INSTALL.md。命令 McpStart / McpStop 在 ZW3D 内切换服务。
配置(环境变量,启动ZW3D前设置)
| 变量 | 含义 |
|---|
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
ZW3D-MCP
English | 简体中文
Let an AI agent (Claude Code, Cursor, …) model parts in a running ZW3D 2025+ and check the result (screenshot, volume, bounding box). The target is ZW3D, not ZWCAD.
The whole MCP server is one DLL that runs inside ZW3D and speaks MCP over HTTP. No Python, no Node, no extra process.
AI agent ── MCP over HTTP: POST http://127.0.0.1:47823/mcp ──▶ zw3dmcp.dll (inside ZW3D)
Quick start
-
Download
zw3d-mcp-vX.Y.Z-win64.zipfrom Releases and unzip it. -
Close ZW3D, then copy
zw3dmcp.dllto%APPDATA%\ZWSOFT\ZW3D\ZW3D 2025\custom\apilibs(create the folder if missing; change the year for newer versions). -
Start ZW3D. The output window shows
[ZW3D-MCP] MCP endpoint: http://127.0.0.1:47823/mcp. If not, run the commandMcpStart. -
Register the endpoint in your client:
claude mcp add --transport http zw3d http://127.0.0.1:47823/mcpCursor:
{"mcpServers": {"zw3d": {"url": "http://127.0.0.1:47823/mcp"}}}. Stdio-only clients need a bridge such asnpx -y mcp-remote http://127.0.0.1:47823/mcp(not verified). -
Ask the AI: “ping ZW3D”.
More detail and troubleshooting: docs/INSTALL.md. Commands McpStart / McpStop toggle the service inside ZW3D.
Configuration (environment variables, set before starting ZW3D)
| Variable | Meaning |
|---|---|
ZW3D_MCP_PORT |
Listening port (default 47823) |
ZW3D_MCP_AUTOSTART=0 |
Do not listen automatically; use McpStart |
ZW3D_MCP_TOKEN |
If set, every request must carry Authorization: Bearer |
ZW3D_MCP_ENABLE_RUN_COMMAND=1 |
Enable the raw run_command tool (off by default) |
Security
The server binds to 127.0.0.1 only and rejects requests whose Host or Origin is not loopback, so a web page cannot drive ZW3D through your browser.
Without ZW3D_MCP_TOKEN, any local process can still call it (including run_command if enabled). Never expose the port to a network.
Tools
Units are millimetres and degrees; points are [x, y, z]. A usage guide (workflow, which tool to pick, common pitfalls) is built into the server:
clients receive it automatically as the MCP instructions, and it is also available as the prompt zw3d_guide.
Session and files
| Tool | What it does |
|---|---|
ping |
Check the connection; plugin version, active file and part |
new_part |
Create a new part file (.Z3PRT) and make it active |
save_part |
Save, or Save As when a path is given |
close_file |
Close the active file (save, discard or ask) |
export_step |
Export the active file as STEP |
export_file |
Export to STEP, IGES, Parasolid, STL, OBJ, JT, PDF, DWG or DXF |
open_file |
Open an existing ZW3D file |
import_file |
Import STEP, Parasolid, SAT, IGES or STL |
screenshot |
Capture the current view as an image (optionally from a standard view / display mode) |
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →