
TIA Portal Openness MCP Server
概览
MCP(Model Context Protocol)服务器,用于西门子TIA Portal Openness,以及用于发布安装和更新的配套CLI。 - TiaPortalMcpServer/:C# MCP 服务器(目标框架:net48),将 TIA 门户工程操作展示为 MCP 工具。- TiaPortalMcpServer.Tests/:工具合同和服务器行为的单元测试和集成测试。- cli/:用于安装服务器版本和管理配套技能的 TypeScript CLI。 - 项目生命周期(projects_create、projects_open、projects_open_with_upgrade、projects_save、projects_close、projects_get_session_info)- 硬件和设备管理(devices_list、devices_create、devices_delete、devices_get_attributes、devices_set_attribute、devices_get_app_id、devices_set_app_id、devices_search_catalog)- 设备项目管理(deviceitems_list、deviceitems_get_attributes、deviceitems_plug_move、deviceitems_copy、deviceitems_delete、catalog_search_device_items)- PLC软件和块操作(software_add_block、blocks_list,...
概述(AI 翻译)
MCP(Model Context Protocol)服务器,用于西门子TIA Portal Openness,以及用于发布安装和更新的配套CLI。
这个仓库包含的内容
TiaPortalMcpServer/:C# MCP 服务器(目标框架:net48),将 TIA 门户工程操作作为 MCP 工具暴露。TiaPortalMcpServer.Tests/:工具合同和服务器行为的单元测试和集成测试。cli/:用于安装服务器发布和管理伴随技能的TypeScript CLI。
关键能力
服务器提供以下工具组:
- 项目生命周期(
projects_create、projects_open、projects_open_with_upgrade、projects_save、projects_close、projects_get_session_info) - 硬件和设备管理(
devices_list、devices_create、devices_delete、devices_get_attributes、devices_set_attribute、devices_get_app_id、devices_set_app_id、devices_search_catalog) - 设备项目管理(
deviceitems_list、deviceitems_get_attributes、deviceitems_plug_move、deviceitems_copy、deviceitems_delete、catalog_search_device_items]) - PLC软件和块操作(
software_add_block、blocks_list、software_get_block_hierarchy)
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
TIA Portal Openness MCP Server
MCP (Model Context Protocol) server for Siemens TIA Portal Openness, plus a companion CLI for release installation and updates.
What this repository contains
TiaPortalMcpServer/: C# MCP server (target framework:net48) exposing TIA Portal engineering operations as MCP tools.TiaPortalMcpServer.Tests/: unit and integration tests for tool contracts and server behavior.cli/: TypeScript CLI for installing server releases and managing companion skills.
Key capabilities
The server provides tool groups for:
- project lifecycle (
projects_create,projects_open,projects_open_with_upgrade,projects_save,projects_close,projects_get_session_info) - hardware and device management (
devices_list,devices_create,devices_delete,devices_get_attributes,devices_set_attribute,devices_get_app_id,devices_set_app_id,devices_search_catalog) - device item management (
deviceitems_list,deviceitems_get_attributes,deviceitems_plug_move,deviceitems_copy,deviceitems_delete,catalog_search_device_items) - PLC software and block operations (
software_add_block,blocks_list,software_get_block_hierarchy) - tag and tag-table management (
tags_create,tags_list,tags_tagtable_create,tags_tagtable_list,tags_tagtable_get,tags_tagtable_delete,tags_tagtable_export,tags_tagtable_open_editor,tags_group_create,tags_group_list,tags_group_find,tags_group_delete,tags_group_system_get,tags_constants_user_list,tags_constants_system_list) - advanced block operations (external sources, ProDiag, UDTs, types, editor helpers — 19 tools in
BlocksTools) - compilation (
compilation_project,compilation_software) - file import and validation (
files_read_csv,files_read_excel,files_list_sheets,files_validate_format,files_get_info) - HMI targets (
hmi_targets_list,hmi_targets_get,hmi_targets_validate) - sampling/LLM-assisted operations (
sampling_generate_code,sampling_summarize_project,sampling_get_suggestions) - elicitation and utility helpers (
utilities_elicit_user_input,utilities_get_project_info,utilities_list_libraries)
All active tools are declared in TiaPortalMcpServer/Tools/.
Runtime model
- Transport: MCP over
stdio. - Host process: .NET console app using
Microsoft.Extensions.Hosting. - Tool discovery: attribute-based (
[McpServerToolType],[McpServerTool]). - Logging: Serilog to stderr and rolling file logs (
TiaPortalMcpServer/logs/).
Requirements
- Windows machine.
- Siemens TIA Portal V20 installed and licensed.
- User account in the
TIA Portal Openness Usersgroup. - .NET Framework 4.8 runtime/developer pack (for building/running
net48project).
Build and run
From repository root:
dotnet build tia-portal-openness-mcpserver.sln
dotnet run --project TiaPortalMcpServer/TiaPortalMcpServer.csproj
Test
安装
npx @modelcontextprotocol/inspector dotnet run --project TiaPortalMcpServer/TiaPortalMcpServer.csproj