Skip to main content
Glama
openplc-engineering-mcp

openplc-engineering-mcp

by allanmarum

openplc-engineering-mcp

一个基于 Python 的小型 MCP 服务器,为 OpenPLC 提供面向领域、只读的工程操作。

该项目是一个早期的实验性实现。其当前目的是在兼容 MCP 的代理与 OpenPLC Editor 项目之间建立一个最小、可测试的集成边界。

架构

MCP Host / LLM Agent
        |
        | MCP
        v
OpenPLC Engineering MCP
        |
        v
OpenPLC

该服务器使用官方的 Model Context Protocol Python SDK 和 stdio 传输。它不会修改 OpenPLC,也不会暴露通用的文件系统或 shell 工具。

Related MCP server: gx3-mcp-server

要求

  • Python 3.12+

  • uv

  • Node.js/npm 仅在使用 MCP Inspector 时需要(mcp dev 使用 npx)

安装

git clone https://github.com/industrix-com-br/openplc-engineering-mcp.git
cd openplc-engineering-mcp
uv sync

运行

启动 stdio MCP 服务器:

uv run openplc-engineering-mcp

使用 MCP Inspector 打开它:

uv run mcp dev src/openplc_engineering_mcp/server.py --with-editable .

测试

uv run pytest

测试使用官方 SDK 基于内存的 Client(mcp) 接口,而不是直接调用工具函数。

当前工具

  • get_server_info — 报告服务器当前的能力。

  • get_project_structure — 返回 OpenPLC Editor 项目的相关结构。

  • list_pous — 根据当前的 OpenPLC Editor 项目布局列出程序、功能块和函数。

OpenPLC 项目检查遵循当前的 Editor 布局:project.json 位于项目根目录,POUs 位于 pous/programs、pous/function-blocks 和 pous/functions 之下,以及 Editor 使用的相关设备和数据类型位置。

范围

此版本有意保持只读和实验性。它不包括项目修改、编译、部署、运行时控制、变量强制、认证、HTTP 传输或不受限制的 shell/文件系统访问。只有在具体需求证明有必要时,才应添加这些能力。

Available Tools

3 tools
get_project_structureB
Read-onlyIdempotent

Return the relevant file structure of an OpenPLC Editor project.

Inputs: project_path (required). Returns: name, path, type, files

get_server_infoA
Read-onlyIdempotent

Return basic information about this experimental OpenPLC MCP server.

Inputs: no named parameters. Returns: object

list_pousB
Read-onlyIdempotent

List the programs, function blocks, and functions in an OpenPLC project.

Inputs: project_path (required). Returns: result

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 3 tools

    Disambiguation4/5

    get_server_info is clearly distinct as server metadata. get_project_structure and list_pous overlap somewhat since a file structure could include POUs, but the descriptions separate file layout from logical POU listings.

    Naming Consistency4/5

    All tool names follow a verb_noun pattern with get_ and list_ prefixes. The mix of get and list is a minor style inconsistency, but the pattern is still predictable and readable.

    Tool Count4/5

    Three tools is a small but reasonable surface for an experimental read-only server. Each tool serves a distinct purpose, though the inclusion of a generic server_info tool makes the set feel slightly thin.

    Completeness2/5

    The server only provides inspection capabilities: server info, project structure, and POU listing. There are no operations for opening, editing, compiling, validating, or managing POU details, which are significant gaps for an engineering-focused server.

    Maintenance

    ActivityMaintained
    ResponsivenessLimited data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      Enables AI agents to read and understand local Mendix project structure and logic by connecting directly to the .mpr file via MCP. Allows querying microflows, entities, attributes, and modules in read-only mode without requiring cloud access.
      4
      1
      ISC
    • F
      license
      A
      quality
      B
      maintenance
      Provides read-only analysis of Mitsubishi GX Works3 PLC projects via MCP, enabling device tracing, cross-referencing, ladder inspection, linting, and report generation without modifying source projects.
      15
      101 PyPI
      10
      -
    • F
      license
      D
      quality
      B
      maintenance
      Provides read-only, structured access to Yasin ecosystem information (project registry, documentation, GitHub state, diagnostics) through the MCP protocol, enabling AI agents to query without direct repository access.
      22
      3
      -