Logo NX MCP Server

NX MCP Server

Cộng đồng
DreamEnding

MCP server for Siemens NX (UG) — AI agents control NX GUI via 47+ tools

Nhà phát hànhDreamEnding
Kho mãNX_MCP
Ngôn ngữPython
Bản fork
25
Sao
138
Công cụ có sẵn
0
Phương thức truyền tảistdio
Danh mục
Giấy phépMIT
Liên kết
  • Kết nối công cụ với quy trình làm việc AI

    NX MCP Server cung cấp các khả năng MCP mà ứng dụng khách và tác nhân AI tương thích có thể sử dụng.

  • 0 công cụ có sẵn

    Xem các thao tác có thể gọi bên dưới, kèm tên và mô tả nếu máy chủ cung cấp.

  • Cấu hình sẵn để sao chép

    Dùng các đoạn cấu hình cài đặt mẫu để thiết lập máy chủ này trong ứng dụng khách MCP bạn muốn dùng.

  • Chỉ số quan tâm đến mã nguồn mở

    138 sao và 25 bản fork từ kho mã được liên kết.


NX MCP exposes 16 typed tools for creating parts, drawing sketches, extruding solids, inspecting model objects and exporting STEP. A Python MCP server runs outside NX; a local bridge executes NXOpen calls inside the NX process.

[!IMPORTANT]

Development preview — 0.2.0.dev0. Historical validation covers Python batch mode on NX2506 and the C# GUI bridge on NX2206. Release acceptance for the same clean candidate on both environments is still pending. See capabilities and validation.

Sketch & modelInspect & recoverSave & exchange
Create sketches, draw lines and rectangles, extrude solids.Query bodies and features, undo operations and fit the view.Open and save NX parts, export STEP files.

How it works

The sidecar handles tool schemas, input validation and MCP responses. The bridge owns the NX session, object references, undo marks and model operations. The sidecar can start without NX; CAD calls require a running bridge.

BridgeUse caseDocumented runtime
C# GUIModel in an open NX window; the UI remains available between callsNX2206
Python batchRun an explicitly enabled, blocking journal loopNX2506

Both bridges expose the same default tool contract. Use one bridge per state directory. See architecture for the protocol and GUI bridge setup for scheduling and deployment details.

Quick start

1. Install the sidecar

You need Windows, a local native Siemens NX installation, Python 3.10+, PowerShell 7, Git and an MCP client that supports stdio servers. Use a disposable workspace for your first run.

powershell
git clone https://github.com/DreamEnding/NX_MCP.git
Set-Location NX_MCP
python -m venv .venv
.\.venv\Scripts\python.exe -m pip install -e .
New-Item -ItemType Directory -Force 'C:\NX_MCP_WORKSPACE' | Out-Null

Run the following commands from the repository root. Replace the sample NX, checkout and user paths with your own. If your network requires a proxy, configure it before cloning or installing packages.

2. Start one NX bridge

Build against your installed NX assemblies:

powershell
.\nx_gui_bridge\build.ps1 -NxRoot 'C:\Program Files\Siemens\NX2206'

Create nx_gui_bridge/build/gui-bridge.json next to the generated DLL:

json
{
  "workspace": "C:\\NX_MCP_WORKSPACE",
  "state_dir": "C:\\Users\\<you>\\.nx-mcp"
}

In NX, choose File → Execute → NX Open (Ctrl+U) and load nx_gui_bridge/build/NxMcpGuiBridge.dll. Running it again stops the bridge. Environment variables override the JSON configuration.

Loading an unsigned DLL requires an NX Open .NET author license (dotnet_author); otherwise sign it with NX's SignDotNet.exe. See the GUI bridge guide for signing, startup loading and client AppData isolation.

In a dedicated PowerShell terminal, set the bridge environment and run the bundled journal through NX's journal runner:

powershell
$env:NX_MCP_WORKSPACE = 'C:\NX_MCP_WORKSPACE'
$env:NX_MCP_STATE_DIR = Join-Path $env:USERPROFILE '.nx-mcp'
$env:NX_MCP_ALLOW_UNVERIFIED_PYTHON_BRIDGE = '1'
$env:NX_MCP_BRIDGE_STOP_FILE = Join-Path $env:NX_MCP_WORKSPACE "bridge-$([guid]::NewGuid()).stop"
Write-Output "Stop the bridge by creating: $env:NX_MCP_BRIDGE_STOP_FILE"
& 'C:\Program Files\Siemens\NX2506\NXBIN\run_journal.exe' (Join-Path (Get-Location) 'examples/start_nx_bridge.py')

This command keeps running while the bridge pumps requests. To stop it, create the printed stop-file path from another terminal using New-Item -ItemType File. The journal loads this checkout's src/ automatically; the default Python bridge needs no MCP or Pydantic installation inside NX. This runner is batch-only.

3. Configure your MCP client

Use the virtual environment's absolute Python path. The workspace and state directory must match the bridge configuration, including the real username in place of <you>.

json
{
  "mcpServers": {
    "nx-mcp": {
      "command": "C:\\src\\NX_MCP\\.venv\\Scripts\\python.exe",
      "args": ["-m", "nx_mcp.server"],
      "env": {
        "NX_MCP_WORKSPACE": "C:\\NX_MCP_WORKSPACE",
        "NX_MCP_STATE_DIR": "C:\\Users\\<you>\\.nx-mcp"
      }
    }
  }
}

Reload the client and call nx_status. A connected bridge returns connected: true, its NX version and bridge_implementation (python_batch or csharp_gui). With no work part, active_part and units are null.

If you receive NX_BRIDGE_UNAVAILABLE, check that the bridge is running and that both processes use the same absolute NX_MCP_STATE_DIR.

Tools

The default tools/list contains exactly 16 tools:

AreaTools
Sessionnx_status
Part filesnx_create_part, nx_open_part, nx_save_part, nx_close_part
Exportnx_export_step
Inspectionnx_list_sketches, nx_list_bodies, nx_list_features
Sketchesnx_create_sketch, nx_sketch_line, nx_sketch_rectangle, nx_finish_sketch
Modelingnx_extrude
Recovery and viewnx_undo, nx_fit_view

Tools publish typed inputs, structured results and MCP operation hints. Geometry inputs use the work part's native units, reported by nx_status.units as mm or inch. If units are missing or null, confirm them before modeling.

The 34 legacy tools are hidden and unverified. Their opt-in settings are explained in the 0.1 migration guide; the C# bridge does not support them. STEP-to-USD conversion is a separate validation example, not an MCP tool. Measurement APIs remain proposals.

Example workflow

Create a 20 × 10 × 12.5 mm block in a new part. These are MCP tool calls, not a Python script; pass each row's arguments through your client. Use fresh output paths and confirm the intended work part before making changes.

StepToolArguments or result to retain
1nx_statusCheck the active part and connection
2nx_create_part{"path":"demo/block.prt","units":"mm"}
3nx_create_sketch{"plane":"XY"}; retain object.id as sketch_id
4nx_sketch_rectangle{"sketch_id":"<id>","corner1":{"x":0,"y":0},"corner2":{"x":20,"y":10}}
5nx_finish_sketch{"sketch_id":"<id>"}
6nx_extrude{"sketch_id":"<id>","distance":12.5}
7nx_list_bodies, nx_list_featuresCheck the returned body and feature
8nx_save_part{}
9nx_export_step{"path":"demo/block.stp"}

Replace <id> with the actual sketch ID from step 3. The example uses XY; XZ/YZ line and rectangle coordinate handling currently needs correction. Object lists verify model structure, not exact dimensional measurements. The NX modeling skill describes unit handling, part ownership, verification and recovery for agents.

Operational boundaries

  • Files: pass paths relative to NX_MCP_WORKSPACE. Both processes validate file boundaries. Geometry commands operate on the current work part, so establish the target part before editing.
  • Save and close: operate on the work part, not its whole assembly tree. An incomplete save returns an error, preserves undo history and prevents save-before-close from discarding the part.
  • Object IDs: are session references, not permanent asset IDs. Query fresh IDs after undo, failed-mutation rollback or closing/reopening a part.
  • Recovery: never automatically replay a mutation whose details.execution_state is unknown. Inspect the model first. A rollback failure blocks writes until explicit recovery; see the recovery contract.
  • Local access: the bridge binds to 127.0.0.1 and authenticates requests. Keep the state directory private: bridge.json contains the session token. Remote exposure and Teamcenter-managed sessions are outside the current scope.

Capabilities and validation

Default availability, automated tests and real-NX acceptance are separate claims.

AreaEvidence and remaining boundary
Default modeling workflowDevelopment-tree NX2506 batch acceptance; clean release-candidate matrix pending
Interactive GUI bridgeHistorical NX2206 acceptance; matching current-candidate acceptance pending
Native unitsMetric/inch save/reopen verified on development-tree Python/NX2506; GUI runtime validation pending
Failure and recovery pathsLocal fault-injection tests; no blanket real-NX acceptance of every error branch
Legacy tools and USD conversionOutside the default tool surface; separate validation requirements

See real-NX validation, M1 status, M2 status and the release checklist for exact builds, dates and acceptance criteria. A fake-NX test or successful C# build does not certify native CAD behavior.

Development

Use the repository virtual environment from PowerShell 7:

powershell
.\.venv\Scripts\Activate.ps1
python -m pip install -e ".[dev]"
python -m pre_commit install --install-hooks
python -m pre_commit run --all-files
python -m mypy src/nx_mcp
python -m pytest -q -p no:cacheprovider -m "not real_nx" --cov=nx_mcp --cov-branch --cov-fail-under=78

Ordinary tests do not require NX. CI runs Python tests, coverage, packaging, contract parity and isolated Windows C# harnesses. Real-NX acceptance runs separately on a dedicated runner. See contributing before adding tools or collecting release evidence.

Documentation

GuideWhat it covers
ArchitectureProcess boundaries, protocol, object lifecycle and recovery
GUI bridgeC# build, configuration, loading and NX2206 evidence
Real-NX validationBatch setup, acceptance commands and runtime evidence
NX modeling skillAgent workflow using the existing tools
0.1 → 0.2 migrationTool and parameter changes
MCP SDK v2 migrationOfficial Python SDK dependencies and client compatibility
STEP → USD validationIndependent conversion and geometry checks
Inspection contractImplemented units and proposed measurement APIs

Changelog · Release checklist · Security policy · MIT license

Star History

If NX MCP helps your workflow, give it a star or share your feedback in an issue.

Explore the chart

Cài đặt

TypingMind
{
  "mcpServers": {
    "nx-mcp": {
      "command": "python",
      "args": [
        "-m",
        "nx_mcp.server"
      ],
      "env": {
        "UGII_BASE_DIR": "<UGII_BASE_DIR>"
      }
    }
  }
}

Dùng MCP NX MCP Server với nhiều mô hình AI

TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên sau khi kết nối NX MCP Server, bạn có thể dùng với nhiều mô hình AI khác nhau trong TypingMind thay vì phải thiết lập riêng cho từng mô hình. MCP này chạy cục bộ thông qua trình kết nối MCP của TypingMind trên thiết bị của bạn.

Hướng dẫn thiết lập để dùng trình kết nối cục bộ

Dùng cách này khi máy chủ MCP cần truy cập các tệp, ứng dụng hoặc tài nguyên riêng tư trên máy tính của bạn.

1

Mở cài đặt MCP

Trong TypingMind, vào Cài đặt, Cài đặt nâng cao, rồi đến Giao thức ngữ cảnh mô hình và chọn Cài trình kết nối.

  1. Mở TypingMind trong trình duyệt của bạn.
  2. Nhấp vào biểu tượng Cài đặt.
  3. Vào Cài đặt nâng cao.
  4. Mở mục Giao thức ngữ cảnh mô hình.
  5. Nhấp vào Cài trình kết nối rồi chọn Thiết bị này.
Màn hình thiết lập trình kết nối MCP của TypingMind với tùy chọn Thiết bị này được chọn
2

Chạy lệnh trình kết nối

Chọn Thiết bị này, sao chép lệnh từ TypingMind và chạy trong Terminal. Giữ tiến trình chạy trong khi bạn dùng MCP.

  1. Sao chép lệnh thiết lập hiển thị trong TypingMind.
  2. Mở Terminal trên macOS hoặc Windows Terminal trên Windows.
  3. Dán và chạy lệnh.
  4. Xác nhận cài đặt gói nếu Terminal hỏi bạn có muốn tiếp tục không.
  5. Giữ tiến trình trong cửa sổ Terminal chạy trong khi dùng các công cụ MCP.
3

Thêm NX MCP Server làm máy chủ

Khi trạng thái trình kết nối là Sẵn sàng, nhấp vào Sửa máy chủ và dán cấu hình máy chủ MCP.

  1. Đợi đến khi trạng thái trình kết nối hiển thị Sẵn sàng.
  2. Nhấp vào Sửa máy chủ.
  3. Dán cấu hình máy chủ MCP của NX MCP Server.
  4. Lưu danh sách máy chủ.
  5. Làm mới nếu bạn muốn xác nhận trình kết nối vẫn sẵn sàng.
Cài đặt MCP của TypingMind hiển thị máy chủ đang hoạt động và nút Sửa máy chủ
{
  "mcpServers": {
    "nx-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Dùng kết nối với nhiều mô hình

Lưu danh sách máy chủ, mở Plugin, bật các công cụ MCP của NX MCP Server, sau đó chọn bất kỳ mô hình AI nào được hỗ trợ trong TypingMind và dùng các công cụ trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.

  1. Mở trang Plugin trong TypingMind.
  2. Bật các công cụ MCP của NX MCP Server.
  3. Bắt đầu cuộc trò chuyện và chọn mô hình AI bạn muốn dùng.
  4. Dùng các công cụ MCP trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.
  5. Chuyển sang mô hình AI khác bất cứ khi nào cần mà không phải kết nối lại MCP.
Cuộc trò chuyện TypingMind dùng các công cụ MCP đã bật với một mô hình AI được chọn
Bạn có thể dùng NX MCP Server giúp tôi làm việc này không?
NX MCP Server
Được. Tôi đã đọc.
Đây là kết quả tôi tìm được bằng NX MCP Server.

Câu hỏi thường gặp

Máy chủ MCP NX MCP Server dùng để làm gì?

NX MCP Server là máy chủ MCP cho phép các ứng dụng AI tương thích kết nối với công cụ và ngữ cảnh bên ngoài. Trong TypingMind, bạn chỉ cần thêm máy chủ MCP này một lần để các công cụ của nó có sẵn trong không gian làm việc AI của bạn.

Bạn có thể dùng MCP NX MCP Server với nhiều mô hình AI trong TypingMind không?

Có. TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên bạn có thể dùng NX MCP Server với nhiều mô hình AI như Claude, ChatGPT, Gemini hoặc các mô hình khác đã cấu hình trong TypingMind mà không cần thiết lập máy chủ MCP riêng cho từng mô hình.

Vì sao nên dùng MCP NX MCP Server với TypingMind?

TypingMind là một trong những giao diện trò chuyện với LLM tốt nhất vì tập hợp nhiều mô hình AI, prompt, plugin, tác nhân AI, khóa API và công cụ MCP vào một không gian làm việc. Khi kết nối NX MCP Server, bạn có thể dùng các công cụ MCP của dịch vụ này với những mô hình ưa thích, đồng thời giữ quy trình trò chuyện gọn gàng trong TypingMind.

Làm cách nào để kết nối MCP NX MCP Server với TypingMind?

NX MCP Server hoạt động thông qua trình kết nối MCP cục bộ của TypingMind. Đây là lựa chọn phù hợp nhất khi máy chủ MCP cần truy cập tệp cục bộ, ứng dụng máy tính, công cụ dòng lệnh hoặc tài nguyên riêng trên máy tính của bạn.

MCP NX MCP Server cung cấp những công cụ nào trong TypingMind?

NX MCP Server cung cấp các chức năng MCP mà bạn có thể bật từ trang Plugin của TypingMind để dùng trong trò chuyện hoặc gán cho tác nhân AI.

Bạn có cần chia sẻ khóa API với TypingMind để dùng MCP NX MCP Server không?

Không. TypingMind ưu tiên xử lý cục bộ và cho phép bạn kiểm soát nhà cung cấp mô hình, khóa API, prompt và cấu hình MCP. Nếu NX MCP Server yêu cầu xác thực, hãy thêm các header, cài đặt OAuth hoặc cấu hình cục bộ cần thiết cho máy chủ MCP đó khi tạo kết nối.

Máy chủ MCP liên quan

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇