u-os-mcp-server

uiff/u-os-mcp-server

3.2

If you are the rightful owner of u-os-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

The MCP NATS Server is a Model Context Protocol server that serves as a gateway to a Weidmueller u-OS Data Hub via NATS, enabling AI agents to interact with PLC variables.

MCP NATS Server

An MCP (Model Context Protocol) server that acts as a gateway to a Weidmueller u-OS Data Hub via NATS. This allows AI agents (like Claude) to read and write variables on a PLC.

Features

  • List Providers: Discover available controllers on the NATS bus.
  • List Variables: See available IOs/variables on a controller.
  • Read/Write: Read and write variable values (currently supports string values).
  • Docker Support: Ready for deployment on Linux PLCs.

Installation

Prerequisites

  • Rust (for building locally)
  • Access to a NATS server (u-OS Data Hub)

Build

cargo build --release

Configuration

  1. Create a credentials.env file (see credentials.env for template):
    CLIENT_ID=your_client_id
    CLIENT_SECRET=your_client_secret
    
  2. Update start.ps1 with your NATS IP address.
    • On the Server/PLC: Use nats://127.0.0.1:4222 (localhost).
    • On a Dev Device: Use the actual IP address of the PLC (e.g., nats://192.168.1.10:4222).

Usage

Local (Windows)

Run the helper script:

.\start.ps1

Docker (Linux PLC)

Build and run the container:

docker build -t mcp-nats-server .
docker run -i --rm --network host -v $(pwd)/credentials.env:/app/credentials.env mcp-nats-server --nats-url nats://127.0.0.1:4222 --nats-creds /app/credentials.env

MCP Configuration

Add this to your Claude Desktop config:

{
  "mcpServers": {
    "u-os-hub": {
      "command": "path/to/mcp-nats-server.exe",
      "args": [
        "--nats-url",
        "nats://YOUR_IP:4222",
        "--nats-creds",
        "path/to/credentials.env",
        "--client-name",
        "mcp-agent"
      ]
    }
  }
}