openplc-engineering-mcp
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+
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 toolsget_project_structureBRead-onlyIdempotent
Return the relevant file structure of an OpenPLC Editor project.
| Name | Required | Description | Default |
|---|---|---|---|
| project_path | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| name | Yes | |
| path | Yes | |
| type | Yes | |
| files | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already indicate readOnlyHint=true and idempotentHint=true, so the safe and repeatable nature of the operation is covered. The description adds little beyond this, but it does clarify that the tool reads a project's file structure and does not contradict the annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single concise sentence with no filler or redundancy. The verb and object are front-loaded, and every word contributes meaning.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The context is fairly simple: one required parameter, safe annotations, and an output schema. However, the description lacks important details about how to specify project_path and what makes the file structure 'relevant,' so it is adequate but incomplete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema provides only the parameter name and type, with 0% description coverage. The tool description suggests project_path refers to an OpenPLC Editor project, but it does not specify whether it should be a directory path, a file path, absolute or relative, creating ambiguity for the agent.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Return') and the resource ('the relevant file structure of an OpenPLC Editor project'), which distinguishes it from siblings like get_server_info and list_pous. However, the word 'relevant' is vague and leaves unclear what subset of the file structure is included.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives no guidance on when to use this tool versus alternatives. It does not mention when get_server_info or list_pous would be more appropriate, nor does it state any prerequisites such as needing a valid project directory.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_server_infoARead-onlyIdempotent
Return basic information about this experimental OpenPLC MCP server.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint and idempotentHint, so the description does not need to restate those. It adds useful context by labeling the server as 'experimental', which signals potential instability or changing behavior beyond what the annotations convey.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single concise sentence that front-loads the action ('Return') and resource, with no redundant or filler content. Every word earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a zero-parameter info tool, the description is complete: annotations cover safety and idempotence, the output schema defines the return format, and the description adds the experimental context. Nothing essential is missing.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With zero parameters, the schema fully covers parameter semantics (vacuously). The description adds no parameter information, but none is needed. Baseline of 4 is appropriate for a parameterless tool.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('Return') and a clear resource ('basic information about this experimental OpenPLC MCP server'). It is distinct from the sibling tools in subject matter, but it does not explicitly differentiate itself from get_project_structure or list_pous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no explicit guidance on when to use this tool versus the siblings, nor any exclusions or alternatives. The intended use is implied by the resource name, but there is no direct usage context.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_pousBRead-onlyIdempotent
List the programs, function blocks, and functions in an OpenPLC project.
| Name | Required | Description | Default |
|---|---|---|---|
| project_path | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint and idempotentHint, so the read-only nature is covered. The description adds that the returned scope includes programs, function blocks, and functions, but does not disclose additional behavior such as error handling, path validation, or output shape beyond what annotations already imply.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is one concise, front-loaded sentence with no filler or redundant information. It states exactly what the tool does in minimal space.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple listing tool with only one parameter and an existing output schema, the description is mostly adequate. However, it lacks parameter-level guidance and does not clarify how project_path should be provided, leaving some room for interpretation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, and the description does not explain the project_path parameter at all. The schema's title 'Project Path' gives basic meaning, but the description adds no value about expected path format or whether it must be absolute, relative, or point to a specific file.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('List') and a specific resource ('programs, function blocks, and functions in an OpenPLC project'), clearly indicating what the tool returns. It does not explicitly contrast itself with siblings like get_project_structure, but the resource focus is specific enough to allow an agent to distinguish it.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided for when to use this tool versus alternatives such as get_project_structure or get_server_info. The description implies a use case but does not state exclusions, prerequisites, or when another sibling would be more appropriate.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
3 tool updates
v0.1.0- First observed
get_project_structure - First observed
get_server_info - First observed
list_pous
TDQS
Scored across 3 tools
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.
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.
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.
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
Related MCP Connectors
Read-only MCP server exposing a user ORANO library to their own AI agent.
Search MCP servers, MCP clients and AI agents, and retrieve listing details. Free, read-only access.
Read-only MCP tools for AI agent discovery, structured resources, and NIULAI information.
Read-only MCP server: let AI agents read your ORANO saved-video library, tasks, and memory.
Related MCP Servers
- FlicenseBqualityDmaintenanceEnables 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.41-
- FlicenseAqualityAmaintenanceProvides 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.4158-
- FlicenseNot gradedqualityCmaintenanceEnables MCP agents to inspect deployment knowledge extracted from a repository, covering workflows, services, deployments, and images.-
- FlicenseDqualityAmaintenanceProvides 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.223-