MCP-server-for-Tia-Portal

gangsterke/MCP-server-for-Tia-Portal

3.1

If you are the rightful owner of MCP-server-for-Tia-Portal 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.

This document provides a structured summary of a Model Context Protocol (MCP) server designed for Tia Portal, focusing on exporting OPC UA nodeset files using Openness.

MCP-server-for-Tia-Portal

Made a MCP server for Tia Portal. Was looking for a way to export OPC UA nodeset files using Tia Portal Openness.

image image

Project Management: Open and close TIA Portal projects PLC Discovery: List all PLC devices in a project Block Operations: List, read, and export program blocks (OB, FC, FB, DB) Tag Management: Access and search PLC tag tables Hardware Configuration: Retrieve device topology and configuration OPC UA Support: Access and export OPC UA server interfaces Project Information: Get detailed project metadata

Available Actions

  1. Open Project. Opens a TIA Portal project file.
  2. Close Project. Closes the currently open project.
  3. List PLCs: Lists all PLC devices in the open project.
  4. List Blocks: Lists program blocks for a specific PLC.
  5. Get Block Code: Retrieves information about a specific block.
  6. Export Block: Exports a block to XML format.
  7. Get Tag Table: Retrieves the PLC tag table (global variables).
  8. Search Tag: Searches for tags by name across the project.
  9. Get Hardware Config:Retrieves hardware configuration and device topology.
  10. Get Project Info: Gets general information about the currently open project.
  11. Export OPC UA Interface: Exports the OPC UA server interface configuration to XML.
  12. Get OPC UA Interface Info: Gets information about the OPC UA server interface configuration.

Limitations

Only one project can be open at a time The server runs in "WithoutUserInterface" mode, so no TIA Portal GUI is shown Some operations may require specific TIA Portal versions or licenses OPC UA functionality requires the PLC to have OPC UA configured

Claude Desktop settings for MCP server

image

Security Considerations

This server provides full access to TIA Portal projects Ensure proper access controls are in place Do not expose this server to untrusted networks Validate all file paths to prevent directory traversal attacks Consider running in a sandboxed environment

Troubleshooting

"No project is open" error Make sure to call OpenProject before attempting other operations.

"PLC not found" error Verify the PLC name matches exactly (case-sensitive). Use ListPLCs to see available PLCs.

OPC UA errors Ensure OPC UA is configured in the TIA Portal project Check that the correct TIA Portal Openness assemblies are referenced Verify the PLC supports OPC UA functionality