Skip to main content
Glama
plc-mcp-server

plc-mcp-server

by OlubunmiAde

PLC MCP Server

A Model Context Protocol (MCP) server for industrial PLC integration. Enables AI assistants to read tags, monitor alarms, and interact with Allen-Bradley ControlLogix PLCs using natural language.

Features

  • 🏭 Tag Operations - Read/write PLC tags

  • 🚨 Alarm Management - View and acknowledge alarms

  • πŸ“Š Diagnostics - PLC status, I/O health, connection info

  • πŸ”’ Safety First - Read-only by default, write whitelist, audit logging

  • πŸ”Œ MCP Standard - Works with Claude Desktop, Cursor, and any MCP client

Related MCP server: ignition-mcp

Quick Start

# Install dependencies
pip install -r requirements.txt

# Configure your PLC connection
cp config.example.yaml config.yaml
# Edit config.yaml with your PLC IP and settings

# Run the server (stdio mode for MCP)
python -m plc_mcp_server

# Or run in HTTP/SSE mode
python -m plc_mcp_server --transport sse --port 8080

Claude Desktop Configuration

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "plc": {
      "command": "python",
      "args": ["-m", "plc_mcp_server"],
      "cwd": "/path/to/plc-mcp-server"
    }
  }
}

Project Structure

plc-mcp-server/
β”œβ”€β”€ plc_mcp_server/
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ __main__.py          # Entry point
β”‚   β”œβ”€β”€ server.py            # MCP server implementation
β”‚   β”œβ”€β”€ plc/
β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”‚   β”œβ”€β”€ client.py        # PLC connection manager
β”‚   β”‚   β”œβ”€β”€ allen_bradley.py # ControlLogix driver
β”‚   β”‚   β”œβ”€β”€ siemens.py       # S7 driver (future)
β”‚   β”‚   └── modbus.py        # Modbus driver (future)
β”‚   β”œβ”€β”€ tools/
β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”‚   β”œβ”€β”€ tags.py          # Tag read/write tools
β”‚   β”‚   β”œβ”€β”€ alarms.py        # Alarm tools
β”‚   β”‚   └── diagnostics.py   # Status/diagnostic tools
β”‚   β”œβ”€β”€ resources/
β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”‚   └── tag_database.py  # Tag list resource
β”‚   └── safety/
β”‚       β”œβ”€β”€ __init__.py
β”‚       β”œβ”€β”€ whitelist.py     # Write permission control
β”‚       └── audit.py         # Audit logging
β”œβ”€β”€ config.example.yaml
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ pyproject.toml
└── tests/
    └── ...

Safety

This server controls industrial equipment. Safety is paramount.

  • Read-only mode by default (allow_writes: false)

  • Tag whitelist for write operations

  • All operations logged to audit trail

  • Confirmation required for writes (via MCP confirmation flow)

License

MIT

Available Tools

9 tools
acknowledge_alarmC

Acknowledge an active alarm.

Inputs: alarm_id (required).

get_alarmsB

Get active alarms from the PLC.

Inputs: include_acknowledged.

get_connection_infoC

Get connection information and statistics.

Inputs: no named parameters.

get_io_statusC

Get I/O module status and health.

Inputs: module.

get_plc_statusA

Get PLC status including CPU state, mode, and faults.

Inputs: no named parameters.

list_tagsB

List all available tags in the PLC. Can filter by pattern.

Inputs: pattern.

read_tagA

Read a PLC tag value. Returns the current value of the specified tag.

Inputs: tag_name (required).

read_tagsA

Read multiple PLC tags at once. More efficient than multiple single reads.

Inputs: tag_names (required).

write_tagA

Write a value to a PLC tag. Requires write permissions and tag must be in whitelist.

Inputs: value (required), tag_name (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 9 tools

    Disambiguation5/5

    Each tool targets a distinct action: reading/writing tags, listing tags, managing alarms, or retrieving status info. No overlap in purpose.

    Naming Consistency5/5

    All tools follow a consistent verb_noun pattern using snake_case (e.g., read_tag, write_tag, acknowledge_alarm).

    Tool Count5/5

    9 tools cover the essential PLC operations without unnecessary bloat; the count is well-scoped for the domain.

    Completeness4/5

    Core operations (read/write tags, list tags, alarms, status) are present; missing a bulk write or subscription feature, but these are minor gaps.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      B
      maintenance
      MCP server that connects WAGO PLCs to LLM agents via the WDx/WDA REST API, enabling AI assistants to read sensor values, change configuration, trigger firmware updates, or monitor entire PLC fleets without custom code.
      233 PyPI
      4
      -
    • A
      license
      C
      quality
      C
      maintenance
      MCP server for Inductive Automation Ignition, enabling AI assistants to browse and write tags, query history and alarms, manage projects, and deploy Perspective views through natural language.
      43
      37 PyPI
      1
      MIT
    • A
      license
      B
      quality
      C
      maintenance
      Universal MCP server for industrial PLC communication, enabling AI agents to read sensors, alarms, status, setpoints, and write setpoints via adapters for Modbus, S7, or custom PLCs.
      6
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      The first and only MCP server for PLC (Programmable Logic Controller) intelligence. Give any AI agent direct access to industrial automation data β€” ladder logic, tag databases, cross-references, fault root cause analysis, and sequence blockers
      MIT