Ugs Mcp

io.github.zackpeters93由 GitHub 帳號 zackpeters93 發布v0.1.1更新於 Oct 24, 2026

CNC machine control via Universal G-code Sender. Jog, home, run files with hardware safety tokens.

概覽

AI 產生的概覽

透過 Universal G-code Sender 控制 CNC 工具機:點動、回原點、執行檔案與巨集,並檢查 G-code,移動需權杖確認。

可以做什麼
透過 UGS Pendant REST API 將助理連接到 CNC 工具機。連線類工具用於連接或中斷 UGS,並排查序列埠問題;狀態類工具讀取工具機狀態、位置、進給率與主軸轉速。運動類工具可點動各軸、回原點、返回工件原點、設定工件原點,以及執行 G-code 檔案或已儲存的巨集。G-code 檢查器可將 G-code 翻譯成英文、進行安全檢查、估算加工時間並列出刀具。
適用情境
當你想讓助理操作或檢查一台已執行 UGS 並啟用 Pendant 外掛的 GRBL 工具機時使用,例如點動、回原點、執行工作,或在切削前檢查 G-code。沒有連接工具機與 UGS 環境時沒有用處。
執行需求
本機 Python 3.11+ 程序,從 PyPI 或原始碼安裝。需要 Universal GCode Sender 2.x 並啟用 UGS Pendant 外掛,且可透過設定的主機與連接埠存取。選用環境變數:UGS_HOST、UGS_PORT、MACROS_DIR、RAPID_SPEED_MM_MIN。未宣告帳號或 API 金鑰。
安裝前請注意
此伺服器會驅動真實機械,可能損壞設備、毀壞工件,甚至造成人員傷亡。運動指令需要兩步驟確認權杖,必須由使用者讀回,但執行檔案、巨集、回原點與設定原點仍會改變工具機狀態。使用前請閱讀安全文件,並確認緊急停止按鈕的位置。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Ugs Mcp,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

ugs-mcp

[PyPI version] [CI] [License: MIT] [Python 3.11+] [ugs-mcp MCP server]

MCP server for controlling CNC machines via Universal GCode Sender.

Lets Claude (or any MCP-compatible AI assistant) connect to a CNC machine, inspect G-code, and issue motion commands — all through the UGS Pendant REST API.


⚠️ STOP. READ THIS FIRST.

This software controls machines that can damage equipment, destroy parts, and injure or kill people.

CNC machines move fast and don't know where your hands are. Before you use this:

If you skim the safety docs and something goes wrong, that's on you. We warned you.


What it does

  • Connection tools — Connect/disconnect UGS to your CNC, troubleshoot serial port issues
  • Status tools — Read machine state, position, feed rate, spindle speed
  • Motion tools (token-protected) — Jog axes, home, return to work zero, run G-code files and macros
  • G-code inspector — Translate G-code to English, safety check, cycle time estimate, tool list

Every motion command uses a two-step token protocol: Claude generates a token, shows it to you, and the machine only moves when you read the token back. Claude cannot bypass this — tokens are generated and validated server-side.


Requirements

  • Universal GCode Sender 2.x (winder.github.io/ugs_website)
  • UGS Pendant plugin installed and active (Tools → Plugins → Installed)
  • Pendant running at http://localhost:8080 (default)
  • Python 3.11+

Installation

Via pip

bash
pip install ugs-mcp

From source

bash
git clone https://github.com/zackpeters93/ugs-mcp.gitcd ugs-mcppip install -e .

Claude Code setup

bash
claude mcp add ugs-cnc ugs-mcp

Or from source (without pip install):

bash
claude mcp add ugs-cnc /path/to/ugs-mcp/ugs_mcp/run_server.sh

Claude Desktop setup

In ~/Library/Application Support/Claude/claude_desktop_config.json:

json
{  "mcpServers": {    "ugs-cnc": {      "command": "ugs-mcp"    }  }}

Or from source:

json
{  "mcpServers": {    "ugs-cnc": {      "command": "/opt/homebrew/opt/[email protected]/libexec/bin/python3",      "args": ["-m", "ugs_mcp.server"],      "cwd": "/path/to/ugs-mcp"    }  }}

Configuration

Environment variables (all optional):

VariableDefaultDescription
UGS_HOSTlocalhostUGS Pendant host
UGS_PORT8080UGS Pendant port
MACROS_DIRugs_mcp/macros/Directory for saved G-code macros
RAPID_SPEED_MM_MIN5000Rapid speed used in return-to-zero

Copy .env.example to .env to customize.


The token system

Every motion tool uses a mandatory two-step confirmation:

Step 1 — Call the tool without a token. Claude shows you a preview (axis, distance, resulting position, safety warnings) and a token like [A3F8B2C1].

Step 2 — Read the preview. If you agree, tell Claude the token. Claude calls the tool again with confirmation_token="A3F8B2C1". The machine moves.

Tokens are generated server-side via uuid4(), expire in 2 minutes, and are single-use. Claude cannot predict, fabricate, or reuse them. The only way movement happens is if you type the token back.


Tools

See USER_GUIDE.md for the full tool reference with parameters, examples, and typical workflows.

CategoryTools
Connectionugs_connect, ugs_disconnect, ugs_troubleshoot_connection
Statusugs_get_status, ugs_get_job_status
Jobugs_run_file, ugs_pause_job, ugs_cancel_job
Motionugs_jog, ugs_home, ugs_return_to_zero, ugs_set_work_zero
G-codegcode_safety_check, gcode_estimate_time, gcode_translate, gcode_list_tools, gcode_save_macro, gcode_list_macros, gcode_run_macro

Tested with

  • SainSmart Genmitsu 3018 Pro (GRBL)
  • UGS 2.x with Pendant plugin
  • macOS / Python 3.11

Likely works with any GRBL-based machine. TinyG/FluidNC/Smoothieware untested.


License

MIT — see LICENSE.

No warranty. No liability. Read SAFETY.md.

來源:README.md,提交 ec3f442

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.1.1最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分