Tutorials

AI Copilot: MCP Tools for TIA Portal

Let AI agents see your project, know your variables, and act on your PLC — through 31 purpose-built tools.

T
T-IA Connect Team
15 min read
Updated Mar 11, 2026

Why MCP Changes Everything

Classic AI assistants (ChatGPT, Copilot) suffer from a major problem in industrial automation: contextual hallucination. They generate syntactically correct SCL code, but use variables that don't exist, wrong data types, or ignore your hardware configuration. With T-IA Connect's built-in MCP server, the AI can see your project, read your tag tables, inspect existing blocks — and actually create or modify code in TIA Portal.

Prerequisites

  • T-IA Connect installed and running
  • A TIA Portal project open (V16–V21)
  • An MCP-compatible AI client (Claude Desktop, or any MCP client)

Setup: Connect Your AI to TIA Portal

Add T-IA Connect as an MCP server in your Claude Desktop configuration file (claude_desktop_config.json):

claude_desktop_config.json
{
  "mcpServers": {
    "tia-connect": {
      "command": "C:\\Program Files\\FeelAutomCorp\\TiaConnect\\TiaPortalApi.McpBridge.exe",
      "args": [],
      "env": {
        "TIA_CONNECT_URL": "http://localhost:9000",
        "TIA_CONNECT_API_KEY": "your-api-key"
      }
    }
  }
}

The McpBridge.exe acts as a stdio-to-HTTP bridge. It forwards AI requests to the T-IA Connect API server which communicates with TIA Portal via Openness.

Example 1: Check Project Status

The simplest tool — verify the connection to TIA Portal and see which project is open.

MCP Tool: get_project_status
{
  "name": "get_project_status",
  "arguments": {}
}
Response
{
  "connected": true,
  "projectName": "WaterTreatment_V19",
  "projectPath": "C:\TIA_Projects\WaterTreatment_V19",
  "tiaVersion": "V19",
  "modified": false
}

Example 2: Open a Project

Open a TIA Portal project file directly from the AI. You can also scan for available projects on disk with list_project_files.

MCP Tool: open_project
{
  "name": "open_project",
  "arguments": {
    "path": "C:\TIA_Projects\WaterTreatment_V19\WaterTreatment_V19.ap19"
  }
}
Response
{
  "success": true,
  "projectName": "WaterTreatment_V19",
  "version": "V19"
}

Example 3: List Devices

See all PLCs, HMIs, and other devices in the current project.

MCP Tool: list_devices
{
  "name": "list_devices",
  "arguments": {}
}
Response
[
  {
    "name": "PLC_1",
    "type": "CPU 1516-3 PN/DP",
    "category": "PLC"
  },
  {
    "name": "HMI_1",
    "type": "TP1500 Comfort",
    "category": "HMI"
  }
]

Example 4: List & Read Blocks

Browse all blocks (FB, FC, DB, OB) in a PLC, then read the full code and interface of any block.

MCP Tool: list_blocks → get_block_details
// Step 1: List all blocks
{ "name": "list_blocks", "arguments": { "deviceName": "PLC_1" } }

// Step 2: Read a specific block
{ "name": "get_block_details", "arguments": {
    "deviceName": "PLC_1",
    "blockName": "FB_MotorControl"
  }
}
Response
// list_blocks response
[
  { "name": "Main [OB1]", "type": "OB", "language": "LAD", "number": 1 },
  { "name": "FB_MotorControl", "type": "FB", "language": "SCL", "number": 1 },
  { "name": "DB_Config", "type": "DB", "language": "DB", "number": 1 }
]

// get_block_details response
{
  "name": "FB_MotorControl",
  "type": "FB",
  "language": "SCL",
  "interface": {
    "input": [
      { "name": "Start", "type": "Bool" },
      { "name": "Stop", "type": "Bool" },
      { "name": "SpeedSetpoint", "type": "Real" }
    ],
    "output": [
      { "name": "Running", "type": "Bool" },
      { "name": "Speed", "type": "Real" }
    ]
  },
  "code": "#Running := #Start AND NOT #Stop;\nIF #Running THEN\n  #Speed := #SpeedSetpoint;\nEND_IF;"
}

Example 5: Create an SCL Block

The most powerful tool — create a Function Block with SCL code, typed variables, and a complete interface definition. The AI can generate this code from a natural language description of your requirements.

MCP Tool: create_scl_block
{
  "name": "create_scl_block",
  "arguments": {
    "deviceName": "PLC_1",
    "blockName": "FB_ValveControl",
    "blockType": "FB",
    "interface": {
      "input": [
        { "name": "Open", "type": "Bool" },
        { "name": "Close", "type": "Bool" },
        { "name": "Timeout", "type": "Time", "defaultValue": "T#5s" }
      ],
      "output": [
        { "name": "IsOpen", "type": "Bool" },
        { "name": "IsClosed", "type": "Bool" },
        { "name": "Error", "type": "Bool" }
      ]
    },
    "sclCode": "IF #Open AND NOT #Close THEN\n  #IsOpen := TRUE;\n  #IsClosed := FALSE;\nELSIF #Close THEN\n  #IsOpen := FALSE;\n  #IsClosed := TRUE;\nEND_IF;"
  }
}
Response
{
  "name": "FB_ValveControl",
  "type": "FB",
  "number": 2,
  "created": true
}

Example 6: Manage Tags

List tag tables, browse variables, and create new tags with proper addresses and data types.

MCP Tools: list_tags → create_tag
// List existing tags
{ "name": "list_tags", "arguments": {
    "deviceName": "PLC_1",
    "tableName": "Motors"
  }
}

// Create a new tag
{ "name": "create_tag", "arguments": {
    "deviceName": "PLC_1",
    "tableName": "Motors",
    "name": "Motor2_Start",
    "dataType": "Bool",
    "logicalAddress": "%I0.2"
  }
}
Response
// list_tags response
[
  { "name": "Motor1_Start", "dataType": "Bool", "address": "%I0.0" },
  { "name": "Motor1_Stop", "dataType": "Bool", "address": "%I0.1" },
  { "name": "Motor1_Running", "dataType": "Bool", "address": "%Q0.0" }
]

// create_tag response
{
  "name": "Motor2_Start",
  "dataType": "Bool",
  "address": "%I0.2",
  "created": true
}

Example 7: Compile

Trigger compilation of a device to validate the generated code. Errors and warnings are returned so the AI can fix issues automatically.

MCP Tool: compile_device
{
  "name": "compile_device",
  "arguments": { "deviceName": "PLC_1" }
}
Response
{
  "success": true,
  "errors": [],
  "warnings": [
    "FB_ValveControl: Variable 'Timeout' declared but not used"
  ],
  "warningCount": 1,
  "errorCount": 0
}

Example 8: Search Hardware Catalog

Search the Siemens hardware catalog and add devices to your project — all through natural language.

MCP Tools: search_hardware_catalog → add_device
// Search the catalog
{ "name": "search_hardware_catalog", "arguments": {
    "query": "CPU 1511"
  }
}

// Add the device
{ "name": "add_device", "arguments": {
    "deviceName": "PLC_2",
    "typeIdentifier": "OrderNumber:6ES7 511-1AK02-0AB0/V2.9"
  }
}
Response
// search_hardware_catalog response
[
  {
    "name": "CPU 1511C-1 PN",
    "typeIdentifier": "OrderNumber:6ES7 511-1CK01-0AB0/V2.9",
    "version": "V2.9"
  },
  {
    "name": "CPU 1511-1 PN",
    "typeIdentifier": "OrderNumber:6ES7 511-1AK02-0AB0/V2.9",
    "version": "V2.9"
  }
]

// add_device response
{
  "name": "PLC_2",
  "type": "CPU 1511-1 PN",
  "added": true
}

Example 9: HMI Screens

List, create, and inspect WinCC HMI screens. Retrieve the full XML design for analysis.

MCP Tools: list_hmi_screens → create_hmi_screen
// List screens
{ "name": "list_hmi_screens", "arguments": {
    "deviceName": "HMI_1"
  }
}

// Create a new screen
{ "name": "create_hmi_screen", "arguments": {
    "deviceName": "HMI_1",
    "screenName": "MotorOverview"
  }
}
Response
// list_hmi_screens response
[
  { "name": "MainScreen", "type": "Screen" },
  { "name": "AlarmView", "type": "Screen" }
]

// create_hmi_screen response
{
  "name": "MotorOverview",
  "created": true
}

Example 10: Save, Archive & Close

Complete project lifecycle management — save your work, create backup archives, and close cleanly.

MCP Tools: save → archive → close
{ "name": "save_project", "arguments": {} }

{ "name": "archive_project", "arguments": {
    "targetDirectory": "C:\TIA_Backups",
    "archiveName": "WaterTreatment_backup_2026-03-11"
  }
}

{ "name": "close_project", "arguments": {} }
Response
{ "saved": true }

{
  "archivePath": "C:\TIA_Backups\WaterTreatment_backup_2026-03-11.zap19",
  "size": "45.2 MB",
  "created": true
}

{ "closed": true }

Complete Tool Reference (31 Tools)

Here is the full list of MCP tools available in T-IA Connect, organized by category.

Project Management

ToolDescriptionParameters
get_project_statusGet current project status
list_project_filesScan disk for TIA projectspath?
open_projectOpen a .ap* project filepath
create_projectCreate an empty TIA projectpath, name
close_projectClose the active project
save_projectSave the current project
archive_projectCreate a .zap backuptargetDirectory, archiveName
retrieve_projectRestore from .zap backuparchivePath, targetDirectory

Hardware & Network

ToolDescriptionParameters
list_devicesList all devices (PLC, HMI)
search_hardware_catalogSearch Siemens hardware catalogquery
add_deviceAdd a device to the projectdeviceName, typeIdentifier
delete_deviceRemove a devicedeviceName
rename_deviceRename a devicecurrentName, newName
configure_networkSet IP / subnet / gatewaydeviceName, ipAddress, subnetMask, gateway

Programming

ToolDescriptionParameters
list_blocksList all blocks (FB, FC, DB, OB)deviceName
get_block_detailsRead block interface and codedeviceName, blockName
create_scl_blockCreate SCL block with interfacedeviceName, blockName, sclCode, blockType, interface
delete_blockDelete a blockdeviceName, blockName
rename_blockRename a blockdeviceName, currentName, newName
compile_deviceCompile device codedeviceName

HMI (WinCC)

ToolDescriptionParameters
list_hmi_screensList WinCC screensdeviceName
create_hmi_screenCreate an HMI screendeviceName, screenName
delete_hmi_screenDelete an HMI screendeviceName, screenName
get_hmi_screen_xmlGet screen XML designdeviceName, screenName

Data & Variables

ToolDescriptionParameters
list_tag_tablesList tag tablesdeviceName
create_tag_tableCreate a tag tabledeviceName, tableName
delete_tag_tableDelete a tag tabledeviceName, tableName
list_tagsList variables in a tabledeviceName, tableName
create_tagCreate a variable (I, Q, M)deviceName, tableName, name, dataType, logicalAddress
delete_tagDelete a variabledeviceName, tableName, tagName

System Diagnostics

ToolDescriptionParameters
get_server_diagnosticsAPI & TIA Portal health check

Bonus: FDS Tools (Design Spec)

T-IA Connect also includes 5 additional MCP tools for the FDS (Functional Design Specification) module. See the dedicated tutorial for details.

CSV to SCL Code Generation Guide

AI + PLC = The Future of Engineering

With 31 MCP tools, your AI assistant becomes a real engineering partner — it reads your project, understands your hardware, and writes code that actually compiles. No more hallucinated variables or blind code generation.

Get started with T-IA Connect and transform your TIA Portal workflow.