Skip to main content
Glama

NX MCP

用自然语言控制 Siemens NX 建模(text-to-CAD)。

你说「建一个半径 50mm 的球、打个 10mm 的孔」,Claude 通过 NX Open API 在 NX 里完成建模,输出 .prt 文件。

⚠️ 当前状态:Demo(批量模式)。 实时控制功能已规划但暂未打通,详见下方「已知问题」。


当前能做什么

已实测验证的建模能力:

操作

状态

新建 / 打开零件

长方体、球体、圆柱体

布尔运算(求差/合并)

圆角(EdgeBlend)

撤销(抑制特征)

保存 .prt

草图 / 拉伸 / 直接打孔 / 倒角

⏳ 未实现

工作方式:批量模式 —— Claude 生成 NX 脚本 → 后台调用 NX 引擎 → 生成/修改 .prt → 你用 NX 打开查看。缺点是每次看结果要重新打开文件。


Related MCP server: 3D MCP Server

环境要求

  • Siemens NX 2206(本机装在 D:\Program Files\Siemens\NX2206,含 NX Open API)

  • Python 3.10+

  • pip


安装(仅实时模式需要,批量模式可跳过)

当前批量 demo 不需要这一步。只有启用实时模式(MCP 服务器 + NX journal)时才需要安装。

pip install -e .

依赖:

依赖

用途

mcp>=1.0.0

MCP SDK(实时模式用)

httpx>=0.27.0

HTTP 客户端(实时模式用)


批量模式用法(当前可用)

run_journal.exe 启动独立后台 NX 会话执行脚本:

# 命令行:跑一个 NX journal 脚本
"D:/Program Files/Siemens/NX2206/NXBIN/run_journal.exe" "你的建模脚本.py"

脚本里用 NX Open API 建模并保存。核心模式:

import NXOpen
session = NXOpen.Session.GetSession()
# 新建零件(或 OpenDisplay 打开已有零件)
wp = session.Parts.NewDisplay(r"输出路径.prt", NXOpen.PartUnits.Millimeters)
# ... 建模操作 ...
wp.Save(NXOpen.BasePart.SaveComponents.TrueValue, NXOpen.BasePart.CloseAfterSave.FalseValue)

所有建模 API 的正确写法、签名和坑,见 docs/nx-open-api-reference.md 开发前必读。


项目结构

nx_mcp_server.py      NX journal HTTP 服务器(实时模式组件)
nx_mcp/               MCP 服务器包(工具定义 + stdio 服务)
  ├── server.py         MCP 入口
  ├── nx_client.py      NX HTTP 客户端
  └── tools/            草图/特征/基础体工具定义
pyproject.toml        包配置
.mcp.json             Claude MCP 配置
docs/                 设计文档、实现计划、NX API 参考
tests/                集成测试

架构

实时模式(目标,未打通)

Claude ←(stdio/MCP)→ MCP Server ←(HTTP)→ NX Journal 服务器 ←(NX Open)→ NX
  • MCP 服务器通过标准 I/O 与 Claude 通信

  • 把工具调用转成 HTTP 请求发给跑在 NX 里的 journal 服务器

  • journal 用「队列 + threading.Event」保证 NX Open 只在主线程执行

批量模式(当前):跳过 MCP 和 HTTP,直接生成脚本 → run_journal.exe 执行。


已知问题与后续计划

  1. 实时模式卡点ugraf.exe -journal 在交互模式下不执行 journal;run_journal.exe 只能起独立后台会话。要让 journal 跑在用户交互式 NX 里,唯一办法是界面菜单 Tools → Automation → Journal → Play(需切到 Advanced 角色)。这是一次性设置,打通后实时模式即可用。

  2. 待补命令:草图、拉伸、旋转、直接打孔、倒角。API 已在 docs/nx-open-api-reference.md 里备好结论。


版本

V0.1(Demo) —— 三维实体建模,批量模式。装配、制图、曲面建模不在当前范围。

License: MIT

F
license - not found
-
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    -
    quality
    D
    maintenance
    Enables natural language 3D modeling in Fusion 360 through an MCP server that translates user commands into Fusion 360 API calls. Supports creating, editing, and managing 3D objects, executing Python code, and capturing model views through conversational interactions.
    1
    MIT
  • F
    license
    -
    quality
    D
    maintenance
    Enables AI-driven CAD operations through natural language, integrating LLM and Eyeshot SDK for model manipulation.

View all related MCP servers

Related MCP Connectors

  • Agent-first CAD: editable .kcad.ts source, deterministic review, OpenCASCADE kernel.

  • Convert Revit files to XKT, IFC, or DWG and query BIM data via natural language.

  • DXF and PDF/X-4 for AI agents: structured facts, PNG renders, an interactive in-chat viewer.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/TQJ2007-git/nx-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server