BC Code Intelligence MCP Server
Business Central and AL development guidance from a bundled knowledge base of specialist personas
Read, edit and write back Siemens TIA Portal V21 PLC and HMI projects as plain text files
By Rick Gaiser (individual) C# Local · stdio Developer tools
22 popularity score ★ 27
Opens the app, which asks before it adds the server. Then replace each <NAME> in its settings with your value.
git clone https://github.com/rickgaiser/TiaMcp.git
cd TiaMcp
dotnet build TiaMcp.slnclaude mcp add tiamcp -- '<ABSOLUTE_PATH_TO_CLONE>/src/TiaMcp.Host/bin/Debug/net48/TiaMcp.Host.exe'{
"mcpServers": {
"tiamcp": {
"command": "<ABSOLUTE_PATH_TO_CLONE>/src/TiaMcp.Host/bin/Debug/net48/TiaMcp.Host.exe",
"args": []
}
}
}{
"mcpServers": {
"tiamcp": {
"command": "<ABSOLUTE_PATH_TO_CLONE>/src/TiaMcp.Host/bin/Debug/net48/TiaMcp.Host.exe",
"args": []
}
}
}{
"servers": {
"tiamcp": {
"type": "stdio",
"command": "<ABSOLUTE_PATH_TO_CLONE>/src/TiaMcp.Host/bin/Debug/net48/TiaMcp.Host.exe",
"args": []
}
}
}[mcp_servers.tiamcp]
command = "<ABSOLUTE_PATH_TO_CLONE>/src/TiaMcp.Host/bin/Debug/net48/TiaMcp.Host.exe"
args = []gemini mcp add --scope user tiamcp '<ABSOLUTE_PATH_TO_CLONE>/src/TiaMcp.Host/bin/Debug/net48/TiaMcp.Host.exe'TiaMcp is a Windows MCP server that talks to a running Siemens TIA Portal V21 instance through Siemens' Openness API. It attaches to an open project, or opens one by path, and exports the project's source to a folder on disk laid out like the TIA Portal project tree. Ladder, FBD and SCL blocks keep, along with data blocks and UDTs, TIA Portal's own .s7dcl/.s7res text. Whole-block STL comes out as AWL, and S7-GRAPH blocks as a compact text format. PLC tag tables and alarm text lists become CSV files you can open in Excel, and so do WinCC Unified tag tables and alarms. This makes diffs easy to read. WinCC Unified screens, faceplates included, are written out as JSON built from the object model, because Openness has no export format for them. Anything from classic WinCC stays as native Openness XML.
The assistant edits those files with its usual file tools and then calls write_source_tree. Only changed items and new files go back, and each written item is read back so the files match what TIA Portal stored. A _manifest.json records each item's state at read time, and an item someone changed inside TIA Portal since then is refused unless force is set. Separate tools rename, create and delete project items and their folders, from blocks and UDTs to Unified screens and HMI alarms. A few helpers describe screen item types and faceplate interfaces so the assistant can edit screen JSON, and compile now covers HMI software as well as PLCs.
On master, src/TiaMcp.Mcp/TiaTools.cs registers 45 tools. On GRAPH blocks the code goes further than the README: the README calls branches and connections read-only, while the write_source_tree text says a sequence's BRANCHES/CONNECTIONS are rewritten when the file has them. INTERFACE and PREOPERATIONS stay read-only.
| Runtime | .NET |
|---|---|
| Runs on | Windows |
| Siemens TIA Portal V21 | Paid planA licensed, installed TIA Portal V21 with your Windows user in the Openness user group |
| Also |
|
There are no published builds to download, so you build TiaMcp.Host.exe yourself with the .NET SDK (dotnet build TiaMcp.sln). Point your client's command at the built file.
Hardware configuration and explicit block numbering are not supported. STL inside a mixed FBD/LAD/SCL block is read-only. A new GRAPH block can only be made by cloning an existing one, and GRAPH blocks must compile cleanly before they can be read or written. Classic WinCC alarms cannot be reached, graphic lists are skipped because exporting them crashes TIA Portal V21, and classic objects cannot be renamed or deleted. Only existing PLC alarm text lists can be written. A write does not compile; call compile_plc afterwards. Deleting a file does not delete the item.
Suits PLC engineers on Windows with TIA Portal V21 who want an assistant to read and change program blocks, tags, HMI tables and Unified screens as text diffs instead of clicking through the editor. It writes straight into a live engineering project, so keep a saved copy or use version control before letting it write. It is no use without a licensed TIA Portal V21 on the same machine, for older TIA versions, or for hardware configuration. It is a community project, not a Siemens product.
7 only read, 25 change things, 13 can delete or overwrite. A ? marks an optional parameter.
tia_connectprojectPath?: stringprocessId?: integerstartPortal?: booleanlist_tia_instancessave_project_as changestargetDirectory: stringsave_project changesclose_project changesproject_statusdelete_plc_udt deletesplcName: stringtypeName: stringrename_plc_udt changesplcName: stringtypeName: stringnewName: stringcreate_plc_udt_group changesplcName: stringparentGroupPath: stringgroupName: stringdelete_plc_udt_group deletesplcName: stringgroupPath: stringrename_plc_udt_group changesplcName: stringgroupPath: stringnewName: stringcreate_plc_instance_db changesplcName: stringgroupPath: stringdbName: stringinstanceOfFbName: stringcreate_plc_group changesplcName: stringparentGroupPath: stringgroupName: stringdelete_plc_group deletesplcName: stringgroupPath: stringrename_plc_group changesplcName: stringgroupPath: stringnewName: stringdelete_plc_block deletesplcName: stringblockName: stringrename_plc_block changesplcName: stringblockName: stringnewName: stringrename_plc_tag changesplcName: stringtagName: stringnewName: stringcreate_plc_tag_table changesplcName: stringgroupPath: stringtableName: stringdelete_plc_tag_table deletesplcName: stringtableName: stringrename_plc_tag_table changesplcName: stringtableName: stringnewName: stringcreate_plc_tag_table_group changesplcName: stringparentGroupPath: stringgroupName: stringdelete_plc_tag_table_group deletesplcName: stringgroupPath: stringrename_plc_tag_table_group changesplcName: stringgroupPath: stringnewName: stringrename_hmi_tag changeshmiName: stringtagName: stringnewName: stringcreate_hmi_tag_table changeshmiName: stringgroupPath: stringtableName: stringdelete_hmi_tag_table deleteshmiName: stringtableName: stringrename_hmi_tag_table changeshmiName: stringtableName: stringnewName: stringcreate_hmi_tag_table_group changeshmiName: stringparentGroupPath: stringgroupName: stringdelete_hmi_tag_table_group deleteshmiName: stringgroupPath: stringrename_hmi_tag_table_group changeshmiName: stringgroupPath: stringnewName: stringdelete_hmi_alarm_class deleteshmiName: stringname: stringdelete_hmi_alarm deleteshmiName: stringtype: stringalarmName: stringdelete_hmi_screen deleteshmiName: stringscreenName: stringrename_hmi_screen changeshmiName: stringscreenName: stringnewName: stringcreate_hmi_screen_group changeshmiName: stringparentGroupPath: stringgroupName: stringdelete_hmi_screen_group deleteshmiName: stringgroupPath: stringrename_hmi_screen_group changeshmiName: stringgroupPath: stringnewName: stringdescribe_hmi_item_typetype?: stringlist_library_typesnameFilter?: stringread_faceplate_typehmiName: stringcontainedType: stringcompile changessoftwareName: stringlist_projectfilter?: stringdeviceName?: stringtargetDirectory?: stringread_source_tree changestargetDirectory: stringitems?: arraydeviceName?: stringadoptExisting?: booleanhmiTagLength?: booleanwrite_source_tree deletessourceDirectory: stringitemList?: stringall?: booleancreateMissing?: booleanoverwriteExisting?: booleanforce?: booleandryRun?: boolean