# ugs-mcp

Connect an AI agent to a CNC machine through Universal GCode Sender to inspect G-code, check machine status, and request motion with your confirmation.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 6
- Author: zackpeters93
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/zackpeters93/ugs-mcp
- Updated: 2026-06-12
- HTML: https://affpapa.org/en/nevibecode/mcp/ugs-mcp

## What it does

The server connects an agent to Universal GCode Sender through the Pendant REST API. It can read machine status, position, feed rate, and spindle speed; inspect G-code; estimate cycle time; and handle jobs, macros, and axis movement.

Motion requires a confirmation token for each command. The agent first presents a preview and token; the machine moves only after you return that token. Tokens are single-use and expire after 2 minutes. This safeguard does not replace reading `SAFETY.md` or knowing where the emergency stop is.

You need Universal GCode Sender 2.x with the Pendant plugin active, plus Python 3.11+. Pendant uses `localhost:8080` by default, and environment variables let you change the connection settings. The project reports testing with a SainSmart Genmitsu 3018 Pro running GRBL.

## Requirements
- Needs: Python and uv (commands run via uvx)
- Environment variables: `UGS_HOST`, `UGS_PORT`, `MACROS_DIR`, `RAPID_SPEED_MM_MIN` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env UGS_HOST=<UGS_HOST> --env UGS_PORT=<UGS_PORT> --env MACROS_DIR=<MACROS_DIR> --env RAPID_SPEED_MM_MIN=<RAPID_SPEED_MM_MIN> --transport stdio ugs-mcp -- uvx ugs-mcp
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from ugs-mcp <command>

### Codex

**Platform CLI**
```bash
codex mcp add ugs-mcp --env UGS_HOST=<UGS_HOST> --env UGS_PORT=<UGS_PORT> --env MACROS_DIR=<MACROS_DIR> --env RAPID_SPEED_MM_MIN=<RAPID_SPEED_MM_MIN> -- uvx ugs-mcp
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from ugs-mcp <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "ugs-mcp": {
            "command": "uvx",
            "args": [
                "ugs-mcp"
            ],
            "env": {
                "UGS_HOST": "<UGS_HOST>",
                "UGS_PORT": "<UGS_PORT>",
                "MACROS_DIR": "<MACROS_DIR>",
                "RAPID_SPEED_MM_MIN": "<RAPID_SPEED_MM_MIN>"
            }
        }
    }
}
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from ugs-mcp <command>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "ugs-mcp": {
            "type": "stdio",
            "command": "uvx",
            "args": [
                "ugs-mcp"
            ],
            "env": {
                "UGS_HOST": "<UGS_HOST>",
                "UGS_PORT": "<UGS_PORT>",
                "MACROS_DIR": "<MACROS_DIR>",
                "RAPID_SPEED_MM_MIN": "<RAPID_SPEED_MM_MIN>"
            }
        }
    }
}
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from ugs-mcp <command>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e UGS_HOST=<UGS_HOST> -e UGS_PORT=<UGS_PORT> -e MACROS_DIR=<MACROS_DIR> -e RAPID_SPEED_MM_MIN=<RAPID_SPEED_MM_MIN> ugs-mcp uvx ugs-mcp
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from ugs-mcp <command>

## When to use it
- inspect G-code for safety issues before running it
- check machine status and current position
- jog an axis after reviewing a confirmation token
- run a G-code file or macro through UGS

## Example prompts
- Check this G-code for safety issues and estimate its cycle time.
- Show the machine status and current position.
- Prepare a 5 mm move on the X axis and show me the confirmation token.

## Similar
- [Scrapling MCP Server](https://affpapa.org/en/nevibecode/mcp/scrapling-mcp-server.md) — MCP server · ★ 89899
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119231
- [AIHawk](https://affpapa.org/en/nevibecode/mcp/aihawk.md) — MCP server · ★ 32260
- [Skyvern](https://affpapa.org/en/nevibecode/mcp/skyvern.md) — MCP server · ★ 23283
- [SeleniumBase MCP](https://affpapa.org/en/nevibecode/mcp/seleniumbase-mcp.md) — MCP server · ★ 13181
- [Inbox Zero](https://affpapa.org/en/nevibecode/mcp/inbox-zero.md) — MCP server · ★ 12826

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
